From 1fd94033300c712a6faeac1b8a7d3fa3fd4e3553 Mon Sep 17 00:00:00 2001
From: liuyg <liuyg@qq.com>
Date: Sat, 19 Mar 2022 16:24:48 +0800
Subject: [PATCH] +解决标签不显示问题,加入判断右侧添加标签失败提示

---
 src/store/modules/popupParams.js           |    8 ++++----
 src/components/map/components/mapPopup.vue |   19 ++++++++++++++-----
 src/pcviews/tool/sign.vue                  |    2 +-
 3 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/src/components/map/components/mapPopup.vue b/src/components/map/components/mapPopup.vue
index 04c3ab4..3fb0831 100644
--- a/src/components/map/components/mapPopup.vue
+++ b/src/components/map/components/mapPopup.vue
@@ -887,11 +887,20 @@
       // return;
       // this.$store.commit("set_closeMapClick", false); //开启其他操作
       add(d).then(
-        () => {
-          this.$message({
-            type: "success",
-            message: "操作成功!",
-          });
+        (res) => {
+          // console.log(res);
+          if (res.data.code == 200) {
+            this.$message({
+              type: "success",
+              message: "操作成功!",
+            });
+          } else {
+            this.$message({
+              type: "error",
+              message: "新增失败!",
+            });
+          }
+
           this.closeaddIconsLayerIconPopup();
         },
         (error) => {
diff --git a/src/pcviews/tool/sign.vue b/src/pcviews/tool/sign.vue
index 07f42b2..0de98d3 100644
--- a/src/pcviews/tool/sign.vue
+++ b/src/pcviews/tool/sign.vue
@@ -166,7 +166,7 @@
         );
 
         // eslint-disable-next-line no-unused-vars
-        const popup = new global.DC.DivForms(global.viewer, {
+        new global.DC.DivForms(global.viewer, {
           domId: "AddTagBox",
           position: [
             global.DC.Transform.transformWGS84ToCartesian(
diff --git a/src/store/modules/popupParams.js b/src/store/modules/popupParams.js
index c01f5ec..04b91f7 100644
--- a/src/store/modules/popupParams.js
+++ b/src/store/modules/popupParams.js
@@ -1,7 +1,7 @@
 import leftNavsData from './pc/leftNavsData'
 window.labelLayer = null;
 window.divIcon = null;
-
+window.divIcononces = null;
 
 const popupParams = {
     state: {
@@ -250,7 +250,7 @@
                 return
             }
             for (const i in list) {
-                const divIcon = new global.DC.DivIcon(
+                window.divIcononces = new global.DC.DivIcon(
                     new global.DC.Position(
                         Number(list[i].jd),
                         Number(list[i].wd),
@@ -268,7 +268,7 @@
                           `
                 )
                 // 订阅事件
-                window.divIcon.on(global.DC.MouseEventType.CLICK, (e) => {
+                window.divIcononces.on(global.DC.MouseEventType.CLICK, (e) => {
                     // console.log(e);
                     // return;
                     // 定制化窗体
@@ -308,7 +308,7 @@
                         data: list[i]
                     })
                 })
-                window.labelLayer.addOverlay(window.divIcon)
+                window.labelLayer.addOverlay(window.divIcononces)
             }
         },
         addLabelLayerIconMobelUse({

--
Gitblit v1.9.3