whycwx
2020-10-10 fb34903f45b0254367036e28aab9ac8b3e63456d
优化查询功能
2个文件已修改
89 ■■■■■ 已修改文件
src/pages/alarmMager/deviceHistoryquery.vue 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/alarmMager/deviceTimequery.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/alarmMager/deviceHistoryquery.vue
@@ -20,7 +20,7 @@
        </div>
        <div class="table-cell text-right">机房名称:</div>
        <div class="table-cell">
            <el-select v-model="selectValue2" :placeholder="selectPlace2" class="rooms" @change="sesston">
            <el-select v-model="selectValue2"  class="rooms" @change="alramData">
              <el-option
                  v-for="item in opt"
                  :key="item.value"
@@ -251,7 +251,7 @@
      }
    },
    /* 机房站点 */
    async sesston() {
    async sesston(status) {
      const newss = await deviserchSeions({ UNote: this.selectValue1 });
      let opt = JSON.parse(newss.data.result).data.map(item => {
        return { label: item, value: item };
@@ -262,12 +262,14 @@
      });
      this.opt = opt;
      this.selectPlace2 = `全部(共${opt.length}种)`;
      this.alramData();
      if(status == 1){
        this.alramData();
      }
    },
    /*查询设备历史告警记录 */
    async alramData() {
   alramData:function() {
       let loading = this.$layer.loading(1);
      const alramaa = await deviceRecord({
       deviceRecord({
        
        binf: {
          StationName: this.selectValue2,
@@ -279,34 +281,43 @@
          pageCurr: this.queryInfo.pageCurr,
          pageSize: this.queryInfo.pagesize
        }
      }).then((res)=>{
        this.$layer.close(loading);
        let alramaa = res;
            if(alramaa.data.result && JSON.parse(alramaa.data.result).code == 1){
              const newAlrams = JSON.parse(alramaa.data.result).data;
              this.total = newAlrams[newAlrams.length - 1].usr_id;
              const oldSalrams = newAlrams.map((item, index) => {
                item.index = index + 1;
                return {
                  room1: item.index,
                  battery1: item.dev_id,
                  tes1: item.dev_name,
                  tester1: item.dev_ip,
                  sessdion1: item.stationName,
                  monomer1: item.alm_confirmed_time,
                  start1: item.alm_start_time,
                  end1: item.alm_end_time,
                  num: item.num,
                  alm_is_confirmed:item.alm_is_confirmed,
                  alm_level:item.alm_level,
                  alm_type:item.alm_type,
                  alm_value:item.alm_value
                };
              });
              this.table.datas = oldSalrams;
          }else{
            this.table.datas = [];
            this.total = 0;
          }
      }).catch((err)=>{
          this.$layer.close(loading);
          this.table.datas = [];
          this.total = 0;
      });
      this.$layer.close(loading);
      this.table.datas = [];
      this.total = 0;
      if(alramaa.data.result && JSON.parse(alramaa.data.result).code == 1){
          const newAlrams = JSON.parse(alramaa.data.result).data;
          this.total = newAlrams[newAlrams.length - 1].usr_id;
          const oldSalrams = newAlrams.map((item, index) => {
            item.index = index + 1;
            return {
              room1: item.index,
              battery1: item.dev_id,
              tes1: item.dev_name,
              tester1: item.dev_ip,
              sessdion1: item.stationName,
              monomer1: item.alm_confirmed_time,
              start1: item.alm_start_time,
              end1: item.alm_end_time,
              num: item.num,
              alm_is_confirmed:item.alm_is_confirmed,
              alm_level:item.alm_level,
              alm_type:item.alm_type,
              alm_value:item.alm_value
            };
          });
          this.table.datas = oldSalrams;
      }
      
    },
    /*  删除 */
@@ -336,11 +347,10 @@
      this.$message.success("删除成功");
      this.alramData();
    },
    //selectValue1改变事件
    //维护区改变事件
    changeSelect1() {
      this.selectValue2 = '';
      this.deviceList();
      this.sesston();
      this.sesston(1);
    },
    /* 显示条数改变时 */
    handleSizeChange(val) {
src/pages/alarmMager/deviceTimequery.vue
@@ -20,7 +20,7 @@
          </div>
          <div class="table-cell text-right">机房名称:</div>
          <div class="table-cell">
              <el-select v-model="selectValue2" :placeholder="selectPlace2" class="rooms">
              <el-select v-model="selectValue2" @change="alarmDev" class="rooms">
                <el-option
                    v-for="item in sesionsNews"
                    :key="item.value"
@@ -293,7 +293,7 @@
      }
    },
    /* 机房名称  */
    async deviceName() {
    async deviceName(status) {
      const newDevicess = await deviceSeions({ UNote: this.selectValue1 });
      if (
        newDevicess.data.result &&
@@ -308,8 +308,10 @@
        });
        this.sesionsNews = sesionsNews;
        this.selectPlace2 = `全部(共${sesionsNews.length}种)`;
        if(status == 1){
          this.alarmDev();
        }
      }
      this.alarmDev();
    },
    /* 告警信息 */
    async alarmDev() {
@@ -451,7 +453,8 @@
    //维护区改变
    changeSelect1() {
      this.selectValue2 = '';
      this.deviceName();
      this.deviceName(1);
    },
    // 显示条数
    handleSizeChange(val) {