|
@@ -0,0 +1,207 @@
|
|
|
+<%@ page contentType="text/html;charset=UTF-8" %>
|
|
|
+<%@ include file="/webpage/include/taglib.jsp"%>
|
|
|
+<html>
|
|
|
+<head>
|
|
|
+ <title>菜单管理</title>
|
|
|
+ <meta name="decorator" content="default"/>
|
|
|
+ <script src="${ctxStatic}/layer-v2.3/layim/layui/layui.js"></script>
|
|
|
+ <link href="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.css" rel="stylesheet" />
|
|
|
+ <%--<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>--%>
|
|
|
+ <style>
|
|
|
+ .layui-table th{
|
|
|
+ font-size: 15px;
|
|
|
+ /*表头内容居中显示*/
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .layui-table th div span{
|
|
|
+ font-size: 15px;
|
|
|
+ /*表头内容居中显示*/
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .layui-table td div ,.layui-table td div font{
|
|
|
+ font-size: 15px;
|
|
|
+ }
|
|
|
+ .pid{
|
|
|
+ font-size:15px;
|
|
|
+ font-weight:400;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+ <script type="text/javascript">
|
|
|
+ $(document).ready(function() {
|
|
|
+ });
|
|
|
+
|
|
|
+ function reset() {
|
|
|
+ $("#searchForm").resetForm();
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+ <style>
|
|
|
+ body{
|
|
|
+ background-color:transparent;
|
|
|
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
|
|
|
+ color:#ffffff;
|
|
|
+ background-color:rgba(255,255,255,0);
|
|
|
+ height:100%;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+<div class="wrapper wrapper-content">
|
|
|
+ <sys:message content="${message}"/>
|
|
|
+ <div class="layui-row">
|
|
|
+ <div class="full-width fl">
|
|
|
+ <div class="layui-row contentShadow shadowLR" id="queryDiv">
|
|
|
+ <form:form id="searchForm" modelAttribute="menu" action="${ctx}/sys/menu/" method="post" class="form-inline">
|
|
|
+ </form:form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="full-width fl">
|
|
|
+ <div class="layui-form contentDetails contentShadow shadowLBR">
|
|
|
+ <div class="nav-btns">
|
|
|
+ <shiro:hasPermission name="sys:menu:add">
|
|
|
+ <table:addRow url="${ctx}/sys/menu/form" title="菜单"></table:addRow><!-- 增加按钮 -->
|
|
|
+ </shiro:hasPermission>
|
|
|
+ <%--<shiro:hasPermission name="sys:menu:edit">
|
|
|
+ <table:editRow url="${ctx}/sys/menu/form" id="treeTable" title="菜单"></table:editRow><!-- 编辑按钮 -->
|
|
|
+ </shiro:hasPermission>
|
|
|
+ <shiro:hasPermission name="sys:menu:del">
|
|
|
+ <table:delRow url="${ctx}/sys/menu/deleteAll" id="treeTable"></table:delRow><!-- 删除按钮 -->
|
|
|
+ </shiro:hasPermission>--%>
|
|
|
+ <button class="nav-btn layui-btn" id="btn-expand">全部展开</button>
|
|
|
+ <button class="nav-btn layui-btn-warm" id="btn-fold">全部折叠</button>
|
|
|
+ <button class="nav-btn nav-btn-refresh" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i> 刷新</button>
|
|
|
+
|
|
|
+ <div style="clear: both;"></div>
|
|
|
+ </div>
|
|
|
+ <table id="permissionTable" class="layui-table" lay-filter="permissionTable"></table>
|
|
|
+ <div style="clear: both;"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div id="changewidth"></div>
|
|
|
+</div>
|
|
|
+
|
|
|
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
|
|
|
+<script>
|
|
|
+
|
|
|
+ resizeListTable();
|
|
|
+ $("a").on("click",addLinkVisied);
|
|
|
+</script>
|
|
|
+<script>
|
|
|
+ resizeListWindow2();
|
|
|
+ $(window).resize(function(){
|
|
|
+ resizeListWindow2();
|
|
|
+ });
|
|
|
+</script>
|
|
|
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
|
|
|
+<script src="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.js" charset="utf-8"></script>
|
|
|
+<script>
|
|
|
+ /*使用模块加载的方式 加载文件*/
|
|
|
+ layui.config({
|
|
|
+ base: '${ctx}/resoueces/css/layui/module/'
|
|
|
+ }).extend({
|
|
|
+ treetable: 'treetable-lay/treetable'
|
|
|
+ }).use(['layer', 'table', 'treetable'], function () {
|
|
|
+ var $ = layui.jquery;
|
|
|
+ var table = layui.table;
|
|
|
+ var layer = layui.layer;
|
|
|
+ var treetable = layui.treetable;
|
|
|
+
|
|
|
+ // 渲染表格
|
|
|
+ var renderTable = function () {
|
|
|
+ layer.load(2);
|
|
|
+ treetable.render({
|
|
|
+ treeColIndex: 0,//树形图标显示在第几列
|
|
|
+ treeSpid: 1,//最上级的父级id
|
|
|
+ treeIdName: 'permissionId',//id字段的名称
|
|
|
+ treePidName: 'pid',//pid字段的名称
|
|
|
+ treeDefaultClose: true,//是否默认折叠
|
|
|
+ treeLinkage: true,//父级展开时是否自动展开所有子级
|
|
|
+ elem: '#permissionTable',
|
|
|
+ url: '${ctx}/sys/menu/getTreeList',
|
|
|
+ page: false,
|
|
|
+ cols: [[
|
|
|
+ /*{type:'checkbox'},*/
|
|
|
+ {field: 'name', title: '结构',width:'15%'},
|
|
|
+ {field: 'name', title: '名称',width:'15%',templet:function(d){
|
|
|
+ return "<a class=\"attention-info pid\" title=\"" + d.name + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看菜单', '${ctx}/sys/menu/form?id=" + d.id +"','80%', '80%')\">" + d.name + "</a>";
|
|
|
+ }},
|
|
|
+ /*{field: 'projectName', align:'center', title: '项目名称',width:200,templet:function(d){
|
|
|
+ if(0 == d.pid){
|
|
|
+ return "<a class=\"attention-info pid\" title=\"" + d.projectName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目', '${ctx}/ruralProject/ruralProjectRecords/view?id=" + d.id +"','95%', '95%')\">" + d.projectName + "</a>";
|
|
|
+ }else{
|
|
|
+ return "<a class=\"attention-info\" title=\"" + d.projectName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目信息', '${ctx}/subProject/subProject/view?id=" + d.id +"','95%', '95%')\">" + d.projectName + "</a>";
|
|
|
+ }
|
|
|
+ }},*/
|
|
|
+ {field: 'href', align:'center', title: '链接',width:'18%',templet: function(d){
|
|
|
+ if(undefined == d.href || null == d.href || '' == d.href){
|
|
|
+ return "<font></font>";
|
|
|
+ }else{
|
|
|
+ return "<font>"+d.href+"</font>";
|
|
|
+ }
|
|
|
+ }},
|
|
|
+ {field: 'sort', align:'center', title: '排序',width:80},
|
|
|
+ {field: 'isShowStr', align:'center', title: '可见',width:80},
|
|
|
+ {field: 'permission', align:'center', title: '权限标识',width:'18%',templet: function(d){
|
|
|
+ if(undefined == d.permission || null == d.permission || '' == d.permission){
|
|
|
+ return "<font></font>";
|
|
|
+ }else{
|
|
|
+ return "<font>"+d.permission+"</font>";
|
|
|
+ }
|
|
|
+ }},
|
|
|
+ {templet: complain, align:'center', title: '操作'}
|
|
|
+ ]],
|
|
|
+ done: function () {
|
|
|
+ layer.closeAll('loading');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ renderTable();
|
|
|
+
|
|
|
+ //触发三个button按钮
|
|
|
+ $('#btn-expand').click(function () {
|
|
|
+ treetable.expandAll('#permissionTable');
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#btn-fold').click(function () {
|
|
|
+ treetable.foldAll('#permissionTable');
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#btn-refresh').click(function () {
|
|
|
+ renderTable();
|
|
|
+ });
|
|
|
+
|
|
|
+ function complain(d){//操作中显示的内容
|
|
|
+ var xml = '';
|
|
|
+
|
|
|
+ <shiro:hasPermission name="sys:menu:view">
|
|
|
+ xml+="<a href=\"javascript:void(0)\" onclick=\"openDialogView('查看菜单', '${ctx}/sys/menu/form?id=" + d.id + " ','80%', '80%')\" class=\"btn btn-info btn-xs\" ><i class=\"fa fa-search-plus\"></i> 查看</a>"
|
|
|
+ </shiro:hasPermission>
|
|
|
+ <shiro:hasPermission name="sys:menu:edit">
|
|
|
+ xml+="<a href=\"javascript:void(0)\" onclick=\"openDialog('修改菜单', '${ctx}/sys/menu/form?id=" + d.id + " ','80%', '80%')\" class=\"btn btn-success btn-xs\" ><i class=\"fa fa-edit\"></i> 修改</a>"
|
|
|
+ </shiro:hasPermission>
|
|
|
+ <shiro:hasPermission name="sys:menu:del">
|
|
|
+ xml+="<a href=\"${ctx}/sys/menu/delete?id="+d.id+"\" onclick=\"return confirmx('要删除该菜单及所有子菜单项吗?', this.href)\" class=\"btn btn-danger btn-xs\" ><i class=\"fa fa-trash\"></i> 删除</a>"
|
|
|
+ </shiro:hasPermission>
|
|
|
+ <shiro:hasPermission name="sys:menu:add">
|
|
|
+ xml+="<a href=\"javascript:void(0)\" onclick=\"openDialog('添加下级菜单', '${ctx}/sys/menu/form?parent.id=" + d.id + " ','80%', '80%')\" class=\"btn btn-primary btn-xs\" ><i class=\"fa fa-plus\"></i> 添加下级菜单</a>"
|
|
|
+ </shiro:hasPermission>
|
|
|
+ return[xml].join('');
|
|
|
+ }
|
|
|
+ //监听工具条
|
|
|
+ table.on('tool(permissionTable)', function (obj) {
|
|
|
+ var data = obj.data;
|
|
|
+ var layEvent = obj.event;
|
|
|
+ if(data.permissionName!=null){
|
|
|
+ if (layEvent === 'del') {
|
|
|
+ layer.msg('删除' + data.id);
|
|
|
+ } else if (layEvent === 'edit') {
|
|
|
+ layer.msg('修改' + data.id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+</script>
|
|
|
+</body>
|
|
|
+</html>
|