yangyin
2024-07-03 941b8118a110e913650798eaa3b9cbc7b0429688
开启报警列表定时器
已修改5个文件
259 ■■■■■ 文件已修改
app.js 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
other/alarm/index.js 75 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
other/alarm/index.wxml 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
other/alarm/index.wxss 124 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/constant.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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
  }
})
other/alarm/index.js
@@ -30,11 +30,10 @@
    listFinish: [],
    bottomStatus: false, //是否到底部
    scrollTop: 0,
    alarmTypeList: [
      {
    alarmTypeList: [{
        ID: 0,
        Name: '/'
      },{
      }, {
        ID: 1,
        Name: '越上限'
      },
@@ -84,7 +83,7 @@
  },
  getAlarmList() {
    this.isLoading = true
    Request({
      url: Constant.BASE_SERVER_URL + 'Monitor/Value/Alarm/Record/Std/GetFluzzyPageList@V1.0',
      method: 'GET',
@@ -96,7 +95,6 @@
        PageSize: this.data.PageSize,
      },
      success: (res) => {
        this.isLoading = false
        var result = res.data
        if (result.Code != 0) {
          wx.showModal({
@@ -118,29 +116,34 @@
          })
          return
        }
        var listFinish = [];
        result.Data.List.forEach(item => {
          listFinish.push(item)
        })
        if (this.data.PageIndex * this.data.PageSize > result.Data.Total) {
        if (result.Data.List == null) {
          this.setData({
            bottomStatus: true,
            listFinish: this.data.listFinish.concat(listFinish),
            alarmList: result.Data.List,
            alarmTotal: result.Data.Total
            bottomStatus: true
          })
          return
        }
        var pageIndex = this.data.PageIndex
        // console.log(pageIndex,107)
        this.setData({
          listFinish: this.data.listFinish.concat(listFinish),
          alarmList: result.Data.List,
          alarmTotal: result.Data.Total,
          PageIndex: pageIndex++
        });
        let pageIndex = this.data.PageIndex
        let oldListFinish = this.data.listFinish
        var listFinish = result.Data.List
        if (oldListFinish.length < result.Data.Total) {
          oldListFinish = oldListFinish.concat(listFinish)
          this.setData({
            listFinish: oldListFinish,
            alarmList: oldListFinish,
            alarmTotal: result.Data.Total,
            PageIndex: ++pageIndex
          });
        }
        if (oldListFinish.length == result.Data.Total) {
          this.setData({
            listFinish: oldListFinish,
            alarmList: oldListFinish,
            bottomStatus: true,
          })
          return;
        }
      },
      fail: (err) => {
        if (res.errMsg == 'request:fail timeout') {
@@ -242,7 +245,7 @@
      batchStartAlarmDate: e.detail.value,
    });
  },
    //批量处理结束时间
  //批量处理结束时间
  changeBatchDateEnd(e) {
    this.setData({
      batchEndAlarmDate: e.detail.value,
@@ -305,8 +308,8 @@
  //批量处理删除操作
  submitBatchFormValue() {
    let param = {
      AlarmType: this.data.alarmTypeValue,
      AlarmLevel: this.data.alarmLevelValue,
      AlarmType: this.data.alarmTypeValue ? this.data.alarmTypeValue : null,
      AlarmLevel: this.data.alarmLevelValue ? this.data.alarmLevelValue : null,
      FromAlarmStatus: 0,
      ToAlarmStatus: 1,
      StartTime: this.data.batchStartAlarmDate,
@@ -323,6 +326,7 @@
            title: '处理成功',
            duration: 2000
          })
          this.hideModal()
          this.getAlarmList()
        }
      }
@@ -332,6 +336,7 @@
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    app.onReset()
    app.startTimer()
  },
@@ -346,13 +351,15 @@
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
    if (this.data.PageIndex < this.data.alarmTotal) { //如果当前页小于总页数,则获取下一页数据
      this.setData({
        scrollTop: 0,
        PageIndex: this.data.PageIndex + 1
      }) //下一页
      this.getAlarmList();
    }
    // if (this.data.PageIndex < this.data.alarmTotal) { //如果当前页小于总页数,则获取下一页数据
    //   this.setData({
    //     scrollTop: 0,
    //     PageIndex: this.data.PageIndex + 1
    //   }) //下一页
    // }
    if (this.data.bottomStatus) return
    this.getAlarmList();
    //切换页面时调用API
  },
other/alarm/index.wxml
@@ -29,10 +29,8 @@
    </view>
    </view>
<scroll-view class="warp_scroll" scroll-y scroll-top="{{scrollTop}}" bindscrolltolower="onReachBottom">
  <view class="list" wx:for="{{alarmList}}" wx:for-item="alarm_item" wx:for-index="node_index" wx:key="node_index">
    <view>
      <block>
        <view class="block_list" style="height:130rpx;" data-meter-name="{{alarm_item.Name}}" data-meter_node_id="{{alarm_item.ID}}">
  <view class="list" >
        <view class="block_list"  data-meter-name="{{alarm_item.Name}}" data-meter_node_id="{{alarm_item.ID}}" wx:for="{{listFinish}}" wx:for-item="alarm_item" wx:for-index="node_index" wx:key="node_index">
          <view class="block_list_center">
            <view class="beng_name" style="justify-content: space-between; align-items: center;">
              <view class="text-blue light" style="margin-right:20rpx;font-size:22rpx;">
@@ -46,13 +44,20 @@
              <view>{{alarm_item.Content}}</view>
            </view>
          </view>
        </view>
      </block>
    </view>
</view>
</scroll-view>
<!-- <view class="paging">
        <view class="page_btn">
          <view wx:if="{{frontPage}}" bindtap="clickFront">上一页</view>
        </view>
        <view class="page_num">第{{thisPages}}页 共{{pages}}页</view>
        <view class="page_btn">
          <view wx:if="{{nextPage}}" bindtap="clickNext">下一页</view>
        </view>
      </view> -->
<icon class="setIcon_pos iconfont icon-wancheng2" bindtap="showModalInput"></icon>
<!--弹窗-->
<view class="modal-mask" bindtap="hideModal" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view>
other/alarm/index.wxss
@@ -7,7 +7,7 @@
}
.hovers {
  background-color: 16b5cb;
  background-color: #16b5cb;
}
.tab {
@@ -39,9 +39,9 @@
  border: 0;
}
.list:hover {
/* .list:hover {
  background-color: #16b5cb;
}
} */
.list {
  position: relative;
@@ -141,6 +141,7 @@
  width: 100%;
  min-height: 20px;
  font-size: 25rpx;
  border-bottom: 1px solid #efefef;
  justify-content: space-between;
}
@@ -152,27 +153,37 @@
  color: #16b5cb;
  justify-content: center;
}
.view_header{
.view_header {
  position: absolute;
  top: 0px;
  left: 0px;
  width: 100%;
overflow: hidden;
  overflow: hidden;
}
.view_header,.jilu,.daoxu,.daoxu>icon{
.view_header,
.jilu,
.daoxu,
.daoxu>icon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative
}
.sortText,.jilu,.daoxu{
.sortText,
.jilu,
.daoxu {
  padding: 5rpx;
 font-size: 25rpx;
  font-size: 25rpx;
}
.block_list_center {
  width: 100%;
}
.setIcon_pos{
.setIcon_pos {
  position: fixed;
  width: 80rpx;
  height: 80rpx;
@@ -181,6 +192,7 @@
  font-size: 80rpx !important;
  color: #16b5cb;
}
.modal-mask {
  width: 100%;
  height: 100%;
@@ -257,20 +269,23 @@
  text-align: center;
  border-right: 1px solid #dedede;
}
.btn-confirm {
  width: 50%;
  color: #16b5cb;
  text-align: center;
}
.monitor_des{
.monitor_des {
  font-size: 26rpx;
}
.station_status {
  position: absolute;
  bottom: 10rpx;
  left: 10rpx;
  padding: 20rpx;
  color: #16b5cb;
}
@@ -309,12 +324,15 @@
.block_list_url>view>icon {
  margin-right: 5rpx;
}
.warp_scroll{
.warp_scroll {
  width: 100%;
  /* min-height:92vh;  */
  margin:3px auto;
  height: calc(100vh - 50rpx);
  margin: 3px auto;
  background: #fff;
}
/* .block_list_url>view:nth-child(1){
  background-color: #16b5cb;
}
@@ -324,28 +342,33 @@
.block_list_url>view:nth-child(3){
  background-color: #2fc598;
} */
.screen{
.screen {
  width: 100vw;
  background: #fff;
  flex-wrap: wrap;
  align-items: center;
  font-size: 30rpx;
}
.screen>.screen_li{
.screen>.screen_li {
  width: 100vm;
  min-height: 70rpx;
  border-top: 1px solid #f4f4f4;
}
.screen>.screen_li:nth-child(1){
.screen>.screen_li:nth-child(1) {
  border-top: 0px;
}
.screen_li_left{
.screen_li_left {
  width: 20vw;
  height: 100%;
  justify-content: flex-end;
  padding: 20rpx 0;
}
.screen_li_left>.iconfont{
.screen_li_left>.iconfont {
  width: 50rpx;
  height: 50rpx;
  font-size: 30rpx;
@@ -355,25 +378,29 @@
  align-items: center;
  justify-content: center;
}
.screen_batch_li_right{
.screen_batch_li_right {
  width: 50vw;
  height: 100%;
  justify-content:flex-start;
  justify-content: flex-start;
  color: #16b5cb;
  padding: 0rpx 20rpx;
}
.screen_li_right{
.screen_li_right {
  width: 80vw;
  height: 100%;
  justify-content:flex-start;
  justify-content: flex-start;
  color: #bebebe;
  padding: 0rpx 20rpx;
}
.screen_li_right>.applicant{
.screen_li_right>.applicant {
  width: 100%;
  height: 100%;
}
.applicant>.applicant_btn{
.applicant>.applicant_btn {
  min-width: 100rpx;
  padding: 10rpx;
  /* background-color: #07b5e0; */
@@ -381,41 +408,72 @@
  justify-content: center;
  border-radius: 5px;
}
.pick-view__group {
  width: 96%;
  height: 70rpx;
}
.picker-item {
  line-height: 70rpx;
  margin-left: 5rpx;
  margin-right: 5rpx;
  text-align: center;
}
.screen_li_right>picker{
.screen_li_right>picker {
  padding: 10rpx;
  border-radius: 5px;
  color: #16b5cb;
}
.screen_li_right>.screen_li_right_cen{
.screen_li_right>.screen_li_right_cen {
  margin: 5rpx 20px;
  display: flex;
  align-items: center;
}
.screen_li_right>.screen_li_right_cen2{
.screen_li_right>.screen_li_right_cen2 {
  margin: 5rpx 5rpx;
  display: flex;
  align-items: center;
}
.screen_btn,
.screen,.screen_li_right>.applicant,.applicant>.applicant_btn,
.screen>.screen_li,.screen_li_left,.screen_li_right{
.screen,
.screen_li_right>.applicant,
.applicant>.applicant_btn,
.screen>.screen_li,
.screen_li_left,
.screen_li_right {
  display: flex;
  align-items: center;
}
.paging {
  width: 580rpx;
  height: 58rpx;
  display: flex;
  margin: 30rpx auto;
  align-items: center;
}
.page_btn {
  width: 96rpx;
  height: 32rpx;
  font-size: 32rpx;
  font-family: "PingFangSC";
  color: #000;
  line-height: 36rpx;
  float: left;
  margin: auto 23rpx;
}
.page_num {
  font-size: 24rpx;
  font-family: "PingFangSC";
  color: #000;
  line-height: 36rpx;
  float: left;
  margin: auto 75rpx;
}
utils/constant.js
@@ -1,8 +1,8 @@
//url相关
var BASE_SERVER_URL_OLD = "https://api.beng35.com/"; //老版域名
// let BASE_SERVER_URL = "https://api2.beng35.com/szjt/"; //新版域名
let BASE_SERVER_URL = "http://58.211.30.42:9091/"  //2024-6-13的新版域名
var BASE_AUTH_URL = "https://api2.beng35.com/auth/" //金庭新版域名
//var BASE_SERVER_URL_OLD = "https://api.beng35.com/"; //老版域名
let BASE_SERVER_URL = "https://szjt.beng35.com/webApi/"; //新版域名
//let BASE_SERVER_URL = "http://58.211.30.42:9091/"  //2024-6-13的新版域名
var BASE_AUTH_URL = "https://szjt.beng35.com/authApi/" //金庭新版域名
var YING_SHI_URL = "https://open.ys7.com/";
var MiniProgram_Name = "WeChartMiniProgram_IStation";
var TencenteMapKey = "GFDBZ-D3NKX-LNL4Z-TSWGU-RYCE3-4HB3I";