menu.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3. <head>
  4. <th:block th:include="include :: header('菜单列表')" />
  5. </head>
  6. <body class="gray-bg">
  7. <div class="container-div">
  8. <div class="row">
  9. <div class="col-sm-12 search-collapse">
  10. <form id="menu-form">
  11. <div class="select-list">
  12. <ul>
  13. <li>
  14. 菜单名称:<input type="text" name="menuName"/>
  15. </li>
  16. <li>
  17. 菜单状态:<select name="visible" th:with="type=${@dict.getType('sys_show_hide')}">
  18. <option value="">所有</option>
  19. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  20. </select>
  21. </li>
  22. <li>
  23. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  24. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  25. </li>
  26. </ul>
  27. </div>
  28. </form>
  29. </div>
  30. <div class="btn-group-sm" id="toolbar" role="group">
  31. <a class="btn btn-success" onclick="$.operate.add(0)" shiro:hasPermission="system:menu:add">
  32. <i class="fa fa-plus"></i> 新增
  33. </a>
  34. <a class="btn btn-primary" onclick="$.operate.edit()" shiro:hasPermission="system:menu:edit">
  35. <i class="fa fa-edit"></i> 修改
  36. </a>
  37. <a class="btn btn-info" id="expandAllBtn">
  38. <i class="fa fa-exchange"></i> 展开/折叠
  39. </a>
  40. </div>
  41. <div class="col-sm-12 select-table table-striped">
  42. <table id="bootstrap-tree-table" data-mobile-responsive="true"></table>
  43. </div>
  44. </div>
  45. </div>
  46. <th:block th:include="include :: footer" />
  47. <script th:inline="javascript">
  48. var addFlag = [[${@permission.hasPermi('system:menu:add')}]];
  49. var editFlag = [[${@permission.hasPermi('system:menu:edit')}]];
  50. var removeFlag = [[${@permission.hasPermi('system:menu:remove')}]];
  51. var datas = [[${@dict.getType('sys_show_hide')}]];
  52. var prefix = ctx + "system/menu";
  53. $(function() {
  54. var options = {
  55. code: "menuId",
  56. parentCode: "parentId",
  57. uniqueId: "menuId",
  58. expandAll: false,
  59. expandFirst: false,
  60. url: prefix + "/list",
  61. createUrl: prefix + "/add/{id}",
  62. updateUrl: prefix + "/edit/{id}",
  63. removeUrl: prefix + "/remove/{id}",
  64. modalName: "菜单",
  65. columns: [{
  66. field: 'selectItem',
  67. radio: true
  68. },
  69. {
  70. title: '菜单名称',
  71. field: 'menuName',
  72. width: '20%',
  73. formatter: function(value, row, index) {
  74. if ($.common.isEmpty(row.icon)) {
  75. return row.menuName;
  76. } else {
  77. return '<i class="' + row.icon + '"></i> <span class="nav-label">' + row.menuName + '</span>';
  78. }
  79. }
  80. },
  81. {
  82. field: 'orderNum',
  83. title: '排序',
  84. width: '10%',
  85. align: "left"
  86. },
  87. {
  88. field: 'url',
  89. title: '请求地址',
  90. width: '15%',
  91. align: "left"
  92. },
  93. {
  94. title: '类型',
  95. field: 'menuType',
  96. width: '10%',
  97. align: "left",
  98. formatter: function(value, item, index) {
  99. if (item.menuType == 'M') {
  100. return '<span class="label label-success">目录</span>';
  101. }
  102. else if (item.menuType == 'C') {
  103. return '<span class="label label-primary">菜单</span>';
  104. }
  105. else if (item.menuType == 'F') {
  106. return '<span class="label label-warning">按钮</span>';
  107. }
  108. }
  109. },
  110. {
  111. field: 'visible',
  112. title: '可见',
  113. width: '10%',
  114. align: "left",
  115. formatter: function(value, row, index) {
  116. return $.table.selectDictLabel(datas, row.visible);
  117. }
  118. },
  119. {
  120. field: 'perms',
  121. title: '权限标识',
  122. width: '15%',
  123. align: "left",
  124. },
  125. {
  126. title: '操作',
  127. width: '20%',
  128. align: "left",
  129. formatter: function(value, row, index) {
  130. var actions = [];
  131. actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.menuId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
  132. actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.menuId + '\')"><i class="fa fa-plus"></i>新增</a> ');
  133. actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.menuId + '\')"><i class="fa fa-trash"></i>删除</a>');
  134. return actions.join('');
  135. }
  136. }]
  137. };
  138. $.treeTable.init(options);
  139. });
  140. </script>
  141. </body>
  142. </html>