liuyg
2021-05-09 4f11d6a54ade61ba7daf8ba856014d2f8994badf
src/views/supervisoryConsole/card.vue
@@ -29,8 +29,7 @@
      style="
        margin-top: 10px;
        display: flex;
        justify-content: center;
        align-items: center;
        justify-content: left;
        flex-wrap: wrap;
      "
    >
@@ -41,7 +40,7 @@
        :key="index"
      >
        <a href="javascript:void(0);" @click.stop="goToDetails(item)">
          <el-card
          <!-- <el-card
            :style="
              item.jtype == 1
                ? 'background: #F34A4Ae6'
@@ -51,19 +50,46 @@
                  : 'background: #C9C9C9e6'
                : 'background: #F48F57e6'
            "
          > -->
          <el-card
            :style="
              item.dtype == 0
                ? 'background: #C9C9C9e6'
                : item.dtype == 1
                ? 'background: #1DBB99e6'
                : item.dtype == 2
                ? 'background: #F34A4Ae6'
                : item.dtype == 3
                ? 'background: #F48F57e6'
                : ''
            "
          >
            <div>{{ item.deviceName }}</div>
            <div>{{ item.street }}</div>
            <div style="width: 80%">{{ item.street }}</div>
            <div class="cet">
            <!-- <div class="cet">
              {{
                item.jtype == 1
                  ? "设备预警"
                  : item.state == ""
                  ? item.onlineStatus == 1
                    ? "设备在线"
                    ? "设备正常"
                    : "设备掉线"
                  : "设备故障"
              }}
            </div> -->
            <div class="cet">
              {{
                item.dtype == 0
                  ? "设备掉线"
                  : item.dtype == 1
                  ? "设备正常"
                  : item.dtype == 2
                  ? "设备预警"
                  : item.dtype == 3
                  ? "设备故障"
                  : ""
              }}
            </div>
@@ -130,9 +156,7 @@
        this.loading = false;
      }, 2000);
    },
    siteStatus(value, e) {
      console.log(this.radio, value);
    },
    inputSearchBtn() {
      this.getEquipmentLists();
    },
@@ -150,31 +174,50 @@
          f = [];
        if (this.radio == "全部") {
          res.data.data.forEach((item) => {
            if (item.jtype == 1) {
            if (item.dtype == 2) {
              f.push(item);
            } else {
              if (item.state != "") a.push(item);
              if (item.state == "" && item.onlineStatus == 1) c.push(item);
              if (item.state == "" && item.onlineStatus != 1) b.push(item);
              if (item.dtype == 3) a.push(item);
              if (item.dtype == 1) c.push(item);
              if (item.dtype == 0) b.push(item);
            }
          });
        } else if (this.radio == "仅显示预警设备") {
          res.data.data.forEach((item) => {
            if (item.jtype == 1) c.push(item);
            if (item.dtype == 2) c.push(item);
          });
        } else if (this.radio == "仅显示设备掉线") {
          res.data.data.forEach((item) => {
            if (item.jtype == 1 && item.onlineStatus != 1) {
              f.push(item);
            } else {
              if (item.onlineStatus != 1) b.push(item);
            }
            if (item.dtype == 0) b.push(item);
          });
        } else if (this.radio == "仅显示设备故障") {
          res.data.data.forEach((item) => {
            if (item.state != "") a.push(item);
            if (item.dtype == 3) a.push(item);
          });
        }
        //  if (this.radio == "全部") {
        //   res.data.data.forEach((item) => {
        //     if (item.jtype == 1) {
        //       f.push(item);
        //     } else {
        //       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 = f.concat(a.concat(c.concat(b)));
@@ -286,8 +329,7 @@
  height: 172px !important;
  box-sizing: border-box;
  margin-bottom: 20px !important;
  min-width: 368px;
  max-width: 370px;
  width: 20% !important;
  a {
    width: 100%;
    height: 100%;
@@ -337,4 +379,4 @@
    }
  }
}
</style>
</style>