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/index.jsp | 80 ++++++++++++++++++++++++++++++++++++--- 1 files changed, 73 insertions(+), 7 deletions(-) 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> -- Gitblit v1.9.1