From ad22ba26863980edd80a1f9adfebb8daba31d74d Mon Sep 17 00:00:00 2001
From: LiJun <LiJun@192.168.10.12>
Date: 星期五, 26 十月 2018 11:50:23 +0800
Subject: [PATCH] 添加机房的是否安装的标识

---
 gx_tieta/WebRoot/charge-test.jsp |  172 ++++++++++++++++++++++++---------------------------------
 1 files changed, 72 insertions(+), 100 deletions(-)

diff --git a/gx_tieta/WebRoot/charge-test.jsp b/gx_tieta/WebRoot/charge-test.jsp
index dd3f21c..59320af 100644
--- a/gx_tieta/WebRoot/charge-test.jsp
+++ b/gx_tieta/WebRoot/charge-test.jsp
@@ -419,10 +419,10 @@
 					<td><s:text name="Computer_room_IP"/></td>				<!-- 鏈烘埧IP -->
 					<td id="StationIP"></td>
 				</tr>
-				<!-- <tr>
-					<td><s:text name="Batt_group"/>ID</td>								鐢垫睜缁処D
+				<tr>
+					<td><s:text name="Batt_group"/>ID</td>								<!-- 鐢垫睜缁処D -->
 					<td id="batt_group_id"></td>
-				</tr> -->
+				</tr>
 				<tr>
 					<td><s:text name="Battery_name"/></td>					<!-- 鐢垫睜缁勫悕绉� -->
 					<td id="BattGroupName"></td>
@@ -1300,16 +1300,7 @@
 	       	$(this).css("background-color","#9bbaf3");
 		});
 		
-		function toInformationArray(list){
-			Monnum_list = new Array();	//鍒濆鍖栫數姹犵紪鍙锋暟缁�
-			Monvol_list = new Array();	//鍒濆鍖栫數姹犵數鍘嬫暟缁�
-			checkArray  = new Array();
-			for(var i=0;i<list.length;i++){
-				Monnum_list[i]="#"+list[i].mon_num;
-				Monvol_list[i]=list[i].mon_vol.toFixed(3);
-				checkArray.push(1);
-			}
-		}
+		
 		
 		
 		//鏌ヨ鎸囧畾鐨勭數姹犵粍id涓嬫寚瀹氭祴璇曟鏁扮殑娴嬭瘯鏁版嵁
@@ -1461,14 +1452,28 @@
 				data=eval("("+data+")");
 				if(data.code==1){
 					data=data.data;
-					//console.info(data);
 					batteststopDataList = data;
-					toInformationArray(data);
+					
+					var batt = getBattinfById();
+					//console.info(batt);
+					var moncount = batt.MonCount;
+					
+					Monnum_list = new Array();	//鍒濆鍖栫數姹犵紪鍙锋暟缁�
+					Monvol_list = new Array();	//鍒濆鍖栫數姹犵數鍘嬫暟缁�
+					checkArray  = new Array();
 					var arr = new Array();
-					//console.info(data);
-					for(var i=0;i<data.length;i++){
-						arr[data[i].mon_num-1]=data[i].mon_vol.toFixed(3);
-					}		
+					for(var i=0;i<moncount;i++){
+						
+						Monnum_list[i]="#"+(i+1);
+						if(data[i] != undefined){						
+							Monvol_list[i]=data[i].mon_vol.toFixed(3);
+						}else{
+							Monvol_list[i]= (0).toFixed(3);		
+						}
+						arr[i]=Monvol_list[i];
+						checkArray.push(1);
+					}			
+		
 					//console.info(arr);
 					//console.info(arrTh[li_index]);
 					$('#charge_thr_th').find('tr th').eq(1).text(arrTh[li_index]);
@@ -2004,6 +2009,7 @@
 			if(AllTestData!=undefined){
 				if(Monnum_list != undefined && Monnum_list.length>0){
 					AllData=new Array();
+					//console.info(Monnum_list);
 					for(var i=0;i<Monnum_list.length;i++){
 						batt_test_voldata[i] = new Array();
 						batt_test_tmpdata[i] = new Array();
@@ -2032,14 +2038,21 @@
 								batt_test_data[batt_index]=batt_test_data[batt_index-1].slice(0);
 								setArrayvalue(batt_test_voldata,batt_index);
 								setArrayvalue(batt_test_tmpdata,batt_index);								
+							}else{
+								var batt = getBattinfById();
+								for(var k =0;k<batt.MonCount;k++){
+									batt_test_data[batt_index][k] = 0;
+									batt_test_voldata[k][batt_index] = 0;
+									batt_test_tmpdata[k][batt_index] = 0;
+								}
 							}
 						}
-						if(max<AllTestData[i].mon_vol){
+						/* if(max<AllTestData[i].mon_vol){
 							max = AllTestData[i].mon_vol;
 						}
 						if(min>AllTestData[i].mon_vol){
 							min = AllTestData[i].mon_vol;
-						}
+						} */
 						//console.info(AllTestData[i]);
 						batt_test_data[batt_index][AllTestData[i].mon_num-1] = AllTestData[i].mon_vol;
 						batt_test_voldata[AllTestData[i].mon_num-1][batt_index] = AllTestData[i].mon_vol;
@@ -2077,6 +2090,8 @@
 				// 鏍规嵁鎶樼嚎鍥剧殑鐘舵�佸�肩敓鎴愬搴旂殑鎶樼嚎
 				var line_status = $('#lineStatus').val();
 				if(line_status == 0) {	// 鐢熸垚鍗曚綋鐢靛帇鎶樼嚎鍥�
+					max = getMaxFromArr(batt_test_voldata);
+		    		min = getMinFromArr(batt_test_voldata);
 					CreateLineEchart('myLineChart',oRBottom,Monnum_list,TestTime,batt_test_voldata,max,min,thrname);		//鐢熸垚鍙充笅鎶樼嚎鍥�
 				}else {	// 鐢熸垚鍗曚綋
 					max = getMaxFromArr(batt_test_tmpdata);
@@ -3185,8 +3200,10 @@
 	$(function() {
 		$('body').on('click', '#nav a[href="control.jsp"]', function() {
 			var batt = getBattinfById();
-			//console.info(batt.StationId);
-			$(this).attr('href', 'control.jsp?battgroupId='+BattGroupId+'&stationId='+batt.StationId);
+			var province = batt.StationName1;
+			var city = batt.StationName2;
+			var home = batt.StationName;
+			$(this).attr('href', 'control.jsp?province='+province+'&city='+city+'&home='+home);
 		});
 	}); 
 	
@@ -3496,18 +3513,23 @@
 				if(model.code == 1){
 					//console.info(model.data);
 					for(var i = 0;i<model.data.length;i++){
-						if(model.data[i].batt_test_type == 3){
+						var _data = model.data[i];
+						if(_data.batt_test_type == 3){
 							arr.push({
-								note: model.data[i].note,
-								val:model.data[i].BattGroupId,
-								fbs: model.data[i].batt_test_tlong,
+								note:_data.note,
+								val:_data.BattGroupId,
+								province: _data.stationName1,
+								city: _data.stationName2,
+								home: _data.stationName,
 								isCharge:0
 							});
-						}else if(model.data[i].batt_test_type == 2){
+						}else if(_data.batt_test_type == 2){
 							arr.push({
-								note: model.data[i].note,
-								val:model.data[i].BattGroupId,
-								fbs: model.data[i].batt_test_tlong,
+								note: _data.note,
+								val: _data.BattGroupId,
+								province: _data.stationName1,
+								city: _data.stationName2,
+								home: _data.stationName,
 								isCharge:1
 							});
 						}
@@ -3521,75 +3543,6 @@
         		
         	}				
 		});
-	}
-	
-	// 鐢熸垚鍏呮斁鐢电洃娴嬫ā鍧楀唴瀹�
-	function createBattListen(ele, list) {
-		//console.info(list);
-		ele.text("");
-		var discharge_num = 0;
-		var charge_num = 0;
-		var ul = $('<ul></ul>');
-		for(var i = 0; i < list.length; i++) {
-			var li = "";
-			if(list[i].isCharge) {
-				li = $('<li><a href="javascript:;" class="batt-charge" value="'+list[i].val+'" fbs="'+list[i].fbs+'" note="'+list[i].note+'">'+list[i].val+'鐢垫睜缁勫厖鐢垫祴璇�!</a></li>');
-				charge_num++;
-			}else {
-				li = $('<li><a href="javascript:;" class="batt-discharge" value="'+list[i].val+'" fbs="'+list[i].fbs+'" note="'+list[i].note+'">'+list[i].val+'鐢垫睜缁勬斁鐢垫祴璇�!</a></li>');
-				discharge_num++;
-			}
-			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);
-	}
-	// 鐐瑰嚮鐢垫睜鍏呮斁鐢电洃娴嬪垪琛ㄨЕ鍙戜簨浠�
-	$(function() {
-		var batt_list = $('#ele_content .batt-listen .batt-list');
-		batt_list.on('click', 'a', function(){
-			var fbsId = $(this).attr('fbs');
-			var isSpecial = regFbsId(fbsId);
-			$('.special-mon-data').removeClass('show');
-			batt_list.find('a').removeClass('active');
-			$(this).addClass('active');
-			BattGroupId=$(this).attr("value");
-			locationBattPos($(this).attr('note'), $(this).attr('value'));
-			if(isSpecial) {
-				
-			}else {
-				clearfourPicture();
-			}
-		});
-	});
-	
-	function BattlocationById(battid){
-		if(battid!=undefined){
-			BattGroupId = battid;
-			$('#lside a').css({'background-color':'#fff'});
-			//鑾峰緱涓�绾ц彍鍗曞苟灞曠ず浜岀骇鑿滃崟
-			var secTag =$('#'+battid).parent().parent().siblings().first().parent().parent().siblings().first().next();
-			var secTagA = $('#'+battid).parent().parent().siblings().first();
-			//console.info(secTagA.text()+'******');
-			if(secTagA.text().trim().length == 0) {
-				secTagA.hide();
-			}
-			secTag.show();
-			//$('#'+thr_id).parent().parent().siblings().first().parent().parent().siblings().first().next().show();
-			//鑾峰緱浜岀骇鑿滃崟骞跺睍绀轰笁绾ц彍鍗�
-			$('#'+battid).parent().parent().siblings().first().next().show();
-			$('#'+battid).css('background-color','#9bbaf3');
-			//涓�绾ц彍鍗曞睍寮�鏍峰紡
-			$('#'+battid).parent().parent().siblings().first().parent().parent().siblings().first().children('.arrow').removeClass("down");
-			$('#'+battid).parent().parent().siblings().first().parent().parent().siblings().first().children('.arrow').addClass("up");
-			$('#'+battid).parent().parent().siblings().first().children('.mark').text('-');
-			$('#'+battid).parent().parent().siblings().first().children('.mark').addClass('black');
-			//alert($('#'+thr_id).parent().parent().siblings().first().text());
-			location.hash="#"+battid;
-			location.hash = '';
-			$('#'+battid).click();
-		}
 	}
 	
 	//璺宠浆鍒版寚瀹氱殑鐢垫睜缁勭粺璁″垎鏋愭煡璇�
@@ -4612,6 +4565,7 @@
 		var second = GLOBAL.pages.siderbar.second;	// 浜岀骇瀵艰埅
 		var third = GLOBAL.pages.siderbar.third;	// 涓夌骇瀵艰埅
 		var fourth = GLOBAL.pages.siderbar.fourth;	// 鍥涚骇瀵艰埅
+		var localSideBar = GLOBAL.pages.siderbar.localSideBar;	// 瀹氫綅鏈烘埧
 		var treeView = new TreeView($('#lside'));
 		$('#lside').width($('#ele_content').width());
 		treeView.setContainer();
@@ -4683,6 +4637,24 @@
 				searchAll_lowAction();			//鑾峰彇闃�鍊�
 			}
 			
+			// 鐢垫睜鍏呮斁鐢垫暟鎹洃鎺�
+			var batt_list = $('.batt-listen .batt-list');
+			batt_list.on('click', 'a', function(){
+				batt_list.find('a').removeClass('active');
+				$(this).addClass('active');
+				var battInfo = $(this).parent().data('attr');	
+				
+				var tmp = {
+					province: battInfo.province,
+					city: battInfo.city,
+					home: battInfo.home,
+					homeid: battInfo.note,
+					battid: battInfo.val
+				};
+				console.log(tmp);
+				localSideBar(treeView, treeView.container, tmp);
+			});
+			
 			
 			// 璁剧疆璁板綍鐨勭瑪鏁颁负-1
 			$('#testrecordcout').val('-1');

--
Gitblit v1.9.1