123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213 |
- <%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
- <% String basePath = request.getScheme()+ "://" + request.getServerName() + ":" +request.getServerPort() + request.getContextPath(); %>
- <style>
- <!--
- .normal_menu{
- height: 26px;line-height: 26px;width: 100%;background: #fff;border-bottom: 1px solid #1369d8;
- }
- .normal_menu_text{
- margin-left: 5px;float: left;color:black;
- }
- .select_menu{
- background-color: #1369d8 !important;
- }
- .menu_child{
- height: 26px;line-height: 26px;width: 100%;border-bottom: 1px solid #1369d8;background: #E0ECFF;display: none;
- }
- .menu_child_text{
- color: #fff;
- }
- -->
- </style>
- <div id="aa" data-options="fit:true,border:false">
- <div id="myMenu" style="margin: 0px;background-color: #F5F5F5;">
-
- </div>
- </div>
- <script type="text/javascript">
- var menuIds = [];
- $('#aa').accordion({
- animate:false
- });
- function my_show(id){
- for(var a in menuIds){
- if(menuIds[a] != id){
- var v_id = menuIds[a];
- $("#my_show_"+v_id).removeClass("layout-button-down");
- $("#my_show_"+v_id).addClass("layout-button-left");
- $(".my_dsr_"+v_id).css('display','none');
- $("#my_dsr_"+v_id).val("1");
- }
- }
- if($("#my_dsr_"+id).val() == "1"){
- $("#my_show_"+id).removeClass("layout-button-left");
- $("#my_show_"+id).addClass("layout-button-down");
- $(".my_dsr_"+id).css('display','block');
- $("#my_dsr_"+id).val("0");
- }else{
- $("#my_show_"+id).removeClass("layout-button-down");
- $("#my_show_"+id).addClass("layout-button-left");
- $(".my_dsr_"+id).css('display','none');
- $("#my_dsr_"+id).val("1");
- }
- }
- function openMenu(v_title,v_icon,v_url,v_id){
- $(".select_menu").removeClass("select_menu");
- $(".menu_child_text").removeClass("menu_child_text");
- $("#menu_"+v_id).addClass("select_menu");
- $("#menu_child_"+v_id).addClass("menu_child_text");
- //alert(v_url);
- //v_url = "mainAction_dsr?id=" + v_id ;
- //alert(v_url);
- if(v_url != null && v_url != '' && v_url != "undefined"){
- parent.$.messager.progress({
- title : '提示',
- text : '数据处理中,请稍候....'
- });
- addTabFunction(
- {
- title : v_title,
- closable : true,
- iconCls:v_icon,
- content : '<iframe src="' + v_url + '" frameborder="0" style="border:0;width:100%;height:99%;"></iframe>'
- }
- );
- }
- }
- $(function(){
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: whzl.basePath+"/groupAction_menuParent",//要访问的后台地址
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- var data = msg.obj;
- for(var i = 0; i < data.length; i++ ){
- var v_id = data[i].id;
- menuIds.push(v_id);
- var menu = "<div id='mymenu_"+v_id+"'>"+
- "<div style='height: 26px;line-height: 26px;width: 100%;background: #fff;border-bottom: 1px solid #1369d8;cursor: pointer;' onclick='my_show("+v_id+")'>"+
- "<a href='javascript:void(0)' >"+
- "<div class='"+data[i].iconCls+"' style='height: 16px;width: 16px;float:left;margin-top: 5px;margin-left: 15px;'></div>"+
- "<div style='margin-left: 5px;float: left;color:black;'>"+data[i].text+"</div>"+
- "<div id='my_show_"+v_id+"' class='layout-button-left' style='height: 16px;width: 16px;float:right;margin-top: 5px;margin-right:5px;'></div>"+
- "<input id='my_dsr_"+v_id+"' type='hidden' value='1'>"+
- "</a>"+
- "</div>" +
- "</div>";
-
- $("#myMenu").append(menu);
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: whzl.basePath+"/groupAction_menuChildren?id="+data[i].id,//要访问的后台地址
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- var data = msg.obj;
- for(var i = 0; i < data.length; i++ ){
- 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+"')\">"+
- "<a href='javascript:void(0)'>"+
- "<div class='"+data[i].iconCls+"' style='height: 16px;width: 16px;float:left;margin-top: 5px;margin-left: 20px;'></div>"+
- "<div id='menu_child_"+data[i].id+"' class='normal_menu_text' style='margin-left: 5px;float: left;'>"+data[i].text+"</div>"+
- "</a>"+
- "</div>";
- $("#mymenu_"+data[i].pid).append(menu);
- }
- }
- }
- });
- /*
- if(data[i].layer == 1){
- var v_id = data[i].id;
- var menu = "<div id='mymenu_"+v_id+"'>"+
- "<div style='height: 26px;line-height: 26px;width: 100%;background: #fff;border-bottom: 1px solid #1369d8;cursor: pointer;' onclick='my_show("+v_id+")'>"+
- "<a href='javascript:void(0)' >"+
- "<div class='"+data[i].iconCls+"' style='height: 16px;width: 16px;float:left;margin-top: 5px;margin-left: 15px;'></div>"+
- "<div style='margin-left: 5px;float: left;color:black;'>"+data[i].text+"</div>"+
- "<div id='my_show_"+v_id+"' class='layout-button-left' style='height: 16px;width: 16px;float:right;margin-top: 5px;margin-right:5px;'></div>"+
- "<input id='my_dsr_"+v_id+"' type='hidden' value='1'>"+
- "</a>"+
- "</div>" +
- "</div>";
-
- $("#myMenu").append(menu);
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: whzl.basePath+"/groupAction_menuChildren?id="+data[i].id,//要访问的后台地址
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- var data = msg.obj;
- for(var i = 0; i < data.length; i++ ){
- var menu = "<div id='menu_"+data[i].id+"' class='my_dsr_"+data[i].pid+" menu_child'>"+
- "<a href='javascript:void(0)' onclick=\"openMenu('"+data[i].text+"','"+data[i].iconCls+"','"+data[i].href+"','"+data[i].id+"')\">"+
- "<div class='"+data[i].iconCls+"' style='height: 16px;width: 16px;float:left;margin-top: 5px;margin-left: 35px;'></div>"+
- "<div id='menu_child_"+data[i].id+"' class='normal_menu_text' style='margin-left: 5px;float: left;'>"+data[i].text+"</div>"+
- "</a>"+
- "</div>";
- $("#mymenu_"+data[i].pid).append(menu);
- }
- }
- }
- });
- }else{
- 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+"')\">"+
- "<a href='javascript:void(0)'>"+
- "<div class='"+data[i].iconCls+"' style='height: 16px;width: 16px;float:left;margin-top: 5px;margin-left: 15px;'></div>"+
- "<div id='menu_child_"+data[i].id+"' class='normal_menu_text'>"+data[i].text+"</div>"+
- "</a>"+
- "</div>";
-
- $("#myMenu").append(menu);
- }
- */
- /*
- $('#aa').accordion('add', {
- title: data[i].text,
- iconCls:data[i].iconCls,
- content: '<ul id="treeMenu_'+i+'" data-options="lines:true" style="margin-top:5px;"></ul>',
- selected: false
- });
- $('#treeMenu_'+i).tree({
- url:whzl.basePath+"/groupAction_menuChildren?id="+data[i].id,
- onClick: function(node){
- //获取父节点
- if(node.attributes.url.length > 0 && node.attributes.url != '#'){
- parent.$.messager.progress({
- title : '提示',
- text : '数据处理中,请稍候....'
- });
- addTabFunction(
- {
- title : node.attributes.pName + "》" + node.text,
- closable : true,
- iconCls:node.iconCls,
- content : '<iframe src="' + node.attributes.url + '" frameborder="0" style="border:0;width:100%;height:100%;"></iframe>'
- }
- );
- }
- } ,
- loadFilter: function(result){
- if(result.success){
- return result.obj;
- }else{
- $.messager.alert('提示',result.message);
- }
- }
- });
- */
- }
- }
- }
- });
-
-
- });
- </script>
|