Explorar o código

修改图例可选中

haojianlong %!s(int64=4) %!d(string=hai) anos
pai
achega
28ab004fa8
Modificáronse 2 ficheiros con 17 adicións e 2 borrados
  1. 8 0
      src/lib/items/SImageLegendItem.js
  2. 9 2
      src/lib/items/SImageLegendItem.ts

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

@@ -54,6 +54,12 @@ export class SImageLegendItem extends SIconTextItem {
         if (data.Properties && data.Properties.color) {
             this.color = new SColor(data.Properties.color);
         }
+        if (data.Properties && data.Properties.IsActive) {
+            this.isActive = data.Properties.IsActive;
+        }
+        if (data.Properties && data.Properties.FrameColor) {
+            this.activeColor = new SColor(data.Properties.FrameColor);
+        }
     }
     get num() {
         return this._num;
@@ -82,6 +88,8 @@ export class SImageLegendItem extends SIconTextItem {
         this.data.Properties.sHeight = this.sHeight;
         this.data.Properties.font = this.font.size;
         this.data.Properties.color = this.color.value;
+        this.data.Properties.FrameColor = this.activeColor.value;
+        this.data.Properties.IsActive = this.isActive;
         this.data.AnchorList = this.anchorList.map(t => {
             return {
                 ID: t.id,

+ 9 - 2
src/lib/items/SImageLegendItem.ts

@@ -1,4 +1,3 @@
-
 import { SGraphItem } from "@saga-web/graph/lib";
 import { SIconTextItem } from '@saga-web/big/lib/items/SIconTextItem';
 import { Legend } from '../types/Legend';
@@ -75,6 +74,12 @@ export class SImageLegendItem extends SIconTextItem {
         if (data.Properties && data.Properties.color) {
             this.color = new SColor(data.Properties.color);
         }
+        if (data.Properties && data.Properties.IsActive) {
+            this.isActive = data.Properties.IsActive;
+        }
+        if (data.Properties && data.Properties.FrameColor) {
+            this.activeColor = new SColor(data.Properties.FrameColor);
+        }
     }
 
     toData(): Legend {
@@ -88,6 +93,8 @@ export class SImageLegendItem extends SIconTextItem {
         this.data.Properties.sHeight = this.sHeight;
         this.data.Properties.font = this.font.size;
         this.data.Properties.color = this.color.value;
+        this.data.Properties.FrameColor = this.activeColor.value;
+        this.data.Properties.IsActive = this.isActive;
         this.data.AnchorList = this.anchorList.map(t => {
             return {
                 ID: t.id,
@@ -99,4 +106,4 @@ export class SImageLegendItem extends SIconTextItem {
         })
         return this.data;
     }
-} // Class SImageLegendItem
+} // Class SImageLegendItem