Sfoglia il codice sorgente

'添加设备设施修改图标大小'

zhangyu 4 anni fa
parent
commit
8db4f15993

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

@@ -400,14 +400,20 @@ export default {
     },
     // 改变线的颜色
     changeBorderColor() {
-      bus.$emit("changeBorderColor", this.borderColor);
+      if (this.borderColor) {
+        bus.$emit("changeBorderColor", this.borderColor);
+      }
     },
     // 改变字体颜色
     changeFontColor(color) {
-      bus.$emit("changeFontColor", color);
+      if (color) {
+        bus.$emit("changeFontColor", color);
+      }
     },
     changebackColor(color) {
-      bus.$emit("changebackColor", color);
+      if (color) {
+        bus.$emit("changebackColor", color);
+      }
     },
     customRequest(info) {
       const formData = new FormData();
@@ -451,7 +457,9 @@ export default {
       bus.$emit("changeImageNum", this.imageNum);
     },
     changefillColor() {
-      bus.$emit("changefillColor", this.fillColor);
+      if (this.fillColor) {
+        bus.$emit("changefillColor", this.fillColor);
+      }
     },
     //设置缩小item为编辑状态
     OpenEditStatus() {

+ 13 - 6
src/components/edit/right_toolbar.vue

@@ -97,7 +97,7 @@ export default {
       attrType: "",
       elementData: [],
       key: "",
-      isLock: false,
+      isLock: true,
       aspectRatio: 1,// 元素宽高比
     };
   },
@@ -213,19 +213,26 @@ export default {
           }
           if (item.name == "Width") {
             item.msg = width;
-            // 针对图片
-            if (Item instanceof SImageMarkerItem) {
+            // Icon显示图片宽
+            if (Item instanceof SImageLegendItem) {
+              item.msg = Item.img.width;
+            }
+            // 针对图片及Icon
+            if (Item instanceof SImageMarkerItem || Item instanceof SImageLegendItem) {
               item.disable = false;
-              // item.msg = Item.width;
             } else {
               item.disable = true;
             }
           }
           if (item.name == "Height") {
             item.msg = height;
-            if (Item instanceof SImageMarkerItem) {
+            // Icon显示图片高
+            if (Item instanceof SImageLegendItem) {
+              item.msg = Item.img.height;
+            }
+            // 针对图片及Icon
+            if (Item instanceof SImageMarkerItem || Item instanceof SImageLegendItem) {
               item.disable = false;
-              // item.msg = Item.height;
             } else {
               item.disable = true;
             }

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

@@ -397,7 +397,7 @@ export class EditScence extends SGraphScene {
                 sWidth: 24,  //icon 的宽
                 sHeight: 24,   //icon 的高
                 font: 12,    //font
-                color: ''  //字体颜色
+                color: '',  //字体颜色
             },
         }
         const item = new SImageLegendItem(null, LegendData);

+ 8 - 0
src/lib/items/SImageLegendItem.ts

@@ -56,6 +56,12 @@ export class SImageLegendItem extends SIconTextItem {
         if (data.Properties && data.Properties.Url) {
             this.img.url = data.Properties.Url;
         }
+        if (data.Properties.ImgPos) {
+            this.img.moveTo(data.Properties.ImgPos.X, data.Properties.ImgPos.Y);
+        }
+        if (data.Properties.TextPos) {
+            this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
+        }
         if (data.Properties && data.Properties.sWidth) {
             this.sWidth = data.Properties.sWidth;
         }
@@ -75,6 +81,8 @@ export class SImageLegendItem extends SIconTextItem {
         this.data.Size = {Width: this.width, Height: this.height};
         this.data.Name = this.name;
         this.data.Properties.Url = this.img.url;
+        this.data.Properties.TextPos = {X: this.textItem.x, Y: this.textItem.y};
+        this.data.Properties.ImgPos = {X: this.img.x, Y: this.img.y};
         this.data.Properties.sWidth = this.sWidth;
         this.data.Properties.sHeight = this.sHeight;
         this.data.Properties.font = this.font.size;