| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">视频名称</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="name" autocomplete="off" class="layui-input"> |
| | | <input type="text" name="title" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">是否会员</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="isUp"> |
| | | <select name="isFree"> |
| | | <option value=""></option> |
| | | <option value="1">免费</option> |
| | | <option value="2">会员</option> |
| | |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="reset"> |
| | | <i class="layui-icon"></i> |
| | | </div> |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary table-action action-more" |
| | | shiro:hasAnyPermissions="video:add,video:delete"> |
| | | <i class="layui-icon"></i> |
| | | <div shiro:hasAnyPermissions="video:add" class="layui-btn layui-btn-sm layui-btn-primary febs-button-cyan-plain table-action" id="add"> |
| | | <i class="layui-icon"></i> |
| | | </div> |
| | | <div shiro:hasAnyPermissions="video:delete" class="layui-btn layui-btn-sm layui-btn-primary febs-button-red-plain table-action" id="del"> |
| | | <i class="layui-icon"></i> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <style> |
| | | .layui-table-cell { |
| | | height: 100%; |
| | | } |
| | | |
| | | .febs-button-cyan-plain{color: #fabc6d;background: #fceedd !important;border-color:#fedbae;} |
| | | .febs-button-cyan-plain:hover{color:#fabc6d;background:#fceedd !important;border-color:#fedbae;box-shadow:0 4px 8px 0 #fedbae;} |
| | | |
| | | .febs-button-red-plain{color:#fb6678;background:#ffdfe3 !important;border-color:#ff8e9b;} |
| | | .febs-button-red-plain:hover{color:#fb6678;background:#ffdfe3 !important;border-color:#ff8e9b;box-shadow:0 4px 8px 0 #ff8e9b;} |
| | | </style> |
| | | <script type="text/html" id="thumbFormat"> |
| | | <img src="{{d.thumb}}" /> |
| | | </script> |
| | | <script type="text/html" id="is-up-format"> |
| | | {{# |
| | | var status = { |
| | |
| | | <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> |
| | |
| | | $view = $('#febs-video'), |
| | | $query = $view.find('#query'), |
| | | $reset = $view.find('#reset'), |
| | | $add = $view.find('#add'), |
| | | $del = $view.find('#del'), |
| | | $searchForm = $view.find('form'), |
| | | sortObject = {field: 'createTime', type: null}, |
| | | tableIns, |
| | |
| | | }); |
| | | } |
| | | 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(); |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | |
| | | }) |
| | | }); |
| | | }); |
| | | |
| | | $add.on('click', function () { |
| | | febs.modal.view('新增视频', 'video/add', { |
| | | btn: ['提交', '重置'], |
| | | area: ['100%', '100%'], |
| | | yes: function (index, layero) { |
| | | $('#video-add').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | $('#video-add').find('#reset').trigger('click'); |
| | | return false; |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | $del.on('click', function() { |
| | | var checkStatus = table.checkStatus('videoTable'); |
| | | |
| | | if (!checkStatus.data.length) { |
| | | febs.alert.warn('请选择需要删除的视频'); |
| | | } else { |
| | | febs.modal.confirm('删除视频', '确定删除该视频?', function () { |
| | | var userIds = []; |
| | | layui.each(checkStatus.data, function (key, item) { |
| | | userIds.push(item.userId) |
| | | }); |
| | | deleteUsers(userIds.join(',')); |
| | | }); |
| | | } |
| | | }) |
| | | |
| | | $query.on('click', function () { |
| | | var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type}); |
| | |
| | | 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'} |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | function getQueryParams() { |
| | | return { |
| | | name: $searchForm.find('input[name="name"]').val().trim(), |
| | | title: $searchForm.find('input[name="title"]').val().trim(), |
| | | isUp: $searchForm.find("select[name='isUp']").val(), |
| | | isFree: $searchForm.find("select[name='isFree']").val(), |
| | | invalidate_ie_cache: new Date() |