南昌市物联网技防平台-前端
liuyg
2021-04-29 fa6fde084a3f6bd75e792c9ecfeda1ef683e7307
src/views/system/cs.vue
@@ -112,6 +112,22 @@
          @current-change="currentChanges"
          @size-change="sizeChanges"
        >
          <template slot="states" slot-scope="scope">
            <el-tag
              :class="[
                scope.row.states == '掉线'
                  ? 'diaoxianl'
                  : scope.row.states == '在线'
                  ? 'zaixianl'
                  : scope.row.states == '故障'
                  ? 'guzhagnl'
                  : scope.row.states == '预警'
                  ? 'baojinl'
                  : '',
              ]"
              >{{ scope.row.states }}</el-tag
            >
          </template>
        </avue-crud>
      </div>
    </el-dialog>
@@ -233,6 +249,8 @@
            label: "设备状态",
            prop: "states",
            width: 90,
            slot: true,
            // className: "cityClass1",
          },
        ],
      },
@@ -1124,6 +1142,7 @@
    },
    changeDataOpen(dat) {
      //处理弹出框数据
      console.log(dat);
      if (dat.length > 0) {
        for (var key in dat) {
          let states;
@@ -1230,7 +1249,6 @@
          this.loadings = false;
        }
      );
    },
  },
  mounted() {},
@@ -1404,4 +1422,24 @@
    overflow: auto;
  }
}
.diaoxianl {
  border: 1px solid #fff;
  color: #fff;
  background-color: #cdcdcd;
}
.zaixianl {
  border: 1px solid #fff;
  color: #fff;
  background-color: #32c1a2;
}
.guzhagnl {
  border: 1px solid #fff;
  color: #fff;
  background-color: #f49966;
}
.baojinl {
  border: 1px solid #fff;
  color: #fff;
  background-color: #f35b5b;
}
</style>