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/batt-station-update1.jsp |   89 ++++++++++++++++++++++++++++++++++++++------
 1 files changed, 77 insertions(+), 12 deletions(-)

diff --git a/gx_tieta/WebRoot/batt-station-update1.jsp b/gx_tieta/WebRoot/batt-station-update1.jsp
index bbc58ad..a2d5656 100644
--- a/gx_tieta/WebRoot/batt-station-update1.jsp
+++ b/gx_tieta/WebRoot/batt-station-update1.jsp
@@ -15,7 +15,7 @@
 		<meta http-equiv="expires" content="0">    
 		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
 		<meta http-equiv="description" content="This is my page">
-	    <title>鏈烘埧绔欑偣鍗囩骇鍔熻兘</title>
+	    <title>BTS璁惧鍗囩骇</title>
 		<link rel="stylesheet" type="text/css" href="pages/css/base.css">
 		<link rel="stylesheet" type="text/css" href="jqueryui/jquery-ui.css">
 	    <link rel="stylesheet" type="text/css" href="src/css/layui.css">
@@ -153,12 +153,24 @@
         		var element = layui.element;	// 鑾峰彇鍏冪礌鎿嶄綔妯″潡
         		
         		// 璁剧疆妫�娴嬫枃浠跺悕寮瑰嚭妗嗙殑content
-        		var cFilenameContent = '<div style="width:300px; height: 50px;"><div style="margin-top: 20px;margin-left: 8px; margin-right: 8px; text-algin: center;">'+
+        		var cFilenameContent = '<div style="width:300px; height: 110px;"><div style="margin-top: 20px;margin-left: 8px; margin-right: 8px; text-algin: center;">'+
 										'<span>閫夋嫨鏂囦欢鍚嶏細</span>'+
 										'<select id="equipeTypeSel" style="width: 200px;height: 26px; border: 1px solid #ccc">'+
 											'<option value="avr_dfu.uc3">avr_dfu.uc3</option>'+
 											'<option value="E51_DFU.SM5">E51_DFU.SM5</option>'+
-										'</select>'+
+										'</select><br><br>'+
+										'<span>绯�&nbsp;缁�&nbsp;绫�&nbsp;鍨嬶細</span>'+
+										'<select id="sysType" style="width: 200px;height: 26px; border: 1px solid #ccc">'+
+											'<option value="12">1U</option>'+
+											'<option value="2">2U</option>'+
+										'</select><br><br>'+
+										'<span>杈撳叆鐗堟湰鍙凤細</span>'+
+										'<input type="text" id="newestVer" style="width: 200px;height: 24px; border: 1px solid #ccc">'+
+									'</div></div>';
+									
+				var cVerContent = '<div style="width:300px; height: 50px;"><div style="margin-top: 20px;margin-left: 8px; margin-right: 8px; text-algin: center;">'+
+										'<span>杈撳叆鐗堟湰鍙凤細</span>'+
+										'<input type="text" id="newestVer" style="width: 200px;height: 24px; border: 1px solid #ccc">'+
 									'</div></div>';
         		
 				var isNewLoad = true;
@@ -426,15 +438,18 @@
 					// 鎵撳紑闈㈡澘璁剧疆鍗囩骇璁惧埆鐨勭被鍨�
 					layer.open({
 						type: 1
-						,title: '鍗囩骇鏂囦欢鍚�'
+						,title: '鍗囩骇鏂囦欢鍚�/鐗堟湰鍙�'
 						,content: cFilenameContent
 						,fixed: true
 						,resize: false
 						,btn:['璁剧疆', '鍙栨秷']
 						,yes: function(index) {
 							var filename = $('#equipeTypeSel').val();
+							var newestVer = $('#newestVer').val();
+							var sysType = $('#sysType').val();
+							
 							// 鏍¢獙瑕佹洿鏂扮殑璁惧
-							checkStationState(updateList, data, filename);
+							checkStationState(updateList, data, filename, newestVer, sysType);
 							layer.close(index);
 						}
 					});
@@ -462,8 +477,24 @@
 					var updateList = [data.fbsid];
 					var allData = [data];
 					
-					// 鏍¢獙瑕佹洿鏂扮殑璁惧
-					checkStationState(updateList, allData, data.filename);
+					// 鎵撳紑闈㈡澘璁剧疆鍗囩骇璁惧埆鐨勭被鍨�
+					layer.open({
+						type: 1
+						,title: '鍗囩骇鏂囦欢鍚�/鐗堟湰鍙�'
+						,content: cFilenameContent
+						,fixed: true
+						,resize: false
+						,btn:['璁剧疆', '鍙栨秷']
+						,yes: function(index) {
+							var newestVer = $('#newestVer').val();
+							var sysType = $('#sysType').val();
+							// 鏍¢獙瑕佹洿鏂扮殑璁惧
+							checkStationState(updateList, allData, data.filename, newestVer, sysType);
+							layer.close(index);
+						}
+					});
+					
+					
 				}
 				
 				// 鐐瑰嚮娣诲姞鐢熸垚琛ㄦ牸
@@ -728,7 +759,7 @@
 				
 				
 				// 楠岃瘉璁惧鏄惁鍏佽璁惧杩涜杩滅▼鍗囩骇
-				function checkStationState(temp, all, filename){
+				function checkStationState(temp, all, filename, newestVer, sysType){
 					$.ajax({ 	
 				        type: "post", 				
 				        url: "Fbs9100s_dfu_stateAction_action_judgeStation",				
@@ -740,7 +771,7 @@
 				        	//console.log(rs);
 				        	if(rs.code == 1) {
 				        		var data = rs.data;
-				        		var updateData = checkUpdating(data, all, filename);
+				        		var updateData = checkUpdating(data, all, filename, newestVer, sysType);
 				        		$('#updateIframeData').data('update', updateData.good);				// 鍙洿鏂扮殑璁惧淇℃伅
 				        		$('#updateIframeData').data('errorUpdate', updateData.bad);	// 鏃犳硶鏇存柊鐨勮澶囦俊鎭� 
 				        		
@@ -810,7 +841,7 @@
 				}
 				
 				// 鏍煎紡璇濆崌绾х殑璁惧
-				function checkUpdating(rsData, all, filename) {
+				function checkUpdating(rsData, all, filename, newestVer, sysType) {
 					var rs = {
 						good: []
 						,bad: []
@@ -825,7 +856,12 @@
 							// 鍒ゆ柇褰撳墠璁惧鏄惁姝e湪鍗囩骇
 							if(_all.updatestatusnum != 1) {
 								if(_all.fbsid == _rsData.FBSDeviceId && _all.filename == filename) {
-									isError = false;	
+									// 妫�娴嬪綋鍓嶇増鏈彿鏄惁涓烘渶鏂�
+									var isNewstVer = checkNewestVer(newestVer, _all.version);
+									var isSysType = checkSysType(sysType, _all.version);
+									if(!isNewstVer && isSysType) {
+										isError = false;	
+									}
 								}
 							}
 						}
@@ -939,7 +975,7 @@
 					return rs;
 				}
 				//console.log(getFnameByVer('D:8,V2.53.40'));
-				// 鏇村叿鐗堟湰鍙疯幏鍙栨枃浠剁殑鍚嶇О
+				// 鏍规嵁鐗堟湰鍙疯幏鍙栨枃浠剁殑鍚嶇О
 				function getFnameByVer(version) {
 					var fileList = [
 						{
@@ -963,6 +999,35 @@
 					
 					return filename;
 				}
+				
+				//console.log(checkNewestVer('42', 'D:8,V2.53.44'));
+				// 楠岃瘉鐗堟湰
+				function checkNewestVer(ver ,version) {
+					var pattern = '^.*\\.[0-9]*\\.([0-9]*)$';
+					var reg = new RegExp(pattern);
+					reg.test(version);
+					// 鍒ゆ柇褰撳墠鐗堟湰鏄惁涓烘渶鏂扮増鏈�
+					var isNewest = false;
+					if(ver == RegExp.$1) {
+						isNewest = true;
+					}
+					return isNewest;
+				}
+				
+				//checkSysType('12', 'D:8,V12.53.44');
+				// 楠岃瘉褰撳墠鐗堟湰2v/12v
+				function checkSysType(sys ,version) {
+					var pattern = '^.*V([0-9]*)\\.[0-9]*\\.[0-9]*$';
+					var reg = new RegExp(pattern);
+					reg.test(version);
+					//console.log(RegExp.$1);
+					var rs = false;
+					if(sys == RegExp.$1) {
+						rs = true;
+					}
+					// console.log(rs);
+					return rs;
+				}
         	});
         </script>
     </body>

--
Gitblit v1.9.1