From 2fe250ece8de95b3f70172fe5b45793ab6a3084a Mon Sep 17 00:00:00 2001
From: D:/workspace/chenjingjing/git/gx_tieta/gx_tieta/.gitignore <chenjingjing@LAPTOP-E51P2139>
Date: 星期五, 18 一月 2019 17:30:50 +0800
Subject: [PATCH] 未审批可更改

---
 gx_tieta/WebRoot/pages/js/pages/siderbar.js |  149 +++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 123 insertions(+), 26 deletions(-)

diff --git a/gx_tieta/WebRoot/pages/js/pages/siderbar.js b/gx_tieta/WebRoot/pages/js/pages/siderbar.js
index 3b56f4d..333fa50 100644
--- a/gx_tieta/WebRoot/pages/js/pages/siderbar.js
+++ b/gx_tieta/WebRoot/pages/js/pages/siderbar.js
@@ -172,7 +172,7 @@
 		} 
 		var tgt = aFolders.eq(0);
 		aFolders.each(function() {
-			var _txt = $(this).find('.treeview-txt').text();
+			var _txt = $(this).find('.treeview-txt').parent().attr('id');
 			if(txt == _txt) {
 				tgt = $(this);
 			}
@@ -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,8 +218,9 @@
 	// 鑾峰彇褰撳墠閫変腑鍐呭锛堢渷-甯�-鏈烘埧-鐢垫睜缁勶級
 	var province = getQueryString('province');	// 鐪�
 	var city = getQueryString('city'); 			// 甯�
+	var county = getQueryString('county');		// 鍖�/鍘�
 	var home = getQueryString('home');			// 鏈烘埧
-	
+	var homeid = getQueryString('battid');		// 鐢垫睜缁刬d
 	//console.log(province);
 	
 	// 鐢熸垚涓�绾у鑸�-鐪�
@@ -304,7 +305,7 @@
 	}
 	
 	
-	// 鐢熸垚 涓夌骇瀵艰埅-鏈烘埧
+	// 鐢熸垚 涓夌骇瀵艰埅-鍖�/鍘�
 	function third(treeView, container, data, spread) {
 		// 宸茬粡瀛樺湪
 		if(container.find('ul').length !=0) {
@@ -313,7 +314,7 @@
 		treeView.addProgress(container);
 		$.ajax({ 	
 	        type: "post", 				
-	        url: "BattInfAction!serchStationName3",				
+	        url: "BattInfAction!serchStationName5",				
 	        async:true,				
 	        dataType:'json',
 	        data:"json = "+JSON.stringify(data),	
@@ -325,12 +326,12 @@
 	        		var formatData = [];
 	        		for(var i=0; i<_data.length;i++) {
 	        			var __data = _data[i];
-	        			var tmp = treeView.getFolder(__data.StationName, 'home', __data.StationName,__data);
+	        			var tmp = treeView.getFolder(__data.StationName5, 'county', __data.StationName5,__data);
 	        			formatData.push(tmp);
 	        		}
 	        		treeView.treeView(container, formatData);
 	        		if(spread) {
-	        			treeView.spreadFolder('home', home, thirdSpread, true);
+	        			treeView.spreadFolder('county', county, thirdSpread, true);
 	        		}
 	        	}else {
 	        		
@@ -347,15 +348,49 @@
 		var tmp = {
 			StationName1: data.StationName1,
 			StationName2: data.StationName2,
-			StationName: data.StationName,
-			StationId: data.StationId
+			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;
@@ -375,10 +410,13 @@
 	        		var formatData = [];
 	        		for(var i=0; i<_data.length;i++) {
 	        			var __data = _data[i];
-	        			var tmp = treeView.getFile(__data.StationName, 'home', '',__data);
+	        			var tmp = treeView.getFolder(__data.StationName3, 'home', __data.StationName,__data);
 	        			formatData.push(tmp);
 	        		}
 	        		treeView.treeView(container, formatData);
+	        		if(spread) {
+	        			treeView.spreadFolder('home', home, fourthSpread, true);
+	        		}
 	        	}else {
 	        		
 	        	}
@@ -387,10 +425,22 @@
 	}
 	
 	// 灏嗗嚱鏁扮粦瀹氬埌GLOBAL.pages.siderbar鐨勫懡鍚嶇┖闂翠笅
-	gl.pages.siderbar.thirdFile = thirdFile;
+	gl.pages.siderbar.fourth = fourth;
 	
-	// 鐢熸垚 涓夌骇瀵艰埅-鐢垫睜缁�
-	function fourth(treeView, container, data, active) {
+	// 灞曞紑鍥涚骇瀵艰埅
+	function fourthSpread(treeView, container, data) {
+		var tmp = {
+			StationName1: data.StationName1,
+			StationName2: data.StationName2,
+			StationName5: data.StationName5,
+			StationName: data.StationName,
+			StationId: data.StationId
+		};
+		fifth(treeView, container, tmp, true);
+	}
+	
+	// 鐢熸垚浜旂骇瀵艰埅-鐢垫睜缁�
+	function fifth(treeView, container, data, active) {
 		// 宸茬粡瀛樺湪
 		if(container.find('ul').length !=0) {
 			return;
@@ -417,7 +467,7 @@
 	        		treeView.treeView(container, formatData);
 	        		//console.info(formatData);
 	        		if(active) {
-	        			treeView.activeFile(container,'eleGroup', '');
+	        			treeView.activeFile(container,'eleGroup', homeid);
 	        			var battId = formatData[0].id;
 	        			location.hash="#"+battId;
 	        			location.hash = "";
@@ -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);
@@ -564,27 +656,30 @@
 	        		var formatData = [];
 	        		for(var i=0; i<_data.length;i++) {
 	        			var __data = _data[i];
-	        			var tmp = treeView.getFolder(__data.StationName, 'home', __data.StationName, __data);
+	        			var tmp = treeView.getFolder(__data.StationName3, 'home', __data.StationName, __data);
 	        			formatData.push(tmp);
 	        		}
 	        		treeView.treeView(container, formatData);
 	        		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');
@@ -648,7 +743,9 @@
 		
 		li.data('attr', list[i]);
 		ul.append(li);
+		
 	}
+	
 	$('#ele_content .batt-listen .count-num').find('span').eq(0).text(discharge_num);
 	$('#ele_content .batt-listen .count-num').find('span').eq(1).text(charge_num);
 	ele.append(ul);

--
Gitblit v1.9.1