Browse Source

修改同时点击消息卡片两次报错问题

sunyu 3 years ago
parent
commit
88ea522f2e
2 changed files with 16 additions and 9 deletions
  1. 7 4
      .idea/workspace.xml
  2. 9 5
      src/components/map.vue

+ 7 - 4
.idea/workspace.xml

@@ -4,7 +4,6 @@
     <list default="true" id="66102da6-d8e2-4f98-976c-45db41c8fbe2" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/components/map.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/map.vue" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/static/js/clusterDisplay.js" beforeDir="false" afterPath="$PROJECT_DIR$/static/js/clusterDisplay.js" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -40,7 +39,11 @@
       <updated>1633693759532</updated>
       <workItem from="1633693760645" duration="5858000" />
       <workItem from="1634022035080" duration="12257000" />
-      <workItem from="1634174841495" duration="9219000" />
+      <workItem from="1634174841495" duration="10010000" />
+      <workItem from="1634290067068" duration="754000" />
+      <workItem from="1634350458108" duration="3498000" />
+      <workItem from="1634864522340" duration="950000" />
+      <workItem from="1634986794986" duration="819000" />
     </task>
     <servers />
   </component>
@@ -48,9 +51,9 @@
     <option name="version" value="3" />
   </component>
   <component name="WindowStateProjectService">
-    <state x="930" y="268" key="FileChooserDialogImpl" timestamp="1633695389724">
+    <state x="930" y="268" key="FileChooserDialogImpl" timestamp="1634297013925">
       <screen x="0" y="0" width="1920" height="1040" />
     </state>
-    <state x="930" y="268" key="FileChooserDialogImpl/0.0.1920.1040@0.0.1920.1040" timestamp="1633695389724" />
+    <state x="930" y="268" key="FileChooserDialogImpl/0.0.1920.1040@0.0.1920.1040" timestamp="1634297013925" />
   </component>
 </project>

+ 9 - 5
src/components/map.vue

@@ -410,7 +410,7 @@ export default {
      * @param {Boolean} isLoacate:是否缩放到要素
      * @returns {void}
      */
-    printFeature: function (title, msg, type, isRefresh = false, isLocate = false, isRelate = false) {
+    printFeature: function (title, msg, type, number = null, isRefresh = false, isLocate = false, isRelate = false) {
       // 初始化图层
       var layer = this.getLayerByTitle(title)
       if (layer !== null) {
@@ -452,6 +452,7 @@ export default {
       // 要素属性装载
       feature.set('id', msg.id)
       feature.set('type', type)
+      feature.set('number', number)
 
       // 要素装载入图层
       // 1.起始点
@@ -713,7 +714,7 @@ export default {
                 data = await that.loadOthersByID(id)
                 break
             }
-            that.printFeature('markLayer', data, type, true, true, true)
+            that.printFeature('markLayer', data, type, number, true, true, true)
             that.isShow = true
             bus.$emit('closeList')
           } else {
@@ -736,7 +737,9 @@ export default {
           if (number === 1) {
             bus.$emit('printMapMark', {
               type: feature.get('type'),
-              id: feature.get('id')
+              id: feature.get('id'),
+              number: feature.get('number')
+
             })
           } else {
             // 当点击的图标个数大于1时设置视角范围为多个图标的矩形范围
@@ -1006,7 +1009,7 @@ export default {
               })
             break
         }
-        that.printFeature('markLayer', data, msg.type, true, true, true)
+        that.printFeature('markLayer', data, msg.type, null, true, true, true)
         that.isShow = true
       })
 
@@ -1014,6 +1017,7 @@ export default {
       bus.$on('printMapMark', async msg => {
         let data
         let id = msg.id
+        let number = msg.number
         switch (msg.type) {
           case 'notice':
             await that.loadNoticeByID(id)
@@ -1040,7 +1044,7 @@ export default {
               })
             break
         }
-        that.printFeature('markLayer', data, msg.type, true, true, true)
+        that.printFeature('markLayer', data, msg.type, number, true, true, true)
 
         //  显示popup
         var feature = that.getLayerByTitle('markLayer').getSource().getFeatures()[0]