YaolongHan 4 gadi atpakaļ
vecāks
revīzija
ce1e6a6aff

+ 1 - 0
src/components/baseEditer.vue

@@ -223,6 +223,7 @@ export default {
       // 设备图例样式对象
       bus.$on("setLenged", obj => {
         this.scene.setlegend = obj;
+        console.log('tshishifas ',this.scene.setlegend)
       });
       //  修改图片url
       bus.$on("upadataImageUrl", val => {

+ 1 - 0
src/components/edit/left_toolbar.vue

@@ -310,6 +310,7 @@ export default {
       });
     },
     getexampleItem(item) {
+      console.log('itemitem',item)
       this.visible = false;
       this.$emit("toolActionClick", item);
     },

+ 16 - 1
src/components/mapClass/EditScence.ts

@@ -254,7 +254,22 @@ export class EditScence extends SGraphScene {
      * 增加图标
      */
     addIconItem(event: SMouseEvent): void {
-        const item = new SImageLegendItem(null, '请在右侧属性栏输入文字!');
+        const LegendData: Legend = {
+            ID: uuid(),
+            Name: this._legend.Name,
+            GraphElementType: this._legend.Type,
+            Num: 0,
+            GraphElementId: this._legend.Id,
+            AttachObjectIds: [],
+            Pos: { X: event.x, Y: event.y },
+            Scale: { X: 1, Y: 1, Z: 1 },          // 缩放
+            Rolate: { X: 0, Y: 0, Z: 0 },
+            // Size: { Width: 0, Height: 0 },         // 大小
+            Properties: {
+                url:this._legend.url
+            },
+        }
+        const item = new SImageLegendItem(null, LegendData);
         this.grabItem == null
         this.cmd = 'choice';
         item.selectable = true;