Helius
2021-12-16 d22f5bdfdaa8502a5f2496248da932b3c50c1fd0
src/main/resources/templates/febs/views/video/video/video-list.html
@@ -56,6 +56,14 @@
        </div>
    </div>
</div>
<style>
    .layui-table-cell {
        height: 100%;
    }
</style>
<script type="text/html" id="thumbFormat">
    <img src="{{d.thumb}}" />
</script>
<script type="text/html" id="is-up-format">
    {{#
    var status = {
@@ -78,6 +86,11 @@
    <span shiro:lacksPermission="video:view,video:update,video:delete">
        <span class="layui-badge-dot febs-bg-orange"></span> 无权限
    </span>
    {{# if(d.isUp == 1) { }}
    <button lay-event="isUp" type="button" class="layui-btn layui-btn-xs layui-btn-danger isUp">下架</button>
    {{# } else { }}
    <button lay-event="isUp" type="button" class="layui-btn layui-btn-xs layui-btn-normal isUp">上架</button>
    {{# } }}
    <a lay-event="edit" shiro:hasPermission="video:update"><i
            class="layui-icon febs-edit-area febs-blue">&#xe7a4;</i></a>
    <a lay-event="del" shiro:hasPermission="video:delete"><i class="layui-icon febs-edit-area febs-red">&#xe7f9;</i></a>
@@ -155,16 +168,29 @@
                });
            }
            if (layEvent === 'edit') {
                febs.modal.open('修改视频', 'video/update/' + data.name, {
                    area: $(window).width() <= 750 ? '90%' : '50%',
                    offset: '30px',
                febs.modal.open('修改视频', 'video/update/' + data.id, {
                    area: ['100%', '100%'],
                    btn: ['提交', '取消'],
                    yes: function (index, layero) {
                        $('#user-update').find('#submit').trigger('click');
                        $('#video-update').find('#submit').trigger('click');
                    },
                    btn2: function () {
                        layer.closeAll();
                    }
                });
            }
            if (layEvent === 'isUp') {
                var text;
                if (data.isUp == 1) {
                    text = "下架";
                } else {
                    text = "上架";
                }
                febs.modal.confirm('是否' + text + "该视频", '确定' + text + '该视频?', function () {
                    febs.post(ctx + 'video/video/changeIsUp/' + data.id, null, function () {
                        febs.alert.success(text + '视频成功');
                        $query.click();
                    });
                });
            }
        });
@@ -201,11 +227,14 @@
                cols: [[
                    {type: 'checkbox'},
                    {field: 'title', title: '视频名', minWidth: 100},
                    {field: 'thumb', title: '缩略图'},
                    {templet: '#thumbFormat', title: '缩略图'},
                    {title: '是否上架', templet: '#is-up-format'},
                    {title: '会员', templet: '#is-free-format'},
                    {field: 'createdTime', title: '创建时间', minWidth: 180, sort: true},
                    {title: '操作', toolbar: '#user-option', minWidth: 140}
                    {field: 'playCnt', title: '播放量'},
                    {field: 'collectCnt', title: '收藏量'},
                    {field: 'starCnt', title: '点赞量'},
                    {field: 'createdTime', title: '创建时间', minWidth: 180},
                    {title: '操作', toolbar: '#user-option'}
                ]]
            });
        }