Browse Source

优化右键重复点击

JX.LI 2 years ago
parent
commit
148a8eaa61
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/components/supermap-2.5d.vue

+ 6 - 0
src/components/supermap-2.5d.vue

@@ -64,6 +64,7 @@
           mapData: null,
           mapData: null,
           mapName: null
           mapName: null
         },
         },
+        clickTime: new Date().getTime()
       }
       }
     },
     },
     watch: {},
     watch: {},
@@ -476,6 +477,11 @@
         let that = this;
         let that = this;
         that.handler.setInputAction(function(movement) {
         that.handler.setInputAction(function(movement) {
           that.mapshow = false
           that.mapshow = false
+          if (new Date().getTime() - that.clickTime < 2000) {
+            return
+          } else {
+            that.clickTime = new Date().getTime()
+          }
           clearInterval(that.timer)
           clearInterval(that.timer)
           that.timer = null
           that.timer = null
           // 监听鼠标的当前位置坐标,然后根据当前坐标去动态更新气泡窗口div的显示位置;
           // 监听鼠标的当前位置坐标,然后根据当前坐标去动态更新气泡窗口div的显示位置;