haojianlong 5 лет назад
Родитель
Сommit
84082902a8

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

@@ -1,6 +1,6 @@
 {
     "name": "@saga-web/base",
-    "version": "2.1.26",
+    "version": "2.1.27",
     "description": "上格云Web基础库。",
     "main": "lib/index.js",
     "types": "lib/index.d.js",

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

@@ -1,6 +1,6 @@
 {
     "name": "@saga-web/big",
-    "version": "1.0.107",
+    "version": "1.0.109",
     "description": "上格云建筑信息化库",
     "main": "lib/index.js",
     "types": "lib/index.d.js",

+ 3 - 1
saga-web-big/src/index.ts

@@ -23,6 +23,7 @@ import { SRelationState } from "./enums/SRelationState";
 import { SItemStatus } from "./enums/SItemStatus";
 import { SPolygonItem } from "./items/SPolygonItem";
 import { SRectSelectItem } from "./items/SRectSelectItem";
+import { SBoardItem } from "./items/floor/SBoardItem";
 
 export {
     SCompassItem,
@@ -49,5 +50,6 @@ export {
     SRelationState,
     SItemStatus,
     SPolygonItem,
-    SRectSelectItem
+    SRectSelectItem,
+    SBoardItem
 };

+ 97 - 0
saga-web-big/src/items/floor/SBoardItem.ts

@@ -0,0 +1,97 @@
+/*
+ * ********************************************************************************************************************
+ *
+ *                      :*$@@%$*:                         ;:                ;;    ;;
+ *                    :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+ *                   :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+ *                   =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+ *                   =@*                                  %!              @ $= % %@=   =%@!      %=
+ *              *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+ *            %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+ *          ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+ *          $@*   ;@@@%=!:                *@*
+ *          =@$    ;;;!=%@@@@=!           =@!
+ *           %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+ *            ;%@@$=$@@%*       *@@@$=%@@%;
+ *               ::;::             ::;::                                              All rights reserved.
+ *
+ * ********************************************************************************************************************
+ */
+
+import { SPainter, SPath2D, SPoint, SColor } from "@saga-web/draw/lib";
+import { Zone } from "../../types/floor/Zone";
+import { ItemColor, ItemOrder } from "../..";
+import { SGraphItem } from "@saga-web/graph/lib";
+
+/**
+ * 业务空间item
+ *
+ * @author  郝建龙
+ */
+export class SBoardItem extends SGraphItem {
+    /** 空间所有数据  */
+    data: Zone;
+    /** 空间轮廓线坐标list  */
+    readonly pointArr: SPoint[][][] = [];
+    /** path    */
+    private pathList: SPath2D[] = [];
+
+    /**
+     * 构造函数
+     *
+     * @param parent    指向父对象
+     * @param data      空间数据
+     */
+    constructor(parent: SGraphItem | null, data: Zone) {
+        super(parent);
+        this.data = data;
+        this.zOrder = ItemOrder.zoneOrder;
+        if (
+            this.data.OutLine.length &&
+            this.data.OutLine[0] &&
+            this.data.OutLine[0].length
+        ) {
+            let tempArr = this.data.OutLine;
+            this.pointArr = tempArr.map((t): SPoint[][] => {
+                let sPath = new SPath2D();
+                let tempArr = t.map((it): SPoint[] => {
+                    let array = it.map(
+                        (item): SPoint => {
+                            let x = item.X,
+                                y = -item.Y;
+                            return new SPoint(x, y);
+                        }
+                    );
+                    sPath.polygon(array);
+                    return array;
+                });
+                this.pathList.push(sPath);
+                return tempArr;
+            });
+        }
+    } // Constructor
+
+    /**
+     * 判断点是否在区域内
+     *
+     * @param x
+     * @param y
+     */
+    contains(x: number, y: number): boolean {
+        return false;
+    } // Function contains()
+
+    /**
+     * Item绘制操作
+     *
+     * @param   painter painter对象
+     */
+    onDraw(painter: SPainter): void {
+        painter.pen.lineWidth = painter.toPx(1);
+        painter.brush.color = ItemColor.spaceColor;
+        painter.pen.color = ItemColor.spaceBorderColor;
+        this.pathList.forEach((t): void => {
+            painter.drawPath(t);
+        });
+    } // Function onDraw()
+} // Class SBoardItem

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

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

+ 100 - 0
saga-web-fengmap/src/config/ProjectRf.ts

@@ -40,5 +40,105 @@ export const ProjectRf = {
             x: 339,
             y: -20
         }
+    ],
+    1000294: [
+        //1000294_100
+        {
+            id: "27",
+            name: "rf807197a.png",
+            width: 867,
+            height: 255,
+            x: -148,
+            y: -30
+        },
+        {
+            id: "28",
+            name: "rf807197b.png",
+            width: 878,
+            height: 261,
+            x: 301,
+            y: -10
+        }
+    ],
+    1000296: [
+        // 1000296_220
+        {
+            id: "27",
+            name: "rf927637a.png",
+            width: 2560,
+            height: 2408,
+            x: 86,
+            y: -174
+        },
+        {
+            id: "28",
+            name: "rf927637b.png",
+            width: 3072,
+            height: 2048,
+            x: 3386,
+            y: 247
+        },
+        {
+            id: "29",
+            name: "rf927637c.png",
+            width: 3072,
+            height: 2048,
+            x: 7073,
+            y: 28
+        }
+    ],
+    1000107: [
+        //1000107_76
+        {
+            id: "27",
+            name: "rf232089a.png",
+            width: 2048,
+            height: 2048,
+            x: 203,
+            y: 150
+        },
+        {
+            id: "28",
+            name: "rf232089b.png",
+            width: 3180,
+            height: 3180,
+            x: 2197,
+            y: -427
+        },
+        {
+            id: "29",
+            name: "rf232089c.png",
+            width: 2288,
+            height: 2288,
+            x: 5445,
+            y: -22
+        },
+        {
+            id: "28",
+            name: "rf232089d.png",
+            width: 2803,
+            height: 2803,
+            x: 502,
+            y: 1995
+        },
+        {
+            id: "29",
+            name: "rf232089e.png",
+            width: 3106,
+            height: 3106,
+            x: 4316,
+            y: 1798
+        }
+    ],
+    1000391: [
+        //1000391_86
+        {
+            id: "27",
+            name: "rf216225.png",
+            width: 16383,
+            height: 8192,
+            x: -1148,
+            y: -365
+        }
     ]
 };

+ 38 - 2
saga-web-fengmap/src/parser/SFengParser.ts

@@ -317,7 +317,7 @@ export class SFengParser extends SParser {
                                 }
                             }
                             // @ts-ignore
-                            walls.push({ OutLine: [outline], HasHole: hasHole, Holes: holes});
+                            walls.push({ OutLine: [outline], HasHole: hasHole, Holes: holes });
                         } else if (this.virtualWallType.indexOf(type) > -1) {
                             // @ts-ignore
                             virtualWall.push({ OutLine: [outline] });
@@ -348,7 +348,7 @@ export class SFengParser extends SParser {
             };
             _fn(obj);
         });
-    }
+    } // Function parseData()
 
     /**
      * 加载底图
@@ -411,6 +411,42 @@ export class SFengParser extends SParser {
     } // Function loadTheme()
 
     /**
+     * 加载楼层地板
+     *
+     * @param groupId
+     * */
+    loadFloor(groupId: string, _fn: Function): any {
+        const minx = this.fmap.minX;
+        const maxy = this.fmap.maxY;
+        this.fmap.getDatasByAlias(Number(groupId), "extent", (res: any) => {
+            let index = res.gdata.geo.indexOf("(");
+            let str = res.gdata.geo.substring(index);
+            str = str.replace(/\(/g, "[");
+            str = str.replace(/\)/g, "]");
+            str = str.replace(/\s/g, ",");
+            const arr = JSON.parse(str);
+            const aaa = [];
+            for (let i = 0; i < arr.length; i++) {
+                let a = arr[i];
+                const bbb = []
+                for (let j = 0; j < a.length; j++) {
+                    let b = a[j];
+                    const ccc = []
+                    for (let k = 0; k < b.length - 1; k += 2) {
+                        ccc.push({
+                            X: b[k] - minx,
+                            Y: b[k + 1] - maxy
+                        });
+                    }
+                    bbb.push(ccc);
+                }
+                aaa.push(bbb);
+            }
+            _fn({ OutLine: aaa });
+        });
+    } // Function loadFloor()
+
+    /**
      * 计算平均值
      *
      * @param   Outline 轮廓线束