first commit
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
{include file="public/header" /}
|
||||
<div class="config-container">
|
||||
<!-- 页面头部样式 -->
|
||||
<div class="config-header" style="display: flex;flex-direction: column;flex-wrap: wrap;align-items: flex-start;">
|
||||
<div class="maintitle">
|
||||
<i class="layui-icon layui-icon-group"></i>
|
||||
<span>角色列表</span>
|
||||
</div>
|
||||
<div style="display: flex;align-items: flex-start;flex-direction: column;gap: 15px;margin-bottom: 10px;">
|
||||
<div>
|
||||
<button class="layui-btn layui-bg-blue" onclick="add()">
|
||||
<i class="layui-icon layui-icon-add-1"></i>添加
|
||||
</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary layui-border-blue" onclick="refresh()">
|
||||
<i class="layui-icon layui-icon-refresh"></i>刷新
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>角色名</th>
|
||||
<th>状态</th>
|
||||
<th>添加时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{volist name="group" id='vo'}
|
||||
<tr>
|
||||
<td>{$vo.group_name}</td>
|
||||
<td>{$vo.status==1?'开启':'<span style="color:red;">禁用</span>'}</td>
|
||||
<td>{:date('Y-m-d H:i:s',$vo.create_time)}</td>
|
||||
<td>
|
||||
<button type="button" class="layui-btn layui-btn-primary layui-btn-xs"
|
||||
onclick="edit({$vo.group_id})">
|
||||
<i class="layui-icon layui-icon-edit"></i>编辑
|
||||
</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary layui-btn-xs"
|
||||
onclick="del({$vo.group_id})">
|
||||
<i class="layui-icon layui-icon-delete"></i>删除
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
layui.use(['layer'], function () {
|
||||
layer = layui.layer;
|
||||
$ = layui.jquery;
|
||||
});
|
||||
// 添加
|
||||
function add() {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '添加角色',
|
||||
shade: 0.3,
|
||||
area: ['450px', '550px'],
|
||||
content: "{$config['admin_route']}yunzeradmin/groupadd"
|
||||
});
|
||||
}
|
||||
// 编辑
|
||||
function edit(group_id) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '编辑角色',
|
||||
shade: 0.3,
|
||||
area: ['450px', '550px'],
|
||||
content: "{$config['admin_route']}yunzeradmin/groupedit?group_id=" + group_id
|
||||
});
|
||||
}
|
||||
// 删除
|
||||
function del(group_id) {
|
||||
layer.confirm('确定要删除吗?', {
|
||||
icon: 3,
|
||||
btn: ['确定', '取消']
|
||||
}, function () {
|
||||
$.post("{$config['admin_route']}yunzeradmin/groupdel", { 'group_id': group_id }, function (res) {
|
||||
if (res.code > 0) {
|
||||
layer.alert(res.msg, { icon: 2 });
|
||||
} else {
|
||||
layer.msg(res.msg, { icon: 1 });
|
||||
setTimeout(function () { window.location.reload(); }, 1000);
|
||||
}
|
||||
}, 'json');
|
||||
});
|
||||
}
|
||||
//刷新列表
|
||||
function refresh() {
|
||||
window.location.reload();
|
||||
}
|
||||
</script>
|
||||
{include file="public/tail" /}
|
||||
Reference in New Issue
Block a user