| | |
| | | this.globalData.userInfo = null; |
| | | } |
| | | }, |
| | | |
| | | |
| | | //获取报警记录 |
| | | getAllAlarmList() { |
| | | var that=this |
| | | var that = this |
| | | // that.cancelTimer() |
| | | Request({ |
| | | url: Constant.BASE_SERVER_URL + 'Monitor/Value/Alarm/Record/Std/GetFluzzyPageList@V1.0', |
| | |
| | | }, //请求失败 |
| | | success: (res) => { |
| | | var result = res.data |
| | | |
| | | if(res.statusCode==404){ |
| | | if (res.statusCode == 404) { |
| | | wx.showModal({ |
| | | title: '', |
| | | content: '通讯失败', |
| | | }) |
| | | that.globalData.alarmTotal=0 |
| | | that.globalData.alarmTotal = 0 |
| | | return |
| | | } |
| | | if (result.Code != 0) { |
| | |
| | | return; |
| | | } |
| | | // result.Data.Total=1 |
| | | if(result.Data.Total==0){ |
| | | that.globalData.monitorDataTimeOut=false |
| | | that.startTimer() |
| | | if (result.Data.Total == 0) { |
| | | that.globalData.monitorDataTimeOut = false |
| | | that.startTimer() |
| | | return; |
| | | } |
| | | that.getMonitorDialog() |
| | | that.startTimer() |
| | | |
| | | that.getMonitorDialog() |
| | | that.startTimer() |
| | | |
| | | } |
| | | }) |
| | | }, |
| | | //初始化时打开报警消息通知弹窗 |
| | | getMonitorDialog(){ |
| | | var that=this |
| | | if(that.globalData.monitorModalName) return |
| | | wx.showModal({ |
| | | title: '消息报警', |
| | | content: '您有新的报警消息需要处理,点击前往报警处理查看', |
| | | getMonitorDialog() { |
| | | var that = this |
| | | if (that.globalData.monitorModalName) return |
| | | wx.showModal({ |
| | | title: '消息报警', |
| | | content: '您有新的报警消息需要处理,点击前往报警处理查看', |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | that.workMonitorSure() |
| | | that.globalData.monitorModalName=false |
| | | that.globalData.monitorModalName = true |
| | | that.globalData.monitorDataTimeOut = true |
| | | } else { |
| | | that.globalData.monitorModalName=false |
| | | that.globalData.monitorModalName = false |
| | | that.globalData.monitorDataTimeOut = false |
| | | that.startTimer() |
| | | } |
| | | } |
| | | }) |
| | | that.globalData.monitorModalName=true |
| | | that.globalData.monitorDataTimeOut=true |
| | | that.globalData.monitorModalName = true |
| | | that.globalData.monitorDataTimeOut = true |
| | | that.cancelTimer() |
| | | }, |
| | | onReset(){ |
| | | this.globalData.monitorDataTimeOut=false |
| | | onStartAlarm(){ |
| | | this.globalData.monitorDataTimeOut = false |
| | | this.globalData.monitorModalName = false |
| | | this.startTimer() |
| | | }, |
| | | onReset() { |
| | | this.globalData.monitorDataTimeOut = true |
| | | this.cancelTimer() |
| | | }, |
| | | startTimer() { |
| | | var that=this |
| | | that.cancelTimer() |
| | | if(that.globalData.monitorDataTimeOut) return |
| | | that.globalData.timer = setInterval(() => { |
| | | var that = this |
| | | that.cancelTimer() |
| | | if (that.globalData.monitorDataTimeOut) return |
| | | that.globalData.timer = setInterval(() => { |
| | | console.log(102) |
| | | that.getAllAlarmList() |
| | | },300000) |
| | | }, 3000) |
| | | }, |
| | | cancelTimer () { |
| | | cancelTimer() { |
| | | var that = this; |
| | | // 取消定时器 |
| | | if (that.globalData.timer) { |
| | |
| | | alarmList: [], |
| | | alarmTotal: 0, |
| | | monitorModalName: false, //是否显示报警提示 |
| | | monitorDataTimeOut:false |
| | | monitorDataTimeOut: false, |
| | | mockData: [] |
| | | } |
| | | }) |