南昌市物联网技防平台-前端
liuyg
2021-04-09 7121b5fcd163f576f5e17c54022dbc23f33d49a5
冲突合并
1 files modified
50 ■■■■■ changed files
src/views/supervisoryConsole/card.vue 50 ●●●●● patch | view | raw | blame | history
src/views/supervisoryConsole/card.vue
@@ -123,6 +123,56 @@
    siteStatus(value, e) {
      console.log(this.radio, value);
    },
    inputSearchBtn() {
      this.getEquipmentLists();
    },
    siteStatus() {
      this.inputSearchValue = "";
      this.getEquipmentLists();
    },
    getEquipmentLists() {
      getList({ deviceName: this.inputSearchValue }).then((res) => {
        var a = [],
          b = [],
          c = [];
        if (this.radio == "全部") {
          res.data.data.forEach((item) => {
            if (item.state != "") a.push(item);
            if (item.state == "" && item.onlineStatus == 1) c.push(item);
            if (item.state == "" && item.onlineStatus != 1) b.push(item);
          });
        } else if (this.radio == "仅显示预警设备") {
          res.data.data.forEach((item) => {
            if (item.jtype == 1) c.push(item);
          });
        } else if (this.radio == "仅显示设备掉线") {
          res.data.data.forEach((item) => {
            if (item.onlineStatus != 1) b.push(item);
          });
        } else if (this.radio == "仅显示设备故障") {
          res.data.data.forEach((item) => {
            if (item.state != "") a.push(item);
          });
        }
        var d = a.concat(c.concat(b));
        d.forEach((item) => {
          this.count.push(item);
        });
        this.option = [];
        for (var i = 0; i <= 24; i++) {
          if (this.count.length > 0) {
            this.option.push(this.count[0]);
            this.count.shift();
          }
        }
        this.inputSearchValue = "";
      });
    },
    goToDetails(data) {
      this.$router.push({ path: "/dataL/dataL", query: data });
    },