模板状态更改时逻辑完善
This commit is contained in:
parent
0a42861847
commit
10e9cc1310
|
|
@ -114,7 +114,7 @@
|
|||
, {
|
||||
field: 'isEnable', align: 'center', title: '启用状态',
|
||||
templet: function (d) {
|
||||
// 根据 isUse 字段的值决定开关的状态
|
||||
// 根据 isEnable 字段的值决定开关的状态
|
||||
return '<input type="checkbox" lay-filter="switchTest" lay-skin="switch" lay-text="启用|禁用" ' +
|
||||
(d.isEnable == '0' ? 'checked' : '') +
|
||||
' data-configId="' + d.id + '">';
|
||||
|
|
@ -176,15 +176,20 @@
|
|||
url: ctxPath + '/setTemplate/changeEnable',
|
||||
data: { configId },
|
||||
success: function (data) {
|
||||
layer.close(index);
|
||||
if (data.res == 1) {
|
||||
layer.msg(data.resMsg, { icon: 1, time: 2000 })
|
||||
initTable()
|
||||
} else {
|
||||
obj.elem.checked = false;
|
||||
layui.form.render('switch')
|
||||
layer.msg(data.resMsg, { icon: 2, time: 2000 })
|
||||
}
|
||||
|
||||
console.log('状态修改结果', data)
|
||||
// if (data.res === 1) {
|
||||
// layer.msg(data.resMsg, { icon: 1, time: 2000 });
|
||||
// search(1);
|
||||
// } else {
|
||||
// layer.msg(data.resMsg, { icon: 2, time: 2000 });
|
||||
// }
|
||||
},
|
||||
error: function (data) {
|
||||
obj.elem.checked = false;
|
||||
layui.form.render('switch')
|
||||
layer.msg(data.resMsg, { icon: 1, time: 2000 })
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue