From 994e5e08cba4e6b9ce321b7cf5cb1ec8d19dfa22 Mon Sep 17 00:00:00 2001
From: ZZJ <zzjdsg2300@163.com>
Date: 星期二, 12 四月 2022 17:50:21 +0800
Subject: [PATCH] 摄像机管理

---
 src/views/equipmentManagement/equipmentList/components/FormList.vue |  101 ++++++++++++++++++++++++--------------------------
 1 files changed, 48 insertions(+), 53 deletions(-)

diff --git a/src/views/equipmentManagement/equipmentList/components/FormList.vue b/src/views/equipmentManagement/equipmentList/components/FormList.vue
index 347be27..2185910 100644
--- a/src/views/equipmentManagement/equipmentList/components/FormList.vue
+++ b/src/views/equipmentManagement/equipmentList/components/FormList.vue
@@ -114,14 +114,14 @@
         <el-table-column label="鎿嶄綔" min-width="180">
           <template slot-scope="scope">
             <!-- 鍔犲叆 -->
-            <span class="iconfont option" @click="joinCluster(scope.row)"
+            <span
+              class="iconfont option"
+              @click="joinCluster(scope.row)"
+              v-if="scope.row.clusterId"
               >&#xe640;</span
             >
             <!-- 閫�鍑� -->
-            <span
-              class="iconfont option"
-              @click="quitCluster(scope.row)"
-              v-if="false"
+            <span class="iconfont option" @click="quitCluster(scope.row)" v-else
               >&#xe63c;</span
             >
             <!-- 绠楁硶璇︽儏 -->
@@ -181,7 +181,7 @@
 </template>
 
 <script>
-import { findDevList } from "@/api/device";
+import { findDevList, findClustersBySearch } from "@/api/device";
 import AddBox from "@/views/equipmentManagement/equipmentList/components/AddBox";
 import UnbindBox from "@/views/equipmentManagement/equipmentDetail/components/UnbindBox";
 import QuitClusterBox from "@/views/equipmentManagement/equipmentList/components/QuitClusterBox";
@@ -192,6 +192,9 @@
     UnbindBox,
     QuitClusterBox,
     JoinClusterBox,
+  },
+  created() {
+    this.getCluster();
   },
   data() {
     return {
@@ -207,16 +210,7 @@
       isShowAdd: false, //鏄惁灞曠ず鏂板寮圭獥
       isShowUnbind: false, //鏄惁灞曠ず瑙g粦寮圭獥
       unbindId: "",
-      clusterArr: [
-        {
-          value: 0,
-          label: "闆嗙兢1",
-        },
-        {
-          value: 1,
-          label: "闆嗙兢2",
-        },
-      ], //鎵�灞為泦缇や笅鎷夋
+      clusterArr: [], //鎵�灞為泦缇や笅鎷夋
       cluster: null, //閫変腑鐨勯泦缇ょ被鍨�
       showQuit: false, //灞曠ず閫�鍑洪泦缇ょ殑寮圭獥
       showJoin: false, //灞曠ず鍔犲叆闆嗙兢鐨勫脊绐�
@@ -224,15 +218,29 @@
     };
   },
   methods: {
+    async getCluster() {
+      const res = await findClustersBySearch({
+        InputText: "",
+        Page: 1,
+        Size: 10000,
+        userId: JSON.parse(sessionStorage.getItem("userInfo")).id,
+      });
+      if (res && res.success) {
+        res.data.list.forEach((item) => {
+          this.clusterArr.push({
+            label: item.clusterName,
+            value: item.clusterId,
+          });
+        });
+      }
+    },
+
     // 璺冲埌璁惧璇︽儏
     checkDetail(row) {
       this.$router.push({
         path: "/equipmentDetail",
         query: {
           id: row.devId,
-          ip: row.devIp,
-          port: row.serverPort,
-          ndid: row.id,
         },
       });
     },
@@ -243,8 +251,6 @@
         path: "/algorithmDetail",
         query: {
           id: row.devId,
-          ip: row.devIp,
-          port: row.serverPort,
         },
       });
     },
@@ -291,39 +297,8 @@
     //瑙g粦鎸夐挳
     Untying(row) {
       console.log(row);
-      this.unbindId = row.id;
+      this.unbindId = row.devId;
       this.isShowUnbind = true;
-      /*  this.$confirm(
-        "瑙g粦鍚庤璁惧灏嗕粠璁惧鍒楄〃涓Щ闄わ紝鏄惁纭鎿嶄綔?",
-        "瑙g粦鎻愮ず",
-        {
-          type: "warning",
-          center: true,
-        }
-      )
-        .then(() => {
-          unbind({ ids: [row.id] })
-            .then(() => {
-              this.$notify({
-                type: "success",
-                message: "瑙g粦鎴愬姛",
-                duration: 2500,
-                offset: 57,
-              });
-              this.searchingBtn();
-            })
-            .catch(() => {
-              this.$notify({
-                type: "error",
-                message: "瑙g粦澶辫触锛岃鑱旂郴瀹㈡湇",
-                duration: 2500,
-                offset: 57,
-              });
-            });
-        })
-        .catch((e) => {
-          console.log(e);
-        }); */
     },
 
     //鑾峰緱榛樿鏃堕棿
@@ -402,6 +377,26 @@
       align-items: center;
     }
 
+    .cluster {
+      .el-select {
+        width: 200px;
+        height: 40px;
+        line-height: 40px;
+
+        ::v-deep input {
+          height: 40px;
+        }
+
+        .el-icon-arrow-up {
+          line-height: 40px;
+        }
+
+        ::v-deep .el-icon-arrow-up {
+          height: 40px;
+        }
+      }
+    }
+
     .id .el-input ::v-deep {
       width: 180px;
     }

--
Gitblit v1.8.0