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/pages/js/pages/siderbar.js | 205 +++++++++++++++++++++++++++++++++++++------------- 1 files changed, 150 insertions(+), 55 deletions(-) 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