mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-04-06 03:58:00 +08:00
99 lines
4.3 KiB
HTML
99 lines
4.3 KiB
HTML
<extend name="Public/base" />
|
|
<block name="main">
|
|
<fieldset class="layui-elem-field">
|
|
<legend>权限管理 - 权限组列表</legend>
|
|
<div class="layui-field-box">
|
|
<span class="layui-btn layui-btn-normal api-add"><i class="layui-icon"></i> 新增</span>
|
|
<table class="layui-table" lay-even>
|
|
<thead>
|
|
<tr>
|
|
<th>#</th>
|
|
<th>权限组</th>
|
|
<th>描述</th>
|
|
<th>访问授权</th>
|
|
<th>成员授权</th>
|
|
<th>状态</th>
|
|
<th>操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<volist name="list" id="vo">
|
|
<tr>
|
|
<td>{$i}</td>
|
|
<td>{$vo['name']}</td>
|
|
<td>{$vo['description']}</td>
|
|
<td>
|
|
<span data-url="{:U('rule', array('group_id' => $vo['id']))}" class="layui-btn edit">访问授权</span>
|
|
</td>
|
|
<td>
|
|
<span data-url="{:U('member', array('group_id' => $vo['id']))}" class="layui-btn edit">成员授权</span>
|
|
</td>
|
|
<td>
|
|
<if condition="$vo['status']">
|
|
<span style="border-radius: 2px;background-color: #5FB878;padding:5px 10px;color: #ffffff">启用</span>
|
|
<else />
|
|
<span style="border-radius: 2px;background-color: #FF5722;padding:5px 10px;color: #ffffff">禁用</span>
|
|
</if>
|
|
</td>
|
|
<td>
|
|
<if condition="$vo['status']">
|
|
<span class="layui-btn layui-btn-danger confirm" data-info="你确定禁用当前权限组么?" data-id="{$vo['id']}" data-url="{:U('close')}">禁用</span>
|
|
<else />
|
|
<span class="layui-btn confirm" data-info="你确定启用当前权限组么?" data-id="{$vo['id']}" data-url="{:U('open')}">启用</span>
|
|
</if>
|
|
<span data-url="{:U('edit', array('id' => $vo['id']))}" class="layui-btn edit layui-btn-normal">编辑</span>
|
|
<span class="layui-btn layui-btn-danger confirm" data-id="{$vo['id']}" data-info="你确定删除当前权限组么?" data-url="{:U('del')}">删除</span>
|
|
</td>
|
|
</tr>
|
|
</volist>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</fieldset>
|
|
</block>
|
|
<block name="myScript">
|
|
<script>
|
|
layui.use(['layer'], function() {
|
|
$('.api-add').on('click', function () {
|
|
layer.open({
|
|
type: 2,
|
|
area: ['80%', '80%'],
|
|
maxmin: true,
|
|
content: '{:U("add")}'
|
|
});
|
|
});
|
|
$('.edit').on('click', function () {
|
|
var ownObj = $(this);
|
|
layer.open({
|
|
type: 2,
|
|
area: ['80%', '66%'],
|
|
maxmin: true,
|
|
content: ownObj.attr('data-url')
|
|
});
|
|
});
|
|
$('.confirm').on('click', function () {
|
|
var ownObj = $(this);
|
|
layer.confirm(ownObj.attr('data-info'), {
|
|
btn: ['确定','取消'] //按钮
|
|
}, function(){
|
|
$.ajax({
|
|
type: "POST",
|
|
url: ownObj.attr('data-url'),
|
|
data: {id:ownObj.attr('data-id')},
|
|
success: function(msg){
|
|
if( msg.code == 1 ){
|
|
location.reload();
|
|
}else{
|
|
layer.msg(msg.msg, {
|
|
icon: 5,
|
|
shade: [0.6, '#393D49'],
|
|
time:1500
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
</block> |