yangyin
2024-07-03 941b8118a110e913650798eaa3b9cbc7b0429688
app.js
@@ -23,7 +23,7 @@
  //获取报警记录
  getAllAlarmList() {
    var that=this
    that.cancelTimer()
    // that.cancelTimer()
    Request({
      url: Constant.BASE_SERVER_URL + 'Monitor/Value/Alarm/Record/Std/GetFluzzyPageList@V1.0',
      method: 'GET',
@@ -40,6 +40,7 @@
      }, //请求失败
      success: (res) => {
        var result = res.data
        if(res.statusCode==404){
          wx.showModal({
            title: '',
@@ -56,7 +57,16 @@
          })
          return;
        }
      that.getMonitorDialog()
        // result.Data.Total=1
        if(result.Data.Total==0){
          that.globalData.monitorDataTimeOut=false
          that.startTimer()
          return;
        }
          that.getMonitorDialog()
          that.startTimer()
      }
    })
  },
@@ -72,15 +82,22 @@
          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)
@@ -98,11 +115,7 @@
    wx.navigateTo({
      url: '/other/alarm/index',
    })
      // that.globalData.timer = setInterval(() => {
      //   that.getAllAlarmList()
      // }, 300000)
    this.cancelTimer()
  },
  // 获取当前设备信息
  getDeviceInfo: function (callback) {
@@ -218,6 +231,6 @@
    alarmList: [],
    alarmTotal: 0,
    monitorModalName: false, //是否显示报警提示
    monitorDataRefresh:false
    monitorDataTimeOut:false
  }
})