From 032bc7893dd507a59f759a3215cced03d1bdbc19 Mon Sep 17 00:00:00 2001 From: hdw <496960745@qq.com> Date: 星期三, 26 九月 2018 09:09:58 +0800 Subject: [PATCH] 首页三级导航设定 --- gx_tieta/WebRoot/control.jsp | 1 gx_tieta/WebRoot/index.jsp | 80 ++++++++++++++++++- gx_tieta/WebRoot/css/index_layout.css | 76 ------------------ gx_tieta/WebRoot/pages/js/pages/siderbar.js | 35 ++++++++ 4 files changed, 111 insertions(+), 81 deletions(-) diff --git a/gx_tieta/WebRoot/control.jsp b/gx_tieta/WebRoot/control.jsp index 0b06a6b..2371c9b 100644 --- a/gx_tieta/WebRoot/control.jsp +++ b/gx_tieta/WebRoot/control.jsp @@ -4012,7 +4012,6 @@ showtable(); time=window.setInterval("showtable()",4000); } - }); }); </script> diff --git a/gx_tieta/WebRoot/css/index_layout.css b/gx_tieta/WebRoot/css/index_layout.css index bd91bbc..3b6fab0 100644 --- a/gx_tieta/WebRoot/css/index_layout.css +++ b/gx_tieta/WebRoot/css/index_layout.css @@ -384,7 +384,7 @@ height: 100%; background-color: #ccc; border-right: 4px dotted #aaa; - + vertical-align: top; } .side-bar.abs { @@ -400,81 +400,11 @@ z-index: 999999; } .side-bar .lside{ + position: absolute; width: 100%; height: 100%; + top: 0; background: white; - overflow-x: auto; - overflow-y: auto; - position: relative; -} -.lside a { - text-decoration: none; - color: #000; -} -.lside>ul{ - width: 100%; - position:absolute; - margin-bottom: 30px; -} -.lside>ul>li>a{ - display:block; - color:black; - font-size: 16px; - padding:12px 5px; - white-space: nowrap; -} -.lside>ul>li>ul{ - display:none; - } -.lside>ul>li>ul>li>a{ - display:block; - font-size: 14px; - padding:10px 20px; - white-space: nowrap; -} -.lside>ul>li>ul>li>ul{ - display:none; -} -.lside>ul>li>ul>li>ul>li>a{ - display:block; - font-size: 12px; - padding:10px 10px 10px 40px; - white-space: nowrap; -} - -.arrow{ - display: block; - float: left; - width:20px; - height:20px; - margin-left:10px; - margin-right:10px; - background:url(../image/arrow_u.png) no-repeat 3px 5px; - background-color:black; -} -.down{ - display: block; - float: left; - width:20px; - height:20px; - margin-left:10px; - margin-right:10px; - background:url(../image/arrow_d.png) no-repeat 3px 6px; - background-color:black; -} - -.mark{ - display: block; - float: left; - font-size: 16px; - width:20px; - height:20px; - margin-left:10px; - margin-right:10px; - text-align:center; - line-height: 20px; - color:white; - background-color: black; } .map-stats-img { diff --git a/gx_tieta/WebRoot/index.jsp b/gx_tieta/WebRoot/index.jsp index 5f87e45..b0aee9e 100644 --- a/gx_tieta/WebRoot/index.jsp +++ b/gx_tieta/WebRoot/index.jsp @@ -29,6 +29,7 @@ <script type="text/javascript" src="http://api.map.baidu.com/library/SearchInfoWindow/1.5/src/SearchInfoWindow_min.js"></script> <link rel="stylesheet" href="http://api.map.baidu.com/library/SearchInfoWindow/1.5/src/SearchInfoWindow_min.css" /> <link href="css/basic.css" type="text/css" rel="stylesheet" /> + <link href="css/common.css" type="text/css" rel="stylesheet" /> <link href="css/index_layout.css" type="text/css" rel="stylesheet" /> <link rel="stylesheet" href="css/img-change.css"> <link rel="stylesheet" href="css/confirm.css"> @@ -309,6 +310,7 @@ <div class="clear"></div> <script type="text/javascript" src="pages/js/base.js"></script> <script type="text/javascript" src="pages/js/common.js"></script> + <script type="text/javascript" src="pages/js/pages/siderbar.js"></script> <script type="text/javascript" src="js/panel.js"></script> <script type="text/javascript" src="js/search.js"></script> <script type="text/javascript" src="js/changePinYin.js"></script> @@ -398,11 +400,6 @@ $('#main .del-module').remove(); //绉婚櫎class="del-module"鐨勫唴瀹� //鏍规嵁楗肩姸鍥剧殑鏁伴噺纭畾浣嶇疆鍜屽ぇ灏� getMapHt(); - - $('.side-bar').resizable({ - minWidth: 190, - maxWidth: 500 - }); /* switch(pieLen){ case 0: $('#main .china-map').remove(); @@ -674,7 +671,7 @@ createIconExplain($('#map')); - searchAllProvince(); // 鐢熸垚缁存姢鍖哄垪琛� + //searchAllProvince(); // 鐢熸垚缁存姢鍖哄垪琛� /* addCommonDotHome(commonDot); createWarnDot(map, warnDotList); dischargeTimeOut(map, dischargeDotList); @@ -2010,7 +2007,7 @@ //console.info(allStation); createMapDot(map, allStation); - setTimeout(searchStation, 4000); + //setTimeout(searchStation, 4000); } /* for(var i=0;i<allStation.length;i++){ if(allStation[i].low_num>0){ //钀藉悗鏁扮洰 @@ -3068,5 +3065,74 @@ img.attr('src', navImg); } } + // siderbar妯″潡 + $(function() { + var TreeView = GLOBAL.pages.TreeView; + var first = GLOBAL.pages.siderbar.first; // 涓�绾у鑸� + var second = GLOBAL.pages.siderbar.second; // 浜岀骇瀵艰埅 + var thirdFile = GLOBAL.pages.siderbar.thirdFile; // 涓夌骇瀵艰埅 + var treeView = new TreeView($('.side-bar .lside')); + // 璁剧疆瀹瑰櫒鍙嫋鍔� + $('.side-bar').resizable({ + handles: 'e', + maxWidth: 520, + minWidth: 200, + alsoResize: $('.side-bar .lside'), + resize:function() { + treeView.setContainer(); + } + }); + + // 鐢熸垚涓�绾у鑸�-鐪� + first(treeView, treeView.container); + + // 鐪�->甯� + treeView.ele.on('click', '.province', function() { + var province = $(this).data('attr'); + second(treeView, $(this).parent(), province); + }); + + // 甯�->鏈烘埧 + treeView.ele.on('click', '.city', function() { + var city = $(this).data('attr'); + thirdFile(treeView, $(this).parent(), city); + }); + + // 鐐瑰嚮鏈烘埧瀹氫綅 + treeView.ele.on('click', '.home', function() { + var home = $(this).data('attr'); + var dev_id = home.FBSDeviceId; + + searchStationById(home.StationId); + // 鏍规嵁璁惧id璁剧疆涓嶅悓鐨勫浘鏍� + if(eType.regType(dev_id, eType.type.equip61850)) { + changeMapImgDesc($('#mapImgDesc'), '61850'); + }else { + changeMapImgDesc($('#mapImgDesc')); + } + }); + + $('#map').on('dblclick', function() { + setLside(); + treeView.setContainer(); + }); + + // 璁剧疆lside鐨勯珮搴� + setLside(); + treeView.setContainer(); + setLside(); + $(window).resize(function() { + setLside(); + }); + + // 璁剧疆lside鐨勯珮搴﹀嚱鏁� + function setLside() { + var sideBar = $('.side-bar'); + var lside = $('.side-bar .lside'); + // 璁剧疆瀹介珮 + lside.width(sideBar.width()); + lside.height(sideBar.height()); + } + }); </script> </html> diff --git a/gx_tieta/WebRoot/pages/js/pages/siderbar.js b/gx_tieta/WebRoot/pages/js/pages/siderbar.js index e72197a..c8ff446 100644 --- a/gx_tieta/WebRoot/pages/js/pages/siderbar.js +++ b/gx_tieta/WebRoot/pages/js/pages/siderbar.js @@ -267,6 +267,41 @@ // 灏嗗嚱鏁扮粦瀹氬埌GLOBAL.pages.siderbar鐨勫懡鍚嶇┖闂翠笅 gl.pages.siderbar.third = third; + // 鐢熸垚 涓夌骇瀵艰埅-鏈烘埧 + function thirdFile(treeView, container, data) { + // 宸茬粡瀛樺湪 + if(container.find('ul').length !=0) { + return; + } + treeView.addProgress(container); + $.ajax({ + type: "post", + url: "BattInfAction!serchStationName3", + async:true, + dataType:'json', + data:"json = "+JSON.stringify(data), + success: function(data){ + var rs = JSON.parse(data.result); + treeView.delProgress(container); + if(rs.code == 1) { + var _data= rs.data; + var formatData = []; + for(var i=0; i<_data.length;i++) { + var __data = _data[i]; + var tmp = treeView.getFile(__data.StationName3, 'home', __data); + formatData.push(tmp); + } + treeView.treeView(container, formatData); + }else { + + } + } + }); + } + + // 灏嗗嚱鏁扮粦瀹氬埌GLOBAL.pages.siderbar鐨勫懡鍚嶇┖闂翠笅 + gl.pages.siderbar.thirdFile = thirdFile; + // 鐢熸垚 涓夌骇瀵艰埅-鐢垫睜缁� function fourth(treeView, container, data) { // 宸茬粡瀛樺湪 -- Gitblit v1.9.1