From a8717f6d4e9f2761d666c430e4546eef6a7f8f12 Mon Sep 17 00:00:00 2001
From: 81041 <81041@192.168.10.14>
Date: 星期三, 28 十一月 2018 08:36:23 +0800
Subject: [PATCH] Merge branch 'dev_lxw' of https://whyclxw1@gitlab.com/whyclxw1/gx_tieta.git into dev_lxw

---
 gx_tieta/WebRoot/index.jsp |   74 ++++++++++++++++++++++++++++++++----
 1 files changed, 65 insertions(+), 9 deletions(-)

diff --git a/gx_tieta/WebRoot/index.jsp b/gx_tieta/WebRoot/index.jsp
index 4593492..fdcef10 100644
--- a/gx_tieta/WebRoot/index.jsp
+++ b/gx_tieta/WebRoot/index.jsp
@@ -126,6 +126,13 @@
 										<table>
 											<tbody>
 												<tr>
+													<td class="alg-c f-bold"><span class="mrl8">鏈烘埧绫诲瀷:</span></td>
+													<td colspan="2" id="homeType">
+														<span class="mrl8 mrr8"><input type="checkbox" value="2"  checked="checked">2V</span>
+														<span><input type="checkbox" checked="checked" value="12">12V</span>
+													</td>
+												</tr>
+												<tr>
 													<td class="w5em alg-c f-bold"><span class="mrl8">鏈烘埧鍚嶇О:</span></td>
 					                				<td><input type="text" id="mapToolSearch"></td>
 													<td class="w54 btn-container">
@@ -591,6 +598,7 @@
 		
 		$('.nav-map').on('click', '.explain-list input', function() {
 			setMapImgStyles();
+			updateStation(true);
 		});
 	});
 	
@@ -1945,8 +1953,10 @@
 	
 	// 鏇存柊鍦板浘鍥炬爣
 	function updateMapDotIcon(map, dotList, isTop) {
+		var homeType = getHomeType();
 		// 閬嶅巻鏌ヨ鍐呭鐢熸垚瀵瑰簲鐨勫浘鏍�
 		for(var i = 0; i<dotList.length; i++) {
+			var isAcType = checkHomeType(dotList[i].type, homeType);
 			var isShow = checkMapImgStyle(dotList[i].msg);
 			var dotIcon = new BMap.Icon(getMapStateImg(mapImages, dotList[i].msg), new BMap.Size(36, 30));	// 璁剧疆鍥剧墖
 			var mk =  getMapMarker(map, dotList[i].title);
@@ -1960,7 +1970,7 @@
 				}
 				
 				// 闅愯棌marker鐐�
-				isShow?mk.show():mk.hide();
+				isShow&&isAcType?mk.show():mk.hide();
 			}
 		}
 	}
@@ -2518,7 +2528,7 @@
 				// 鑾峰彇缁撴灉闆�
 				var rs = JSON.parse(data.result);
 				var list = rs.data;
-				// console.log(list);
+				//console.log(list);
 				allStation = new Array();
 				if(list!=undefined && list.length>0){
 					// 璁剧疆鍒嗛〉淇℃伅
@@ -2533,7 +2543,7 @@
 					// 鏄剧ず鍖哄煙鐨勫浘鏍�
 					bmap.setDots(allStation);
 					bmap.queryInRect(map, createMapDot);
-					updateStation();
+					updateStation(setRect);
 					
 					// 鏇存柊灏忓伐鍏锋悳绱㈡満鎴垮姛鑳�
 					updateSearchSource(allStation);
@@ -2574,9 +2584,16 @@
 	}
 	
 	// 杞鏇存柊鍦板浘鐨勭偣鏌ヨ
-	function updateStation() {
+	var updateTimeout;
+	var updateLoad;
+	function updateStation(isLoad) {
 		var bmap = GLOBAL.BMap;		// BMap鐨勫懡鍚嶇┖闂�
 		var updateStationData = [];
+		
+		if(isLoad) {
+			updateLoad = layer.load(1);
+		}
+		
 		$.ajax({
 			type: "post",
 			url: "BattMap_informationAction!searchUserManageStation2",				
@@ -2584,6 +2601,7 @@
 	        dataType:'json',
 	        data: "json="+JSON.stringify(mapPages),
 	        success: function(result) {
+	        	layer.close(updateLoad);
 	        	var data = JSON.parse(result.result);
 	        	//console.log(data);
 	        	for(var i=0; i<data.length; i++) {
@@ -2595,7 +2613,7 @@
 	        			bmap.updateDots(_list);
 	        		}
 	        	}
-	        	
+	        	//console.log(updateStationData);
 	        	updateMapDotIcon(map, updateStationData, true);
 	        	// 鏇存柊鍒嗛〉淇℃伅
 	        	mapPages.pageCurr++;
@@ -2603,8 +2621,9 @@
 	        		mapPages.pageCurr=1;
 	        		mapPages.pageNew=false;
 	        	}
-	        	
-	        	setTimeout(updateStation, 4000);
+	        	// 鍏抽棴骞舵坊鍔犲欢鏃舵墽琛�
+	        	clearInterval(updateTimeout);
+	        	updateTimeout = setTimeout(updateStation, 4000);
 	        	
 	        }
 		});
@@ -2614,7 +2633,6 @@
 	function formatUpdateStation(list) {
 		var obj = {};
 		var data = list.data;
-		//console.log(list);
 		// GPS鍧愭爣杞寲涓虹櫨搴﹀潗鏍�
 		var point = GPS.wgs2bd(data.latitude, data.longitude);
 		// 鏋勯�犵粨鏋滈泦
@@ -2625,9 +2643,13 @@
 		obj.fbsId = data.FBSDeviceId;
 		obj.addr = data.Address;
 		obj.msg = list.msg;
-		obj.num = list.num;
+		obj.num = data.num;
+		obj.type = data.monvolstd;
 		return obj;
 	}
+	
+	// 鏍规嵁鏄剧ず鐨勭被鍨嬬瓫閫夋暟鎹�
+	
 	
 	// 鏍规嵁allStation鐨勫�煎幓鏇存柊鍐呭
 	function updateMapByAllStation() {
@@ -3852,6 +3874,7 @@
 		$( "#mapToolSearch" ).on('input propertychange', function(){
 			$('#mapToolSearchBtn').data('homeInfo', 0);
 		});
+		
 		// 瀹氫箟鏈烘埧鏌ヨ淇℃伅
 		$( "#mapToolSearch" ).autocomplete({
 			source: [],
@@ -3859,6 +3882,13 @@
 				$('#mapToolSearchBtn').data('homeInfo', ui.item);	// 璁剧疆鏈烘埧淇℃伅鍐呭
 			}
 		});
+		
+		// 鐐瑰嚮鏈烘埧绫诲瀷澶嶉�夋
+		$('#homeType input[type=checkbox]').click(function() {
+			var homeType = getHomeType();
+			updateStation(true);
+		});
+		
 		
 		// 鐐瑰嚮鏌ョ湅homeInfo鐨勫��
 		$('#mapToolSearchBtn').click(function() {
@@ -3960,6 +3990,32 @@
 		};
 	});
 	
+	// 0=鍏ㄩ儴涓嶉�� 14=鍏ㄩ儴閫変腑 2=閫変腑2V 12=閫変腑12V
+	function getHomeType() {
+		var boxList = $('#homeType input[type=checkbox]')
+		var rs = 0;		// 鍏ㄩ儴
+		
+		boxList.each(function() {
+			if($(this).is(':checked')) {
+				rs += Number($(this).val());
+			}
+		});
+		
+		return rs;
+	}
+	
+	
+	// 妫�娴嬪綋鍓嶆満鎴挎槸鍚︾鍚�2V鎴�12V
+	function checkHomeType(homeType, type) {
+		var rs = false;
+		var _homeType = Number(homeType);
+		if(type == 14 || homeType == type) {
+			rs = true;
+		}
+		
+		return rs;
+	}
+	
 	// 鏇存柊鍦板浘宸ュ叿鎼滅储鏈烘埧
 	function updateSearchSource(data) {
 		var homeSource = [];

--
Gitblit v1.9.1