Quellcode durchsuchen

兼容旧数据

haojianlong vor 4 Jahren
Ursprung
Commit
be37651643
2 geänderte Dateien mit 6 neuen und 0 gelöschten Zeilen
  1. 3 0
      src/lib/items/SImageLegendItem.js
  2. 3 0
      src/lib/items/SImageLegendItem.ts

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

@@ -57,6 +57,9 @@ export class SImageLegendItem extends SIconTextItem {
         if (data.Properties && data.Properties.IsActive) {
         if (data.Properties && data.Properties.IsActive) {
             this.isActive = data.Properties.IsActive;
             this.isActive = data.Properties.IsActive;
         }
         }
+        if (data.AttachObjectIds && data.AttachObjectIds.length) {
+            this.isActive = true;
+        }
         if (data.Properties && data.Properties.FrameColor) {
         if (data.Properties && data.Properties.FrameColor) {
             this.activeColor = new SColor(data.Properties.FrameColor);
             this.activeColor = new SColor(data.Properties.FrameColor);
         }
         }

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

@@ -77,6 +77,9 @@ export class SImageLegendItem extends SIconTextItem {
         if (data.Properties && data.Properties.IsActive) {
         if (data.Properties && data.Properties.IsActive) {
             this.isActive = data.Properties.IsActive;
             this.isActive = data.Properties.IsActive;
         }
         }
+        if (data.AttachObjectIds && data.AttachObjectIds.length) {
+            this.isActive = true;
+        }
         if (data.Properties && data.Properties.FrameColor) {
         if (data.Properties && data.Properties.FrameColor) {
             this.activeColor = new SColor(data.Properties.FrameColor);
             this.activeColor = new SColor(data.Properties.FrameColor);
         }
         }