| | |
| | | //获取报警记录 |
| | | getAllAlarmList() { |
| | | var that=this |
| | | that.cancelTimer() |
| | | // that.cancelTimer() |
| | | Request({ |
| | | url: Constant.BASE_SERVER_URL + 'Monitor/Value/Alarm/Record/Std/GetFluzzyPageList@V1.0', |
| | | method: 'GET', |
| | |
| | | }, //请求失败 |
| | | success: (res) => { |
| | | var result = res.data |
| | | |
| | | if(res.statusCode==404){ |
| | | wx.showModal({ |
| | | title: '', |
| | |
| | | }) |
| | | return; |
| | | } |
| | | that.getMonitorDialog() |
| | | // result.Data.Total=1 |
| | | if(result.Data.Total==0){ |
| | | that.globalData.monitorDataTimeOut=false |
| | | that.startTimer() |
| | | return; |
| | | } |
| | | |
| | | that.getMonitorDialog() |
| | | that.startTimer() |
| | | |
| | | } |
| | | }) |
| | | }, |
| | |
| | | that.workMonitorSure() |
| | | that.globalData.monitorModalName=false |
| | | } else { |
| | | that.startTimer() |
| | | that.globalData.monitorModalName=false |
| | | that.startTimer() |
| | | } |
| | | } |
| | | }) |
| | | that.globalData.monitorModalName=true |
| | | that.globalData.monitorDataTimeOut=true |
| | | that.cancelTimer() |
| | | }, |
| | | onReset(){ |
| | | this.globalData.monitorDataTimeOut=false |
| | | }, |
| | | startTimer() { |
| | | var that=this |
| | | that.cancelTimer() |
| | | if(that.globalData.monitorDataTimeOut) return |
| | | that.globalData.timer = setInterval(() => { |
| | | that.getAllAlarmList() |
| | | },300000) |
| | |
| | | wx.navigateTo({ |
| | | url: '/other/alarm/index', |
| | | }) |
| | | // that.globalData.timer = setInterval(() => { |
| | | // that.getAllAlarmList() |
| | | // }, 300000) |
| | | |
| | | |
| | | this.cancelTimer() |
| | | }, |
| | | // 获取当前设备信息 |
| | | getDeviceInfo: function (callback) { |
| | |
| | | alarmList: [], |
| | | alarmTotal: 0, |
| | | monitorModalName: false, //是否显示报警提示 |
| | | monitorDataRefresh:false |
| | | monitorDataTimeOut:false |
| | | } |
| | | }) |