west.jsp 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <% String basePath = request.getScheme()+ "://" + request.getServerName() + ":" +request.getServerPort() + request.getContextPath(); %>
  4. <style>
  5. <!--
  6. .normal_menu{
  7. height: 26px;line-height: 26px;width: 100%;background: #fff;border-bottom: 1px solid #1369d8;
  8. }
  9. .normal_menu_text{
  10. margin-left: 5px;float: left;color:black;
  11. }
  12. .select_menu{
  13. background-color: #1369d8 !important;
  14. }
  15. .menu_child{
  16. height: 26px;line-height: 26px;width: 100%;border-bottom: 1px solid #1369d8;background: #E0ECFF;display: none;
  17. }
  18. .menu_child_text{
  19. color: #fff;
  20. }
  21. -->
  22. </style>
  23. <div id="aa" data-options="fit:true,border:false">
  24. <div id="myMenu" style="margin: 0px;background-color: #F5F5F5;">
  25. </div>
  26. </div>
  27. <script type="text/javascript">
  28. var menuIds = [];
  29. $('#aa').accordion({
  30. animate:false
  31. });
  32. function my_show(id){
  33. for(var a in menuIds){
  34. if(menuIds[a] != id){
  35. var v_id = menuIds[a];
  36. $("#my_show_"+v_id).removeClass("layout-button-down");
  37. $("#my_show_"+v_id).addClass("layout-button-left");
  38. $(".my_dsr_"+v_id).css('display','none');
  39. $("#my_dsr_"+v_id).val("1");
  40. }
  41. }
  42. if($("#my_dsr_"+id).val() == "1"){
  43. $("#my_show_"+id).removeClass("layout-button-left");
  44. $("#my_show_"+id).addClass("layout-button-down");
  45. $(".my_dsr_"+id).css('display','block');
  46. $("#my_dsr_"+id).val("0");
  47. }else{
  48. $("#my_show_"+id).removeClass("layout-button-down");
  49. $("#my_show_"+id).addClass("layout-button-left");
  50. $(".my_dsr_"+id).css('display','none');
  51. $("#my_dsr_"+id).val("1");
  52. }
  53. }
  54. function openMenu(v_title,v_icon,v_url,v_id){
  55. $(".select_menu").removeClass("select_menu");
  56. $(".menu_child_text").removeClass("menu_child_text");
  57. $("#menu_"+v_id).addClass("select_menu");
  58. $("#menu_child_"+v_id).addClass("menu_child_text");
  59. //alert(v_url);
  60. //v_url = "mainAction_dsr?id=" + v_id ;
  61. //alert(v_url);
  62. if(v_url != null && v_url != '' && v_url != "undefined"){
  63. parent.$.messager.progress({
  64. title : '提示',
  65. text : '数据处理中,请稍候....'
  66. });
  67. addTabFunction(
  68. {
  69. title : v_title,
  70. closable : true,
  71. iconCls:v_icon,
  72. content : '<iframe src="' + v_url + '" frameborder="0" style="border:0;width:100%;height:99%;"></iframe>'
  73. }
  74. );
  75. }
  76. }
  77. $(function(){
  78. $.ajax({
  79. type: "post",//使用post方法访问后台
  80. dataType: "json",//返回json格式的数据
  81. url: whzl.basePath+"/groupAction_menuParent",//要访问的后台地址
  82. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  83. success: function(msg){//msg为返回的数据,在这里做数据绑定
  84. if(msg.success){
  85. var data = msg.obj;
  86. for(var i = 0; i < data.length; i++ ){
  87. var v_id = data[i].id;
  88. menuIds.push(v_id);
  89. var menu = "<div id='mymenu_"+v_id+"'>"+
  90. "<div style='height: 26px;line-height: 26px;width: 100%;background: #fff;border-bottom: 1px solid #1369d8;cursor: pointer;' onclick='my_show("+v_id+")'>"+
  91. "<a href='javascript:void(0)' >"+
  92. "<div class='"+data[i].iconCls+"' style='height: 16px;width: 16px;float:left;margin-top: 5px;margin-left: 15px;'></div>"+
  93. "<div style='margin-left: 5px;float: left;color:black;'>"+data[i].text+"</div>"+
  94. "<div id='my_show_"+v_id+"' class='layout-button-left' style='height: 16px;width: 16px;float:right;margin-top: 5px;margin-right:5px;'></div>"+
  95. "<input id='my_dsr_"+v_id+"' type='hidden' value='1'>"+
  96. "</a>"+
  97. "</div>" +
  98. "</div>";
  99. $("#myMenu").append(menu);
  100. $.ajax({
  101. type: "post",//使用post方法访问后台
  102. dataType: "json",//返回json格式的数据
  103. url: whzl.basePath+"/groupAction_menuChildren?id="+data[i].id,//要访问的后台地址
  104. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  105. success: function(msg){//msg为返回的数据,在这里做数据绑定
  106. if(msg.success){
  107. var data = msg.obj;
  108. for(var i = 0; i < data.length; i++ ){
  109. var menu = "<div id='menu_"+data[i].id+"' style='cursor: pointer;' class='my_dsr_"+data[i].pid+" menu_child' onclick=\"openMenu('"+data[i].text+"','"+data[i].iconCls+"','"+data[i].href+"','"+data[i].id+"')\">"+
  110. "<a href='javascript:void(0)'>"+
  111. "<div class='"+data[i].iconCls+"' style='height: 16px;width: 16px;float:left;margin-top: 5px;margin-left: 20px;'></div>"+
  112. "<div id='menu_child_"+data[i].id+"' class='normal_menu_text' style='margin-left: 5px;float: left;'>"+data[i].text+"</div>"+
  113. "</a>"+
  114. "</div>";
  115. $("#mymenu_"+data[i].pid).append(menu);
  116. }
  117. }
  118. }
  119. });
  120. /*
  121. if(data[i].layer == 1){
  122. var v_id = data[i].id;
  123. var menu = "<div id='mymenu_"+v_id+"'>"+
  124. "<div style='height: 26px;line-height: 26px;width: 100%;background: #fff;border-bottom: 1px solid #1369d8;cursor: pointer;' onclick='my_show("+v_id+")'>"+
  125. "<a href='javascript:void(0)' >"+
  126. "<div class='"+data[i].iconCls+"' style='height: 16px;width: 16px;float:left;margin-top: 5px;margin-left: 15px;'></div>"+
  127. "<div style='margin-left: 5px;float: left;color:black;'>"+data[i].text+"</div>"+
  128. "<div id='my_show_"+v_id+"' class='layout-button-left' style='height: 16px;width: 16px;float:right;margin-top: 5px;margin-right:5px;'></div>"+
  129. "<input id='my_dsr_"+v_id+"' type='hidden' value='1'>"+
  130. "</a>"+
  131. "</div>" +
  132. "</div>";
  133. $("#myMenu").append(menu);
  134. $.ajax({
  135. type: "post",//使用post方法访问后台
  136. dataType: "json",//返回json格式的数据
  137. url: whzl.basePath+"/groupAction_menuChildren?id="+data[i].id,//要访问的后台地址
  138. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  139. success: function(msg){//msg为返回的数据,在这里做数据绑定
  140. if(msg.success){
  141. var data = msg.obj;
  142. for(var i = 0; i < data.length; i++ ){
  143. var menu = "<div id='menu_"+data[i].id+"' class='my_dsr_"+data[i].pid+" menu_child'>"+
  144. "<a href='javascript:void(0)' onclick=\"openMenu('"+data[i].text+"','"+data[i].iconCls+"','"+data[i].href+"','"+data[i].id+"')\">"+
  145. "<div class='"+data[i].iconCls+"' style='height: 16px;width: 16px;float:left;margin-top: 5px;margin-left: 35px;'></div>"+
  146. "<div id='menu_child_"+data[i].id+"' class='normal_menu_text' style='margin-left: 5px;float: left;'>"+data[i].text+"</div>"+
  147. "</a>"+
  148. "</div>";
  149. $("#mymenu_"+data[i].pid).append(menu);
  150. }
  151. }
  152. }
  153. });
  154. }else{
  155. var menu = "<div id='menu_"+data[i].id+"' class='normal_menu' style='cursor: pointer;' onclick=\"openMenu('"+data[i].text+"','"+data[i].iconCls+"','"+data[i].href+"','"+data[i].id+"')\">"+
  156. "<a href='javascript:void(0)'>"+
  157. "<div class='"+data[i].iconCls+"' style='height: 16px;width: 16px;float:left;margin-top: 5px;margin-left: 15px;'></div>"+
  158. "<div id='menu_child_"+data[i].id+"' class='normal_menu_text'>"+data[i].text+"</div>"+
  159. "</a>"+
  160. "</div>";
  161. $("#myMenu").append(menu);
  162. }
  163. */
  164. /*
  165. $('#aa').accordion('add', {
  166. title: data[i].text,
  167. iconCls:data[i].iconCls,
  168. content: '<ul id="treeMenu_'+i+'" data-options="lines:true" style="margin-top:5px;"></ul>',
  169. selected: false
  170. });
  171. $('#treeMenu_'+i).tree({
  172. url:whzl.basePath+"/groupAction_menuChildren?id="+data[i].id,
  173. onClick: function(node){
  174. //获取父节点
  175. if(node.attributes.url.length > 0 && node.attributes.url != '#'){
  176. parent.$.messager.progress({
  177. title : '提示',
  178. text : '数据处理中,请稍候....'
  179. });
  180. addTabFunction(
  181. {
  182. title : node.attributes.pName + "》" + node.text,
  183. closable : true,
  184. iconCls:node.iconCls,
  185. content : '<iframe src="' + node.attributes.url + '" frameborder="0" style="border:0;width:100%;height:100%;"></iframe>'
  186. }
  187. );
  188. }
  189. } ,
  190. loadFilter: function(result){
  191. if(result.success){
  192. return result.obj;
  193. }else{
  194. $.messager.alert('提示',result.message);
  195. }
  196. }
  197. });
  198. */
  199. }
  200. }
  201. }
  202. });
  203. });
  204. </script>