YaolongHan 4 tahun lalu
induk
melakukan
280e2a4894

+ 5 - 0
src/components/baseEditer.vue

@@ -410,6 +410,11 @@ export default {
         setTimeout(() => {
         }, 100);
       })
+      // 更改图例数据工程化数据
+       bus.$on('changeAttachObjectIds', arr => {
+        this.scene.upadatAttachObjectIds(arr);
+      })
+
     },
     // 读取数据
     readGroup() {

+ 4 - 0
src/components/edit/attr_select.vue

@@ -468,6 +468,10 @@ export default {
     changeitemExplain(){
       bus.$emit("changeitemExplain",this.itemExplain);
     }
+    // 更改工程信息化数据
+    changeAttachObjectIds(){
+      bus.$emit('changeAttachObjectIds',arr)
+    }
   },
   watch: {
     focusItemList: function(newval) {

+ 17 - 5
src/components/mapClass/EditScence.ts

@@ -219,7 +219,7 @@ export class EditScence extends SGraphScene {
         // 起始锚点
         item.startAnchor = anc;
         if (anc) {
-            anc.parent?.connect('changePos', item, item.changePos)
+            anc.parent ?.connect('changePos', item, item.changePos)
         }
         this.scenceUpdate(this);
         return true
@@ -229,14 +229,16 @@ export class EditScence extends SGraphScene {
      * 增加多边形item lenged
      */
     addPolygonItem(event: SMouseEvent): void {
-        const SubType = this._legend.SubType ? this._legend.SubType : ''
+        const SubType = this._legend.SubType ? this._legend.SubType : '';
+        //获取信息工程化相关参数
+        const AttachObjectIds = this._legend.InfoTypeId ? this._legend.InfoTypeId : [];
         const LegendData: Legend = {
             ID: uuid(),
             Name: this._legend.Name,
             GraphElementType: this._legend.Type,
             Num: 1,
             GraphElementId: this._legend.Id,
-            AttachObjectIds: [],
+            AttachObjectIds: AttachObjectIds,
             Type: "Zone",
             Pos: { X: event.x, Y: event.y },
             OutLine: [{ X: event.x, Y: event.y }],
@@ -636,6 +638,16 @@ export class EditScence extends SGraphScene {
         }
     }
 
+   /**
+    * 更新工程信息化的相关数据
+    * @param AttachObjectIds Array
+    */
+    upadatAttachObjectIds(AttachObjectIds: []): void {
+        if (this.focusItem) {
+            this.focusItem.data.AttachObjectIds = AttachObjectIds;
+        }
+    }
+
     /**
      * 删除指定item
      */
@@ -828,7 +840,7 @@ export class EditScence extends SGraphScene {
 
     /**
      * 设置结束锚点
-     * 
+     *
     */
     setTipeEndanchor(event: SMouseEvent): void {
         if (this.grabItem instanceof TipelineItem) {
@@ -840,7 +852,7 @@ export class EditScence extends SGraphScene {
                 event.y = p.y;
                 if (this.grabItem.pointList.length) {
                     this.grabItem.endAnchor = anc;
-                    anc.parent?.connect('changePos', this.grabItem, this.grabItem.changePos)
+                    anc.parent ?.connect('changePos', this.grabItem, this.grabItem.changePos)
                 }
                 this.grabItem.status = SItemStatus.Normal;
             }