From ed35d0b4c2051e067bd9904c4b0158257d5db0d9 Mon Sep 17 00:00:00 2001
From: ZZJ <10913410+zzj2100@user.noreply.gitee.com>
Date: 星期二, 02 八月 2022 18:58:30 +0800
Subject: [PATCH] 摄像机树样式,导出数据样式

---
 src/views/equipmentManagement/equipmentList/components/Content.vue |   48 ++++++++++++++++++++++--------------------------
 1 files changed, 22 insertions(+), 26 deletions(-)

diff --git a/src/views/equipmentManagement/equipmentList/components/Content.vue b/src/views/equipmentManagement/equipmentList/components/Content.vue
index 8194efc..bb69fb1 100644
--- a/src/views/equipmentManagement/equipmentList/components/Content.vue
+++ b/src/views/equipmentManagement/equipmentList/components/Content.vue
@@ -5,14 +5,14 @@
     <!-- 鍏ㄥ睆鎸夐挳 -->
     <img
       class="zoomOut iconfont"
-      src="/images/equipmentManagement/鍏ㄥ睆.png"
+      src="/images/equipmentManagement/full.png"
       @click="toggleZoom('Full')"
       v-if="!isFull"
     />
     <!-- 鍙栨秷鍏ㄥ睆鐨勬寜閽� -->
     <img
       class="zoomOut iconfont"
-      src="/images/equipmentManagement/閫�鍑哄叏灞�.png"
+      src="/images/equipmentManagement/quit.png"
       @click="toggleZoom('')"
       v-else
     />
@@ -34,6 +34,9 @@
 import AMapLoader from "@amap/amap-jsapi-loader";
 import InfoCard from "@/views/equipmentManagement/equipmentList/components/InfoCard";
 import FormList from "@/views/equipmentManagement/equipmentList/components/FormList";
+
+import bus from "@/plugin/bus";
+
 export default {
   created() {
     window._AMapSecurityConfig = {
@@ -41,9 +44,16 @@
     };
   },
   mounted() {
-    this.searchingBtn();
-    //DOM鍒濆鍖栧畬鎴愯繘琛屽湴鍥惧垵濮嬪寲
+    this.initMap("");
+    bus.$on("refleshNode", (node) => {
+      this.nodes = node;
+      this.initNode();
+    });
   },
+  beforeDestroy() {
+    bus.$off("refleshNode");
+  },
+
   components: {
     InfoCard, //璁惧淇℃伅寮瑰眰
     FormList, //琛ㄦ牸
@@ -59,6 +69,7 @@
       center: [116.06157, 39.66157], //鍦板浘涓績
       activeNode: null, //閫変腑鐨勫湴鍥捐妭鐐�
       geocoder: {},
+      myMaker: null,
     };
   },
 
@@ -91,6 +102,9 @@
     },
     //鍒濆鍖栬妭鐐�
     initNode() {
+      if (this.myMaker) {
+        this.myMaker.destroy();
+      }
       this.nodes.filter((item, index) => {
         //鏌ヨ琛屾斂浣嶇疆
         this.geocoder.getAddress([item.lon, item.lat], (status, result) => {
@@ -103,8 +117,8 @@
           let markerContent =
             "" +
             `<div class="nodeMarker" id="node${index}}">` +
-            '<img class="normal" src="/images/equipmentManagement/璁惧榛樿.png">' +
-            '<img class="selected" src="/images/equipmentManagement/璁惧閫変腑.png">' +
+            '<img class="normal" src="/images/equipmentManagement/default.png">' +
+            '<img class="selected" src="/images/equipmentManagement/select.png">' +
             `<div class="box"> <div class="name">${item.devName}</div> <div class="property">IP鍦板潃: <span class="data">${item.devIp}</span> </div> <div class="property">璁惧浣嶇疆: <span class="data">${item.province}</span></div><div class="property">瀹夎鏃堕棿: <span class="data">${item.installTime}</span></div></div>`;
           ("</div>");
 
@@ -123,6 +137,7 @@
           });
 
           this.map.add(marker);
+          this.myMaker = marker;
         });
       });
     },
@@ -143,25 +158,6 @@
         this.isFull = false;
       }
       this.initMap(status);
-    },
-
-    // 鏌ヨ鍒楄〃
-    searchingBtn() {
-      let param = {
-        page: 1,
-        size: 999,
-        // startTime: this.searchTime[0],
-        // endTime: this.searchTime[1],
-        inputText: "",
-      };
-      findDevList(param)
-        .then((res) => {
-          this.nodes = res.data.list;
-          this.initMap("");
-        })
-        .catch((err) => {
-          console.log(err);
-        });
     },
   },
 };
@@ -198,7 +194,7 @@
         box-sizing: border-box;
         display: none;
         position: absolute;
-        padding: 20px;
+        padding: 20px 10px;
         top: 40px;
         left: -100px;
         width: 247px;

--
Gitblit v1.8.0