From 78a6a3d7f0719985953ffdcc4bc3c11243250aa6 Mon Sep 17 00:00:00 2001
From: hdw <496960745@qq.com>
Date: 星期一, 03 十二月 2018 13:19:34 +0800
Subject: [PATCH] 设备升级添加文件名称验证
---
gx_tieta/WebRoot/iframe/batt-station-update.html | 12 ++++++++++--
gx_tieta/WebRoot/batt-station-update1.jsp | 45 +++++++++++++++++++++++++++++++++++----------
2 files changed, 45 insertions(+), 12 deletions(-)
diff --git a/gx_tieta/WebRoot/batt-station-update1.jsp b/gx_tieta/WebRoot/batt-station-update1.jsp
index 22d818d..bbc58ad 100644
--- a/gx_tieta/WebRoot/batt-station-update1.jsp
+++ b/gx_tieta/WebRoot/batt-station-update1.jsp
@@ -152,6 +152,15 @@
var layer = layui.layer; // 鑾峰彇寮瑰嚭妗嗘ā鍧�
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;">'+
+ '<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>'+
+ '</div></div>';
+
var isNewLoad = true;
var pre_province = getQueryString('province');
// 鏌ヨ鐪佷笅鎷夋
@@ -414,8 +423,23 @@
updateList.push(data[i].fbsid);
}
+ // 鎵撳紑闈㈡澘璁剧疆鍗囩骇璁惧埆鐨勭被鍨�
+ layer.open({
+ type: 1
+ ,title: '鍗囩骇鏂囦欢鍚�'
+ ,content: cFilenameContent
+ ,fixed: true
+ ,resize: false
+ ,btn:['璁剧疆', '鍙栨秷']
+ ,yes: function(index) {
+ var filename = $('#equipeTypeSel').val();
+ // 鏍¢獙瑕佹洿鏂扮殑璁惧
+ checkStationState(updateList, data, filename);
+ layer.close(index);
+ }
+ });
// 鏍¢獙瑕佹洿鏂扮殑璁惧
- checkStationState(updateList, data);
+ // checkStationState(updateList, data);
});
// 鐐瑰嚮琛ㄦ牸鐨則oolbar
@@ -439,7 +463,7 @@
var allData = [data];
// 鏍¢獙瑕佹洿鏂扮殑璁惧
- checkStationState(updateList, allData);
+ checkStationState(updateList, allData, data.filename);
}
// 鐐瑰嚮娣诲姞鐢熸垚琛ㄦ牸
@@ -625,7 +649,7 @@
status: [],
datapackage: []
};
- console.log(rs);
+ //console.log(rs);
if(rs.code == 1 && rs.data.length>0){
var tblData = tOptions.data;
for(var i=0; i<rs.data.length; i++) {
@@ -704,7 +728,7 @@
// 楠岃瘉璁惧鏄惁鍏佽璁惧杩涜杩滅▼鍗囩骇
- function checkStationState(temp, all){
+ function checkStationState(temp, all, filename){
$.ajax({
type: "post",
url: "Fbs9100s_dfu_stateAction_action_judgeStation",
@@ -716,11 +740,11 @@
//console.log(rs);
if(rs.code == 1) {
var data = rs.data;
- var updateData = checkUpdating(data, all);
+ var updateData = checkUpdating(data, all, filename);
$('#updateIframeData').data('update', updateData.good); // 鍙洿鏂扮殑璁惧淇℃伅
$('#updateIframeData').data('errorUpdate', updateData.bad); // 鏃犳硶鏇存柊鐨勮澶囦俊鎭�
- console.log(updateData);
+ //console.log(updateData);
// 鍒ゆ柇鏄惁鏈夊崌绾х殑璁惧
if(updateData.good.length == 0) {
if(temp.length == 1) {
@@ -736,7 +760,7 @@
layer.open({
type: 2,
title: '鏇存柊璁惧',
- area: ['700px', '524px'],
+ area: ['960px', '524px'],
fixed: false, //涓嶅浐瀹�
maxmin: true,
content: 'iframe/batt-station-update.html',
@@ -760,9 +784,10 @@
}
//console.log(updateList);
+ //return;
// 鍏抽棴寮瑰嚭闈㈡澘
layer.close(index);
-
+ // console.log(updateList);
// 鍗囩骇璁惧
updateBTSDevice(updateList);
//console.log(updateList);
@@ -785,7 +810,7 @@
}
// 鏍煎紡璇濆崌绾х殑璁惧
- function checkUpdating(rsData, all) {
+ function checkUpdating(rsData, all, filename) {
var rs = {
good: []
,bad: []
@@ -799,7 +824,7 @@
// 鍒ゆ柇褰撳墠璁惧鏄惁姝e湪鍗囩骇
if(_all.updatestatusnum != 1) {
- if(_all.fbsid == _rsData.FBSDeviceId) {
+ if(_all.fbsid == _rsData.FBSDeviceId && _all.filename == filename) {
isError = false;
}
}
diff --git a/gx_tieta/WebRoot/iframe/batt-station-update.html b/gx_tieta/WebRoot/iframe/batt-station-update.html
index ec524b6..633ec9b 100644
--- a/gx_tieta/WebRoot/iframe/batt-station-update.html
+++ b/gx_tieta/WebRoot/iframe/batt-station-update.html
@@ -38,8 +38,10 @@
<table class="hdw-tbl">
<thead>
<tr>
- <th style="width:30%">璁惧ID</th>
+ <th style="width:120px">璁惧ID</th>
<th>鏈烘埧鍚嶇О</th>
+ <th>鐗堟湰鍙�</th>
+ <th>鍗囩骇鏂囦欢鍚�</th>
</tr>
</thead>
<tbody>
@@ -47,6 +49,8 @@
<tr>
<td>{{ item.fbsid }}</td>
<td>{{ item.stationname }}</td>
+ <td>{{ item.version }}</td>
+ <td>{{ item.filename }}</td>
</tr>
{{# }); }}
</tbody>
@@ -59,8 +63,10 @@
<table class="hdw-tbl">
<thead>
<tr>
- <th style="width:30%">璁惧ID</th>
+ <th style="width:120px">璁惧ID</th>
<th>鏈烘埧鍚嶇О</th>
+ <th>鐗堟湰鍙�</th>
+ <th>鍗囩骇鏂囦欢鍚�</th>
</tr>
</thead>
<tbody>
@@ -68,6 +74,8 @@
<tr>
<td>{{ item.fbsid }}</td>
<td>{{ item.stationname }}</td>
+ <td>{{ item.version }}</td>
+ <td>{{ item.filename }}</td>
</tr>
{{# }); }}
</tbody>
--
Gitblit v1.9.1