list2.jsp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <!doctype html>
  4. <html>
  5. <head>
  6. <title></title>
  7. <%@ include file="../../common/head.jsp"%>
  8. <script type="text/javascript">
  9. var tree = null;
  10. function p_add()
  11. {
  12. var node = tree.getSelected();
  13. if(node)
  14. {
  15. var _id = node.data.text.split('-')[1].trim();
  16. var _pid = $('#menu_' + _id.trim()).attr('pid').trim();
  17. }
  18. else
  19. {
  20. _id = 0;
  21. _pid = 0; // 获取pid
  22. }
  23. s_open_dlg('新增', 'transfer.cs?action=add&pid='+_pid + '&id=' + _id);
  24. }
  25. function p_modify(){
  26. var node = tree.getSelected();
  27. if(node){
  28. var _id = node.data.text.split('-')[1].trim();
  29. var _pid = $('#menu_' + _id.trim()).attr('pid').trim();
  30. if(parseInt(_id) == 0){
  31. return;
  32. }
  33. s_open_dlg('修改', 'transfer.cs?action=modify&pid='+_pid + '&id=' + _id);
  34. }
  35. else
  36. s_show_dlg_question('请先选择节点');
  37. }
  38. function p_del()
  39. {
  40. var node = tree.getSelected();
  41. var _id = null;
  42. var _pid = null;
  43. if(node)
  44. {
  45. _id = node.data.text.split('-')[1];
  46. _pid = $('#menu_' + _id.trim()).attr('pid'); // 获取pid
  47. }
  48. else
  49. s_show_dlg_question('请先选择节点');
  50. }
  51. $(function ()
  52. {
  53. tree = $("#tree").ligerTree({ checkbox: false, parentIcon: null, childIcon: null });
  54. $("#toptoolbar").ligerToolBar({ items: [
  55. {
  56. text: action.add,
  57. click: p_add,
  58. icon:'add'
  59. },
  60. { line:true },
  61. { text: action.update, click: p_modify },
  62. { line:true },
  63. { text: action.del, click: p_del }
  64. ]
  65. });
  66. });
  67. </script>
  68. </head>
  69. <body>
  70. <div id="toptoolbar" ></div>
  71. <!--简易模式-->
  72. <div style="width:99%; float:left; border:1px solid #ccc; overflow:auto; ">
  73. <ul id="tree">
  74. <li>
  75. <span>
  76. <label style="display: none" id="menu_0" pid="0"></label>
  77. 系统菜单 - 0
  78. </span>
  79. <ul>
  80. <s:forEach items="${superMenuList }" var="superMenu">
  81. <li>
  82. <span>
  83. <label style="display: none" id="menu_${superMenu.id }" pid="${superMenu.pid }"></label>
  84. ${superMenu.name } - ${superMenu.id}
  85. </span>
  86. </li>
  87. </s:forEach>
  88. </ul>
  89. </li>
  90. </ul>
  91. </div>
  92. <div style="display:none">
  93. </div>
  94. </body>
  95. </html>