Pārlūkot izejas kodu

graph:big:底图item修改,移除style暴露属性直接修改颜色

haojianlong 4 gadi atpakaļ
vecāks
revīzija
72f7d39474

+ 2 - 2
persagy-web-big/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@persagy-web/big",
-    "version": "2.2.24",
+    "version": "2.2.25",
     "description": "博锐尚格建筑信息化库",
     "main": "lib/index.js",
     "types": "lib/index.d.js",
@@ -41,7 +41,7 @@
         "typescript": "^3.9.3"
     },
     "dependencies": {
-        "@persagy-web/graph": "2.2.27",
+        "@persagy-web/graph": "2.2.29",
         "axios": "^0.18.0",
         "pako": "^1.0.10",
         "crypto-js": "^4.0.0",

+ 1 - 9
persagy-web-big/src/items/floor/SColumnItem.ts

@@ -44,14 +44,6 @@ export class SColumnItem extends SGraphPolyGroupItem {
      * @param data      柱子数据
      */
     constructor(parent: SGraphItem | null, data: Column) {
-        const style = {
-            default: {
-                stroke: "#000000",
-                fill: "#000000",
-                lineWidth: 0,
-                effect: {}
-            }
-        };
         let tempArr = data.OutLine;
         let outline: Point[][] = [];
         if (tempArr && tempArr.length) {
@@ -60,7 +52,7 @@ export class SColumnItem extends SGraphPolyGroupItem {
             });
         }
 
-        super(parent, { outline: outline, style: style });
+        super(parent, { outline: outline });
         this.data = data;
         this.zOrder = ItemOrder.columnOrder;
     }

+ 1 - 52
persagy-web-big/src/items/floor/SSpaceItem.ts

@@ -105,33 +105,7 @@ export class SSpaceItem extends SGraphAreaGroupItem {
                 data.OutLine.map((t): any =>
                     t.map((it): any => ({ x: it.X, y: -it.Y }))
                 )
-            ],
-            style: {
-                default: {
-                    stroke: "#2b2b2b",
-                    fill: "#f1fffd80",
-                    lineWidth: 1,
-                    effect: {}
-                },
-                selected: {
-                    stroke: "#2b2b2b",
-                    fill: "#1abc9c",
-                    lineWidth: 1,
-                    effect: {}
-                },
-                disabled: {
-                    stroke: "#2b2b2b",
-                    fill: "#afafaf",
-                    lineWidth: 1,
-                    effect: {}
-                },
-                highlight: {
-                    stroke: "#2b2b2b",
-                    fill: "#fbb029",
-                    lineWidth: 1,
-                    effect: {}
-                }
-            }
+            ]
         });
 
         this.data = data;
@@ -140,31 +114,6 @@ export class SSpaceItem extends SGraphAreaGroupItem {
     }
 
     /**
-     * 绘制前设置绘制样式
-     *
-     * @return 当前状态
-     */
-    setStyle(): string {
-        let status = "default";
-        // 如果存在样式
-        if (this.style) {
-            // 如果处于高亮状态
-            if (this.highLightFlag) {
-                status = "highlight";
-            } else if (this.enabled) {
-                // 是否可用,true 可用
-                if (this.selected) {
-                    // 是否选中
-                    status = "selected";
-                }
-            } else {
-                status = "disabled";
-            }
-        }
-        return status;
-    }
-
-    /**
      * 鼠标按下事件
      *
      * @param event   保存事件参数

+ 1 - 10
persagy-web-big/src/items/floor/SWallItem.ts

@@ -45,14 +45,6 @@ export class SWallItem extends SGraphAreaGroupItem {
      * @param data      墙数据
      */
     constructor(parent: SGraphItem | null, data: Wall) {
-        const style = {
-            default: {
-                stroke: "#000000",
-                fill: "#000000",
-                lineWidth: 0,
-                effect: {}
-            }
-        };
         let tempArr = data.OutLine;
         let outline: Point[][] = [];
         // 如果数据存在
@@ -63,8 +55,7 @@ export class SWallItem extends SGraphAreaGroupItem {
         }
 
         super(parent, {
-            outline: outline.length ? [outline] : [],
-            style: style
+            outline: outline.length ? [outline] : []
         });
 
         this.data = data;

+ 1 - 69
persagy-web-big/src/items/floor/ZoneItem.ts

@@ -89,39 +89,7 @@ export class SZoneItem extends SGraphAreaGroupItem {
                         }
                     );
                 });
-            }),
-            style: {
-                default: {
-                    stroke: "#00000000",
-                    fill: "#ffee2280",
-                    lineWidth: 1,
-                    effect: {}
-                },
-                selected: {
-                    stroke: "#00000000",
-                    fill: "#1abc9c",
-                    lineWidth: 1,
-                    effect: {}
-                },
-                highlight: {
-                    stroke: "#00000000",
-                    fill: data.Color || "#fbb029",
-                    lineWidth: 1,
-                    effect: {}
-                },
-                unselect: {
-                    stroke: "#00000000",
-                    fill: "#cecece",
-                    lineWidth: 1,
-                    effect: {}
-                },
-                infected: {
-                    stroke: "#00000000",
-                    fill: "#ff0000",
-                    lineWidth: 1,
-                    effect: {}
-                }
-            }
+            })
         });
 
         this.data = data;
@@ -158,42 +126,6 @@ export class SZoneItem extends SGraphAreaGroupItem {
     }
 
     /**
-     * 绘制前设置绘制样式
-     *
-     * @return 当前状态
-     */
-    setStyle(): string {
-        let status = "default";
-        // 是否存在样式
-        if (this.style) {
-            // 是否可选中
-            if (!this.selectable) {
-                status = "unselect";
-            } else {
-                // 是否选中
-                if (this.selected) {
-                    status = "selected";
-                } else if (this.highLightFlag) {
-                    // 高亮状态
-                    status = "highlight";
-                } else if (this.isInfected) {
-                    // 受影响
-                    status = "infected";
-                } else {
-                    status = "default";
-                    if (this.data.Color) {
-                        // 数据是否存在 color
-                        this.style.default.fill = `${this.data.Color}${
-                            Transparency[this.transparency]
-                        }`;
-                    }
-                }
-            }
-        }
-        return status;
-    }
-
-    /**
      * Item 绘制操作
      *
      * @param painter   绘制对象

+ 1 - 1
persagy-web-graph/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@persagy-web/graph",
-    "version": "2.2.28",
+    "version": "2.2.29",
     "description": "博锐尚格二维图形引擎。",
     "main": "lib/index.js",
     "types": "lib/index.d.js",