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/Top.jsp | 39 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 38 insertions(+), 1 deletions(-) diff --git a/gx_tieta/WebRoot/Top.jsp b/gx_tieta/WebRoot/Top.jsp index fad10b8..b733db6 100644 --- a/gx_tieta/WebRoot/Top.jsp +++ b/gx_tieta/WebRoot/Top.jsp @@ -193,9 +193,12 @@ <script src="js/dev.js"></script> <script src="js/createTab.js"></script> <script type="text/javascript" src="js/scrollBar.js"></script> + <script type="text/javascript" src="js/VoiceUtil.js"></script> <script type="text/javascript"> $(document).ready(function(){ - setUserName(); + setUserName(); //璁剧疆鐢ㄦ埛鍚嶇О + + searchRecentlyAlarm(); //鏌ヨ鏈�杩�30绉掔殑璁惧鍜岀數姹犲憡璀� var lanuage=$('#top_cont .international .inter_action').attr('value'); $('#top_cont .international a').click(function() { @@ -328,6 +331,9 @@ } }); } + + + $(function(){ $.ajax({ @@ -681,6 +687,37 @@ }); } + + + //鏌ヨ鏈�杩�30鍐呯殑璁惧鍜岀數姹犲憡璀﹀苟鎾姤璇煶 + function searchRecentlyAlarm(){ + $.ajax({ + type: "post", + url: "Battalarm_dataAction!serchIn30", + async:true, + dataType:'json', + data:null, + success: function(data){ + console.info(data); + var model = eval("("+data.result+")"); + console.info(model); + if(model.code == 1){ + var alarm_str = ""; + for(var i=0;i<model.data.length;i++){ + var obj = model.data[i]; + alarm_str += obj.note+";"; + } + voice.play(alarm_str,searchRecentlyAlarm); + }else{ + setTimeout(searchRecentlyAlarm, 5000); + } + }, + error:function() { + setTimeout(searchRecentlyAlarm, 5000); + } + }); + } + // 鏍规嵁鏁版嵁鐢熸垚琛ㄦ牸 function createTblByModel(model) { //console.log(model); -- Gitblit v1.9.1