From b921db470a289d3a5bdf2db8d60e6e5e6b4b5973 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Mon, 10 May 2021 14:55:28 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/jfpt-Vue

---
 src/views/system/cs.vue |   44 +++++++++++++++++++++++++++-----------------
 1 files changed, 27 insertions(+), 17 deletions(-)

diff --git a/src/views/system/cs.vue b/src/views/system/cs.vue
index 15c292f..6949ebe 100644
--- a/src/views/system/cs.vue
+++ b/src/views/system/cs.vue
@@ -177,7 +177,7 @@
       datas: [], //cc
       loadings: true, //等待
       querys: {}, //搜索
-      isEdit:false,
+      isEdit: false,
       pages: {
         pageSize: 10,
         currentPage: 1,
@@ -728,7 +728,7 @@
       // form是表单或者表格绑定的数据集,v-model='form'
       handler(val) {
         if (val) {
-          if(that.isEdit){
+          if (that.isEdit) {
             getDetail(this.form.id).then((res) => {
               this.form = res.data.data;
               this.form.wd = val.latitude;
@@ -905,7 +905,7 @@
     },
     beforeOpen(done, type) {
       if (["edit"].includes(type)) {
-        that.isEdit=true;
+        that.isEdit = true;
         getDetail(this.form.id).then((res) => {
           if (this.form.type == "1") {
             const data = res.data.data;
@@ -1000,7 +1000,7 @@
       }
 
       if (["edit"].includes(type)) {
-        that.isEdit=false;        
+        that.isEdit = false;
       }
       done();
     },
@@ -1154,19 +1154,29 @@
       if (dat.length > 0) {
         for (var key in dat) {
           let states;
-          if (dat[key].state != "") {
-            states = "故障";
-          } else {
-            if (dat[key].jtype != 1) {
-              if (dat[key].onlineStatus == 1) {
-                states = "在线";
-              } else {
-                states = "掉线";
-              }
-            } else {
-              states = "预警";
-            }
-          }
+          // if (dat[key].state != "") {
+          //   states = "故障";
+          // } else {
+          //   if (dat[key].jtype != 1) {
+          //     if (dat[key].onlineStatus == 1) {
+          //       states = "在线";
+          //     } else {
+          //       states = "掉线";
+          //     }
+          //   } else {
+          //     states = "预警";
+          //   }
+          // }
+          states =
+            dat[key].dtype == 0
+              ? "掉线"
+              : dat[key].dtype == 1
+              ? "正常"
+              : dat[key].dtype == 2
+              ? "预警"
+              : dat[key].dtype == 3
+              ? "故障"
+              : "";
           // console.log(states);
           dat[key].states = states;
           dat[key].stateSevicestate =

--
Gitblit v1.9.3