120 lines
3.5 KiB
PHP
120 lines
3.5 KiB
PHP
{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-picture"></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>
|
|
|
|
<div id="test7" class="demo-tree"></div>
|
|
<table class="layui-table">
|
|
<thead>
|
|
<tr>
|
|
<th style="text-align:center">类型</th>
|
|
<th style="text-align:center">菜单名</th>
|
|
<th style="text-align:center">图标</th>
|
|
<th style="text-align:center">排序</th>
|
|
<th style="text-align:center">状态</th>
|
|
<th style="text-align:center">操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{volist name="lists" id='vo'}
|
|
<tr>
|
|
<td align="center">
|
|
{if($vo['type']==1)}
|
|
功能模块:{$vo['src']}
|
|
{elseif($vo['type']==2)/}
|
|
超链接:{$vo['src']}
|
|
{else/}
|
|
顶级
|
|
{/if}
|
|
</td>
|
|
<td align="center">{$vo['label']}</td>
|
|
<td align="center"><i class="layui-icon {$vo['icon_class']}"></i> {$vo['icon_class']}</td>
|
|
<td align="center">{$vo['sort']}</td>
|
|
<td align="center">{$vo['status']==1?'开启':'<span style="color:red;">禁用</span>'}</td>
|
|
<td align="center">
|
|
{if($vo['type'] == 0)}
|
|
<button type="button" class="layui-btn layui-btn-xs layui-btn-normal"
|
|
onclick="buttonInfo({$vo.smid})">下级菜单</button>
|
|
{/if}
|
|
<button type="button" class="layui-btn layui-btn-xs layui-btn-primary" onclick="edit({$vo.smid})">
|
|
<i class="layui-icon layui-icon-edit"></i>编辑
|
|
</button>
|
|
<button type="button" class="layui-btn layui-btn-xs layui-btn-primary" onclick="del({$vo.smid})">
|
|
<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: ['550px', '550px'],
|
|
content: '{$config["admin_route"]}yunzer/menuadd'
|
|
});
|
|
}
|
|
// 编辑
|
|
function edit(smid) {
|
|
layer.open({
|
|
type: 2,
|
|
title: '编辑菜单',
|
|
shade: 0.3,
|
|
area: ['550px', '550px'],
|
|
content: '{$config["admin_route"]}yunzer/menuedit?smid=' + smid
|
|
});
|
|
}
|
|
// 删除
|
|
function del(smid) {
|
|
layer.confirm('确定要删除吗?', {
|
|
icon: 3,
|
|
btn: ['确定', '取消']
|
|
}, function () {
|
|
$.post('{$config["admin_route"]}yunzer/menudel', { 'smid': smid }, 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 buttonInfo(smid) {
|
|
window.location.href = "{$config['admin_route']}yunzer/buttoninfo?smid=" + smid;
|
|
}
|
|
|
|
//刷新列表
|
|
function refresh() {
|
|
window.location.reload();
|
|
}
|
|
</script>
|
|
|
|
{include file="public/tail" /} |