1. 题库增加上下架状态

beetlsql3-dev
Mlxa0324 3 years ago
parent 74a981f71c
commit 3df0856ea4

@ -46,10 +46,20 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
title : '归属章节',align:"center" title : '归属章节',align:"center"
}, },
{ {
field : 'userId',title : '操作',align:"center",width:150, templet: function (d) { field : 'questionStatus',width:200,
var htm = '<button type="button" class="layui-btn layui-btn-xs" lay-event="edit">编辑</button></a>'; title : '状态',align:"center", templet(d) {
htm += '<button type="button" class="layui-btn layui-btn-xs" lay-event="del">删除</button></a>'; return d.questionStatus === 1
return htm; ? `<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(); searchForm.reset();
Lib.doSearchForm($("#searchForm"), resourcesQuestionTable, 1); Lib.doSearchForm($("#searchForm"), resourcesQuestionTable, 1);
}, },
up: function() {
alert('up')
},
down: function() {
alert('down')
},
search:function () { search:function () {
Lib.doSearchForm($("#searchForm"), resourcesQuestionTable, 1); Lib.doSearchForm($("#searchForm"), resourcesQuestionTable, 1);
},import:function (){ },import:function (){

Loading…
Cancel
Save