mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-08 19:12:48 +08:00
优化表格开关,无权限的退化为list;
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
data-auth-edit="{:auth('{{controllerUrl}}/edit')}"
|
data-auth-edit="{:auth('{{controllerUrl}}/edit')}"
|
||||||
data-auth-delete="{:auth('{{controllerUrl}}/delete')}"
|
data-auth-delete="{:auth('{{controllerUrl}}/delete')}"
|
||||||
data-auth-export="{:auth('{{controllerUrl}}/export')}"
|
data-auth-export="{:auth('{{controllerUrl}}/export')}"
|
||||||
|
data-auth-modify="{:auth('{{controllerUrl}}/modify')}"
|
||||||
lay-filter="currentTable">
|
lay-filter="currentTable">
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
data-auth-add="{:auth('mall.cate/add')}"
|
data-auth-add="{:auth('mall.cate/add')}"
|
||||||
data-auth-edit="{:auth('mall.cate/edit')}"
|
data-auth-edit="{:auth('mall.cate/edit')}"
|
||||||
data-auth-delete="{:auth('mall.cate/delete')}"
|
data-auth-delete="{:auth('mall.cate/delete')}"
|
||||||
|
data-auth-modify="{:auth('mall.cate/modify')}"
|
||||||
lay-filter="currentTable">
|
lay-filter="currentTable">
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
data-auth-edit="{:auth('mall.goods/edit')}"
|
data-auth-edit="{:auth('mall.goods/edit')}"
|
||||||
data-auth-delete="{:auth('mall.goods/delete')}"
|
data-auth-delete="{:auth('mall.goods/delete')}"
|
||||||
data-auth-stock="{:auth('mall.goods/stock')}"
|
data-auth-stock="{:auth('mall.goods/stock')}"
|
||||||
|
data-auth-modify="{:auth('mall.goods/modify')}"
|
||||||
lay-filter="currentTable">
|
lay-filter="currentTable">
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
data-auth-add="{:auth('mall.tag/add')}"
|
data-auth-add="{:auth('mall.tag/add')}"
|
||||||
data-auth-edit="{:auth('mall.tag/edit')}"
|
data-auth-edit="{:auth('mall.tag/edit')}"
|
||||||
data-auth-delete="{:auth('mall.tag/delete')}"
|
data-auth-delete="{:auth('mall.tag/delete')}"
|
||||||
|
|
||||||
lay-filter="currentTable">
|
lay-filter="currentTable">
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
data-auth-edit="{:auth('system.admin/edit')}"
|
data-auth-edit="{:auth('system.admin/edit')}"
|
||||||
data-auth-delete="{:auth('system.admin/delete')}"
|
data-auth-delete="{:auth('system.admin/delete')}"
|
||||||
data-auth-password="{:auth('system.admin/password')}"
|
data-auth-password="{:auth('system.admin/password')}"
|
||||||
|
data-auth-modify="{:auth('system.admin/modify')}"
|
||||||
lay-filter="currentTable">
|
lay-filter="currentTable">
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
data-auth-edit="{:auth('system.auth/edit')}"
|
data-auth-edit="{:auth('system.auth/edit')}"
|
||||||
data-auth-delete="{:auth('system.auth/delete')}"
|
data-auth-delete="{:auth('system.auth/delete')}"
|
||||||
data-auth-authorize="{:auth('system.auth/authorize')}"
|
data-auth-authorize="{:auth('system.auth/authorize')}"
|
||||||
|
data-auth-modify="{:auth('system.auth/modify')}"
|
||||||
lay-filter="currentTable">
|
lay-filter="currentTable">
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
data-auth-add="{:auth('system.menu/add')}"
|
data-auth-add="{:auth('system.menu/add')}"
|
||||||
data-auth-edit="{:auth('system.menu/edit')}"
|
data-auth-edit="{:auth('system.menu/edit')}"
|
||||||
data-auth-delete="{:auth('system.menu/delete')}"
|
data-auth-delete="{:auth('system.menu/delete')}"
|
||||||
|
data-auth-modify="{:auth('system.menu/modify')}"
|
||||||
lay-filter="currentTable">
|
lay-filter="currentTable">
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<table id="currentTable" class="layui-table layui-hide"
|
<table id="currentTable" class="layui-table layui-hide"
|
||||||
data-auth-refresh="{:auth('system.node/refreshNode')}"
|
data-auth-refresh="{:auth('system.node/refreshNode')}"
|
||||||
data-auth-clear="{:auth('system.node/clearNode')}"
|
data-auth-clear="{:auth('system.node/clearNode')}"
|
||||||
|
data-auth-modify="{:auth('system.node/modify')}"
|
||||||
lay-filter="currentTable">
|
lay-filter="currentTable">
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
data-auth-add="{:auth('system.quick/add')}"
|
data-auth-add="{:auth('system.quick/add')}"
|
||||||
data-auth-edit="{:auth('system.quick/edit')}"
|
data-auth-edit="{:auth('system.quick/edit')}"
|
||||||
data-auth-delete="{:auth('system.quick/delete')}"
|
data-auth-delete="{:auth('system.quick/delete')}"
|
||||||
|
data-auth-modify="{:auth('system.quick/modify')}"
|
||||||
lay-filter="currentTable">
|
lay-filter="currentTable">
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1065,9 +1065,15 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick
|
|||||||
},
|
},
|
||||||
switch: function (data) {
|
switch: function (data) {
|
||||||
var option = data.LAY_COL;
|
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.filter = option.filter || option.field || null;
|
||||||
option.checked = option.checked || 1;
|
option.checked = option.checked || 1;
|
||||||
option.tips = option.tips || '开|关';
|
option.tips = option.tips || '开|关';
|
||||||
|
|
||||||
var value = admin.table.returnColumnValue(data);
|
var value = admin.table.returnColumnValue(data);
|
||||||
var checked = value === option.checked ? 'checked' : '';
|
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);
|
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