From 43fa0ec4dc02c2bb1a2ac5e9eea81cae4d2cb11d Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Fri, 17 Dec 2021 16:08:18 +0800 Subject: [PATCH] Merge branch 'master' of http://120.27.238.55:7000/r/xc-video --- src/main/resources/templates/febs/views/video/video/video-list.html | 43 ++++++++++++++++++++++++++++++++++++------- 1 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/main/resources/templates/febs/views/video/video/video-list.html b/src/main/resources/templates/febs/views/video/video/video-list.html index 49123d9..1e72d99 100644 --- a/src/main/resources/templates/febs/views/video/video/video-list.html +++ b/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"></i></a> <a lay-event="del" shiro:hasPermission="video:delete"><i class="layui-icon febs-edit-area febs-red"></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'} ]] }); } -- Gitblit v1.9.1