From 81f54040c2cb65537c6c6e1db8358a39a57dea0d Mon Sep 17 00:00:00 2001
From: mayisheng <admin>
Date: Mon, 15 Aug 2022 16:14:01 +0800
Subject: [PATCH] 1

---
 src/pcviews/tool/sign.vue |   49 ++++++++++++++++++++++++++++---------------------
 1 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/src/pcviews/tool/sign.vue b/src/pcviews/tool/sign.vue
index c79594f..4ce02c7 100644
--- a/src/pcviews/tool/sign.vue
+++ b/src/pcviews/tool/sign.vue
@@ -59,7 +59,6 @@
     },
     methods: {
         dingw (item) {
-            const that = this
             // console.log(item);
             // this.$store.dispatch("mapFlyTo", {
             //   lntLat: [item.jd, item.wd, 120], //114.04020791, 27.62934732
@@ -75,7 +74,7 @@
                 destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees(
                     item.jd,
                     item.wd,
-                    400.0
+                    950.0
                 ),
                 orientation: {
                     // 指向
@@ -106,11 +105,19 @@
         },
         getData () {
             const that = this
+            that.loading = true
+            const oks = setTimeout(() => {
+                that.loading = false
+                that.signShow = false
+            }, 5000)
             getlabel().then((res) => {
+                clearTimeout(oks)
                 console.log(res)
                 const data = res.data.data.records
                 that.signList = data
-                that.signList.length > 0 ? that.signShow = true : that.signShow = false
+                that.signList.length > 0
+                    ? (that.signShow = true)
+                    : (that.signShow = false)
                 that.loading = false
                 // that.$store.commit("clearLabelLayerIcon");
                 that.$store.dispatch('addLabelLayerIcon', {
@@ -120,31 +127,29 @@
             })
         },
         moveMessage (e, b) {
-            if (b == '') {
-                global.viewer.tooltip.enable = false
-            } else {
-                global.viewer.tooltip.enable = true
-                global.viewer.tooltip.showAt(e.windowPosition, b)
-            }
+            global.viewer.tooltip.enable = true
+            global.viewer.tooltip.showAt(e.windowPosition, b)
+        },
+
+        mouserMove (e) {
+            this.moveMessage(e, '点击确认标注位置')
         },
 
         addSign () {
             var that = this
             this.$store.commit('set_closeMapClick', true)
             // console.log("开始", "see");
-            global.viewer.on(global.DC.MouseEventType.MOUSE_MOVE, (e) =>
-                that.moveMessage(e, '点击确认标注位置')
-            )
+            global.viewer.on(global.DC.MouseEventType.MOUSE_MOVE, that.mouserMove)
 
             global.viewer.once(global.DC.MouseEventType.CLICK, (e) => {
                 if (that.destroyedFlag == false) return
 
-                global.viewer.on(global.DC.MouseEventType.MOUSE_MOVE, (e) =>
-                    that.moveMessage(e, '')
-                )
+                global.viewer.tooltip.showAt({ x: 100, y: 100 }, '')
+                global.viewer.tooltip.enable = false
+                global.viewer.off(global.DC.MouseEventType.MOUSE_MOVE, that.mouserMove)
 
                 // eslint-disable-next-line no-unused-vars
-                const popup = new global.DC.DivForms(global.viewer, {
+                var div = new global.DC.DivForms(global.viewer, {
                     domId: 'AddTagBox',
                     position: [
                         global.DC.Transform.transformWGS84ToCartesian(
@@ -166,16 +171,18 @@
             this.$store.dispatch('delVisitedViews', this.$route)
             this.$router.push('/pcLayout/default')
             this.$store.commit('clearLabelLayerIcon')
+            this.destroyedFlag = false
+            global.viewer.tooltip.showAt({ x: 100, y: 100 }, '')
+            global.viewer.tooltip.enable = false
+            global.viewer.off(global.DC.MouseEventType.MOUSE_MOVE, this.mouseMove)
         }
     },
     destroyed () {
         var that = this
         that.destroyedFlag = false
-        if (global.DC) {
-            global.viewer.on(global.DC.MouseEventType.MOUSE_MOVE, (e) =>
-                that.moveMessage(e, '')
-            )
-        }
+        global.viewer.tooltip.showAt({ x: 100, y: 100 }, '')
+        global.viewer.tooltip.enable = false
+        global.viewer.off(global.DC.MouseEventType.MOUSE_MOVE, that.mouseMove)
         this.$store.commit('clearLabelLayerIcon')
     }
 }

--
Gitblit v1.9.3