From 62372bbc389e9dc507708f55d7b3e157f6948e0d Mon Sep 17 00:00:00 2001
From: hdw <hdw@192.168.1.4>
Date: 星期一, 24 十二月 2018 10:13:39 +0800
Subject: [PATCH] 添加系统类型
---
gx_tieta/WebRoot/batt-station-update1.jsp | 40 +++++++++++++++++++++++++++++++---------
1 files changed, 31 insertions(+), 9 deletions(-)
diff --git a/gx_tieta/WebRoot/batt-station-update1.jsp b/gx_tieta/WebRoot/batt-station-update1.jsp
index 0f48d91..eccb967 100644
--- a/gx_tieta/WebRoot/batt-station-update1.jsp
+++ b/gx_tieta/WebRoot/batt-station-update1.jsp
@@ -153,11 +153,16 @@
var element = layui.element; // 鑾峰彇鍏冪礌鎿嶄綔妯″潡
// 璁剧疆妫�娴嬫枃浠跺悕寮瑰嚭妗嗙殑content
- var cFilenameContent = '<div style="width:300px; height: 80px;"><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><br><br>'+
+ '<span>绯� 缁� 绫� 鍨嬶細</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">'+
@@ -441,9 +446,10 @@
,yes: function(index) {
var filename = $('#equipeTypeSel').val();
var newestVer = $('#newestVer').val();
+ var sysType = $('#sysType').val();
// 鏍¢獙瑕佹洿鏂扮殑璁惧
- checkStationState(updateList, data, filename, newestVer);
+ checkStationState(updateList, data, filename, newestVer, sysType);
layer.close(index);
}
});
@@ -481,9 +487,9 @@
,btn:['璁剧疆', '鍙栨秷']
,yes: function(index) {
var newestVer = $('#newestVer').val();
-
+ var sysType = $('#sysType').val();
// 鏍¢獙瑕佹洿鏂扮殑璁惧
- checkStationState(updateList, allData, data.filename, newestVer);
+ checkStationState(updateList, allData, data.filename, newestVer, sysType);
layer.close(index);
}
});
@@ -753,7 +759,7 @@
// 楠岃瘉璁惧鏄惁鍏佽璁惧杩涜杩滅▼鍗囩骇
- function checkStationState(temp, all, filename, newestVer){
+ function checkStationState(temp, all, filename, newestVer, sysType){
$.ajax({
type: "post",
url: "Fbs9100s_dfu_stateAction_action_judgeStation",
@@ -765,7 +771,7 @@
//console.log(rs);
if(rs.code == 1) {
var data = rs.data;
- var updateData = checkUpdating(data, all, filename, newestVer);
+ var updateData = checkUpdating(data, all, filename, newestVer, sysType);
$('#updateIframeData').data('update', updateData.good); // 鍙洿鏂扮殑璁惧淇℃伅
$('#updateIframeData').data('errorUpdate', updateData.bad); // 鏃犳硶鏇存柊鐨勮澶囦俊鎭�
@@ -835,7 +841,7 @@
}
// 鏍煎紡璇濆崌绾х殑璁惧
- function checkUpdating(rsData, all, filename, newestVer) {
+ function checkUpdating(rsData, all, filename, newestVer, sysType) {
var rs = {
good: []
,bad: []
@@ -852,7 +858,8 @@
if(_all.fbsid == _rsData.FBSDeviceId && _all.filename == filename) {
// 妫�娴嬪綋鍓嶇増鏈彿鏄惁涓烘渶鏂�
var isNewstVer = checkNewestVer(newestVer, _all.version);
- if(!isNewstVer) {
+ var isSysType = checkSysType(sysType, _all.version);
+ if(!isNewstVer && isSysType) {
isError = false;
}
}
@@ -993,7 +1000,7 @@
return filename;
}
- console.log(checkNewestVer('42', 'D:8,V2.53.44'));
+ //console.log(checkNewestVer('42', 'D:8,V2.53.44'));
// 楠岃瘉鐗堟湰
function checkNewestVer(ver ,version) {
var pattern = '^.*\\.[0-9]*\\.([0-9]*)$';
@@ -1006,6 +1013,21 @@
}
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