Browse Source

'修改取消绑定弹窗多次绑定名称问题'

zhangyu 4 years ago
parent
commit
ef2a626edc

+ 2 - 2
src/components/baseEditer.vue

@@ -690,8 +690,8 @@ export default {
         this.changeScaleByClick = false;
       });
       // 更改图例数据工程化数据
-      bus.$on("changeAttachObjectIds", arr => {
-        this.scene.upadatAttachObjectIds(arr);
+      bus.$on("changeAttachObjectIds", (arr, flag) => {
+        this.scene.upadatAttachObjectIds(arr, flag);
       });
       // redo
       bus.$on("changeRedo", () => {

+ 2 - 2
src/components/edit/edit-dialog.vue

@@ -246,7 +246,7 @@
                         }
                     })
                     console.log(lists);
-                    bus.$emit('changeAttachObjectIds', lists)
+                    bus.$emit('changeAttachObjectIds', lists, true)
                     bus.$emit('updateAttachMsg', lists)
                 }, 1000);
             },
@@ -266,7 +266,7 @@
 
                 })
                 console.log(lists);
-                bus.$emit('changeAttachObjectIds', lists)
+                bus.$emit('changeAttachObjectIds', lists, false)
             },
             onSearch(value) {
                 this.queryGlsmsasset()

+ 2 - 2
src/components/mapClass/EditScence.ts

@@ -740,7 +740,7 @@ export class EditScence extends SGraphScene {
      * 更新工程信息化的相关数据
      * @param AttachObjectIds Array
      */
-    upadatAttachObjectIds(AttachObjectIds: []): void {
+    upadatAttachObjectIds(AttachObjectIds: [], flag: boolean): void {
         if (this.focusItem) {
             this.focusItem.data.AttachObjectIds = AttachObjectIds;
             // 重新选中focusitem
@@ -754,7 +754,7 @@ export class EditScence extends SGraphScene {
                 item instanceof SFHFQZoneLegendItem
             ) {
                 let arr = item.data.AttachObjectIds;
-                if (arr && arr.length && arr[arr.length - 1].name) {
+                if (arr && arr.length && arr[arr.length - 1].name && flag) {
                     let name = item.name;
                     if (name) {
                         item.name = name + `\n${arr[arr.length - 1].name}`;