menu_list.jsp 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  4. <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
  5. <%
  6. String path = request.getContextPath();
  7. String basePath = request.getScheme() + "://"
  8. + request.getServerName() + ":" + request.getServerPort()
  9. + path + "/";
  10. %>
  11. <!DOCTYPE html>
  12. <html lang="en">
  13. <head>
  14. <base href="<%=basePath%>">
  15. <!-- jsp文件头和头部 -->
  16. <%@ include file="../index/top.jsp"%>
  17. <script type="text/javascript">
  18. //刷新ztree
  19. function parentReload(){
  20. if(null != ${MSG} && 'change' == ${MSG}){
  21. parent.location.href="<%=basePath%>menu/listAllMenu.do?MENU_ID="+${MENU_ID};
  22. }else{
  23. //什么也不干
  24. }
  25. }
  26. parentReload();
  27. </script>
  28. </head>
  29. <body class="no-skin">
  30. <!-- /section:basics/navbar.layout -->
  31. <div class="main-container" id="main-container">
  32. <!-- /section:basics/sidebar -->
  33. <div class="main-content">
  34. <div class="main-content-inner">
  35. <div class="page-content">
  36. <div class="row">
  37. <div class="col-xs-12">
  38. <table id="dynamic-table" class="table table-striped table-bordered table-hover">
  39. <thead>
  40. <tr>
  41. <th class="center" style="width: 50px;">序号</th>
  42. <th class='center'>名称</th>
  43. <th class='center'>资源路径</th>
  44. <th class='center' style="width: 50px;">状态</th>
  45. <th class='center' style="width: 120px;">操作</th>
  46. </tr>
  47. </thead>
  48. <tbody>
  49. <c:choose>
  50. <c:when test="${not empty menuList}">
  51. <c:forEach items="${menuList}" var="menu" varStatus="vs">
  52. <tr>
  53. <td class='center'>${menu.MENU_ORDER }</td>
  54. <td class='center'><i class="${menu.MENU_ICON }">&nbsp;</i>
  55. <a href="javascript:goSonmenu('${menu.MENU_ID }')">${menu.MENU_NAME }</a>
  56. &nbsp;
  57. <c:if test="${menu.PARENT_ID == '0' }">
  58. <c:if test="${menu.MENU_TYPE == '1' }">
  59. <span class="label label-success arrowed">系统</span>
  60. </c:if>
  61. <c:if test="${menu.MENU_TYPE == '2' }">
  62. <span class="label label-important arrowed-in">业务</span>
  63. </c:if>
  64. <c:if test="${menu.MENU_TYPE == '3' }">
  65. <span class="label label-purple arrowed">类型三</span>
  66. </c:if>
  67. <c:if test="${menu.MENU_TYPE == '4' }">
  68. <span class="label label-primary arrowed-right">类型四</span>
  69. </c:if>
  70. </c:if>
  71. </td>
  72. <td>${menu.MENU_URL == '#'? '': menu.MENU_URL}</td>
  73. <td class='center'><i class="ace-icon fa ${menu.MENU_STATE == 1? 'fa-eye': 'fa-eye-slash'}"></i></td>
  74. <td class='center'>
  75. <c:if test="${QX.edit != 1 && QX.del != 1 }">
  76. <span class="label label-large label-grey arrowed-in-right arrowed-in"><i class="ace-icon fa fa-lock" title="无权限"></i></span>
  77. </c:if>
  78. <div class="hidden-sm hidden-xs action-buttons">
  79. <c:if test="${QX.edit == 1 }">
  80. <a class="blue" href="javascript:editTb('${menu.MENU_ID }');">
  81. <i class="ace-icon glyphicon glyphicon-picture bigger-130" title="编辑图标"></i>
  82. </a>
  83. <a class="green" href="javascript:editmenu('${menu.MENU_ID }');">
  84. <i class="ace-icon fa fa-pencil-square-o bigger-130" title="修改"></i>
  85. </a>
  86. </c:if>
  87. <c:if test="${QX.del == 1 }">
  88. <a class="red" href="javascript:delmenu('${menu.MENU_ID }');">
  89. <i class="ace-icon fa fa-trash-o bigger-130" title="删除"></i>
  90. </a>
  91. </c:if>
  92. </div>
  93. <div class="hidden-md hidden-lg">
  94. <div class="inline pos-rel">
  95. <button
  96. class="btn btn-minier btn-yellow dropdown-toggle"
  97. data-toggle="dropdown" data-position="auto">
  98. <i
  99. class="ace-icon fa fa-caret-down icon-only bigger-120"></i>
  100. </button>
  101. <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
  102. <c:if test="${QX.edit == 1 }">
  103. <li><a href="javascript:editTb('${menu.MENU_ID }');" class="tooltip-info" data-rel="tooltip" title="View">
  104. <span class="blue">
  105. <i class="ace-icon glyphicon glyphicon-picture bigger-120" title="编辑图标"></i>
  106. </span>
  107. </a></li>
  108. <li><a href="javascript:editmenu('${menu.MENU_ID }');" class="tooltip-success" data-rel="tooltip" title="Edit">
  109. <span class="green">
  110. <i class="ace-icon fa fa-pencil-square-o bigger-120" title="修改"></i>
  111. </span>
  112. </a></li>
  113. </c:if>
  114. <c:if test="${QX.del == 1 }">
  115. <li><a href="javascript:delmenu('${menu.MENU_ID }');" class="tooltip-error" data-rel="tooltip" title="Delete">
  116. <span class="red"> <i class="ace-icon fa fa-trash-o bigger-120" title="删除"></i>
  117. </span>
  118. </a></li>
  119. </c:if>
  120. </ul>
  121. </div>
  122. </div>
  123. </td>
  124. </tr>
  125. </c:forEach>
  126. </c:when>
  127. <c:otherwise>
  128. <tr>
  129. <td colspan="100" class='center'>没有相关数据</td>
  130. </tr>
  131. </c:otherwise>
  132. </c:choose>
  133. </tbody>
  134. </table>
  135. <div>
  136. &nbsp;&nbsp;
  137. <c:if test="${QX.add == 1 }"><a class="btn btn-sm btn-success" onclick="addmenu('${MENU_ID}');">新增</a></c:if>
  138. <c:if test="${null != pd.MENU_ID && pd.MENU_ID != '0'}">
  139. <a class="btn btn-sm btn-success" onclick="goSonmenu('${pd.PARENT_ID}');">返回</a>
  140. </c:if>
  141. </div>
  142. </div>
  143. <!-- /.col -->
  144. </div>
  145. <!-- /.row -->
  146. </div>
  147. <!-- /.page-content -->
  148. </div>
  149. </div>
  150. <!-- /.main-content -->
  151. <!-- 返回顶部 -->
  152. <a href="#" id="btn-scroll-up"
  153. class="btn-scroll-up btn btn-sm btn-inverse"> <i
  154. class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
  155. </a>
  156. </div>
  157. <!-- /.main-container -->
  158. <!-- basic scripts -->
  159. <!-- 页面底部js¨ -->
  160. <%@ include file="../index/foot.jsp"%>
  161. <!-- 删除时确认窗口 -->
  162. <script src="static/ace/js/bootbox.js"></script>
  163. <!-- ace scripts -->
  164. <script src="static/ace/js/ace/ace.js"></script>
  165. <!-- inline scripts related to this page -->
  166. <script type="text/javascript">
  167. $(document).ready(function(){
  168. top.hangge();
  169. });
  170. //去此ID下子菜单列表
  171. function goSonmenu(MENU_ID){
  172. top.jzts();
  173. window.location.href="<%=basePath%>menu.do?MENU_ID="+MENU_ID;
  174. };
  175. //新增菜单
  176. function addmenu(MENU_ID){
  177. top.jzts();
  178. window.location.href="<%=basePath%>menu/toAdd.do?MENU_ID="+MENU_ID;
  179. };
  180. //编辑菜单
  181. function editmenu(MENU_ID){
  182. top.jzts();
  183. window.location.href="<%=basePath%>menu/toEdit.do?id="+MENU_ID;
  184. };
  185. //删除
  186. function delmenu(MENU_ID){
  187. bootbox.confirm("确定要删除此菜单吗?", function(result) {
  188. if(result) {
  189. var url = "<%=basePath%>menu/delete.do?MENU_ID="+MENU_ID+"&guid="+new Date().getTime();
  190. top.jzts();
  191. $.get(url,function(data){
  192. if("success" == data.result){
  193. parent.location.href="<%=basePath%>menu/listAllMenu.do?MENU_ID="+${MENU_ID};
  194. }else if("false" == data.result){
  195. top.hangge();
  196. bootbox.dialog({
  197. message: "<span class='bigger-110'>删除失败,请先删除子菜单!</span>",
  198. buttons:
  199. {
  200. "button" :
  201. {
  202. "label" : "确定",
  203. "className" : "btn-sm btn-success"
  204. }
  205. }
  206. });
  207. }
  208. });
  209. }
  210. });
  211. }
  212. //编辑菜单图标
  213. function editTb(MENU_ID){
  214. top.jzts();
  215. var diag = new top.Dialog();
  216. diag.Drag=true;
  217. diag.Title ="编辑图标";
  218. diag.URL = '<%=basePath%>menu/toEditicon.do?MENU_ID='+MENU_ID;
  219. diag.Width = 800;
  220. diag.Height = 380;
  221. diag.CancelEvent = function(){ //关闭事件
  222. if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
  223. top.jzts();
  224. setTimeout("location.reload()",100);
  225. }
  226. diag.close();
  227. };
  228. diag.show();
  229. }
  230. </script>
  231. </body>
  232. </html>