mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
优化表格开关,无权限的退化为list;
This commit is contained in:
@@ -1065,9 +1065,15 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick
|
||||
},
|
||||
switch: function (data) {
|
||||
var option = data.LAY_COL;
|
||||
|
||||
if (!admin.checkAuth('modify', option.init.table_elem)) {
|
||||
return admin.table.list(data);
|
||||
}
|
||||
|
||||
option.filter = option.filter || option.field || null;
|
||||
option.checked = option.checked || 1;
|
||||
option.tips = option.tips || '开|关';
|
||||
|
||||
var value = admin.table.returnColumnValue(data);
|
||||
var checked = value === option.checked ? 'checked' : '';
|
||||
return laytpl('<input type="checkbox" name="' + option.field + '" value="' + data.id + '" lay-skin="switch" lay-text="' + option.tips + '" lay-filter="' + option.filter + '" ' + checked + ' >').render(data);
|
||||
|
||||
Reference in New Issue
Block a user