116 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			116 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| {include file="public/header" /}
 | |
| <div class="config-container">
 | |
| 	<div class="config-header" style="display:flex;justify-content: space-between;">
 | |
| 		<div>
 | |
| 			<span>菜单管理</span>
 | |
| 		</div>
 | |
| 		<div>
 | |
| 			<button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="add()">
 | |
| 				<i class="layui-icon layui-icon-add-1"></i>添加
 | |
| 			</button>
 | |
| 			<button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="refresh()">
 | |
| 				<i class="layui-icon layui-icon-refresh"></i>刷新
 | |
| 			</button>
 | |
| 		</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" /} |