fix(rights):修复权限表状态禁用切换
This commit is contained in:
@@ -31,6 +31,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
<script type="text/html" id="power-toolbar">
|
||||
{% if authorize("admin:power:add") %}
|
||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
||||
@@ -73,17 +76,10 @@
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="power_enable">
|
||||
<input type="checkbox" name="enable"
|
||||
value="{{ "{{d.powerId}}" }}" lay-skin="switch" lay-text="启用|禁用"
|
||||
lay-filter="power_enable" {{ "{{# if(d.enable==1){ }} checked {{# } }}" }}>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="icon">
|
||||
<i class="layui-icon {{ "{{d.icon}}" }}"></i>
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
<form id="add_view" class="layui-form" action="" style="display: none">
|
||||
<div class="mainBox">
|
||||
@@ -196,7 +192,12 @@
|
||||
{ field: 'powerName', minWidth: 200, title: '权限名称' },
|
||||
{ field: 'icon', title: '图标', templet: '#icon' },
|
||||
{ field: 'powerType', title: '权限类型', templet: '#power-type' },
|
||||
{ field: 'enable', title: '是否可用', templet: '#power-enable' },
|
||||
{
|
||||
field: 'enable', title: '是否可用', templet: (d) => {
|
||||
// TODO 修改禁用启动逻辑
|
||||
return `<input type="checkbox" name="enable" value="${d.powerId}" lay-skin="switch" lay-text="启用|禁用" lay-filter="power_enable" ${d.enable == 1 ? 'checked=checked' : ''}`
|
||||
}
|
||||
},
|
||||
{ field: 'sort', title: '排序' },
|
||||
{ title: '操作', templet: '#power-bar', width: 150, align: 'center' }
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user