From 68dfe47cf6a32ac3560fc4b64e11eaa47c3bb6e7 Mon Sep 17 00:00:00 2001 From: 81041 <81041@DESKTOP-025NVD9> Date: 星期五, 11 一月 2019 10:16:36 +0800 Subject: [PATCH] Merge branch 'dev_lxw' of https://gitlab.com/whyclxw1/gx_tieta.git into dev_lxw --- gx_tieta/WebRoot/js/base.js | 173 +++++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 113 insertions(+), 60 deletions(-) diff --git a/gx_tieta/WebRoot/js/base.js b/gx_tieta/WebRoot/js/base.js index 6bb8f63..0b15d8c 100644 --- a/gx_tieta/WebRoot/js/base.js +++ b/gx_tieta/WebRoot/js/base.js @@ -19,14 +19,14 @@ function exitUser(){ $.post("LoginAction!exitUser",null,function(data){ //console.info(data); - window.location.replace("login.jsp"); }); + window.location.replace("login.jsp"); } // 妫�鏌ュ綋鍓嶇敤鎴锋槸鍚﹀湪鍙︿竴涓绘満鐧婚檰 function checkUserlogin(){ - //console.info("check"); + console.info("check***********************"); $.post("LoginAction_check",null,function(data){ data = eval("(" + data.result + ")"); user=data.uinf; @@ -38,7 +38,7 @@ window.location.href="login.jsp"; }else{ clearInterval(timeID); - timeID = setTimeout(checkUserlogin,5000); + timeID = setTimeout(checkUserlogin,100); } }).error(function(){ clearInterval(timeID); @@ -380,17 +380,17 @@ //data=eval("("+data+")"); data=data.result; data=eval("("+data+")"); - console.info(data); + //console.info(data); if(data.code==1){ if(data.data.length>0){ data=data.data[0]; document.getElementById("StationId").innerHTML=data.StationId; //鏈烘埧id document.getElementById("StationName").innerHTML=data.StationName; //鏈烘埧鍚嶇О document.getElementById("StationIP").innerHTML=data.StationIp; //鏈烘埧ip - //document.getElementById("batt_group_id").innerHTML=data.BattGroupId; //鐢垫睜缁刬p + document.getElementById("batt_group_id").innerHTML=data.BattGroupId; //鐢垫睜缁刬p document.getElementById("BattGroupName").innerHTML=data.BattGroupName; //鐢垫睜缁勫悕绉� - document.getElementById("BattGroupNum").innerHTML=data.BattGroupNum; //鐢垫睜缁勫簭鍙� + document.getElementById("BattGroupNum").innerHTML=data.GroupIndexInFBSDevice+1; //鐢垫睜缁勫簭鍙� document.getElementById("BattProducer").innerHTML=data.BattProducer; //鐢垫睜鍝佺墝 document.getElementById("BattModel").innerHTML=data.BattModel; //鐢垫睜鍨嬪彿 document.getElementById("MonCapStd").innerHTML=data.MonCapStd; //鏍囩О瀹归噺 @@ -412,7 +412,7 @@ //console.info(data); document.getElementById("FBSDeviceIp").innerHTML=data.FbsDeviceIp; //璁惧Ip document.getElementById("GroupIndexInFBSDevice").innerHTML=data.GroupIndexInFBSDevice; //Bindex - + document.getElementById("installUser").innerHTML= data.install_user; // 瀹夎浜哄憳 //鏄剧ず鐢垫睜缁勬満鍘嗗崱 $('#card_infor').show(); @@ -422,6 +422,64 @@ }); } +//鏍规嵁stationid鏌ヨ鍩虹珯鐨勪俊鎭� +function findStationInfoByStation(temp){ + //console.info(JSON.stringify(temp)); + $.ajax({ + type:"post", + url: "Battinf_exAction!serchByCondition", + async:true, + dataType:'json', + data:"json="+JSON.stringify(temp), + success: function(data){ + var model = eval('('+data.result+')'); + //console.log(model); + if(model.code == 1 && model.data.length>0){ + var station = model.data[0]; + //console.info(station); + $('#station_stationid_ex').text(temp.StationId_ex); //绔欑偣id + $('#station_stationname').text(station.stationName); //鏈烘埧鍚嶇О + $('#station_stationid').text(station.stationId); //鏈烘埧鍚嶇О + $('#station_affiliation').text(station.affiliation); //鎵�灞炵粍缁� + $('#station_dataSources').text(station.dataSources); //鏁版嵁鏉ユ簮 + $('#station_stationType').text(station.stationType); //绔欏潃绫诲瀷 + $('#station_jinweidu').text("缁忓害:" + station.longitude+";绾害:"+station.latitude); //缁忕含搴� + $('#station_stationAddr').text(station.stationAddr); //鎵�鍦ㄥ湴鍧� + $('#station_stationstate').text("绔欏潃绛夌骇:"+station.stationLevel+";缁存姢鐘舵��:"+station.maintenanceState+";灏侀攣鐘舵��:"+(station.blockedState==0?'鍚�':'鏄�')); //鏈烘埧鐘舵�� + $('#station_maintenanceCompany').text(station.maintenanceCompany); //缁存姢鍗曚綅 + $('#station_stationscenario').text("涓氬姟鍦烘櫙:"+station.businessScenario+";瑕嗙洊鍦烘櫙:"+station.CoverScenario+";绔欏潃鍦板舰:"+station.siteTerrain); //绔欏潃鍦烘櫙 + $('#station_stationproperty').text("浜ф潈鎬ц川:"+station.propertyRights+";(鍘�)浜ф潈鍗曚綅:"+station.propertyUnit+";鏄惁鍏变韩:"+(station.isShare==1?'鏄�':'鍚�')); //绔欏潃浜ф潈 + $('#station_useUnit').text(station.useUnit); //浣跨敤鍗曚綅 + $('#station_siteCode').text(station.siteCode); //鐗╃悊绔欏潃缂栫爜 + $('#station_historySiteCode').text(station.historySiteCode); //鍘嗗彶鐗╃悊绔欏潃缂栫爜 + $('#station_siteInternalNumber').text(station.siteInternalNumber); //绔欏潃鍐呴儴缂栧彿 + $('#station_sitePinyinReferred').text(station.sitePinyinReferred); //绔欏潃鎷奸煶绠�绉� + $('#station_siteChineseReferred').text(station.siteChineseReferred); //涓枃绠�绉� + $('#station_isOpenBusiness').text(station.isOpenBusiness); //鏄惁寮�閫氫笟鍔� + $('#station_schoolPersonnel').text(station.schoolPersonnel); //褰曞叆浜哄憳 + $('#station_entryTime').text(station.entryTime); //褰曞叆鏃堕棿 + $('#station_modifyPeople').text(station.modifyPeople); //淇敼浜� + $('#station_modifyTime').text(station.modifyTime); //淇敼鏃堕棿 + $('#station_note').text(station.note); //澶囨敞 + $('#station_receiveorvalidity').text("绔欏潃鎺ユ敹鏍囪:"+(station.siteReceivesMark==1?'鏄�':'鍚�')+";鏄惁鏈夋晥:"+(station.siteValidity==1?'鏄�':'鍚�')); //澶囨敞 + $('#station_siteNameCMCC').text(station.siteNameCMCC); //绉诲姩绔欏潃鍚嶇О + $('#station_siteNameCTC').text(station.siteNameCTC); //鑱旈�氱珯鍧�鍚嶇О + $('#station_siteNameCUCC').text(station.siteNameCUCC); //鐢典俊绔欏潃鍚嶇О + $('#station_producer').text(station.producer); //鍝佺墝 + $('#station_lastTimeLong').text(station.lastTimeLong); //缁埅娴嬬畻鏃堕暱 + $('#station_lastTimeType').text(station.lastTimeType); //缁埅娴嬬畻绫诲埆 + $('#station_lastTimeDate').text(station.lastTimeDate); //缁埅鍙戠敓鏃堕棿 + $('#station_shareInfo').text(station.shareInfo); //鍏变韩鎯呭喌 + $('#station_electPower').text("绉诲姩璐拱:"+(station.electPowerCMCC==1?'鏄�':'鍚�')+";鐢典俊璐拱:"+(station.electPowerCTC==1?'鏄�':'鍚�')+";鑱旈�氳喘涔�:"+(station.electPowerCUCC==1?'鏄�':'鍚�')); //鍏变韩鎯呭喌 + $('#station_isCanElectPower').text(station.isCanElectPower==1?'鏄�':'鍚�'); //鏄惁鍏峰鍙戠數鏉′欢 + $('#station_upperStationRoute').text(station.upperStationRoute); //涓婄珯璺▼ + $('#station_upperStationDifficult').text(station.upperStationDifficult); //涓婄珯闅炬槗绋嬪害 + $('#station_clienteleErrorService').text(station.clienteleErrorService); //瀹㈡埛闂搴撴湭瀹屾垚钃勭數姹犵淮淇� + + } + } + }); +} //鏍规嵁num鑾峰彇鏁呴殰绫诲瀷鍜屾晠闅滄帓闄ゆ柟娉� @@ -506,12 +564,13 @@ function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg); - if (r != null) - return unescape(r[2]); + if (r != null) { + return decodeURI(r[2]); + } return null; } -function createEleWarning(num){ +function createEleWarning(num, muted){ //娓呯悊鍛婅妗� $('body').children('#eleWarning').remove(); var __divCon=$('<div id="eleWarning"></div>'); //鍛婅瀹瑰櫒 @@ -528,6 +587,10 @@ var __divContentCon=$('<div class="warning-content"></div>'); //鍛婅鍐呭瀹瑰櫒 /* 鍛婅鐨勯煶棰�*/ var __divAudio=$('<audio autoplay="autoplay"></audio>'); + // 鍒ゆ柇鏄惁闈欓煶 + if(muted) { + __divAudio=$('<audio autoplay="autoplay" muted></audio>'); + } var __divSourceWav=$('<source src="sound/warnings.wav" type="audio/wav" />'); var __divSourceMp3=$('<source src="sound/warnings.mp3" type="audio/mpeg" />'); __divAudio.append(__divSourceWav); @@ -553,16 +616,27 @@ var totalAlm_num=Number.POSITIVE_INFINITY; //鏌ヨ鍛婅鏁� -function searchAlm(){ - //createEleWarning(); +function searchAlm(isShowVoice){ + // 鍒ゆ柇鏄惁鏄剧ず鍙充笅瑙掔殑鍛婅鎻愮ず妗� + if(!isShowVoice) { + self.setTimeout("searchAlm()",10000); + return; + } + // 璇锋眰鍚庡彴鏌ヨ鏈�鏂板嚭鐜扮殑鍛婅涓暟 $.post("Battalarm_dataAction!serchRealTime",null,function(data){ model=eval("("+data.result+")"); if(model.code==1){ - $('#batt_alarm_num').text(model.sum); + $('#batt_alarm_num .num').text(model.sum); if(totalAlm_num<model.sum){ - createEleWarning(model.sum-totalAlm_num); + var voiceStatus = checkPageVoiceStatus(); + createEleWarning(model.sum-totalAlm_num, !voiceStatus); } totalAlm_num=model.sum; + + // 5绉掑悗鍏抽棴闈㈡澘 + setTimeout(function() { + $('body').children('#eleWarning').remove(); + }, 5000); self.setTimeout("searchAlm()",10000); } @@ -1091,52 +1165,6 @@ } } -/** - 妫�娴嬫湇鍔″櫒杩炴帴鏄惁姝e父 - 绋嬪簭鍔熻兘: 閫氳繃璇锋眰鍚庡彴绋嬪簭濡傛灉涓夋閮借姹傚け璐ヨ涓烘湇鍔″櫒鎸傛帀,璺宠浆鍒扮櫥闄嗛〉闈� -*/ -;(function ($) { - var url = window.location.href; - var loginPatt = /\/login.jsp/; - - // 鍒ゆ柇褰撳墠椤甸潰涓嶆槸鐧婚檰椤甸潰寮�濮嬫墽琛屾娴嬫湇鍔″櫒鐘舵�� - if(!loginPatt.test(url)) { - checkServer(); - } - - var linkNum = 0; // 娴嬭瘯鏈嶅姟鍣ㄨ繛鎺ヨ鏁� =3 璺宠浆鍒扮櫥闄嗛〉闈� - function checkServer() { - $.ajax({ - url:'User_infAction!checkService', - type: 'post', - async: true, - success: function(rs) { - linkNum = 0; // 鍒濆鍖栨祴璇曡繛鎺� - setTimeout(checkServer, 200); - }, - error:function() { - // 缃戠粶杩炴帴涓嶆甯� - if(!navigator.onLine) { - linkNum = 0; - setTimeout(checkServer, 200); - }else{ - linkNum++; - // 鏈嶅姟鍣ㄨ繛鎺ヤ笉姝e父 - if(linkNum == 3) { - console.info('鍑虹幇绗�'+linkNum+"娆℃祴璇曟湇鍔″櫒杩炴帴澶辫触锛佽烦杞埌鐧婚檰"); - // 缃戠粶姝e父浣嗘湇鍔″櫒杩炵画澶氭妫�娴嬩笉姝e父璺宠浆鍒扮櫥闄嗛〉闈� - alert('鏈嶅姟鍣ㄨ繍琛屽紓甯革紝璇锋煡鐪嬫湇鍔″櫒鏄惁姝e湪杩愯锛�'); - window.location.replace("login.jsp"); - }else { - console.info('鍑虹幇绗�'+linkNum+"娆℃祴璇曟湇鍔″櫒杩炴帴澶辫触锛�"); - checkServer(); - } - } - } - }); - } -})(jQuery); - /*****************甯哥敤鍒ゆ柇鏁版嵁绫诲瀷*****************/ //鏄惁涓烘暟瀛� @@ -1176,4 +1204,29 @@ // 鍒ゆ柇鏄惁涓哄璞� function isObject(s) { return (typeof s === 'object' && !isArray(s)); +} + +//浣跨敤XMLHttpRequest鐨勬柟寮忚幏鍙栨ā鏉块〉 +function getTpl(url) { + var xmlhttp; // 瀹炰緥鍖朮MLHttpRequest瀵硅薄 + if(window.XMLHttpRequest) { + xmlhttp = new XMLHttpRequest(); + }else { + xmlhttp = new ActiveXObject('Mocrosoft.XMLHTTP'); + } + + // 璁剧疆璇锋眰 + xmlhttp.open('GET', url, false); + + // 鍙戦�佽姹� + xmlhttp.send(); + + var tpl; + if(xmlhttp.readyState == 4 && xmlhttp.status == 200) { + tpl = xmlhttp.responseText; + }else { + tpl = ""; + } + + return tpl; } \ No newline at end of file -- Gitblit v1.9.1