瀏覽代碼

Merge remote-tracking branch 'origin/master'

sybotan 4 年之前
父節點
當前提交
0ee6b03d02

+ 2 - 1
docs/.vuepress/components/GitCode.vue

@@ -53,7 +53,8 @@
                 }).then(res => {
                     this.code = res.data;
                     this.$nextTick(()=>{
-                        document.querySelectorAll("pre code").forEach(block => {
+                        // 此处选择器 只选择当前组件的pre code,否则影响组件外 代码区域 格式
+                        document.querySelectorAll(".custom-code pre code").forEach(block => {
                             Prism.highlightElement(block)
                         });
                     });

+ 1 - 5
docs/guides/big/items/column.md

@@ -5,11 +5,7 @@
 
 ## 源代码
 
-::: details 查看代码
-
-<<< @/docs/guides/big/items/src/SColumnItem.ts
-
-:::
+<GitCode fileUrl="/persagy-web-big/src/items/floor/SColumnItem.ts" />
 
 ## 代码说明
     

+ 1 - 5
docs/guides/big/items/door.md

@@ -5,11 +5,7 @@
 
 ## 源代码
 
-::: details 查看代码
-
-<<< @/docs/guides/big/items/src/SDoorItem.ts
-
-:::
+<GitCode fileUrl="/persagy-web-big/src/items/floor/SDoorItem.ts" />
 
 ## 代码说明
     

+ 1 - 5
docs/guides/big/items/space.md

@@ -5,11 +5,7 @@
 
 ## 源代码
 
-::: details 查看代码
-
-<<< @/docs/guides/big/items/src/SSpaceItem.ts
-
-:::
+<GitCode fileUrl="/persagy-web-big/src/items/floor/SSpaceItem.ts" />
 
 ## 代码说明
     

+ 0 - 92
docs/guides/big/items/src/SColumnItem.ts

@@ -1,92 +0,0 @@
-import {SGraphItem} from "@persagy-web/graph/lib";
-import {Column} from "@persagy-web/big/lib/types/floor/Column";
-import {SPainter, SPoint, SRect} from "@persagy-web/draw/lib";
-import {ItemColor, ItemOrder} from "@persagy-web/big/lib";
-
-/**
- * 柱子item
- *
- * @author  郝建龙
- */
-export class SColumnItem extends SGraphItem {
-    /** 柱子数据    */
-    data: Column;
-    /** X坐标最小值  */
-    private minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值  */
-    private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值  */
-    private minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值  */
-    private maxY = Number.MIN_SAFE_INTEGER;
-    /** 柱子轮廓线坐标list  */
-    private readonly pointArr: SPoint[][] = [];
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      柱子数据
-     */
-    constructor(parent: SGraphItem | null, data: Column) {
-        super(parent);
-        this.data = data;
-        this.zOrder = ItemOrder.columnOrder;
-        let tempArr = this.data.OutLine;
-        if (tempArr && tempArr.length) {
-            this.minX = tempArr[0][0].X;
-            this.maxX = this.minX;
-            this.minY = -tempArr[0][0].Y;
-            this.maxY = this.minY;
-            this.pointArr = tempArr.map((t): SPoint[] => {
-                return t.map(
-                    (it): SPoint => {
-                        let x = it.X,
-                            y = -it.Y;
-                        if (x < this.minX) {
-                            this.minX = x;
-                        }
-                        if (y < this.minY) {
-                            this.minY = y;
-                        }
-                        if (x > this.maxX) {
-                            this.maxX = x;
-                        }
-                        if (y > this.maxY) {
-                            this.maxY = y;
-                        }
-                        return new SPoint(x, y);
-                    }
-                );
-            });
-        }
-    } // Constructor
-
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    boundingRect(): SRect {
-        return new SRect(
-            this.minX,
-            this.minY,
-            this.maxX - this.minX,
-            this.maxY - this.minY
-        );
-    } // Function boundingRect()
-
-    /**
-     * Item绘制操作
-     *
-     * @param   painter       painter对象
-     */
-    onDraw(painter: SPainter): void {
-        painter.pen.color = ItemColor.columnColor;
-        painter.pen.lineWidth = painter.toPx(1);
-        painter.brush.color = ItemColor.columnColor;
-        this.pointArr.forEach((t): void => {
-            painter.drawPolygon(t);
-        });
-    } // Function onDraw()
-} // Class SColumnItem

+ 0 - 137
docs/guides/big/items/src/SDoorItem.ts

@@ -1,137 +0,0 @@
-import {SColor, SPainter, SPoint, SRect} from "@persagy-web/draw/lib";
-import { SGraphItem } from "@persagy-web/graph/lib";
-import { Door } from "@persagy-web/big/lib/types/floor/Door";
-import { ItemColor, ItemOrder } from "@persagy-web/big/lib";
-import { SMathUtil } from "@persagy-web/big/lib/utils/SMathUtil";
-
-/**
- * 门item
- *
- * @author  郝建龙
- */
-export class SDoorItem extends SGraphItem {
-    /** 门数据 */
-    data: Door;
-    /** 门轮廓线坐标list  */
-    private readonly pointArr: SPoint[] = [];
-    /** 门长度 */
-    private readonly r: number = 0;
-    /** 角度  */
-    private readonly ang: number = 0;
-    /** 旋转点 */
-    private readonly p: SPoint = new SPoint(0, 0);
-    /** 旋转起始角度,结束角度+Math.PI/2 */
-    private readonly startAng: number = -Math.PI / 2;
-    /** X坐标最小值  */
-    private minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值  */
-    private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值  */
-    private minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值  */
-    private maxY = Number.MIN_SAFE_INTEGER;
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      门数据
-     */
-    constructor(parent: SGraphItem | null, data: Door) {
-        super(parent);
-        this.data = data;
-        this.zOrder = ItemOrder.doorOrder;
-        if (this.data.OutLine.length) {
-            this.pointArr = this.data.OutLine[0].map(
-                (t): SPoint => {
-                    let x = t.X,
-                        y = -t.Y;
-                    if (x < this.minX) {
-                        this.minX = x;
-                    }
-                    if (y < this.minY) {
-                        this.minY = y;
-                    }
-                    if (x > this.maxX) {
-                        this.maxX = x;
-                    }
-                    if (y > this.maxY) {
-                        this.maxY = y;
-                    }
-                    return new SPoint(t.X, -t.Y);
-                }
-            );
-
-            let p1 = this.pointArr[0],
-                p2 = this.pointArr[1];
-            // 旋转点
-            this.p = p1;
-            const HX = (this.data.HandDirection.X = Number(
-                this.data.HandDirection.X.toFixed()
-            ));
-            const HY = (this.data.HandDirection.Y = Number(
-                this.data.HandDirection.Y.toFixed()
-            ));
-            const FX = (this.data.FaceDirection.X = Number(
-                this.data.FaceDirection.X.toFixed()
-            ));
-            const FY = (this.data.FaceDirection.Y = Number(
-                this.data.FaceDirection.Y.toFixed()
-            ));
-            // 向量点乘 => x1 * x2 + y1 * y2,大于0同向
-            let dotProduct = (p2.x - p1.x) * HX + (p2.y - p1.y) * -HY;
-            if (dotProduct > 0) {
-                this.p = p2;
-                p2 = p1;
-                p1 = this.p;
-            }
-            // 两点间距离
-            this.r = SMathUtil.pointDistance(p1.x, p1.y, p2.x, p2.y);
-            // 门朝向角度
-            let fo = Math.atan(-FY / FX);
-            this.ang = FX > 0 ? fo : fo + Math.PI;
-            // 向量叉乘 => x1 * y2 - x2 * y1,小于0是顺时针
-            let direction = (p2.x - p1.x) * -FY - (p2.y - p1.y) * FX;
-            if (direction > 0) {
-                this.startAng = 0;
-            }
-        }
-    } // Constructor
-
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    boundingRect(): SRect {
-        return new SRect(
-            0,
-            0,
-            this.r,
-            this.r
-        );
-    } // Function boundingRect()
-
-    /**
-     * Item绘制操作
-     *
-     * @param   painter       painter对象
-     */
-    onDraw(painter: SPainter): void {
-        painter.translate(this.p.x, this.p.y);
-        painter.rotate(this.ang);
-        painter.pen.lineWidth = painter.toPx(1);
-        painter.pen.color = ItemColor.doorColor;
-        painter.drawLine(0, 0, this.r, 0);
-        painter.pen.lineDash = [50, 100];
-        painter.pen.lineWidth = painter.toPx(1);
-        // painter.drawArc(
-        //     -this.r,
-        //     -this.r,
-        //     this.r * 2,
-        //     this.r * 2,
-        //     this.startAng,
-        //     this.startAng + Math.PI / 2
-        // );
-    } // Function onDraw()
-} // Class SDoorItem

+ 0 - 192
docs/guides/big/items/src/SSpaceItem.ts

@@ -1,192 +0,0 @@
-import {
-    SColor,
-    SPainter,
-    SPath,
-    SPoint,
-    SPolygonUtil,
-    SRect,
-    STextAlign
-} from "@persagy-web/draw/lib";
-import { SGraphItem } from "@persagy-web/graph/lib";
-import { Space } from "@persagy-web/big/lib/types/floor/Space";
-import { ItemColor, ItemOrder } from "@persagy-web/big/lib";
-
-/**
- * 模型空间item
- *
- * @author  郝建龙
- */
-export class SSpaceItem extends SGraphItem {
-    /** 空间所有数据  */
-    data: Space;
-    /** 空间轮廓线坐标list  */
-    readonly pointArr: SPoint[][] = [];
-    /** X坐标最小值  */
-    minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值  */
-    maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值  */
-    minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值  */
-    maxY = Number.MIN_SAFE_INTEGER;
-    /** path对象      */
-    private path = new SPath();
-    /** 高亮状态    */
-    private _highLightFlag: boolean = false;
-    get highLightFlag(): boolean {
-        return this._highLightFlag;
-    } // Get highLightFlag
-    set highLightFlag(value: boolean) {
-        this._highLightFlag = value;
-        this.update();
-    } // Set highLightFlag
-    /** 是否显示名字  */
-    private _showBaseName: boolean = false;
-    get showBaseName(): boolean {
-        return this._showBaseName;
-    } // Get showBaseName
-    set showBaseName(value: boolean) {
-        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
-    /** 名字颜色    */
-    private _nameColor: string = "#000000";
-    get nameColor(): string {
-        return this._nameColor;
-    } // Get nameColor
-    set nameColor(value: string) {
-        this._nameColor = value;
-        this.update();
-    } // Set nameColor
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      空间数据
-     */
-    constructor(parent: SGraphItem | null, data: Space) {
-        super(parent);
-        this.data = data;
-        this.zOrder = ItemOrder.spaceOrder;
-        let tempArr = this.data.OutLine;
-        this.name = data.Name || "";
-        if (tempArr && tempArr.length) {
-            this.minX = tempArr[0][0].X;
-            this.maxX = this.minX;
-            this.minY = -tempArr[0][0].Y;
-            this.maxY = this.minY;
-            this.pointArr = tempArr.map((t): SPoint[] => {
-                let temp = t.map(
-                    (it): SPoint => {
-                        let x = it.X,
-                            y = -it.Y;
-                        if (x < this.minX) {
-                            this.minX = x;
-                        }
-                        if (y < this.minY) {
-                            this.minY = y;
-                        }
-                        if (x > this.maxX) {
-                            this.maxX = x;
-                        }
-                        if (y > this.maxY) {
-                            this.maxY = y;
-                        }
-                        return new SPoint(x, y);
-                    }
-                );
-                this.path.polygon(temp);
-                return temp;
-            });
-        }
-    } // Constructor
-
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    boundingRect(): SRect {
-        return new SRect(
-            this.minX,
-            this.minY,
-            this.maxX - this.minX,
-            this.maxY - this.minY
-        );
-    } // Function boundingRect()
-
-    /**
-     * 判断点是否在区域内
-     *
-     * @param x
-     * @param y
-     */
-    contains(x: number, y: number): boolean {
-        let arr = this.pointArr;
-        if (arr.length < 1 || !SPolygonUtil.pointIn(x, y, arr[0])) {
-            return false;
-        }
-
-        for (let i = 1; i < arr.length; i++) {
-            if (SPolygonUtil.pointIn(x, y, arr[i])) {
-                return false;
-            }
-        }
-        return true;
-    } // Function contains()
-
-    /**
-     * Item绘制操作
-     *
-     * @param   painter       painter对象
-     */
-    onDraw(painter: SPainter): void {
-        painter.pen.color = ItemColor.spaceBorderColor;
-        if (this.selected) {
-            painter.brush.color = ItemColor.selectColor;
-        } else if (this.highLightFlag) {
-            painter.brush.color = ItemColor.spaceHighColor;
-        } else {
-            painter.brush.color = ItemColor.spaceColor;
-        }
-        painter.pen.lineWidth = painter.toPx(1);
-        painter.drawPath(this.path);
-
-        if (this.showBaseName) {
-            if (this.name && this.name != "null") {
-                painter.brush.color = new SColor(this.nameColor);
-                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(
-                    this.name,
-                    this.data.Location.Points[0].X,
-                    -this.data.Location.Points[0].Y
-                );
-            }
-        }
-    } // Function onDraw()
-} // Class SSpaceItem

+ 0 - 92
docs/guides/big/items/src/SVirtualWallItem.ts

@@ -1,92 +0,0 @@
-import { SPainter, SPoint, SRect } from "@persagy-web/draw/lib";
-import { SGraphItem } from "@persagy-web/graph/lib";
-import {VirtualWall} from "@persagy-web/big/lib/types/floor/VirtualWall";
-import {ItemColor, ItemOrder} from "@persagy-web/big/lib";
-
-/**
- * 墙item
- *
- * @author  郝建龙
- */
-export class SVirtualWallItem extends SGraphItem {
-    /** 虚拟墙数据   */
-    data: VirtualWall;
-    /** X坐标最小值  */
-    private minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值  */
-    private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值  */
-    private minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值  */
-    private maxY = Number.MIN_SAFE_INTEGER;
-    /** 虚拟墙轮廓线坐标list  */
-    private readonly pointArr: SPoint[][] = [];
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      虚拟墙数据
-     */
-    constructor(parent: SGraphItem | null, data: VirtualWall) {
-        super(parent);
-        this.data = data;
-        this.zOrder = ItemOrder.virtualWallOrder;
-        let tempArr = this.data.OutLine;
-        if (tempArr && tempArr.length) {
-            this.minX = tempArr[0][0].X;
-            this.maxX = this.minX;
-            this.minY = -tempArr[0][0].Y;
-            this.maxY = this.minY;
-            this.pointArr = tempArr.map((t): SPoint[] => {
-                return t.map(
-                    (it): SPoint => {
-                        let x = it.X,
-                            y = -it.Y;
-                        if (x < this.minX) {
-                            this.minX = x;
-                        }
-                        if (y < this.minY) {
-                            this.minY = y;
-                        }
-                        if (x > this.maxX) {
-                            this.maxX = x;
-                        }
-                        if (y > this.maxY) {
-                            this.maxY = y;
-                        }
-                        return new SPoint(x, y);
-                    }
-                );
-            });
-        }
-    } // Constructor
-
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    boundingRect(): SRect {
-        return new SRect(
-            this.minX,
-            this.minY,
-            this.maxX - this.minX,
-            this.maxY - this.minY
-        );
-    } // Function boundingRect()
-
-    /**
-     * Item绘制操作
-     *
-     * @param   painter       painter对象
-     */
-    onDraw(painter: SPainter): void {
-        painter.pen.lineWidth = painter.toPx(1);
-        painter.pen.color = ItemColor.virtualWallColor;
-        painter.pen.lineDash = [200, 100];
-        this.pointArr.forEach((t): void => {
-            painter.drawPolyline(t);
-        });
-    } // Function onDraw()
-} // Class SVirtualWallItem

+ 0 - 93
docs/guides/big/items/src/SWallItem.ts

@@ -1,93 +0,0 @@
-import {SPainter, SPath, SPoint, SRect} from "@persagy-web/draw/lib";
-import { SGraphItem } from "@persagy-web/graph/lib";
-import { Wall } from "@persagy-web/big/lib/types/floor/Wall";
-import { ItemColor, ItemOrder } from "@persagy-web/big/lib";
-
-/**
- * 墙item
- *
- * @author  郝建龙
- */
-export class SWallItem extends SGraphItem {
-    /** 墙数据 */
-    data: Wall;
-    /** X坐标最小值  */
-    private minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值  */
-    private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值  */
-    private minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值  */
-    private maxY = Number.MIN_SAFE_INTEGER;
-    /** 墙轮廓线坐标list  */
-    private readonly pointArr: SPoint[][] = [];
-    /** path对象  */
-    private path = new SPath();
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      墙数据
-     */
-    constructor(parent: SGraphItem | null, data: Wall) {
-        super(parent);
-        this.data = data;
-        this.zOrder = ItemOrder.wallOrder;
-        let tempArr = this.data.OutLine;
-        if (tempArr && tempArr.length) {
-            this.minX = tempArr[0][0].X;
-            this.maxX = this.minX;
-            this.minY = -tempArr[0][0].Y;
-            this.maxY = this.minY;
-            tempArr.forEach((t): void => {
-                const temp = t.map(
-                    (it): SPoint => {
-                        let x = it.X,
-                            y = -it.Y;
-                        if (x < this.minX) {
-                            this.minX = x;
-                        }
-                        if (y < this.minY) {
-                            this.minY = y;
-                        }
-                        if (x > this.maxX) {
-                            this.maxX = x;
-                        }
-                        if (y > this.maxY) {
-                            this.maxY = y;
-                        }
-                        return new SPoint(x, y);
-                    }
-                );
-                this.path.polygon(temp);
-            });
-        }
-    } // Constructor
-
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    boundingRect(): SRect {
-        return new SRect(
-            this.minX,
-            this.minY,
-            this.maxX - this.minX,
-            this.maxY - this.minY
-        );
-    } // Function boundingRect()
-
-    /**
-     * Item绘制操作
-     *
-     * @param   painter       painter对象
-     */
-    onDraw(painter: SPainter): void {
-        painter.pen.color = ItemColor.wallColor;
-        painter.pen.lineWidth = painter.toPx(1);
-        painter.brush.color = ItemColor.wallColor;
-        painter.drawPath(this.path);
-    } // Function onDraw()
-} // Class SWallItem

+ 0 - 82
docs/guides/big/items/src/SWindowItem.ts

@@ -1,82 +0,0 @@
-import { SPainter, SPoint, SRect } from "@persagy-web/draw/lib";
-import { SGraphItem } from "@persagy-web/graph/lib";
-import {Casement} from "@persagy-web/big/lib/types/floor/Casement";
-import {ItemColor, ItemOrder} from "@persagy-web/big/lib";
-
-/**
- * 窗户item
- *
- * @author  郝建龙
- */
-export class SWindowItem extends SGraphItem {
-    /** 窗户数据    */
-    data: Casement;
-    /** 窗户轮廓线坐标list  */
-    private readonly pointArr: SPoint[] = [];
-    /** X坐标最小值  */
-    private minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值  */
-    private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值  */
-    private minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值  */
-    private maxY = Number.MIN_SAFE_INTEGER;
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      窗户数据
-     */
-    constructor(parent: SGraphItem | null, data: Casement) {
-        super(parent);
-        this.data = data;
-        this.zOrder = ItemOrder.windowOrder;
-        if (this.data.OutLine.length) {
-            this.pointArr = this.data.OutLine[0].map(
-                (t): SPoint => {
-                    let x = t.X,
-                        y = -t.Y;
-                    if (x < this.minX) {
-                        this.minX = x;
-                    }
-                    if (y < this.minY) {
-                        this.minY = y;
-                    }
-                    if (x > this.maxX) {
-                        this.maxX = x;
-                    }
-                    if (y > this.maxY) {
-                        this.maxY = y;
-                    }
-                    return new SPoint(x, y);
-                }
-            );
-        }
-    } // Constructor
-
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    boundingRect(): SRect {
-        return new SRect(
-            this.minX,
-            this.minY,
-            this.maxX - this.minX,
-            this.maxY - this.minY
-        );
-    } // Function boundingRect()
-
-    /**
-     * Item绘制操作
-     *
-     * @param   painter       painter对象
-     */
-    onDraw(painter: SPainter): void {
-        painter.pen.color = ItemColor.windowColor;
-        painter.pen.lineWidth = painter.toPx(1);
-        painter.drawPolyline(this.pointArr);
-    } // Function onDraw()
-} // Class SWindowItem

+ 0 - 235
docs/guides/big/items/src/SZoneItem.ts

@@ -1,235 +0,0 @@
-import {
-    SColor,
-    SPainter,
-    SPath,
-    SPoint,
-    SPolygonUtil,
-    SRect
-} from "@persagy-web/draw/lib";
-import { SMouseEvent } from "@persagy-web/base/lib";
-import { SGraphItem } from "@persagy-web/graph/lib";
-import {Zone} from "@persagy-web/big/lib/types/floor/Zone";
-import {ItemColor, ItemOrder, Transparency} from "@persagy-web/big/lib";
-
-/**
- * 业务空间item
- *
- * @author  郝建龙
- */
-export class SZoneItem extends SGraphItem {
-    /** 空间所有数据  */
-    data: Zone;
-    /** 空间轮廓线坐标list  */
-    readonly pointArr: SPoint[][][] = [];
-    /** X坐标最小值  */
-    private minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值  */
-    private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值  */
-    private minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值  */
-    private maxY = Number.MIN_SAFE_INTEGER;
-    /** path    */
-    private pathList: SPath[] = [];
-    /** 点击位置坐标  */
-    private clickPoint: SPoint | undefined;
-    /** 选中时的颜色  */
-    private selectColor: SColor = ItemColor.selectColor;
-    /** 不可选时的颜色  */
-    private unselectColor: SColor = ItemColor.zoneUnselectColor;
-    /** 高亮状态    */
-    private _highLightFlag: boolean = false;
-    get highLightFlag(): boolean {
-        return this._highLightFlag;
-    } // Get highLightFlag
-    set highLightFlag(value: boolean) {
-        this._highLightFlag = value;
-        this.update();
-    } // Set highLightFlag
-    /** 透明度 */
-    _transparency: number = 20;
-    get transparency(): number {
-        return this._transparency;
-    } // Get transparency
-    set transparency(value: number) {
-        this._transparency = value;
-        this.update();
-    } // Set transparency
-    /** 受影响状态   */
-    _isInfected: boolean = false;
-    get isInfected(): boolean {
-        return this._isInfected;
-    } // Get isInfected
-    set isInfected(value: boolean) {
-        this._isInfected = value;
-        this.update();
-    } // Set isInfected
-    /** 受影响的业务空间填充颜色    */
-    private infectedColor: SColor = ItemColor.zoneInfectedColor;
-    /** 受影响的业务空间边框颜色    */
-    private infectedBorder: SColor = ItemColor.zoneInfectedBorder;
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      空间数据
-     */
-    constructor(parent: SGraphItem | null, data: Zone) {
-        super(parent);
-        this.data = data;
-        this.zOrder = ItemOrder.zoneOrder;
-        this.highLightFlag = data.HighLightFlag || false;
-        this.transparency = data.Transparency || 20;
-        this.isInfected = data.Infected || false;
-        if (
-            this.data.OutLine.length &&
-            this.data.OutLine[0] &&
-            this.data.OutLine[0].length
-        ) {
-            let tempArr = this.data.OutLine;
-            this.minX = tempArr[0][0][0].X;
-            this.maxX = this.minX;
-            this.minY = -tempArr[0][0][0].Y;
-            this.maxY = this.minY;
-            // 处理轮廓点数组,同时计算最大最小值
-            this.pointArr = tempArr.map((t): SPoint[][] => {
-                let sPath = new SPath();
-                let tempArr = t.map((it): SPoint[] => {
-                    let array = it.map(
-                        (item): SPoint => {
-                            let x = item.X,
-                                y = -item.Y;
-                            if (x < this.minX) {
-                                this.minX = x;
-                            }
-                            if (y < this.minY) {
-                                this.minY = y;
-                            }
-                            if (x > this.maxX) {
-                                this.maxX = x;
-                            }
-                            if (y > this.maxY) {
-                                this.maxY = y;
-                            }
-                            return new SPoint(x, y);
-                        }
-                    );
-                    sPath.polygon(array);
-                    return array;
-                });
-                this.pathList.push(sPath);
-                return tempArr;
-            });
-        }
-    } // Constructor
-
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    boundingRect(): SRect {
-        return new SRect(
-            this.minX,
-            this.minY,
-            this.maxX - this.minX,
-            this.maxY - this.minY
-        );
-    } // Function boundingRect()
-
-    /**
-     * 鼠标单击事件
-     *
-     * @param   event   事件参数
-     * @return  boolean
-     */
-    onMouseDown(event: SMouseEvent): boolean {
-        if (this.selectable) {
-            this.selected = !this.selected;
-            this.clickPoint = new SPoint(event.x, event.y);
-        }
-        this.$emit("click", event);
-        return true;
-    } // Function onMouseDown()
-
-    /**
-     * 鼠标抬起事件
-     *
-     * @param   event   事件参数
-     * @return  boolean
-     */
-    onMouseUp(event: SMouseEvent): boolean {
-        return false;
-    } // Function onMouseUp()
-
-    /**
-     * 判断点是否在区域内
-     *
-     * @param x
-     * @param y
-     */
-    contains(x: number, y: number): boolean {
-        // return true;
-        for (let j = 0; j < this.pointArr.length; j++) {
-            let arr = this.pointArr[j];
-            if (arr.length < 1 || !SPolygonUtil.pointIn(x, y, arr[0])) {
-                continue;
-            }
-            if (arr.length == 1) {
-                return true;
-            }
-            let flag = false;
-            for (let i = 1; i < arr.length; i++) {
-                if (SPolygonUtil.pointIn(x, y, arr[i])) {
-                    flag = true;
-                    break;
-                }
-            }
-            if (flag) {
-                continue;
-            }
-            return true;
-        }
-        return false;
-    } // Function contains()
-
-    /**
-     * Item绘制操作
-     *
-     * @param   painter painter对象
-     * @param   rect    绘制区域
-     */
-    onDraw(painter: SPainter, rect?: SRect): void {
-        painter.pen.color = SColor.Transparent;
-        if (!this.selectable) {
-            painter.brush.color = this.unselectColor;
-        } else {
-            if (this.selected) {
-                painter.brush.color = this.selectColor;
-            } else if (this.highLightFlag) {
-                painter.brush.color = new SColor(this.data.Color);
-            } else if (this.isInfected) {
-                painter.brush.color = this.infectedColor;
-                // painter.pen.color = this.infectedBorder;
-            } else {
-                painter.brush.color = new SColor(
-                    `${this.data.Color}${Transparency[this.transparency]}`
-                );
-            }
-        }
-        painter.pen.lineWidth = painter.toPx(1);
-        this.pathList.forEach((t): void => {
-            painter.drawPath(t);
-        });
-        painter.brush.color = SColor.Black;
-        painter.font.size = painter.toPx(10);
-        if (this.clickPoint) {
-            painter.drawText(
-                this.data.RoomLocalName,
-                this.clickPoint.x,
-                this.clickPoint.y
-            );
-        }
-    } // Function onDraw()
-} // Class ZoneItem

+ 1 - 5
docs/guides/big/items/virtualWall.md

@@ -5,11 +5,7 @@
 
 ## 源代码
 
-::: details 查看代码
-
-<<< @/docs/guides/big/items/src/SVirtualWallItem.ts
-
-:::
+<GitCode fileUrl="/persagy-web-big/src/items/floor/SVirtualWallItem.ts" />
 
 ## 代码说明
     

+ 1 - 5
docs/guides/big/items/wall.md

@@ -5,11 +5,7 @@
 
 ## 源代码
 
-::: details 查看代码
-
-<<< @/docs/guides/big/items/src/SWallItem.ts
-
-:::
+<GitCode fileUrl="/persagy-web-big/src/items/floor/SWallItem.ts" />
 
 ## 代码说明
     

+ 1 - 5
docs/guides/big/items/window.md

@@ -5,11 +5,7 @@
 
 ## 源代码
 
-::: details 查看代码
-
-<<< @/docs/guides/big/items/src/SWindowItem.ts
-
-:::
+<GitCode fileUrl="/persagy-web-big/src/items/floor/SWindowItem.ts" />
 
 ## 代码说明
     

+ 1 - 5
docs/guides/big/items/zone.md

@@ -5,11 +5,7 @@
 
 ## 源代码
 
-::: details 查看代码
-
-<<< @/docs/guides/big/items/src/SZoneItem.ts
-
-:::
+<GitCode fileUrl="/persagy-web-big/src/items/floor/ZoneItem.ts" />
 
 ## 代码说明
     

+ 118 - 0
docs/guides/standard/javascript.md

@@ -1,3 +1,121 @@
 # javascript 编写规范
 
+::: details 目录
+[[toc]]
+:::
+
 [返回规范总览](./README.md)
+
+## JSDoc 注释规范
+
+### JSDoc 注释规则
+
+#### JSDoc注释一般应该放置在方法或函数声明之前,它必须以\/ \*\*开始,以便由<font color=red> JSDoc </font>解析器识别。其他任何以 \/\* , \/\*\*\* 或者超过3个星号的注释,都将被JSDoc解析器忽略。如下所示:
+
+```javascript
+/*
+
+** 一段简单的 JSDoc 注释。
+
+*/
+```
+#### JSDoc 的注释效果
+
+假如我们有一段这样的代码,没有任何注释,看起来是不是有一定的成本。
+```javascript
+function Book(title, author){
+    this.title=title;
+    this.author=author;
+}
+
+Book.prototype={
+    getTitle:function(){
+        return this.title;  
+    },
+    setPageNum:function(pageNum){
+        this.pageNum=pageNum;
+    }
+};
+```
+
+如果使用了<font color=red> JSDoc </font>注释该代码后,代码的可阅读性就大大的提高了。
+```javascript
+/**
+* Book类,代表一个书本.
+* @constructor
+* @param {string} title - 书本的标题.
+* @param {string} author - 书本的作者.
+*/
+function Book(title, author){
+    this.title=title;
+    this.author=author;
+}
+Book.prototype={
+    /**
+    * 获取书本的标题
+    * @returns {string|*} 返回当前的书本名称
+    */
+    getTitle:function(){
+        return this.title;   
+    },
+    /**
+    * 设置书本的页数
+    * @param pageNum {number} 页数
+    */
+    setPageNum:function(pageNum){
+        this.pageNum=pageNum;
+    }
+};
+```
+
+### @constructor 构造函数声明注释
+
+@constructor明确一个函数是某个类的构造函数。
+
+### @param 参数注释
+
+我们通常会使用@param来表示函数、类的方法的参数,@param是<font color=red> JSDoc </font>中最常用的注释标签。参数标签可表示一个参数的参数名、参数类型和参数描述的注释。如下所示:
+
+```javascript
+/**
+* @param {String} wording 需要说的句子
+*/
+
+function say(wording){
+    console.log(wording);
+}
+```
+
+### @return 返回值注释
+
+@return表示一个函数的返回值,如果函数没有显示指定返回值可不写。如下所示:
+
+```javascript
+/**
+* @return {Number} 返回值描述
+*/
+```
+
+### @example 示例注释
+
+@example通常用于表示示例代码,通常示例的代码会另起一行编写,如下所示:
+
+```javascript
+/**
+* @example
+* multiply(3, 2);
+*/
+```
+
+### 其他常用注释
+
+1. @overview对当前代码文件的描述。
+2. @copyright代码的版权信息。
+3. @author []代码的作者信息。
+4. @version当前代码的版本。
+
+### 更多参考
+
+如果想了解更多的<font color=red> JSDoc </font>注释的内容,可参考下面的链接。 
+
+[JSDoc 文档](https://jsdoc.app/index.html)

+ 67 - 0
docs/guides/standard/typescript.md

@@ -6,4 +6,71 @@
 
 [返回规范总览](./README.md)
 
+## 命名
+
+1. 使用<font color=red> PascalCase </font>为类型命名。
+2. 不要使用I做为接口名前缀。
+3. 使用<font color=red> PascalCase </font>为枚举值命名。
+4. 使用<font color=red> camelCase </font>为函数命名。
+5. 使用<font color=red> camelCase </font>为属性或本地变量命名。
+6. 不要为私有属性名添加_前缀。
+7. 尽可能使用完整的单词拼写命名。
+
+## 组件
+
+1. 1个文件对应一个逻辑组件 (比如:解析器,检查器)。
+2. <font color=red> .generated.*  </font>后缀的文件是自动生成的,不要手动改它。
+3. 不要导出类型/函数,除非你要在不同的组件中共享它。
+4. 不要在全局命名空间内定义类型/值。
+5. 共享的类型应该在<font color=red> types.ts </font>里定义。
+6. 在一个文件里,类型定义应该出现在顶部。
+
+## null和undefined
+
+使用``` undefined ```,不要使用``` null```。
+
+## 标记
+
+一个类型中有超过2个布尔属性时,把它变成一个标记。
+
+## 注释
+
+为函数,接口,枚举类型和类使用[JSDoc](./javascript.md)风格的注释。
+
+## 字符串
+
+1. 使用双引号""
+2. 所有要展示给用户看的信息字符串都要做好本地化工作(在<font color=red> diagnosticMessages.json </font>中创建新的实体)。
+
+## 错误提示信息
+
+1. 在句子结尾使用。
+2. 对不确定的实体使用不定冠词。
+3. 确切的实体应该使用名字(变量名,类型名等)
+4. 当创建一条新的规则时,主题应该使用单数形式(比如:An external module cannot...而不是External modules cannot)。
+5. 使用现在时态。
+6. 错误提示信息代码
+7. 提示信息被划分类成了一般的区间。如果要新加一个提示信息,在上条代码上加1做为新的代码。
+
+| 提示 | 意义 |
+| :-: | :-: |
+| 1000 | 语法信息 |
+| 2000 | 语言信息 |
+| 4000 | 声明生成信息 |
+| 5000 | 编译器选项信息 |
+| 6000 | 命令行编译器信息 |
+| 7000 | noImplicitAny信息 |
+
+## 风格
+
+1. 使用<font color=red> arrow </font>函数代替匿名函数表达式。
+2. 只要需要的时候才把arrow函数的参数括起来。
+3. 总是使用{}把循环体和条件语句括起来。
+4. 开始的{总是在同一行。
+5. 小括号里开始不要有空白。
+6. 逗号,冒号,分号后要有一个空格。
+7. 每个变量声明语句只声明一个变量
+   (比如 使用var x = 1; var y = 2;而不是var x = 1, y = 2;)。
+8. <font color=red> else </font>要在结束的}后另起一行。
+