From 702466cfeeb2553182df8d92996b64fe8e9693be Mon Sep 17 00:00:00 2001 From: hdw <496960745@qq.com> Date: 星期二, 30 十月 2018 16:47:20 +0800 Subject: [PATCH] 历史实时增加县筛选 --- gx_tieta/WebRoot/control.jsp | 21 +++ gx_tieta/WebRoot/charge-test.jsp | 20 +++ gx_tieta/WebRoot/index.jsp | 4 gx_tieta/WebRoot/pages/js/pages/siderbar.js | 205 ++++++++++++++++++++++++++++++----------- gx_tieta/WebRoot/css/common.css | 4 5 files changed, 188 insertions(+), 66 deletions(-) diff --git a/gx_tieta/WebRoot/charge-test.jsp b/gx_tieta/WebRoot/charge-test.jsp index c5f6a10..e5c18e4 100644 --- a/gx_tieta/WebRoot/charge-test.jsp +++ b/gx_tieta/WebRoot/charge-test.jsp @@ -3245,8 +3245,9 @@ var batt = getBattinfById(); var province = batt.StationName1; var city = batt.StationName2; + var county = batt.StationName5; var home = batt.StationName; - $(this).attr('href', 'control.jsp?province='+province+'&city='+city+'&home='+home); + $(this).attr('href', 'control.jsp?province='+province+'&city='+city+'&county='+county+'&home='+home); }); }); @@ -3563,6 +3564,7 @@ val:_data.BattGroupId, province: _data.stationName1, city: _data.stationName2, + county: _data.stationName5, home: _data.stationName, isCharge:0 }); @@ -3572,6 +3574,7 @@ val: _data.BattGroupId, province: _data.stationName1, city: _data.stationName2, + county: _data.stationName5, home: _data.stationName, isCharge:1 }); @@ -4608,6 +4611,7 @@ var second = GLOBAL.pages.siderbar.second; // 浜岀骇瀵艰埅 var third = GLOBAL.pages.siderbar.third; // 涓夌骇瀵艰埅 var fourth = GLOBAL.pages.siderbar.fourth; // 鍥涚骇瀵艰埅 + var fifth = GLOBAL.pages.siderbar.fifth; // 浜旂骇瀵艰埅 var localSideBar = GLOBAL.pages.siderbar.localSideBar; // 瀹氫綅鏈烘埧 var treeView = new TreeView($('#lside')); $('#lside').width($('#ele_content').width()); @@ -4632,11 +4636,18 @@ second(treeView, $(this).parent(), province); }); - // 甯�->鏈烘埧 + // 甯�->鍖� treeView.ele.on('click', '.city', function() { var city = $(this).data('attr'); third(treeView, $(this).parent(), city); }); + + // 鍖�->鏈烘埧 + treeView.ele.on('click', '.county', function() { + var county = $(this).data('attr'); + fourth(treeView, $(this).parent(), county); + }); + battinlist = []; // 鏈烘埧->鐢垫睜缁� @@ -4645,10 +4656,11 @@ var tmp = { StationName1: home.StationName1, StationName2: home.StationName2, + StationName5: home.StationName5, StationName: home.StationName, StationId: home.StationId }; - fourth(treeView, $(this).parent(), tmp); + fifth(treeView, $(this).parent(), tmp); }); // 鐢垫睜缁� @@ -4695,6 +4707,7 @@ province: battInfo.province, city: battInfo.city, home: battInfo.home, + county: battInfo.county, homeid: battInfo.note, battid: battInfo.val }; @@ -4711,6 +4724,7 @@ province: batt.StationName1, city: batt.StationName2, home: batt.StationName, + county: batt.StationName5, homeid: batt.StationId, battid: batt.BattGroupId }; diff --git a/gx_tieta/WebRoot/control.jsp b/gx_tieta/WebRoot/control.jsp index 6c973d5..cd8d13b 100644 --- a/gx_tieta/WebRoot/control.jsp +++ b/gx_tieta/WebRoot/control.jsp @@ -2896,8 +2896,9 @@ var batt = getBatt(); var province = batt.StationName1; var city = batt.StationName2; + var county = batt.StationName5; var home = batt.StationName; - $(this).attr('href', 'charge-test.jsp?province='+province+'&city='+city+'&home='+home); + $(this).attr('href', 'charge-test.jsp?province='+province+'&city='+city+'&county='+county+'&home='+home); }); }); @@ -2932,6 +2933,7 @@ val:_data.BattGroupId, province: _data.stationName1, city: _data.stationName2, + county: _data.stationName5, home: _data.stationName, isCharge:0 }); @@ -2941,6 +2943,7 @@ val: _data.BattGroupId, province: _data.stationName1, city: _data.stationName2, + county: _data.stationName5, home: _data.stationName, isCharge:1 }); @@ -4111,6 +4114,7 @@ var second = GLOBAL.pages.siderbar.second; // 浜岀骇瀵艰埅 var third = GLOBAL.pages.siderbar.third; // 涓夌骇瀵艰埅 var fourth = GLOBAL.pages.siderbar.fourth; // 鍥涚骇瀵艰埅 + var fifth = GLOBAL.pages.siderbar.fifth; // 浜旂骇瀵艰埅 var localSideBar = GLOBAL.pages.siderbar.localSideBar; // 瀹氫綅鏈烘埧 var treeView = new TreeView($('#lside')); $('#lside').width($('#ele_content').width()); @@ -4135,10 +4139,16 @@ second(treeView, $(this).parent(), province); }); - // 甯�->鏈烘埧 + // 甯�->鍘� treeView.ele.on('click', '.city', function() { var city = $(this).data('attr'); third(treeView, $(this).parent(), city); + }); + + // 鍘�->鏈烘埧 + treeView.ele.on('click', '.county', function() { + var county = $(this).data('attr'); + fourth(treeView, $(this).parent(), county); }); battinlist = []; @@ -4148,10 +4158,11 @@ var tmp = { StationName1: home.StationName1, StationName2: home.StationName2, + StationName5: home.StationName5, StationName: home.StationName, StationId: home.StationId }; - fourth(treeView, $(this).parent(), tmp); + fifth(treeView, $(this).parent(), tmp); }); // 鐢垫睜缁� @@ -4238,6 +4249,7 @@ var tmp = { province: batt.StationName1, city: batt.StationName2, + county: batt.StationName5, home: batt.StationName, homeid: batt.StationId, battid: batt.BattGroupId @@ -4281,11 +4293,12 @@ var tmp = { province: battInfo.province, city: battInfo.city, + county: battInfo.county, home: battInfo.home, homeid: battInfo.note, battid: battInfo.val }; - + //console.log(tmp); localSideBar(treeView, treeView.container, tmp); }); diff --git a/gx_tieta/WebRoot/css/common.css b/gx_tieta/WebRoot/css/common.css index 9df4432..68b9d85 100644 --- a/gx_tieta/WebRoot/css/common.css +++ b/gx_tieta/WebRoot/css/common.css @@ -51,6 +51,10 @@ .whyc-sider-menu>ul>li>ul>li>ul>li>ul>li>a>i.fa { margin-left: 2em; } +/* end */ +.whyc-sider-menu>ul>li>ul>li>ul>li>ul>li>ul>li>a>i.fa { + margin-left: 2.5em; +} .whyc-sider-menu i.fa { color: #676863; font-size: 22px; diff --git a/gx_tieta/WebRoot/index.jsp b/gx_tieta/WebRoot/index.jsp index 7f02c46..6015b53 100644 --- a/gx_tieta/WebRoot/index.jsp +++ b/gx_tieta/WebRoot/index.jsp @@ -136,8 +136,6 @@ <td> <select name="mapIconStyleSel" id="mapIconStyleSel"> <option>鍏ㄩ儴</option> - <option>宸插畨瑁�</option> - <option>鏈畨瑁�</option> </select> </td> </tr> @@ -1734,9 +1732,7 @@ } }); - magImgStyles.push(''); // 鏍规嵁褰撳墠鍐呭鏇存柊鍦板浘鍥炬爣 - // map.clearOverlays(); searchStation(); } diff --git a/gx_tieta/WebRoot/pages/js/pages/siderbar.js b/gx_tieta/WebRoot/pages/js/pages/siderbar.js index 3b56f4d..930a16f 100644 --- a/gx_tieta/WebRoot/pages/js/pages/siderbar.js +++ b/gx_tieta/WebRoot/pages/js/pages/siderbar.js @@ -188,7 +188,7 @@ _prop.activeFile = function(container, cla, id, callback) { var rsCla = '.sider-menu-file'+'.'+cla; var aFiles = container.find(rsCla); - console.log(aFiles.length); + //console.log(aFiles.length); // 娌℃湁鑾峰彇鍒板唴瀹瑰氨杩斿洖false if(aFiles.length == 0) { return false; @@ -218,6 +218,7 @@ // 鑾峰彇褰撳墠閫変腑鍐呭锛堢渷-甯�-鏈烘埧-鐢垫睜缁勶級 var province = getQueryString('province'); // 鐪� var city = getQueryString('city'); // 甯� + var county = getQueryString('county'); // 鍖�/鍘� var home = getQueryString('home'); // 鏈烘埧 //console.log(province); @@ -304,8 +305,92 @@ } - // 鐢熸垚 涓夌骇瀵艰埅-鏈烘埧 + // 鐢熸垚 涓夌骇瀵艰埅-鍖�/鍘� function third(treeView, container, data, spread) { + // 宸茬粡瀛樺湪 + if(container.find('ul').length !=0) { + return; + } + treeView.addProgress(container); + $.ajax({ + type: "post", + url: "BattInfAction!serchStationName5", + 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.getFolder(__data.StationName5, 'county', __data.StationName5,__data); + formatData.push(tmp); + } + treeView.treeView(container, formatData); + if(spread) { + treeView.spreadFolder('county', county, thirdSpread, true); + } + }else { + + } + } + }); + } + + // 灏嗗嚱鏁扮粦瀹氬埌GLOBAL.pages.siderbar鐨勫懡鍚嶇┖闂翠笅 + gl.pages.siderbar.third = third; + + // 灞曞紑涓夌骇瀵艰埅 + function thirdSpread(treeView, container, data) { + var tmp = { + StationName1: data.StationName1, + StationName2: data.StationName2, + StationName5: data.StationName5, + }; + fourth(treeView, container, tmp, true); + } + + + // 鐢熸垚 涓夌骇瀵艰埅-鍖�/鍘� + function thirdFile(treeView, container, data) { + // 宸茬粡瀛樺湪 + if(container.find('ul').length !=0) { + return; + } + treeView.addProgress(container); + $.ajax({ + type: "post", + url: "BattInfAction!serchStationName5", + 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.StationName5, 'county', '',__data); + formatData.push(tmp); + } + treeView.treeView(container, formatData); + }else { + + } + } + }); + } + + // 灏嗗嚱鏁扮粦瀹氬埌GLOBAL.pages.siderbar鐨勫懡鍚嶇┖闂翠笅 + gl.pages.siderbar.thirdFile = thirdFile; + + //鐢熸垚鍥涚骇瀵艰埅-鏈烘埧 + function fourth(treeView, container, data, spread) { // 宸茬粡瀛樺湪 if(container.find('ul').length !=0) { return; @@ -330,7 +415,7 @@ } treeView.treeView(container, formatData); if(spread) { - treeView.spreadFolder('home', home, thirdSpread, true); + treeView.spreadFolder('home', home, fourthSpread, true); } }else { @@ -340,57 +425,22 @@ } // 灏嗗嚱鏁扮粦瀹氬埌GLOBAL.pages.siderbar鐨勫懡鍚嶇┖闂翠笅 - gl.pages.siderbar.third = third; + gl.pages.siderbar.fourth = fourth; - // 灞曞紑涓夌骇瀵艰埅 - function thirdSpread(treeView, container, data) { + // 灞曞紑鍥涚骇瀵艰埅 + function fourthSpread(treeView, container, data) { var tmp = { StationName1: data.StationName1, StationName2: data.StationName2, + StationName5: data.StationName5, StationName: data.StationName, StationId: data.StationId }; - fourth(treeView, container, tmp, true); + fifth(treeView, container, tmp, true); } - - // 鐢熸垚 涓夌骇瀵艰埅-鏈烘埧 - 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.StationName, 'home', '',__data); - formatData.push(tmp); - } - treeView.treeView(container, formatData); - }else { - - } - } - }); - } - - // 灏嗗嚱鏁扮粦瀹氬埌GLOBAL.pages.siderbar鐨勫懡鍚嶇┖闂翠笅 - gl.pages.siderbar.thirdFile = thirdFile; - - // 鐢熸垚 涓夌骇瀵艰埅-鐢垫睜缁� - function fourth(treeView, container, data, active) { + // 鐢熸垚浜旂骇瀵艰埅-鐢垫睜缁� + function fifth(treeView, container, data, active) { // 宸茬粡瀛樺湪 if(container.find('ul').length !=0) { return; @@ -428,10 +478,8 @@ } }); } - // 灏嗗嚱鏁扮粦瀹氬埌GLOBAL.pages.siderbar鐨勫懡鍚嶇┖闂翠笅 - gl.pages.siderbar.fourth = fourth; - + gl.pages.siderbar.fifth = fifth; })(jQuery, window, document, GLOBAL); @@ -457,6 +505,7 @@ first(treeView, container); homeInfo.StationName1 = data.province; homeInfo.StationName2 = data.city; + homeInfo.StationName5 = data.county; homeInfo.StationName = data.home; homeInfo.StationId = data.homeid; battId = data.battid; @@ -540,13 +589,56 @@ } - // 鐢熸垚 涓夌骇瀵艰埅-鏈烘埧 + // 鐢熸垚 涓夌骇瀵艰埅-鍖�/鍘� function third(treeView, container, data, spread) { + // 宸茬粡瀛樺湪 + if(container.find('ul').length !=0) { + location.hash="#"+homeInfo.StationName5; + location.hash=""; + treeView.spreadFolder('county', homeInfo.StationName5, thirdSpread, true); + return; + } + treeView.addProgress(container); + $.ajax({ + type: "post", + url: "BattInfAction!serchStationName5", + 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.getFolder(__data.StationName5, 'county', __data.StationName5, __data); + formatData.push(tmp); + } + treeView.treeView(container, formatData); + if(spread) { + location.hash="#"+homeInfo.StationName5; + location.hash=""; + treeView.spreadFolder('county', homeInfo.StationName5, thirdSpread, true); + } + } + } + }); + } + + // 灞曞紑涓夌骇瀵艰埅 + function thirdSpread(treeView, container, data) { + fourth(treeView, container, homeInfo, true); + } + + // 鐢熸垚 鍥涚骇瀵艰埅-鏈烘埧 + function fourth(treeView, container, data, spread) { // 宸茬粡瀛樺湪 if(container.find('ul').length !=0) { location.hash="#"+homeInfo.StationName; location.hash=""; - treeView.spreadFolder('home', homeInfo.StationName, thirdSpread, true); + treeView.spreadFolder('home', homeInfo.StationName, fourthSpread, true); return; } treeView.addProgress(container); @@ -571,20 +663,23 @@ if(spread) { location.hash="#"+homeInfo.StationName; location.hash=""; - treeView.spreadFolder('home', homeInfo.StationName, thirdSpread, true); + treeView.spreadFolder('home', homeInfo.StationName, fourthSpread, true); } } } }); } + // 灞曞紑涓夌骇瀵艰埅 - function thirdSpread(treeView, container, data) { - fourth(treeView, container, homeInfo, true); + function fourthSpread(treeView, container, data) { + fifth(treeView, container, homeInfo, true); } - // 鐢熸垚 涓夌骇瀵艰埅-鐢垫睜缁� - function fourth(treeView, container, data, active) { + + + // 鐢熸垚 浜旂骇瀵艰埅-鐢垫睜缁� + function fifth(treeView, container, data, active) { // 宸茬粡瀛樺湪 if(container.find('ul').length !=0) { container.addClass('sider-menu-open'); -- Gitblit v1.9.1