Browse Source

代码分类 源码从git取

haojianlong 4 years ago
parent
commit
354955529e

+ 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" />
 
 ## 代码说明