瀏覽代碼

'图片item修改'

zhangyu 4 年之前
父節點
當前提交
2ee56b6a84

+ 6 - 3
src/components/edit/attr_select.vue

@@ -68,7 +68,7 @@
     </div>
     <!--图片-->
     <div class="attr-select" v-if="type=='baseImage'">
-      <span class="grid-title">文字内容</span>
+      <span class="grid-title">图片</span>
       <section class="grid">
         <div class="grid-content">
           <a-upload-dragger
@@ -99,7 +99,7 @@
           />
         </div>
         <div class="color-choice">
-          <swatches v-model="color" popover-x="left" />
+          <swatches v-model="borderColor" popover-x="left" @close="changeBorderColor" />
         </div>
       </div>
     </div>
@@ -508,7 +508,10 @@ export default {
           } else if (Item.lineStyle == SLineStyle.Dotted) {
             this.borderStyle = "dotted";
           }
-        } else if (
+        } else if (newval.itemType == "baseImage") {
+          this.lineWidth = Item.lineWidth;
+          this.borderColor = Item.strokeColor.value;
+        }else if (
           newval.itemType == "Zone" ||
           newval.itemType == "Line" ||
           newval.itemType == "Image"

+ 1 - 1
src/lib/items/SFHFQZoneLegendItem.ts

@@ -126,7 +126,7 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
             }
             // 设置线宽
             if (data.Properties.LineWidth) {
-                this.lineWidth = data.Properties.LineWidth
+                this.lineWidth = data.Properties.LineWidth;
             }
             if (data.Properties.StrokeColor) {
                 this.strokeColor = data.Properties.StrokeColor.includes('#') ? new SColor(data.Properties.StrokeColor) : new SColor(hexify(data.Properties.StrokeColor));

+ 10 - 1
src/lib/items/SImageMarkerItem.ts

@@ -1,6 +1,6 @@
 
 import { SGraphItem, SImageItem } from "@saga-web/graph/lib";
-import { SPainter } from "@saga-web/draw";
+import { SPainter, SColor } from "@saga-web/draw";
 import { Marker } from '../types/Marker';
 import { ItemOrder } from '@saga-web/big/lib';
 
@@ -23,6 +23,7 @@ export class SImageMarkerItem extends SImageItem {
         super(parent);
         this.zOrder = ItemOrder.imageOrder;
         this.isTransform = false;
+        this.url = "";
         this.data = data;
         this.id = data.ID;
         this.name = data.Name;
@@ -34,12 +35,20 @@ export class SImageMarkerItem extends SImageItem {
         if (data.Properties && data.Properties.Url) {
             this.url = data.Properties.Url;
         }
+        if (data.Properties.LineWidth) {
+            this.lineWidth = data.Properties.LineWidth;
+        }
+        if (data.Properties.StrokeColor) {
+            this.strokeColor = data.Properties.StrokeColor.includes('#') ? new SColor(data.Properties.StrokeColor) : new SColor(hexify(data.Properties.StrokeColor));
+        }
     } // Constructor
 
     toData(): Marker {
         this.data.Pos = {X: this.x, Y: this.y};
         this.data.Size = {Width: this.width, Height: this.height};
         this.data.Properties.Url = this.url;
+        this.data.Properties.StrokeColor = this.strokeColor.value;
+        this.data.Properties.LineWidth = this.lineWidth;
         return this.data;
     }
 } // Class SImageMarkerItem

+ 1 - 1
src/lib/items/SSCPZZoneLegendItem.ts

@@ -134,7 +134,7 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
             }
             // 设置线宽
             if (data.Properties.LineWidth) {
-                this.lineWidth = data.Properties.LineWidth
+                this.lineWidth = data.Properties.LineWidth;
             }
             if (data.Properties.StrokeColor) {
                 this.strokeColor = data.Properties.StrokeColor.includes('#') ? new SColor(data.Properties.StrokeColor) : new SColor(hexify(data.Properties.StrokeColor));

+ 1 - 1
src/lib/items/SZoneLegendItem.ts

@@ -127,7 +127,7 @@ export class SZoneLegendItem extends SPolygonItem {
             }
             // 设置线宽
             if (data.Properties.LineWidth) {
-                this.lineWidth = data.Properties.LineWidth
+                this.lineWidth = data.Properties.LineWidth;
             }
             if (data.Properties.StrokeColor) {
                 this.strokeColor = data.Properties.StrokeColor.includes('#') ? new SColor(data.Properties.StrokeColor) : new SColor(hexify(data.Properties.StrokeColor));