io.sails.autoConnect = false; io.sails.url="http://"+alarmServiceIP+":"+alarmServicePort+""; socketio = io.sails.connect(); var alarmInfoDialog; var alarmData=new Array(); var alarmLevelDic={}; var alarmLevelDicName={}; getAlarmLevels(); function getAlarmLevels(){ var reqData = {"method":"GetLevels","param":{}}; var eventName = "/alarm/doservice"; var dataTypes=[]; dataTypes.push("*"); socketio.post(eventName,reqData,function(data){ if(data.success="true"){ var DataType=data.data.data; for(var i=0;i

"+tagName+"

" + currentAlarmDesc + "

"; var alarmDialogConfigObj = { title: "报警", titleAlign: "left", titleBackground:'rgb(12,77,85)', position:alarmDialogPosition, closable: true, draggable: true, contentPadding: 5, width: 250, height: 200, content: content, buttons: [{ label: "<<" }, { label: "<" }, { label: "第" + (curAlarmIndex+1)+ "/" + curAlarmCount + "页" }, { label: ">" }, { label: ">>" }, { label: "确认", className: "button-yes" } ], buttonsAlign: "center", action: function (item, e) { if (item["label"] == "<") { if (curAlarmIndex == 0) { return; }else{ curAlarmIndex=curAlarmIndex-1; } } if (item["label"] == "<<") { if (curAlarmIndex == 0) { return;} curAlarmIndex = 0; } if (item["label"] == ">") { // curAlarmIndex = curAlarmIndex + 1 if (curAlarmIndex !=curAlarmCount-1) { curAlarmIndex = curAlarmIndex + 1 //return; } } if (item["label"] == ">>") { curAlarmIndex = curAlarmCount-1; } if (item["label"] == "确认") { data.removeArr(curAlarmIndex); curAlarmIndex=curAlarmIndex-1; var EnsureUser = currentData.ensure_info; var Ensuretag = currentData.tag_name; tagobj = { "tag_name": Ensuretag, "ensure_info": EnsureUser }; ensureAlarm([tagobj]); if(data.length<=0){ alarmInfoDialog.hide(); // getRealAlarmInfos(realdataModelReal,tablePaneReal,pageinputReal.value,rowssizeReal.getValue(),pageCountReal,dataAreaNameReal,alarmGroupValueReal,alarmLevelValueReal); return; } else { if (curAlarmIndex >= curAlarmCount) { curAlarmIndex = curAlarmCount; } } } AlarmInfoShow(data,curAlarmIndex); } } var tabViewConfig = [ { name: 'scada', view: content, selected: true } ] if (typeof (alarmInfoDialog) == "undefined"){ // alarmInfoDialog = new ht.widget.Dialog(); alarmInfoDialog = createDialogWithTabView(alarmDialogConfigObj, tabViewConfig); } // alarmInfoDialog.setConfig(alarmDialogConfigObj); alarmInfoDialog.setModal(false); if(alarmInfoDialog.isShowing()){ //alarmInfoDialog.hide(); }else{ alarmInfoDialog.show(); } getAlarmSound(data); } //获取报警铃声 function getAlarmSound(data){ var minlevel=1000; var alarmInfos=data; var wavfilename=""; for(var i=0;i