From e7c6c4eecddae9515b0cd1be68335690843df3d1 Mon Sep 17 00:00:00 2001
From: liuyg <liuyg@qq.com>
Date: Wed, 02 Mar 2022 15:19:23 +0800
Subject: [PATCH] +自定义标签的添加和删除

---
 src/store/modules/popupParams.js |  115 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 100 insertions(+), 15 deletions(-)

diff --git a/src/store/modules/popupParams.js b/src/store/modules/popupParams.js
index 997c1e2..93ab92b 100644
--- a/src/store/modules/popupParams.js
+++ b/src/store/modules/popupParams.js
@@ -7,10 +7,22 @@
         pointPosition: null,
         stateName: null,
         siteName: null,
+        telephone: null,
         introduceText: null,
-        panoramaUrl: null,
         detailsPopup: false,
-        panoramaPopup: false
+        panoramaUrl: null,
+        panoramaPopup: false,
+        monitorUrl: null,
+        monitorPopup: false,
+        // 图集
+        popupImgAtlas: [],
+        teachList: [],
+        liveList: [],
+        addTagPopup: false,
+        addTagPosition: null,
+
+        labelLayer: null, //自定义标签图层
+        addSignList: true,
     },
     mutations: {
         SET_POPUPBGURL(state, popupBgUrl) {
@@ -19,38 +31,111 @@
         SET_POPUPQRURL(state, pupupQRUrl) {
             state.pupupQRUrl = pupupQRUrl
         },
-        SET_TERMINUS (state, terminus) {
+        SET_TERMINUS(state, terminus) {
             state.terminus = terminus
         },
-        SET_STARTINGPOINT (state, startingPoint) {
+        SET_STARTINGPOINT(state, startingPoint) {
             state.startingPoint = startingPoint
         },
-        SET_POINTPOSITION (state, pointPosition) {
+        SET_POINTPOSITION(state, pointPosition) {
             state.pointPosition = pointPosition
         },
-        SET_STATENAME (state, stateName) {
+        SET_STATENAME(state, stateName) {
             state.stateName = stateName
         },
-        SET_SITENAME (state, siteName) {
+        SET_SITENAME(state, siteName) {
             state.siteName = siteName
         },
-        SET_INTRODUCETEXT (state, introduceText) {
+        SET_TELEPHONE(state, telephone) {
+            state.telephone = telephone
+        },
+        SET_INTRODUCETEXT(state, introduceText) {
             state.introduceText = introduceText
         },
-        SET_PANORAMAURL (state, panoramaUrl) {
+        SET_PANORAMAURL(state, panoramaUrl) {
             state.panoramaUrl = panoramaUrl
         },
-        SET_DETAILSPOPUP (state, detailsPopup) {
-            state.detailsPopup = detailsPopup
-        },
-        SET_PANORAMAPOPUP (state, panoramaPopup) {
+        SET_PANORAMAPOPUP(state, panoramaPopup) {
             state.panoramaPopup = panoramaPopup
         },
+        SET_MONITORURL(state, monitorUrl) {
+            state.monitorUrl = monitorUrl
+        },
+        SET_MONITORPOPUP(state, monitorPopup) {
+            state.monitorPopup = monitorPopup
+        },
+        SET_DETAILSPOPUP(state, detailsPopup) {
+            state.detailsPopup = detailsPopup
+        },
+        SET_POPUPIMGATLAS(state, popupImgAtlas) {
+            state.popupImgAtlas = popupImgAtlas
+        },
+        SET_TEACHLIST(state, teachList) {
+            state.teachList = teachList
+        },
+        SET_LIVELIST(state, liveList) {
+            state.liveList = liveList
+        },
 
-        CLEAR_ALL (state, param) {
+        SET_ADDTAGPOPUP(state, addTagPopup) {
+            state.addTagPopup = addTagPopup
+        },
+
+        SET_ADDTAGPOSITION(state, addTagPosition) {
+            state.addTagPosition = addTagPosition
+        },
+        initLabelLayer(state, val) {
+            if (!state.labelLayer) {
+                state.labelLayer = new global.DC.HtmlLayer("labelLayer");
+                val.addLayer(state.labelLayer);
+            }
+        },
+        addLabelLayerIcon(state, val) {
+            let list = val.list;
+            if (val.clear) {
+                //     state.labelLayer.remove();
+                state.labelLayer.clear();
+            }
+            if (val.add) { //刷新列表
+                state.addSignList = !state.addSignList;
+            }
+            for (let i in list) {
+                console.log(list[i], 112233)
+                const divIcon = new global.DC.DivIcon(
+                    new global.DC.Position(
+                        Number(list[i].jd),
+                        Number(list[i].wd),
+                        0
+                    ),
+                    `
+                              <div class="tag-entitys-box">
+                                  <div class="tag-content">
+                                      ${list[i].name}
+                                  </div>
+                                  <div class="tag-angle-content">
+                                      <img src="https://map.hit.edu.cn/images/tarrow_xq.png">
+                                  </div>
+                              </div>
+                          `
+                );
+                state.labelLayer.addOverlay(divIcon);
+            }
+        },
+        clearLabelLayerIcon(state, val) {
+            if (state.labelLayer) {
+                state.labelLayer.clear();
+            }
+        },
+
+        CLEAR_ALL(state, param) {
             state.siteName = param
             state.introduceText = param
+            state.telephone = param
             state.panoramaUrl = param
+            state.monitorUrl = param
+            state.popupBgUrl = param
+            state.teachList = []
+            state.liveList = []
         }
     },
     actions: {
@@ -58,4 +143,4 @@
     }
 }
 
-export default popupParams
+export default popupParams
\ No newline at end of file

--
Gitblit v1.9.3