Browse Source

底图空间item 增加文本 大小接口;修复多边形修改部分属性为刷新问题

haojianlong 5 years ago
parent
commit
34f1964e75

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

@@ -1,6 +1,6 @@
 {
     "name": "@saga-web/big",
-    "version": "1.0.67",
+    "version": "1.0.71",
     "description": "上格云建筑信息化库",
     "main": "lib/index.js",
     "types": "lib/index.d.js",
@@ -42,6 +42,6 @@
         "typescript": "^3.9.3"
     },
     "dependencies": {
-        "@saga-web/graph": "2.1.102"
+        "@saga-web/graph": "2.1.104"
     }
 }

+ 2 - 0
saga-web-big/src/items/SPolygonItem.ts

@@ -66,6 +66,7 @@ export class SPolygonItem extends SGraphItem {
     }
     set strokeColor(v: SColor) {
         this._strokeColor = v;
+        this.update();
     }
 
     /** 填充颜色 */
@@ -75,6 +76,7 @@ export class SPolygonItem extends SGraphItem {
     }
     set fillColor(v: SColor) {
         this._fillColor = v;
+        this.update();
     }
 
     /** 边框样式 */

+ 24 - 1
saga-web-big/src/items/floor/SSpaceItem.ts

@@ -62,6 +62,7 @@ export class SSpaceItem extends SGraphItem {
         this._highLightFlag = value;
         this.update();
     } // Set highLightFlag
+    /** 是否显示名字  */
     private _showBaseName: boolean = false;
     get showBaseName(): boolean {
         return this._showBaseName;
@@ -70,6 +71,24 @@ export class SSpaceItem extends SGraphItem {
         this._showBaseName = value;
         this.update();
     } // Set showBaseName
+    /** 是否名字大小  */
+    private _nameSize: number = 10;
+    get nameSize(): number {
+        return this._nameSize;
+    } // Get nameSize
+    set nameSize(value: number) {
+        this._nameSize = value;
+        this.update();
+    } // Set nameSize
+    /** 名字是否缩放  */
+    private _nameTransform: boolean = false;
+    get nameTransform(): boolean {
+        return this._nameTransform;
+    } // Get nameTransform
+    set nameTransform(value: boolean) {
+        this._nameTransform = value;
+        this.update();
+    } // Set nameTransform
 
     /**
      * 构造函数
@@ -200,7 +219,11 @@ export class SSpaceItem extends SGraphItem {
         if (this.showBaseName) {
             if (this.name && this.name != "null") {
                 painter.brush.color = SColor.Black;
-                painter.font.size = painter.toPx(10);
+                if (this.nameTransform) {
+                    painter.font.size = this.nameSize;
+                } else {
+                    painter.font.size = painter.toPx(this.nameSize);
+                }
                 // painter.font.size = 500;
                 painter.font.textAlign = STextAlign.Center;
                 painter.drawText(

+ 2 - 2
saga-web-fengmap/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@saga-web/feng-map",
-    "version": "1.0.19",
+    "version": "1.0.20",
     "description": "上格云Web平面图。",
     "main": "lib/index.js",
     "types": "lib/index.d.js",
@@ -32,7 +32,7 @@
         "typescript": "^3.9.3"
     },
     "dependencies": {
-        "@saga-web/big": "1.0.67",
+        "@saga-web/big": "1.0.68",
         "axios": "^0.18.0"
     }
 }

+ 53 - 42
saga-web-fengmap/src/parser/SFengParser.ts

@@ -261,56 +261,67 @@ export class SFengParser extends SParser {
                 columns: Column[] = [],
                 walls: Wall[] = [],
                 virtualWall: VirtualWall[] = [],
-                doors: Door[] = [];
-            result = result
-                .map((t: any) => {
-                    if (t.target) {
-                        if (t.target._data && t.target._data.vertices) {
-                            let arr = t.target._data.vertices,
-                                type = t.typeID,
-                                outline = [];
-                            for (let i = 0; i < arr.length - 1; i += 2) {
-                                outline.push({
-                                    X: arr[i] - maxx,
-                                    Y: arr[i + 1] - maxy
-                                });
-                            }
-                            if (this.spaceType.indexOf(type) > -1) {
-                                spaces.push({
-                                    // @ts-ignore
-                                    OutLine: [outline],
-                                    Name: t.target.name,
-                                    Location: {
-                                        // @ts-ignore
-                                        Points: [this.getAverageVal([outline])]
-                                    },
-                                    Type: t.typeID,
-                                    // @ts-ignore
-                                    Tag: SFengParser.typeIdMap[t.typeID],
-                                    SourceId: t.FID,
-                                    Height: t.target.height
-                                });
-                            } else if (this.columnType.indexOf(type) > -1) {
-                                // @ts-ignore
-                                columns.push({ OutLine: [outline] });
-                            } else if (this.wallType.indexOf(type) > -1) {
+                pList: any[] = [];
+            result.forEach((t: any) => {
+                if (t.target) {
+                    let type = t.typeID;
+                    if (t.target._data && t.target._data.vertices) {
+                        let arr = t.target._data.vertices,
+                            outline = [];
+                        for (let i = 0; i < arr.length - 1; i += 2) {
+                            outline.push({
+                                X: arr[i] - maxx,
+                                Y: arr[i + 1] - maxy
+                            });
+                        }
+                        if (this.spaceType.indexOf(type) > -1) {
+                            spaces.push({
                                 // @ts-ignore
-                                walls.push({ OutLine: [outline] });
-                            } else if (
-                                this.virtualWallType.indexOf(type) > -1
-                            ) {
+                                OutLine: [outline],
+                                Name: t.target.name,
+                                Location: {
+                                    // @ts-ignore
+                                    Points: [this.getAverageVal([outline])]
+                                },
+                                Type: t.typeID,
                                 // @ts-ignore
-                                virtualWall.push({ OutLine: [outline] });
-                            }
+                                Tag: SFengParser.typeIdMap[t.typeID],
+                                SourceId: t.FID,
+                                Height: t.target.height
+                            });
+                        } else if (this.columnType.indexOf(type) > -1) {
+                            // @ts-ignore
+                            columns.push({ OutLine: [outline] });
+                        } else if (this.wallType.indexOf(type) > -1) {
+                            // @ts-ignore
+                            walls.push({ OutLine: [outline] });
+                        } else if (this.virtualWallType.indexOf(type) > -1) {
+                            // @ts-ignore
+                            virtualWall.push({ OutLine: [outline] });
                         }
                     }
-                })
-                .filter((item: any) => item);
+                    if (this.poiList.indexOf(type) > -1) {
+                        pList.push({
+                            Name: t.target.name,
+                            Pos: {
+                                X: t.mapCoord.x - maxx,
+                                Y: t.mapCoord.y - maxy
+                            },
+                            Type: t.typeID,
+                            // @ts-ignore
+                            Tag: SFengParser.typeIdMap[t.typeID],
+                            Height: t.target.height,
+                            SourceId: t.ID
+                        });
+                    }
+                }
+            });
             obj = {
                 Spaces: spaces,
                 Columns: columns,
                 Walls: walls,
-                VirtualWalls: virtualWall
+                VirtualWalls: virtualWall,
+                PList: pList
             };
             _fn(obj);
         });

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

@@ -1,6 +1,6 @@
 {
     "name": "@saga-web/graph",
-    "version": "2.1.102",
+    "version": "2.1.104",
     "description": "上格云二维图形引擎。",
     "main": "lib/index.js",
     "types": "lib/index.d.js",