From e22fd0bac62d20d94e58409ea15049c67f6ff1eb Mon Sep 17 00:00:00 2001 From: 81041 <81041@192.168.10.26> Date: 星期四, 13 十二月 2018 10:33:35 +0800 Subject: [PATCH] 修改 --- gx_tieta/WebRoot/batt-station-update1.jsp | 94 ++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 81 insertions(+), 13 deletions(-) diff --git a/gx_tieta/WebRoot/batt-station-update1.jsp b/gx_tieta/WebRoot/batt-station-update1.jsp index 22d818d..0f48d91 100644 --- a/gx_tieta/WebRoot/batt-station-update1.jsp +++ b/gx_tieta/WebRoot/batt-station-update1.jsp @@ -152,6 +152,22 @@ var layer = layui.layer; // 鑾峰彇寮瑰嚭妗嗘ā鍧� 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;">'+ + '<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>'+ + '<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; var pre_province = getQueryString('province'); // 鏌ヨ鐪佷笅鎷夋 @@ -414,8 +430,25 @@ updateList.push(data[i].fbsid); } + // 鎵撳紑闈㈡澘璁剧疆鍗囩骇璁惧埆鐨勭被鍨� + layer.open({ + type: 1 + ,title: '鍗囩骇鏂囦欢鍚�/鐗堟湰鍙�' + ,content: cFilenameContent + ,fixed: true + ,resize: false + ,btn:['璁剧疆', '鍙栨秷'] + ,yes: function(index) { + var filename = $('#equipeTypeSel').val(); + var newestVer = $('#newestVer').val(); + + // 鏍¢獙瑕佹洿鏂扮殑璁惧 + checkStationState(updateList, data, filename, newestVer); + layer.close(index); + } + }); // 鏍¢獙瑕佹洿鏂扮殑璁惧 - checkStationState(updateList, data); + // checkStationState(updateList, data); }); // 鐐瑰嚮琛ㄦ牸鐨則oolbar @@ -438,8 +471,24 @@ var updateList = [data.fbsid]; var allData = [data]; - // 鏍¢獙瑕佹洿鏂扮殑璁惧 - checkStationState(updateList, allData); + // 鎵撳紑闈㈡澘璁剧疆鍗囩骇璁惧埆鐨勭被鍨� + layer.open({ + type: 1 + ,title: '鍗囩骇鏂囦欢鍚�/鐗堟湰鍙�' + ,content: cFilenameContent + ,fixed: true + ,resize: false + ,btn:['璁剧疆', '鍙栨秷'] + ,yes: function(index) { + var newestVer = $('#newestVer').val(); + + // 鏍¢獙瑕佹洿鏂扮殑璁惧 + checkStationState(updateList, allData, data.filename, newestVer); + layer.close(index); + } + }); + + } // 鐐瑰嚮娣诲姞鐢熸垚琛ㄦ牸 @@ -625,7 +674,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 +753,7 @@ // 楠岃瘉璁惧鏄惁鍏佽璁惧杩涜杩滅▼鍗囩骇 - function checkStationState(temp, all){ + function checkStationState(temp, all, filename, newestVer){ $.ajax({ type: "post", url: "Fbs9100s_dfu_stateAction_action_judgeStation", @@ -716,11 +765,11 @@ //console.log(rs); if(rs.code == 1) { var data = rs.data; - var updateData = checkUpdating(data, all); + var updateData = checkUpdating(data, all, filename, newestVer); $('#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 +785,7 @@ layer.open({ type: 2, title: '鏇存柊璁惧', - area: ['700px', '524px'], + area: ['960px', '524px'], fixed: false, //涓嶅浐瀹� maxmin: true, content: 'iframe/batt-station-update.html', @@ -760,9 +809,10 @@ } //console.log(updateList); + //return; // 鍏抽棴寮瑰嚭闈㈡澘 layer.close(index); - + // console.log(updateList); // 鍗囩骇璁惧 updateBTSDevice(updateList); //console.log(updateList); @@ -785,7 +835,7 @@ } // 鏍煎紡璇濆崌绾х殑璁惧 - function checkUpdating(rsData, all) { + function checkUpdating(rsData, all, filename, newestVer) { var rs = { good: [] ,bad: [] @@ -799,8 +849,12 @@ // 鍒ゆ柇褰撳墠璁惧鏄惁姝e湪鍗囩骇 if(_all.updatestatusnum != 1) { - if(_all.fbsid == _rsData.FBSDeviceId) { - isError = false; + if(_all.fbsid == _rsData.FBSDeviceId && _all.filename == filename) { + // 妫�娴嬪綋鍓嶇増鏈彿鏄惁涓烘渶鏂� + var isNewstVer = checkNewestVer(newestVer, _all.version); + if(!isNewstVer) { + isError = false; + } } } } @@ -914,7 +968,7 @@ return rs; } //console.log(getFnameByVer('D:8,V2.53.40')); - // 鏇村叿鐗堟湰鍙疯幏鍙栨枃浠剁殑鍚嶇О + // 鏍规嵁鐗堟湰鍙疯幏鍙栨枃浠剁殑鍚嶇О function getFnameByVer(version) { var fileList = [ { @@ -938,6 +992,20 @@ 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; + } }); </script> </body> -- Gitblit v1.9.1