From 1c02e66149af3199dad71e3fb93c36b3f7e871b9 Mon Sep 17 00:00:00 2001 From: LiJun <LiJun@192.168.10.18> Date: 星期二, 30 十月 2018 10:22:22 +0800 Subject: [PATCH] 告警语音播报 --- gx_tieta/WebRoot/js/base.js | 38 ++++++++++++++++++++++++++++++++------ 1 files changed, 32 insertions(+), 6 deletions(-) diff --git a/gx_tieta/WebRoot/js/base.js b/gx_tieta/WebRoot/js/base.js index 6bb8f63..1e6aa81 100644 --- a/gx_tieta/WebRoot/js/base.js +++ b/gx_tieta/WebRoot/js/base.js @@ -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; //鏍囩О瀹归噺 @@ -506,8 +506,9 @@ 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; } @@ -1125,7 +1126,7 @@ if(linkNum == 3) { console.info('鍑虹幇绗�'+linkNum+"娆℃祴璇曟湇鍔″櫒杩炴帴澶辫触锛佽烦杞埌鐧婚檰"); // 缃戠粶姝e父浣嗘湇鍔″櫒杩炵画澶氭妫�娴嬩笉姝e父璺宠浆鍒扮櫥闄嗛〉闈� - alert('鏈嶅姟鍣ㄨ繍琛屽紓甯革紝璇锋煡鐪嬫湇鍔″櫒鏄惁姝e湪杩愯锛�'); + alert('缃戠粶杩炴帴寮傚父锛岃妫�鏌ョ綉缁滆繛鎺ユ槸鍚︽甯革紒'); window.location.replace("login.jsp"); }else { console.info('鍑虹幇绗�'+linkNum+"娆℃祴璇曟湇鍔″櫒杩炴帴澶辫触锛�"); @@ -1176,4 +1177,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