|
|
|
@ -46,10 +46,20 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
|
|
|
|
|
title : '归属章节',align:"center"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'userId',title : '操作',align:"center",width:150, templet: function (d) {
|
|
|
|
|
var htm = '<button type="button" class="layui-btn layui-btn-xs" lay-event="edit">编辑</button></a>';
|
|
|
|
|
htm += '<button type="button" class="layui-btn layui-btn-xs" lay-event="del">删除</button></a>';
|
|
|
|
|
return htm;
|
|
|
|
|
field : 'questionStatus',width:200,
|
|
|
|
|
title : '状态',align:"center", templet(d) {
|
|
|
|
|
return d.questionStatus === 1
|
|
|
|
|
? `<span class="layui-badge layui-bg-green" style="background-color: #c0e7dd !important; color: #30b08f!important">上架</span>`
|
|
|
|
|
: '<span class="layui-badge layui-bg-gray" style="background-color: #dadada !important; color: #6c6c6c!important">下架</span>'}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'userId',title : '操作',align:"center",width:260, templet: function (d) {
|
|
|
|
|
return `
|
|
|
|
|
<button type="button" class="layui-btn layui-btn-xs" lay-event="up" data-item="${JSON.stringify(d)}" style="background-color: #30b08f !important; color: #ffffff!important">上架</button>
|
|
|
|
|
<button type="button" class="layui-btn layui-btn-xs" lay-event="down" data-item="${JSON.stringify(d)}" style="background-color: #bebebe !important; color: #ffffff!important">下架</button>
|
|
|
|
|
<button type="button" class="layui-btn layui-btn-xs" lay-event="edit">编辑</button>
|
|
|
|
|
<button type="button" class="layui-btn layui-btn-xs" lay-event="del">删除</button>
|
|
|
|
|
`;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -80,6 +90,12 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
|
|
|
|
|
searchForm.reset();
|
|
|
|
|
Lib.doSearchForm($("#searchForm"), resourcesQuestionTable, 1);
|
|
|
|
|
},
|
|
|
|
|
up: function() {
|
|
|
|
|
alert('up')
|
|
|
|
|
},
|
|
|
|
|
down: function() {
|
|
|
|
|
alert('down')
|
|
|
|
|
},
|
|
|
|
|
search:function () {
|
|
|
|
|
Lib.doSearchForm($("#searchForm"), resourcesQuestionTable, 1);
|
|
|
|
|
},import:function (){
|
|
|
|
|