From 0afa84e6de17cda97792f3acd114fffa552ee163 Mon Sep 17 00:00:00 2001 From: 81041 <81041@DESKTOP-025NVD9> Date: 星期四, 03 一月 2019 16:15:03 +0800 Subject: [PATCH] Merge branch 'dev_lxw' of https://gitlab.com/whyclxw1/gx_tieta.git into dev_lxw --- gx_tieta/WebRoot/ex-battinfo.jsp | 26 ++- gx_tieta/WebRoot/mobil/ele-param2.html | 4 gx_tieta/WebRoot/index.jsp | 56 ++++++++- gx_tieta/WebRoot/mobil/batt-approved1.html | 126 +++++++------------- gx_tieta/WebRoot/mobil/batt-approve-index.html | 37 +++--- gx_tieta/WebRoot/Top.jsp | 90 ++++++++++++++ gx_tieta/WebRoot/equipWarn1.jsp | 4 gx_tieta/WebRoot/iframe/batt-info-add.html | 5 8 files changed, 225 insertions(+), 123 deletions(-) diff --git a/gx_tieta/WebRoot/Top.jsp b/gx_tieta/WebRoot/Top.jsp index d0863f8..172f767 100644 --- a/gx_tieta/WebRoot/Top.jsp +++ b/gx_tieta/WebRoot/Top.jsp @@ -196,6 +196,35 @@ </div> </div> </body> + <script type="text/javascript"> + // 妫�娴嬮〉闈㈡槸鍚﹁璁块棶 + var pageIsVisit = false; + ;(function($) { + // 闅愯棌鐨勫師鍨� + var hiddenProperty = 'hidden' in document ? 'hidden' : + 'webkitHidden' in document ? 'webkitHidden' : + 'mozHidden' in document ? 'mozHidden' : + null; + + // 椤甸潰鍒濆鍖� + if (!document[hiddenProperty]) { + pageIsVisit = true; + }else{ + pageIsVisit = false; + } + + + var visibilityChangeEvent = hiddenProperty.replace(/hidden/i, 'visibilitychange'); + var onVisibilityChange = function(){ + if (!document[hiddenProperty]) { + pageIsVisit = true; + }else{ + pageIsVisit = false; + } + } + document.addEventListener(visibilityChangeEvent, onVisibilityChange); + })(jQuery); + </script> <script src="pages/js/base.js"></script> <script src="pages/js/common.js"></script> <script src="js/dev.js"></script> @@ -243,6 +272,13 @@ //鏌ヨ钀藉悗鍗曚綋鎬绘暟 function searchlowmon(){ + + // 鍒ゆ柇椤甸潰鏄惁琚闂� + if(!pageIsVisit) { + setTimeout(searchlowmon, 5000); + return; + } + $.ajax({ type: "post", url: "BadBatt_monAction!searchNums", @@ -263,6 +299,12 @@ //鏌ヨ鏈烘埧鍋滅數鎬绘暟 function searchpoweroffOld(){ + // 鍒ゆ柇椤甸潰鏄惁琚闂� + if(!pageIsVisit) { + setTimeout(searchpoweroffOld, 5000); + return; + } + $.ajax({ type: "post", url: "BattPower_offAction!serchPowerOff", @@ -283,6 +325,11 @@ //鏌ヨ鏈烘埧鍋滅數鎬绘暟 function searchpoweroff(){ + // 鍒ゆ柇椤甸潰鏄惁琚闂� + if(!pageIsVisit) { + setTimeout(searchpoweroff, 5000); + return; + } $.ajax({ type: "post", url: "Bts_station_stateAction_action_serchByState", @@ -303,6 +350,11 @@ //鏌ヨ璁惧鍛婅鎬绘暟 function searchdevalarm(){ + // 鍒ゆ柇椤甸潰鏄惁琚闂� + if(!pageIsVisit) { + setTimeout(searchdevalarm, 5000); + return; + } $.ajax({ type: "post", url: "Batt_devalarm_dataAction!searchNums", @@ -323,6 +375,11 @@ //鏌ヨ鏀剧數璁″垝寤惰繜鎬绘暟 function searchnotcomplan(){ + // 鍒ゆ柇椤甸潰鏄惁琚闂� + if(!pageIsVisit) { + setTimeout(searchnotcomplan, 5000); + return; + } $.ajax({ type: "post", url: "BattDischarge_planAction!searchNums", @@ -343,6 +400,11 @@ // 鏈烘埧缁埅涓嶈冻涓暟 function searchWeakHome() { + // 鍒ゆ柇椤甸潰鏄惁琚闂� + if(!pageIsVisit) { + setTimeout(searchWeakHome, 5000); + return; + } $.ajax({ type: 'post' ,async: true @@ -361,6 +423,11 @@ // 鏌ヨ鎵�鏈夌殑璁惧鏁� searchAllDevNum(); function searchAllDevNum() { + // 鍒ゆ柇椤甸潰鏄惁琚闂� + if(!pageIsVisit) { + setTimeout(searchAllDevNum, 5000); + return; + } $.ajax({ type: 'post' ,async: true @@ -384,6 +451,11 @@ // 鏌ヨ鎵�鏈夌殑鐢垫睜缁勬暟 searchAllEleGroupNum(); function searchAllEleGroupNum() { + // 鍒ゆ柇椤甸潰鏄惁琚闂� + if(!pageIsVisit) { + setTimeout(searchAllEleGroupNum, 5000); + return; + } $.ajax({ type: 'post' ,async: true @@ -554,6 +626,11 @@ * 瀹炴椂鏌ヨ鍛婅淇℃伅 */ function searchBattAndDevAlarm(){ + // 鍒ゆ柇椤甸潰鏄惁琚闂� + if(!pageIsVisit) { + setTimeout(searchBattAndDevAlarm, 3000); + return; + } $.ajax({ type:"post", url: "Battalarm_dataAction!serchTopAlmTen", @@ -597,7 +674,12 @@ seachServerTime(); //鑾峰彇鏈嶅姟鍣ㄤ笂鐨勬椂闂� - function seachServerTime(){ + function seachServerTime(){ + // 鍒ゆ柇椤甸潰鏄惁琚闂� + if(!pageIsVisit) { + setTimeout(seachServerTime, 1000); + return; + } $.ajax({ type:"post", url: "User_infAction!searchServerTime", @@ -716,6 +798,11 @@ //鏌ヨ鏈�杩�30鍐呯殑璁惧鍜岀數姹犲憡璀﹀苟鎾姤璇煶 function searchRecentlyAlarm(){ + // 鍒ゆ柇椤甸潰鏄惁琚闂� + if(!pageIsVisit) { + setTimeout(searchRecentlyAlarm, 5000); + return; + } $.ajax({ type: "post", url: "Battalarm_dataAction!serchIn30", @@ -1005,6 +1092,5 @@ }); } })(jQuery); - </script> </html> diff --git a/gx_tieta/WebRoot/equipWarn1.jsp b/gx_tieta/WebRoot/equipWarn1.jsp index 75e4f7a..9efbf68 100644 --- a/gx_tieta/WebRoot/equipWarn1.jsp +++ b/gx_tieta/WebRoot/equipWarn1.jsp @@ -114,7 +114,7 @@ <select id="alarm_type"> <option value="0">鍏ㄩ儴</option> <option value="119020">閫氫俊鏁呴殰</option> - <option value="618501">缁х數鍣ㄥ憡璀�</option> + <!-- <option value="618501">缁х數鍣ㄥ憡璀�</option> <option value="618502">閫氳鍛婅</option> <option value="618503">璁惧杩囨俯鍛婅</option> <option value="618504">浜屾瀬绠1鍛婅</option> @@ -122,7 +122,7 @@ <option value="119024">鍩虹珯鍋滅數鍛婅</option> <option value="119025">鍩虹珯鍙戠數鍛婅</option> <option value="119026">鍩虹珯鎺夌珯鍛婅</option> - <option value="119027">鍩虹珯寮�闂ㄥ憡璀�</option> + <option value="119027">鍩虹珯寮�闂ㄥ憡璀�</option> --> <option value ="119028">璁惧楂樻俯鍛婅</option> <option value ="119032">璁惧SD鍗℃晠闅�</option> <option value ="119033">閲囬泦绾垮憡璀�</option> diff --git a/gx_tieta/WebRoot/ex-battinfo.jsp b/gx_tieta/WebRoot/ex-battinfo.jsp index c0b02b5..efa9644 100644 --- a/gx_tieta/WebRoot/ex-battinfo.jsp +++ b/gx_tieta/WebRoot/ex-battinfo.jsp @@ -481,7 +481,7 @@ // 璺宠浆鍒板疄鏃堕〉闈� function controlPage(data) { - console.log(data); + // console.log(data); var home = data.StationName; var province = data.StationName1; var city = data.StationName2; @@ -550,7 +550,7 @@ ,complete: function() { layer.close(load); // 鍚姩鑷姩鍒锋柊 - //updateSearch(); + updateSearch(); } }); } @@ -581,6 +581,7 @@ //console.log(res); var rs = JSON.parse(res.result); var resData = []; + var isUpdateTbl = false; if(rs.code == 1) { var data = rs.data; // console.log(data); @@ -588,17 +589,22 @@ for(var i=0; i<data.length; i++) { var _data = data[i]; var _tmp = formaterResData(_data); - resData.push(_tmp); - Page.setAll(_data.apply_note); + + if(_data.apply_note != Page.all) { + resData.push(_tmp); + Page.setAll(_data.apply_note); + isUpdateTbl = true; + } } }else { Page.setAll(0); } - $('#applyNum').text(Page.all); // 璁剧疆寰界珷 - tOptions.data = resData; // 璁剧疆琛ㄦ牸鐨勬暟鎹� - - // 鐢熸垚琛ㄦ牸鏁版嵁 - table.reload('pageTbl', tOptions); + // console.log(isUpdateTbl); + if(isUpdateTbl) { + $('#applyNum').text(Page.all); // 璁剧疆寰界珷 + tOptions.data = resData; // 璁剧疆琛ㄦ牸鐨勬暟鎹� + table.render(tOptions); + } // 瀹炴椂鍥炶皟 updateSearch.timer = setTimeout(updateSearch, 4000); @@ -645,7 +651,7 @@ // 鐢熸垚琛ㄦ牸鏁版嵁 table.render(acceptOptions); - console.log(table); + // console.log(table); } ,complete: function() { layer.close(load); diff --git a/gx_tieta/WebRoot/iframe/batt-info-add.html b/gx_tieta/WebRoot/iframe/batt-info-add.html index 2f06466..6d96497 100644 --- a/gx_tieta/WebRoot/iframe/batt-info-add.html +++ b/gx_tieta/WebRoot/iframe/batt-info-add.html @@ -233,9 +233,9 @@ </div> <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3"> <div class="layui-block"> - <label class="layui-form-label">浣跨敤鏃ユ湡</label> + <label class="layui-form-label">鎶曞叆浣跨敤鏃ユ湡</label> <div class="layui-input-block"> - <input type="text" name="BattInUseDate" disabled="" id="usedate" autocomplete="off" class="layui-input layui-bg-gray" value="{{= d.BattInUseDate }}"> + <input type="text" name="BattInUseDate" id="usedate" autocomplete="off" class="layui-input" value="{{= d.BattInUseDate }}"> </div> </div> </div> @@ -467,6 +467,7 @@ laydate.render({ elem: '#usedate' ,format: 'yyyy-MM-dd HH:mm:ss' + ,value: new Date() }); }); diff --git a/gx_tieta/WebRoot/index.jsp b/gx_tieta/WebRoot/index.jsp index 6fcf891..45bb7c7 100644 --- a/gx_tieta/WebRoot/index.jsp +++ b/gx_tieta/WebRoot/index.jsp @@ -801,12 +801,14 @@ } //闇�瑕佸疄鏃舵煡璇㈢殑鏂规硶 - function Repeatoperation(){ - searchBattmaintrecords(); - searchUserTask(); - searchAnnounceall(); - searchTestsCale(); - + function Repeatoperation(){ + // 鍒ゆ柇椤甸潰鏄惁姝e湪琚闂� + if(pageIsVisit) { + searchBattmaintrecords(); + searchUserTask(); + searchAnnounceall(); + searchTestsCale(); + } setTimeout(Repeatoperation,10000); } @@ -940,6 +942,13 @@ if($('#content .warn-pie').length==0){ return; } + + // 鍒ゆ柇椤甸潰鏄惁琚闂� + if(!pageIsVisit) { + setTimeout(searchalarm_data, 10000); + return; + } + //鐢熸垚鐢垫睜鍛婅鐜囬ゼ鐘跺浘 var $warn=$('#content .pie-con .warn-pie'); //鑾峰彇鍛婅瀹瑰櫒鐨刯query瀵硅薄 if($warn.length!=0){ @@ -1051,6 +1060,12 @@ return; } + // 鍒ゆ柇椤甸潰鏄惁琚闂� + if(!pageIsVisit) { + setTimeout(searchmaintByMap, 10000); + return; + } + // 鍒ゆ柇鏄惁涓篍charts瀵硅薄 var isEcharts = isObject(brdnPie)?true:false; @@ -1123,6 +1138,13 @@ if($('#content .repair-pie').length==0){ return; } + + // 鍒ゆ柇椤甸潰鏄惁琚闂� + if(!pageIsVisit) { + setTimeout(searchBatt_maint_inf, 10000); + return; + } + // 鍒ゆ柇鏄惁涓篍charts瀵硅薄 var isEcharts = isObject(repairPie)?true:false; if(!isEcharts) { @@ -1178,6 +1200,13 @@ if($('#content .health-pie').length==0){ return; } + + // 鍒ゆ柇椤甸潰鏄惁琚闂� + if(!pageIsVisit) { + setTimeout(searchGood, 10000); + return; + } + //鐢熸垚鐢垫睜鍋ュ悍鐜� var $health=$('#content .pie-con .health-pie'); //鑾峰彇鏁呴殰瀹瑰櫒鐨刯query瀵硅薄 if($health.length!=0){ @@ -1228,6 +1257,12 @@ var endurPie; function searchEndurHome() { if($('#content .endur-pie').length==0){ + return; + } + + // 鍒ゆ柇椤甸潰鏄惁琚闂� + if(!pageIsVisit) { + setTimeout(searchEndurHome, 10000); return; } @@ -1840,7 +1875,7 @@ var powercut = mapImgDesc.find('.badge-powercut'); // 鍋滅數鏈烘埧 var normal = mapImgDesc.find('.badge-normal'); // 姝e父鏈烘埧 var weak = mapImgDesc.find('.badge-xuhang'); // 缁埅涓嶈冻3灏忔椂鏈烘埧 - console.log(warn.length); + // console.log(warn.length); // 璇锋眰鍚庡彴鏁版嵁 $.ajax({ type: 'post' @@ -2632,6 +2667,13 @@ var bmap = GLOBAL.BMap; // BMap鐨勫懡鍚嶇┖闂� var updateStationData = []; + // 鍒ゆ柇鏄惁琚闂� + if(!pageIsVisit) { + // 鍏抽棴骞舵坊鍔犲欢鏃舵墽琛� + clearInterval(updateTimeout); + updateTimeout = setTimeout(updateStation, 4000); + } + if(isLoad) { updateLoad = layer.load(1); } diff --git a/gx_tieta/WebRoot/mobil/batt-approve-index.html b/gx_tieta/WebRoot/mobil/batt-approve-index.html index fa21748..1c493a4 100644 --- a/gx_tieta/WebRoot/mobil/batt-approve-index.html +++ b/gx_tieta/WebRoot/mobil/batt-approve-index.html @@ -125,32 +125,33 @@ var model = new Array(); console.info(data); for(var i=0;i<data.length;i++){ - arrdata.push(data[i]);//瀛樺偍鏁版嵁 - if(model.length==0){ - model.push(data[i].binf.StationName); - }else{ - if(model[model.length-1]!=data[i].binf.StationName){ - model.push(data[i].binf.StationName); - } - } - console.info(model); - stationlist=model; + if(data[i].check_en!=1){ + arrdata.push(data[i]);//瀛樺偍鏁版嵁 + if(model.length==0){ + model.push(data[i].binf.StationName); + }else{ + if(model[model.length-1]!=data[i].binf.StationName){//鑻ヤ笉閲嶅锛屽垯PUSH杩涘幓 + model.push(data[i].binf.StationName); + } + } + console.info(model); + stationlist=model; + } } createUl($('#battList'),model); } - } }); } function setarrbatt(arrdata,station){ - console.info(arrdata); - if(arrdata.length>0){ //瀛樺叆鐨勪负鎵�鏈夊凡鏌ュ嚭鏁版嵁 - var arr= creatYanshouObj(arrdata,station);//鐢宠楠屾敹鏂规硶銆� - return arr; - }else{ - alert("璇风瓑寰呭嚑绉掑悗鍐嶆彁浜ょ敵璇�"); - } + console.info(arrdata); + if(arrdata.length>0){ //瀛樺叆鐨勪负鎵�鏈夊凡鏌ュ嚭鏁版嵁 + var arr= creatYanshouObj(arrdata,station);//鐢宠楠屾敹鏂规硶銆� + return arr; + }else{ + alert("璇风瓑寰呭嚑绉掑悗鍐嶆彁浜ょ敵璇�"); + } } function creatYanshouObj(arrdata,station){ //閫氳繃鐐瑰嚮鏈烘埧淇℃伅锛坰tationid锛夛紝鑾峰彇璇ユ満鎴跨數姹犵粍 //var StationId = arrdata[index].binf.StationId; diff --git a/gx_tieta/WebRoot/mobil/batt-approved1.html b/gx_tieta/WebRoot/mobil/batt-approved1.html index 1c7d0ff..f0dc700 100644 --- a/gx_tieta/WebRoot/mobil/batt-approved1.html +++ b/gx_tieta/WebRoot/mobil/batt-approved1.html @@ -318,8 +318,8 @@ var arr = temp; function setcookieCreat(i){ - console.info(temp); - console.info(i) + console.info(temp); + console.info(i) //var index=Math.ceil(i-1); arrdata = temp[i].binf; console.info(arrdata); @@ -336,7 +336,7 @@ } // 瀛樺偍鎵�鏈夌殑鏁版嵁 - $('#homeInfoIframeAll').data('allData', temp); + $('#homeInfoIframeAll').data('allData', temp); var _data = temp[0]; var _temp = { homeId: _data.binf.StationId @@ -347,7 +347,7 @@ } // 瀛樺偍闇�瑕佺殑homeInfo淇℃伅 - $('#homeInfoIframe').data('homeInfo', _temp); + $('#homeInfoIframe').data('homeInfo', _temp); iframePopup = layer.open({ type: 2 @@ -377,20 +377,18 @@ $(function () { //setTimes($("#startTestrecord"),'2000-01-01'); - //setTimes($("#endTestrecord"),new Date().format('yyyy-MM-dd')); - - installstartdata(temp);//瀵煎叆鍒濆椤甸潰鍊� - diubao();//鍒濆涓㈠寘鐜� - updateinstalldata(temp);//瀹炴椂鏇存柊楠屾敹鐘舵�� - timeer = window.setTimeout(function() { - diubao(); - updateinstalldata(temp); - }, 4000); //涓㈠寘鐜囷紝閫氫俊璁℃暟锛�4绉掑埛鏂�1娆°�� - //4绉掑埛鏂颁竴娆¢〉闈� + //setTimes($("#endTestrecord"),new Date().format('yyyy-MM-dd')); + installstartdata(temp);//瀵煎叆鍒濆椤甸潰鍊� + getnewnumber(temp[0].binf.FBSDeviceId); + updateinstalldata(); }); + var timeer = ''; + - function updateinstalldata(temp){ - //console.info(temp); + function updateinstalldata(){ + console.info(temp); + // 娓呴櫎璁℃椂鍣� + clearInterval(updateinstalldata.timer); var data=temp[0].binf.StationId; var _data ={ binf:{ StationId:data @@ -404,15 +402,19 @@ url: 'Battinf_applyAction!serchById', data: "json="+data, dataType: 'json', - success:function(data) { - - data = JSON.parse(data.result); - console.info(data); - if(data.code==1&&data.data.length>0){ - data = data.data; - //console.info(data[0].check_en); - document.getElementById("check_en").value = yanshou(data[0].check_en); - } + success:function(data) { + data = JSON.parse(data.result); + console.info(data); + if(data.code==1&&data.data.length>0){ + data = data.data; + //console.info(data[0].check_en); + document.getElementById("check_en").value = yanshou(data[0].check_en); + } + + // 鏇存柊鍐呭 + updateinstalldata.timer = setTimeout(function() { + updateinstalldata(); + }, 4000); } }); } @@ -512,67 +514,40 @@ } } - function diubao(){ - if(temp.length>0){ - data=temp[0].binf; - document.getElementById("tongxunnumber").value = getCookienumber(data.StationId); - document.getElementById("diubaonumber").value = getCookiediubao(data.StationId); - } - } - function getCookienumber(id){//杈撳叆ID锛岃繑鍥為�氳璁℃暟銆傛暟鎹粠缂撳瓨鑾峰彇銆� - var a = getnumber(); - //console.info(a); - if(getCookie("numberget")){ - var number = getCookie("numberget"); - number = JSON.parse(number); - console.info(number); - if(number[0]){ - for(var i =0; i<number.length;i++){ - if(id == number[i].dev_id){ - return number[i].dev_commcount; - } - } - } - } - return 0; - } - function getnumber(){ //鍚戣幏鍙栨墍鏈夐�氳璁℃暟骞跺瓨鍏ョ紦瀛� - $.ajax({ + + function getnewnumber(id){//涓㈠寘鐜囷紝閫氳璁℃暟 + $.ajax({ type: 'post', async: true, url: 'Battinf_applyAction!devCommNum', data: null, dataType: 'json', success:function(data) { + console.info(data); data = JSON.parse(data.result); if(data.code==1){ console.info(data.data); - var json =JSON.stringify(data.data); - setCookie("numberget",json); - //return data.data; + data=data.data; + console.info(data[0]); + for(var i=0;i<data.length;i++){ + console.info(data[i].dev_id); + console.info(id) + if(data[i].dev_id==id){ + console.info(id); + document.getElementById("tongxunnumber").value = data[i].dev_commcount; + var errorCount = data[i].dev_errcommcount; + var allCount = data[i].dev_commcount+errorCount; + var parcent = (allCount==0?0:errorCount/allCount*100); + console.info(parcent); + document.getElementById("diubaonumber").value = parcent; + } + } } } }); } - function getCookiediubao(id){ //涓㈠寘鐜� - if(getCookie("numberget")){ - var number = getCookie("numberget"); - number = JSON.parse(number); - console.info(number); - if(number[0]){ - for(var i =0; i<number.length;i++){ - if(id == number[i].dev_id){ - var errorCount = number[i].dev_errcommcount; - var allCount = number[i].dev_commcount+errorCount; - var parcent = (allCount==0?0:errCount/allCount*100) - return parcent; - } - } - } - } - return 0; - } + // 鏍煎紡鍖栨彁浜ゅ悗鍙颁俊鎭殑瀵硅薄鏁扮粍骞惰繑鍥� 鍗曚釜淇敼锛屾墜鏈烘柟寮忎笉淇敼澶氫釜鐢垫睜缁� function getUpdateArr(){ mon=$('#MonVolStd').val(); @@ -652,13 +627,6 @@ }); }); - function nullOrn(){ - - return true; - - - } - function editBatt(){// console.info(getUpdateArr()); var temp = JSON.stringify(getUpdateArr()); diff --git a/gx_tieta/WebRoot/mobil/ele-param2.html b/gx_tieta/WebRoot/mobil/ele-param2.html index e4075f3..74553c3 100644 --- a/gx_tieta/WebRoot/mobil/ele-param2.html +++ b/gx_tieta/WebRoot/mobil/ele-param2.html @@ -464,9 +464,7 @@ }, }; console.info(temp); - searchBattLife(temp) - - + searchBattLife(temp); } // 鏌ヨ鍐呭 function searchBattLife(temp){ -- Gitblit v1.9.1