Sfoglia il codice sorgente

OCPP and OCPi status mapping
https://dev.wormwood.com.sg/zentao/task-view-879.html

wudebin 4 mesi fa
parent
commit
08d26ebcde
1 ha cambiato i file con 15 aggiunte e 1 eliminazioni
  1. 15 1
      Strides-Admin/src/views/charge/Connectors.vue

+ 15 - 1
Strides-Admin/src/views/charge/Connectors.vue

@@ -54,7 +54,8 @@
       v-loading="listLoading"
       :data="connectorList"
       class="no-border"
-      style="width: 100%;min-height: 65vh;">
+      style="width: 100%;min-height: 65vh;"
+      :row-class-name="setRowClass">
       <el-table-column
         label="Station ID"
         prop="sitePk"
@@ -357,6 +358,8 @@ export default {
       this.listLoading = true;
       api.getConnectorListV2(this.filter).then(res => {
         this.listLoading = false;
+        this.total = 0;
+        this.connectorList = []
         if (res.data.totalRow) {
           this.total = res.data.totalRow;
         }
@@ -364,10 +367,18 @@ export default {
           this.connectorList = res.data.records;
         }
       }).catch(err => {
+        this.total = 0;
+        this.connectorList = []
         this.$message.error(err)
         this.listLoading = false;
       })
     },
+    setRowClass({row, rowIndex}) {
+      if (row.ocpiStatus == "INOPERATIVE") {
+        return "highlight-connector-row"
+      }
+      return ""
+    },
     handleCommand(cb, item) {
       this[cb](item)
     },
@@ -534,4 +545,7 @@ export default {
     font-size: 18px;
     align-items: center;
   }
+  .highlight-connector-row {
+    background-color: #fef6d5 !important;
+  }
 </style>