Kaynağa Gözat

persagy-big 代码飞检。

sybotan 4 yıl önce
ebeveyn
işleme
ae50baf5e8
75 değiştirilmiş dosya ile 638 ekleme ve 541 silme
  1. 1 1
      persagy-web-big/package.json
  2. 2 1
      persagy-web-big/src/config/ItemColor.ts
  3. 2 1
      persagy-web-big/src/config/ItemOrder.ts
  4. 2 1
      persagy-web-big/src/config/Transparency.ts
  5. 1 0
      persagy-web-big/src/enums/SGraphElementType.ts
  6. 2 1
      persagy-web-big/src/enums/SItemStatus.ts
  7. 1 0
      persagy-web-big/src/enums/SLineType.ts
  8. 1 0
      persagy-web-big/src/enums/SMarkerType.ts
  9. 1 0
      persagy-web-big/src/enums/SRelationDir.ts
  10. 2 1
      persagy-web-big/src/enums/SRelationState.ts
  11. 15 17
      persagy-web-big/src/factories/SItemFactory.ts
  12. 1 1
      persagy-web-big/src/factories/STopoItemFactory.ts
  13. 12 10
      persagy-web-big/src/items/SArrowItem.ts
  14. 2 3
      persagy-web-big/src/items/SArrowPoly.ts
  15. 42 35
      persagy-web-big/src/items/SIconTextItem.ts
  16. 1 1
      persagy-web-big/src/items/SLayerItem.ts
  17. 69 62
      persagy-web-big/src/items/SLineItem.ts
  18. 82 59
      persagy-web-big/src/items/SPolygonItem.ts
  19. 91 69
      persagy-web-big/src/items/SPolylineItem.ts
  20. 8 8
      persagy-web-big/src/items/SRectSelectItem.ts
  21. 2 3
      persagy-web-big/src/items/STooltipItem.ts
  22. 10 10
      persagy-web-big/src/items/floor/SBoardItem.ts
  23. 3 5
      persagy-web-big/src/items/floor/SColumnItem.ts
  24. 16 16
      persagy-web-big/src/items/floor/SDoorItem.ts
  25. 6 5
      persagy-web-big/src/items/floor/SHighlightItem.ts
  26. 12 14
      persagy-web-big/src/items/floor/SSpaceItem.ts
  27. 4 3
      persagy-web-big/src/items/floor/SSpaceItems.ts
  28. 11 11
      persagy-web-big/src/items/floor/SVirtualWallItem.ts
  29. 3 7
      persagy-web-big/src/items/floor/SWallItem.ts
  30. 3 2
      persagy-web-big/src/items/floor/SWallItems.ts
  31. 13 13
      persagy-web-big/src/items/floor/SWindowItem.ts
  32. 13 9
      persagy-web-big/src/items/floor/ZoneItem.ts
  33. 27 21
      persagy-web-big/src/parser/SFloorParser.ts
  34. 3 2
      persagy-web-big/src/parser/SParser.ts
  35. 12 9
      persagy-web-big/src/parser/STopologyParser.ts
  36. 9 10
      persagy-web-big/src/parser/SZoneParser.ts
  37. 4 1
      persagy-web-big/src/types/BigPoint.ts
  38. 8 2
      persagy-web-big/src/types/FloorData.ts
  39. 6 6
      persagy-web-big/src/types/ImageData.ts
  40. 5 5
      persagy-web-big/src/types/Marker.ts
  41. 1 1
      persagy-web-big/src/types/MinDis.ts
  42. 1 1
      persagy-web-big/src/types/Outline.ts
  43. 3 1
      persagy-web-big/src/types/Place.ts
  44. 4 1
      persagy-web-big/src/types/PointToLine.ts
  45. 3 1
      persagy-web-big/src/types/Size.ts
  46. 5 5
      persagy-web-big/src/types/TextData.ts
  47. 3 1
      persagy-web-big/src/types/TopologyData.ts
  48. 5 5
      persagy-web-big/src/types/floor/Casement.ts
  49. 4 4
      persagy-web-big/src/types/floor/Column.ts
  50. 5 5
      persagy-web-big/src/types/floor/Door.ts
  51. 4 4
      persagy-web-big/src/types/floor/Space.ts
  52. 4 5
      persagy-web-big/src/types/floor/VirtualWall.ts
  53. 5 6
      persagy-web-big/src/types/floor/Wall.ts
  54. 3 4
      persagy-web-big/src/types/floor/Zone.ts
  55. 3 1
      persagy-web-big/src/types/topology/Anchor.ts
  56. 2 1
      persagy-web-big/src/types/topology/MarkerTopo.ts
  57. 4 2
      persagy-web-big/src/types/topology/Node.ts
  58. 8 6
      persagy-web-big/src/types/topology/Relation.ts
  59. 47 46
      persagy-web-big/src/utils/SMathUtil.ts
  60. 1 1
      persagy-web-draw/src/enums/SArrowStyleType.ts
  61. 1 1
      persagy-web-draw/src/enums/SCompositeType.ts
  62. 1 1
      persagy-web-edit/src/enums/SGraphLayoutType.ts
  63. 1 1
      persagy-web-edit/src/enums/SOrderSetType.ts
  64. 1 1
      persagy-web-graph/src/SGraphSelectContainer.ts
  65. 1 1
      persagy-web-graph/src/enums/SGraphLayoutType.ts
  66. 1 1
      persagy-web-graph/src/enums/SOrderSetType.ts
  67. 1 1
      persagy-web-graph/src/items/SAnchorItem.ts
  68. 1 1
      persagy-web-graph/src/items/SGraphAreaGroupItem.ts
  69. 1 1
      persagy-web-graph/src/items/SGraphPolyGroupItem.ts
  70. 1 1
      persagy-web-graph/src/items/SGraphShape.ts
  71. 1 1
      persagy-web-graph/src/items/SGraphSvgItem.ts
  72. 1 1
      persagy-web-graph/src/items/SObjectItem.ts
  73. 1 1
      persagy-web-graph/src/types/Point.ts
  74. 1 1
      persagy-web-graph/src/types/SGraphStyle.ts
  75. 1 1
      persagy-web-graph/src/types/Style.ts

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

@@ -3,7 +3,7 @@
     "version": "2.2.15",
     "description": "博锐尚格建筑信息化库",
     "main": "lib/index.js",
-    "types": "lib/index.d.js",
+    "types": "lib/index.d.js",ef
     "remote": {
         "host": "47.93.22.124",
         "path": "/opt/web/doc/api/web/big",

+ 2 - 1
persagy-web-big/src/config/ItemColor.ts

@@ -29,7 +29,8 @@ import { SColor } from "@persagy-web/draw";
 /**
  * 接口item颜色配置
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
+ * @deprecated
  */
 export class ItemColor {
     /** 墙颜色 */

+ 2 - 1
persagy-web-big/src/config/ItemOrder.ts

@@ -27,7 +27,8 @@
 /**
  * item层级类
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
+ * @deprecated
  */
 export class ItemOrder {
     /** 空间层级 */

+ 2 - 1
persagy-web-big/src/config/Transparency.ts

@@ -27,7 +27,8 @@
 /**
  * 透明度索引对应
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
+ * @deprecated
  */
 export const Transparency = [
     "00",

+ 1 - 0
persagy-web-big/src/enums/SGraphElementType.ts

@@ -28,6 +28,7 @@
  * 图标,区域类型
  *
  * @author  张宇
+ * @deprecated 万达
  */
 export enum SGraphElementType {
     /** 非图例 */

+ 2 - 1
persagy-web-big/src/enums/SItemStatus.ts

@@ -27,7 +27,8 @@
 /**
  * item状态
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
+ * @deprecated move to edit
  */
 export enum SItemStatus {
     /** 标准状态 */

+ 1 - 0
persagy-web-big/src/enums/SLineType.ts

@@ -28,6 +28,7 @@
  * 线类型
  *
  * @author  张宇
+ * @deprecated 万达
  */
 export enum SLineType {
     /** 直线 */

+ 1 - 0
persagy-web-big/src/enums/SMarkerType.ts

@@ -28,6 +28,7 @@
  * 标识对象类型
  *
  * @author  张宇
+ * @deprecated 万达
  */
 export enum SMarkerType {
     /** 图标 */

+ 1 - 0
persagy-web-big/src/enums/SRelationDir.ts

@@ -28,6 +28,7 @@
  * 关系方向
  *
  * @author  张宇
+ * @deprecated 万达
  */
 export enum SRelationDir {
     /** 无向 */

+ 2 - 1
persagy-web-big/src/enums/SRelationState.ts

@@ -27,7 +27,8 @@
 /**
  * 关系状态
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
+ * @deprecated
  */
 export enum SRelationState {
     /** 标准状态 */

+ 15 - 17
persagy-web-big/src/factories/SItemFactory.ts

@@ -42,22 +42,20 @@ import { Zone } from "../types/floor/Zone";
 /**
  * item创建工厂
  *
- * @author 郝建龙
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
-
 export class SItemFactory {
     /**
      * 构造函数
-     *
-     * */
+     */
     constructor() {} // Constructor
 
     /**
      * 创建柱子item
      *
      * @param   data    柱子数据
-     * @return  柱子item
-     * */
+     * @return  柱子 item
+     */
     createColumn(data: Column): SColumnItem {
         return new SColumnItem(null, data);
     } // Function createColumn()
@@ -66,8 +64,8 @@ export class SItemFactory {
      * 创建墙item
      *
      * @param   data    墙数据
-     * @return  墙item
-     * */
+     * @return  墙 item
+     */
     createWall(data: Wall): SWallItem {
         return new SWallItem(null, data);
     } // Function createWall()
@@ -76,8 +74,8 @@ export class SItemFactory {
      * 创建虚拟墙item
      *
      * @param   data    虚拟墙数据
-     * @return  虚拟墙item
-     * */
+     * @return  虚拟墙 item
+     */
     createVirtualWall(data: VirtualWall): SVirtualWallItem {
         return new SVirtualWallItem(null, data);
     } // Function createVirtualWall()
@@ -86,8 +84,8 @@ export class SItemFactory {
      * 创建空间item
      *
      * @param   data    空间数据
-     * @return  空间item
-     * */
+     * @return  空间 item
+     */
     createSpace(data: Space): SSpaceItem {
         return new SSpaceItem(null, data);
     } // Function createSpace()
@@ -97,7 +95,7 @@ export class SItemFactory {
      *
      * @param   data    门数据
      * @return  门item
-     * */
+     */
     createDoor(data: Door): SDoorItem {
         return new SDoorItem(null, data);
     } // Function createDoor()
@@ -106,8 +104,8 @@ export class SItemFactory {
      * 创建窗item
      *
      * @param   data    窗户数据
-     * @return  窗户item
-     * */
+     * @return  窗户 item
+     */
     createWindow(data: Casement): SWindowItem {
         return new SWindowItem(null, data);
     } // Function createWindow()
@@ -116,8 +114,8 @@ export class SItemFactory {
      * 创建业务空间item
      *
      * @param   data    业务空间数据
-     * @return  业务空间item
-     * */
+     * @return  业务空间 item
+     */
     createZone(data: Zone): SZoneItem {
         return new SZoneItem(null, data);
     } // Function createZone()

+ 1 - 1
persagy-web-big/src/factories/STopoItemFactory.ts

@@ -27,6 +27,6 @@
 /**
  * 拓扑图item创建工厂
  *
- * @author 郝建龙
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export class STopoItemFactory {} // Class STopoItemFactory

+ 12 - 10
persagy-web-big/src/items/SArrowItem.ts

@@ -29,35 +29,36 @@ import { SPolylineItem } from "..";
 import { SLineStyle } from "@persagy-web/graph";
 
 /**
- * 折线 箭头item
+ * 折线箭头 item
  *
- * @author 郝建龙
- * */
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
+ */
 export class SArrowItem extends SPolylineItem {
     /** 起始点样式 */
     _begin = SArrowStyleType.None;
     get begin(): SArrowStyleType {
         return this._begin;
-    }
+    } // Get begin
     set begin(v: SArrowStyleType) {
         this._begin = v;
         this.update();
-    }
+    } // Set begin
+
     /** 结束点样式 */
     _end = SArrowStyleType.None;
     get end(): SArrowStyleType {
         return this._end;
-    }
+    } // Get end
     set end(v: SArrowStyleType) {
         this._end = v;
         this.update();
-    }
+    } // Set end
 
     /**
      * 绘制基本图形
      *
-     * @param   painter painter对象
-     * */
+     * @param painter   绘制对象
+     */
     drawBaseLine(painter: SPainter): void {
         // 绘制基本图形
         if (this.lineStyle == SLineStyle.Dashed) {
@@ -71,6 +72,7 @@ export class SArrowItem extends SPolylineItem {
                 painter.toPx(this.lineWidth)
             ];
         }
+
         painter.pen.color = this.strokeColor;
         painter.drawArrowLine(this.pointList[0], this.pointList[1], {
             begin: this.begin,
@@ -86,4 +88,4 @@ export class SArrowItem extends SPolylineItem {
         );
         painter.drawPolyline(this.pointList);
     } // Function drawBaseLine()
-}
+} // Class SArrowItem

+ 2 - 3
persagy-web-big/src/items/SArrowPoly.ts

@@ -29,7 +29,6 @@ import { SGraphItem } from "@persagy-web/graph";
 /**
  * 箭头多边形类型
  *
- * @author  郝建龙
- * */
-
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
+ */
 export class SArrowPoly extends SGraphItem {} // Class SArrowPoly

+ 42 - 35
persagy-web-big/src/items/SIconTextItem.ts

@@ -44,15 +44,16 @@ import {
 import { Anchor } from "../types/topology/Anchor";
 
 /**
- * 图例item  icon
+ * 图例 item
  *
- * */
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
+ */
 export class SIconTextItem extends SObjectItem {
-    /** item状态 */
+    /** item 状态 */
     _status: SItemStatus = SItemStatus.Normal;
     get status(): SItemStatus {
         return this._status;
-    }
+    } // Get status
     set status(v: SItemStatus) {
         this._status = v;
         if (v == SItemStatus.Normal) {
@@ -69,13 +70,13 @@ export class SIconTextItem extends SObjectItem {
             this.img.moveable = false;
         }
         this.update();
-    }
+    } // Set status
 
     /** 是否显示文字 */
     _showText: boolean = true;
     get showText(): boolean {
         return this._showText;
-    }
+    } // Get showText
     set showText(v: boolean) {
         if (v === this._showText) {
             return;
@@ -86,7 +87,7 @@ export class SIconTextItem extends SObjectItem {
         } else {
             this.textItem.hide();
         }
-    }
+    } // Set showText
 
     /** 是否被选中 */
     get selected(): boolean {
@@ -137,7 +138,7 @@ export class SIconTextItem extends SObjectItem {
         this.update();
     } // Set activeColor
 
-    /** X轴坐标 */
+    /** X 轴坐标 */
     get x(): number {
         return this.pos.x;
     } // Get x
@@ -146,7 +147,8 @@ export class SIconTextItem extends SObjectItem {
         this.$emit("changePos");
         this.update();
     } // Set x
-    /** Y轴坐标 */
+
+    /** Y 轴坐标 */
     get y(): number {
         return this.pos.y;
     } // Get y
@@ -159,7 +161,7 @@ export class SIconTextItem extends SObjectItem {
     /** icon宽 */
     get sWidth(): number {
         return this.img.width;
-    }
+    } // Get sWidth
     set sWidth(v: number) {
         this.img.width = v;
         this.img.origin = new SPoint(
@@ -168,12 +170,12 @@ export class SIconTextItem extends SObjectItem {
         );
         this.changeAnchorPoint();
         this.update();
-    }
+    } // Set sWidth
 
     /** icon高 */
     get sHeight(): number {
         return this.img.height;
-    }
+    } // Get sHeight
     set sHeight(v: number) {
         this.img.height = v;
         this.img.origin = new SPoint(
@@ -182,47 +184,51 @@ export class SIconTextItem extends SObjectItem {
         );
         this.changeAnchorPoint();
         this.update();
-    }
+    } // Set sHeight
 
     /** 是否显示锚点 */
     private _showAnchor: boolean = false;
     get showAnchor(): boolean {
         return this._showAnchor;
-    }
+    } // Get showAnchor
     set showAnchor(v: boolean) {
         this._showAnchor = v;
         this.anchorList.forEach(t => {
             t.visible = v;
         });
-    }
+    } // Set showAnchor
+
     /** 文本内容 */
     get text(): string {
         return this.textItem.text;
-    }
+    } // Get text
     set text(v: string) {
         this.textItem.text = v;
         this.update();
-    }
+    } // Set text
+
     /** 文本颜色 */
     get color(): SColor {
         return this.textItem.color;
-    }
+    } // Get color
     set color(v: SColor) {
         this.textItem.color = v;
         this.update();
-    }
+    } // Get color
+
     /** 文本字体 */
     get font(): SFont {
         return this.textItem.font;
-    }
+    } // Get font
     set font(v: SFont) {
         this.textItem.font = v;
         this.update();
-    }
+    } // Set font
+
     /** img Item */
     img: SImageItem = new SImageItem(this);
 
-    /** text item */
+    /** text Item */
     textItem: STextItem = new STextItem(this);
 
     /**
@@ -230,7 +236,7 @@ export class SIconTextItem extends SObjectItem {
      *
      * @param   parent  父类
      * @param   data    锚点数据
-     * */
+     */
     constructor(parent: SGraphItem | null, data?: Anchor[]) {
         super(parent);
         this.img.width = 32;
@@ -279,12 +285,11 @@ export class SIconTextItem extends SObjectItem {
         );
         this.moveable = true;
         this.selectable = true;
-    }
+    } // Constructor
 
     /**
      * 计算并移动锚点的位置
-     *
-     * */
+     */
     private changeAnchorPoint(): void {
         // 判断是否有锚点
         if (this.anchorList.length) {
@@ -309,7 +314,7 @@ export class SIconTextItem extends SObjectItem {
      *
      * @param   event   事件对象
      * @return  是否处理事件
-     * */
+     */
     onMouseDown(event: SMouseEvent): boolean {
         if (this.status == SItemStatus.Normal) {
             return super.onMouseDown(event);
@@ -324,8 +329,8 @@ export class SIconTextItem extends SObjectItem {
      *
      * @param   oldSize 改之前的大小
      * @param   newSize 改之后大小
-     * */
-    onResize(oldSize: SSize, newSize: SSize) {
+     */
+    onResize(oldSize: SSize, newSize: SSize): void {
         console.log(arguments);
     } // Function onResize()
 
@@ -334,7 +339,7 @@ export class SIconTextItem extends SObjectItem {
      *
      * @param   event   鼠标事件
      * @return  是否处理事件
-     * */
+     */
     onDoubleClick(event: SMouseEvent): boolean {
         // 如果位show状态 双击改对象则需改为编辑状态
         if (SItemStatus.Normal == this.status) {
@@ -349,10 +354,10 @@ export class SIconTextItem extends SObjectItem {
     } // Function onDoubleClick()
 
     /**
-     * 宽高发生变化
+     * Item 对象边界区域
      *
-     * @return  SRect   所有子对象的并集
-     * */
+     * @return  边界矩阵
+     */
     boundingRect(): SRect {
         let rect = this.img
             .boundingRect()
@@ -364,13 +369,14 @@ export class SIconTextItem extends SObjectItem {
                     .adjusted(this.textItem.pos.x, this.textItem.pos.y, 0, 0)
             );
         }
+
         return rect.adjusted(-5, -5, 10, 10);
     } // Function boundingRect()
 
     /**
-     * Item绘制操作
+     * Item 绘制操作
      *
-     * @param   painter painter对象
+     * @param painter   绘制对象
      */
     onDraw(painter: SPainter): void {
         if (this.status == SItemStatus.Edit) {
@@ -380,6 +386,7 @@ export class SIconTextItem extends SObjectItem {
             painter.brush.color = SColor.Transparent;
             painter.drawRect(this.boundingRect());
         }
+
         if (this.isActive) {
             painter.pen.color = SColor.Transparent;
             painter.brush.color = this.activeColor;

+ 1 - 1
persagy-web-big/src/items/SLayerItem.ts

@@ -29,6 +29,6 @@ import { SGraphItem } from "@persagy-web/graph";
 /**
  *  编辑器图层-图层锁定,业务层组合使用
  *
- * * @author  郝建龙(1061851420@qq.com)
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export class SLayerItem extends SGraphItem {} // Class SLayerItem

+ 69 - 62
persagy-web-big/src/items/SLineItem.ts

@@ -36,19 +36,18 @@ import {
 } from "@persagy-web/graph";
 
 /**
- * 直线item
+ * 直线 item
  *
- * @author  张宇(taohuzy@163.com)
- * */
-
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
+ */
 export class SLineItem extends SGraphItem {
-    /** X坐标最小值 */
+    /** X 坐标最小值 */
     private minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值 */
+    /** X 坐标最大值 */
     private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值 */
+    /** Y 坐标最小值 */
     private minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值 */
+    /** Y 坐标最大值 */
     private maxY = Number.MIN_SAFE_INTEGER;
 
     /** 线段 */
@@ -134,56 +133,56 @@ export class SLineItem extends SGraphItem {
     /** 当前点坐标 */
     private curPoint: SPoint | null = null;
 
-    /** undo/redo堆栈 */
+    /** undo/redo 堆栈 */
     private undoStack: SUndoStack = new SUndoStack();
 
     /**
      * 构造函数
      *
-     * @param   parent  父级
-     * */
+     * @param parent  父级
+     */
     constructor(parent: SGraphItem | null);
 
     /**
      * 构造函数
      *
-     * @param   parent  父级
-     * @param   line    坐标集合
-     * */
+     * @param parent  父级
+     * @param line    坐标集合
+     */
     constructor(parent: SGraphItem | null, line: SPoint[]);
 
     /**
      * 构造函数
      *
-     * @param   parent  父级
-     * @param   point   第一个点坐标
-     * */
+     * @param parent  父级
+     * @param point   第一个点坐标
+     */
     constructor(parent: SGraphItem | null, point: SPoint);
 
     /**
      * 构造函数
      *
-     * @param   parent  父级
-     * @param   l       坐标集合|第一个点坐标
-     * */
-    constructor(parent: SGraphItem | null, l?: SPoint | SPoint[]) {
+     * @param parent    父级
+     * @param line      坐标集合|第一个点坐标
+     */
+    constructor(parent: SGraphItem | null, line?: SPoint | SPoint[]) {
         super(parent);
-        if (l) {
-            if (l instanceof SPoint) {
-                this.line.push(l);
+        if (line) {
+            if (line instanceof SPoint) {
+                this.line.push(line);
             } else {
-                this.line = l;
+                this.line = line;
             }
         } else {
             this.line = [];
         }
-    }
+    } // Constructor
 
     /**
      * 添加点至数组中
      *
-     * @param   p       添加的点
-     * */
+     * @param p 添加的点
+     */
     private addPoint(p: SPoint): void {
         if (this.line.length < 2) {
             this.line.push(p);
@@ -201,8 +200,8 @@ export class SLineItem extends SGraphItem {
     /**
      * 鼠标双击事件
      *
-     * @param	event         事件参数
-     * @return	boolean
+     * @param event     事件参数
+     * @return 是否处理事件
      */
     onDoubleClick(event: SMouseEvent): boolean {
         if (this.status == SItemStatus.Normal) {
@@ -219,9 +218,9 @@ export class SLineItem extends SGraphItem {
     /**
      * 鼠标按下事件
      *
-     * @param   event   鼠标事件
-     * @return  是否处理事件
-     * */
+     * @param event     鼠标事件
+     * @return 是否处理事件
+     */
     onMouseDown(event: SMouseEvent): boolean {
         this.curIndex = -1;
         this.curPoint = null;
@@ -239,14 +238,15 @@ export class SLineItem extends SGraphItem {
                 return true;
             }
         }
+
         return true;
     } // Function onMouseDown()
 
     /**
      * 鼠标抬起事件
      *
-     * @param	event         事件参数
-     * @return	boolean
+     * @param event     事件参数
+     * @return 是否处理事件
      */
     onMouseUp(event: SMouseEvent): boolean {
         if (this.status == SItemStatus.Edit) {
@@ -266,6 +266,7 @@ export class SLineItem extends SGraphItem {
             this.moveToOrigin(this.x, this.y);
             return super.onMouseUp(event);
         }
+
         this.curIndex = -1;
         this.curPoint = null;
         return true;
@@ -274,13 +275,14 @@ export class SLineItem extends SGraphItem {
     /**
      * 鼠标移动事件
      *
-     * @param   event   鼠标事件
-     * @return  是否处理事件
-     * */
+     * @param event     事件参数
+     * @return 是否处理事件
+     */
     onMouseMove(event: SMouseEvent): boolean {
         if (event.shiftKey) {
             event = this.compare(event);
         }
+
         if (this.status == SItemStatus.Create) {
             if (this.line[0] instanceof SPoint) {
                 this.line[1] = new SPoint(event.x, event.y);
@@ -293,15 +295,16 @@ export class SLineItem extends SGraphItem {
         } else {
             return super.onMouseMove(event);
         }
+
         this.update();
         return true;
     } // Function onMouseMove()
 
     /**
-     * 获取点击点与Point[]中的点距离最近点
+     * 获取点击点与 Point[] 中的点距离最近点
      *
-     * @param   p   鼠标点击点
-     * */
+     * @param p     鼠标点击点
+     */
     findNearestPoint(p: SPoint): void {
         let len = this.sceneDis;
         for (let i = 0; i < this.line.length; i++) {
@@ -322,11 +325,11 @@ export class SLineItem extends SGraphItem {
     /**
      * 记录相关动作并推入栈中
      *
-     * @param	SGraphCommand   相关命令类
-     * @param	any             对应传入参数
+     * @param SGraphCommand 相关命令类
+     * @param any           对应传入参数
      */
     protected recordAction(SGraphCommand: any, any: any[]): void {
-        // 记录相关命令并推入堆栈中
+        // 记录相关命令并推入堆栈中 todo
         const command = new SGraphCommand(this.scene, this, ...any);
         this.undoStack.push(command);
     } // Function recordAction()
@@ -334,9 +337,9 @@ export class SLineItem extends SGraphItem {
     /**
      * 移动后处理所有坐标,并肩原点置为场景原点
      *
-     * @param   x   x坐标
-     * @param   y   y坐标
-     * */
+     * @param x     x 坐标
+     * @param y     y 坐标
+     */
     moveToOrigin(x: number, y: number): void {
         super.moveToOrigin(x, y);
         this.line = this.line.map(t => {
@@ -349,10 +352,11 @@ export class SLineItem extends SGraphItem {
     } // Function moveToOrigin()
 
     /**
-     * shift垂直水平创建或编辑
+     * shift 垂直水平创建或编辑
      *
-     * @param   event   事件
-     * */
+     * @param event     事件
+     * @return 处理后的事件对象
+     */
     compare(event: SMouseEvent): SMouseEvent {
         if (this.line.length) {
             let last = new SPoint(event.x, event.y);
@@ -373,15 +377,16 @@ export class SLineItem extends SGraphItem {
                 event.y = last.y;
             }
         }
+
         return event;
     } // Function compare()
 
     /**
      * 判断点是否在区域内
      *
-     * @param   x
-     * @param   y
-     * @return  true-
+     * @param x     x 坐标
+     * @param y     y 坐标
+     * @return 是否包含
      */
     contains(x: number, y: number): boolean {
         if (this.line.length == 2) {
@@ -393,12 +398,12 @@ export class SLineItem extends SGraphItem {
                 return true;
             }
         }
+
         return false;
     } // Function contains()
 
     /**
      * 撤销操作
-     *
      */
     undo(): void {
         if (this.status != SItemStatus.Normal) {
@@ -408,7 +413,6 @@ export class SLineItem extends SGraphItem {
 
     /**
      * 重做操作
-     *
      */
     redo(): void {
         if (this.status != SItemStatus.Normal) {
@@ -417,9 +421,8 @@ export class SLineItem extends SGraphItem {
     } // Function redo()
 
     /**
-     * 取消操作item事件
-     *
-     * */
+     * 取消操作 item 事件
+     */
     cancelOperate(): void {
         if (this.status == SItemStatus.Create) {
             this.parent = null;
@@ -431,9 +434,9 @@ export class SLineItem extends SGraphItem {
     } // Function cancelOperate()
 
     /**
-     * Item对象边界区域
+     * Item 对象边界区域
      *
-     * @return	SRect
+     * @return 边界区域
      */
     boundingRect(): SRect {
         if (this.line.length) {
@@ -458,6 +461,7 @@ export class SLineItem extends SGraphItem {
                 }
             });
         }
+
         return new SRect(
             this.minX,
             this.minY,
@@ -467,9 +471,9 @@ export class SLineItem extends SGraphItem {
     } // Function boundingRect()
 
     /**
-     * Item绘制操作
+     * Item 绘制操作
      *
-     * @param   painter painter对象
+     * @param painter   绘制对象
      */
     onDraw(painter: SPainter): void {
         this.sceneDis = painter.toPx(this.dis);
@@ -489,6 +493,7 @@ export class SLineItem extends SGraphItem {
                     painter.toPx(this.lineWidth)
                 ];
             }
+
             if (this.selected && this.status == SItemStatus.Normal) {
                 painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
                 painter.shadow.shadowBlur = 10;
@@ -496,6 +501,7 @@ export class SLineItem extends SGraphItem {
                 painter.shadow.shadowOffsetX = 5;
                 painter.shadow.shadowOffsetY = 5;
             }
+
             painter.drawLine(this.line[0], this.line[1]);
             if (
                 this.status == SItemStatus.Edit ||
@@ -507,6 +513,7 @@ export class SLineItem extends SGraphItem {
                     if (i == this.curIndex) {
                         painter.brush.color = this.activeFillColor;
                     }
+
                     painter.drawCircle(p.x, p.y, painter.toPx(5));
                 });
             }

+ 82 - 59
persagy-web-big/src/items/SPolygonItem.ts

@@ -47,40 +47,38 @@ import { SMathUtil } from "../utils/SMathUtil";
 /**
  * 编辑多边形
  *
- * @author  韩耀龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export class SPolygonItem extends SGraphItem {
-    /** X坐标最小值 */
+    /** X 坐标最小值 */
     private minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值 */
+    /** X 坐标最大值 */
     private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值 */
+    /** Y 坐标最小值 */
     private minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值 */
+    /** Y 坐标最大值 */
     private maxY = Number.MIN_SAFE_INTEGER;
 
     /** 轮廓线坐标 */
     private pointList: SPoint[] = [];
-    // 获取当前状态
     get getPointList(): SPoint[] {
         return this.pointList;
-    }
-    // 编辑当前状态
+    } // Get getPointList
     set setPointList(arr: SPoint[]) {
         this.pointList = arr;
         this.update();
-    }
+    } // Set getPointList
 
     /** 当前状态 */
     protected _status: number = SItemStatus.Normal;
     get status(): SItemStatus {
         return this._status;
-    }
+    } // Get status
     set status(value: SItemStatus) {
         this._status = value;
         this.undoStack.clear();
         this.update();
-    }
+    } // Set status
 
     /** 边框颜色 */
     _strokeColor: SColor = new SColor("#0091FF");
@@ -137,7 +135,7 @@ export class SPolygonItem extends SGraphItem {
     private scenceLen: number = 15;
     /** 场景像素 */
     private isAlt: boolean = false;
-    /** undo/redo堆栈 */
+    /** undo/redo 堆栈 */
     protected undoStack: SUndoStack = new SUndoStack();
 
     /**
@@ -155,10 +153,10 @@ export class SPolygonItem extends SGraphItem {
     /**
      * 储存新的多边形顶点
      *
-     * @param x   点位得x坐标
-     * @param y   点位得y坐标
+     * @param x   点位得 x 坐标
+     * @param y   点位得 y 坐标
      * @param i   储存所在索引
-     * @return SPoint添加的顶点
+     * @return SPoint 添加的顶点
      */
     insertPoint(x: number, y: number, i: number | null = null): SPoint {
         const point = new SPoint(x, y);
@@ -175,7 +173,7 @@ export class SPolygonItem extends SGraphItem {
      * 删除点位
      *
      * @param i   删除点所在的索引
-     * @return    SPoint|null。索引不在数组范围则返回null
+     * @return 索引不在数组范围则返回 null
      */
     deletePoint(i: number | null = null): SPoint | null {
         let point = null;
@@ -203,20 +201,22 @@ export class SPolygonItem extends SGraphItem {
     /**
      * 多边形顶点的移动位置
      *
-     * @param x   点位得x坐标
-     * @param y   点位得y坐标
-     * @param i   点位得i坐标
-     * @return    移动对应得点。如果索引无法找到移动顶点,则返回null
+     * @param x   点位得 x 坐标
+     * @param y   点位得 y 坐标
+     * @param i   点位得 i 坐标
+     * @return    移动对应得点。如果索引无法找到移动顶点,则返回 null
      */
     movePoint(x: number, y: number, i: number): SPoint | null {
         let point = null;
         if (i >= this.pointList.length || i < 0) {
             return null;
         }
+
         if (this.pointList.length) {
             this.pointList[i].x = x;
             this.pointList[i].y = y;
         }
+
         point = this.pointList[i];
         return point;
     } // Function movePoint()
@@ -247,6 +247,7 @@ export class SPolygonItem extends SGraphItem {
                 painter.toPx(this.lineWidth)
             ];
         }
+
         if (this.selected) {
             painter.shadow.shadowBlur = 10;
             painter.shadow.shadowColor = new SColor(`#00000033`);
@@ -255,6 +256,7 @@ export class SPolygonItem extends SGraphItem {
         } else {
             painter.shadow.shadowColor = SColor.Transparent;
         }
+
         painter.drawPolygon([...pointList]);
         painter.restore();
     } // Function drawShowPolygon()
@@ -277,6 +279,7 @@ export class SPolygonItem extends SGraphItem {
                 this.lastPoint.y
             );
         }
+
         painter.drawPolyline(pointList);
         painter.pen.color = SColor.Transparent;
         painter.brush.color = new SColor(this.fillColor.value);
@@ -316,10 +319,9 @@ export class SPolygonItem extends SGraphItem {
     } // Function drawCreatePolygon()
 
     /**
-     *
      * 编辑状态 --绘制多边形数组
      *
-     * @param painter    绘制类
+     * @param painter       绘制类
      * @param pointList    绘制多边形数组
      */
     protected drawEditPolygon(painter: SPainter, pointList: SPoint[]): void {
@@ -337,6 +339,7 @@ export class SPolygonItem extends SGraphItem {
             if (index == this.curIndex) {
                 painter.brush.color = new SColor("#2196f3");
             }
+
             painter.drawCircle(item.x, item.y, painter.toPx(this.len / 2));
         });
     } // Function drawCreatePolygon()
@@ -345,8 +348,6 @@ export class SPolygonItem extends SGraphItem {
      * 编辑状态操作多边形数组
      *
      * @param event    鼠标事件
-     *
-     *
      */
     protected editPolygonPoint(event: SMouseEvent): void {
         //  判断是否为删除状态 isAlt = true为删除状态
@@ -371,6 +372,7 @@ export class SPolygonItem extends SGraphItem {
                 if (this.pointList.length <= 3) {
                     return;
                 }
+
                 const delePoint = new SPoint(
                     this.pointList[lenIndex].x,
                     this.pointList[lenIndex].y
@@ -421,12 +423,14 @@ export class SPolygonItem extends SGraphItem {
                                 new SLine(this.pointList[i], this.pointList[0])
                             );
                         }
+
                         if (dis.MinDis < len.MinDis) {
                             len = dis;
                             index = i;
                         }
                     }
                 }
+
                 // 判断是否有点
                 if (len.Point) {
                     // 点在了多边形的边上
@@ -460,8 +464,9 @@ export class SPolygonItem extends SGraphItem {
 
     /**
      * 记录相关动作并推入栈中
-     * @param	SGraphCommand         相关命令类
-     * @param	any                    对应传入参数
+     *
+     * @param	SGraphCommand   相关命令类
+     * @param	any             对应传入参数
      */
     protected recordAction(SGraphCommand: any, any: any[]): void {
         // 记录相关命令并推入堆栈中
@@ -495,8 +500,8 @@ export class SPolygonItem extends SGraphItem {
     /**
      * 鼠标双击事件
      *
-     * @param	event         事件参数
-     * @return	boolean
+     * @param event   事件参数
+     * @return 是否处理
      */
     onDoubleClick(event: SMouseEvent): boolean {
         // 如果位show状态 双击改对象则需改为编辑状态
@@ -507,6 +512,7 @@ export class SPolygonItem extends SGraphItem {
             this.status = SItemStatus.Normal;
             this.releaseItem();
         }
+
         this.update();
         return true;
     } // Function onDoubleClick()
@@ -514,8 +520,8 @@ export class SPolygonItem extends SGraphItem {
     /**
      * 键盘事件
      *
-     * @param	event         事件参数
-     * @return	boolean
+     * @param event     事件参数
+     * @return 是否处理
      */
 
     onKeyDown(event: KeyboardEvent): boolean {
@@ -537,6 +543,7 @@ export class SPolygonItem extends SGraphItem {
                 this.isAlt = true;
             }
         }
+
         this.update();
         return true;
     } // Function onKeyDown()
@@ -544,8 +551,8 @@ export class SPolygonItem extends SGraphItem {
     /**
      * 键盘键抬起事件
      *
-     * @param	event         事件参数
-     * @return	boolean
+     * @param event     事件参数
+     * @return 是否处理
      */
     onKeyUp(event: KeyboardEvent): void {
         if (this.status == SItemStatus.Edit) {
@@ -558,19 +565,21 @@ export class SPolygonItem extends SGraphItem {
                 }
             }
         }
+
         this.update();
     } // Function onKeyUp()
 
     /**
      * 鼠标按下事件
      *
-     * @param	event         事件参数
-     * @return	boolean
+     * @param event     事件参数
+     * @return 是否处理
      */
     onMouseDown(event: SMouseEvent): boolean {
         if (event.shiftKey) {
             event = this.compare(event);
         }
+
         // 如果状态为编辑状态则添加点
         if (this.status == SItemStatus.Create) {
             // 新增顶点
@@ -583,6 +592,7 @@ export class SPolygonItem extends SGraphItem {
                     this.pointList[0].y
                 );
             }
+
             if (this.pointList.length > 2 && len > 0 && len < this.scenceLen) {
                 this.status = SItemStatus.Normal;
                 //3 传递完成事件状态
@@ -601,14 +611,15 @@ export class SPolygonItem extends SGraphItem {
         } else {
             return super.onMouseDown(event);
         }
+
         return true;
     } // Function onMouseDown()
 
     /**
      * 鼠标移入事件
      *
-     * @param	event         事件参数
-     * @return	boolean
+     * @param event     事件参数
+     * @return 是否处理
      */
     onMouseEnter(event: SMouseEvent): boolean {
         return true;
@@ -617,10 +628,9 @@ export class SPolygonItem extends SGraphItem {
     /**
      * 鼠标移出事件
      *
-     * @param	event         事件参数
-     * @return	boolean
+     * @param event     事件参数
+     * @return 是否处理
      */
-
     onMouseLeave(event: SMouseEvent): boolean {
         return true;
     } // Function onMouseLeave()
@@ -628,14 +638,14 @@ export class SPolygonItem extends SGraphItem {
     /**
      * 鼠标移动事件
      *
-     * @param	event         事件参数
-     * @return	boolean
+     * @param event     事件参数
+     * @return 是否处理
      */
-
     onMouseMove(event: SMouseEvent): boolean {
         if (event.shiftKey) {
             event = this.compare(event);
         }
+
         if (this.status == SItemStatus.Create) {
             this.lastPoint = new SPoint();
             this.lastPoint.x = event.x;
@@ -648,18 +658,21 @@ export class SPolygonItem extends SGraphItem {
                     this.pointList[this.curIndex].y = event.y;
                 }
             }
+
             this.update();
         } else {
             return super.onMouseMove(event);
         }
+
         return true;
     } // Function onMouseMove()
 
     /**
-     * shift垂直水平创建或编辑
+     * shift 垂直水平创建或编辑
      *
-     * @param   event   事件
-     * */
+     * @param event     事件
+     * @return 处理后的事件
+     */
     compare(event: SMouseEvent): SMouseEvent {
         if (this.pointList.length) {
             let last = new SPoint(event.x, event.y);
@@ -670,6 +683,7 @@ export class SPolygonItem extends SGraphItem {
                     last = this.pointList[this.curIndex - 1];
                 }
             }
+
             const dx = Math.abs(event.x - last.x);
             const dy = Math.abs(event.y - last.y);
             if (dy > dx) {
@@ -678,14 +692,15 @@ export class SPolygonItem extends SGraphItem {
                 event.y = last.y;
             }
         }
+
         return event;
     } // Function compare()
 
     /**
      * 鼠标抬起事件
      *
-     * @param	event         事件参数
-     * @return	boolean
+     * @param event     事件参数
+     * @return 是否处理
      */
     onMouseUp(event: SMouseEvent): boolean {
         if (this.status == SItemStatus.Edit) {
@@ -705,15 +720,16 @@ export class SPolygonItem extends SGraphItem {
             this.moveToOrigin(this.x, this.y);
             return super.onMouseUp(event);
         }
+
         return true;
     } // Function onMouseUp()
 
     /**
      * 移动后处理所有坐标,并肩原点置为场景原点
      *
-     * @param   x   x坐标
-     * @param   y   y坐标
-     * */
+     * @param x   x 坐标
+     * @param y   y 坐标
+     */
     moveToOrigin(x: number, y: number): void {
         super.moveToOrigin(x, y);
         this.pointList = this.pointList.map(t => {
@@ -728,8 +744,8 @@ export class SPolygonItem extends SGraphItem {
     /**
      * 适配事件
      *
-     * @param	event         事件参数
-     * @return	boolean
+     * @param event     事件参数
+     * @return 是否处理
      */
     onResize(event: SMouseEvent): boolean {
         return true;
@@ -737,7 +753,6 @@ export class SPolygonItem extends SGraphItem {
 
     /**
      * 取消操作
-     *
      */
     cancelOperate(): void {
         // 当状态为展示状态
@@ -748,13 +763,14 @@ export class SPolygonItem extends SGraphItem {
             // 编辑状态
             this.status = SItemStatus.Normal;
         }
+
         this.update();
     } // Function cancelOperate()
 
     /**
-     * Item对象边界区域
+     * Item 对象边界区域
      *
-     * @return SRect
+     * @return 边界区域
      */
     boundingRect(): SRect {
         if (this.pointList.length) {
@@ -768,17 +784,22 @@ export class SPolygonItem extends SGraphItem {
                 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 SRect(
             this.minX,
             this.minY,
@@ -790,21 +811,23 @@ export class SPolygonItem extends SGraphItem {
     /**
      * 判断点是否在区域内
      *
-     * @param x
-     * @param y
+     * @param x     x 坐标
+     * @param y     y 坐标
+     * @return 是否在区域内
      */
     contains(x: number, y: number): boolean {
         let arr = this.pointList;
         if (arr.length < 3 || !SPolygonUtil.pointIn(x, y, arr)) {
             return false;
         }
+
         return true;
     } // Function contains()
 
     /**
-     * Item绘制操作
+     * Item 绘制操作
      *
-     * @param   painter       painter对象
+     * @param painter   绘制对象
      */
     onDraw(painter: SPainter): void {
         this.scenceLen = painter.toPx(this.len);

+ 91 - 69
persagy-web-big/src/items/SPolylineItem.ts

@@ -37,19 +37,18 @@ import {
 } from "@persagy-web/graph";
 
 /**
- * 折线item
+ * 折线 item
  *
- * @author  郝建龙
- * */
-
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
+ */
 export class SPolylineItem extends SGraphItem {
-    /** X坐标最小值 */
+    /** X 坐标最小值 */
     private minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值 */
+    /** X 坐标最大值 */
     private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值 */
+    /** Y 坐标最小值 */
     private minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值 */
+    /** Y 坐标最大值 */
     private maxY = Number.MIN_SAFE_INTEGER;
     /** 折点信息 */
     pointList: SPoint[] = [];
@@ -63,6 +62,7 @@ export class SPolylineItem extends SGraphItem {
         this.undoStack.clear();
         this.update();
     } // Set status
+
     /** 鼠标移动时的点 */
     protected lastPoint: SPoint | null = null;
     /** 线条颜色 */
@@ -74,6 +74,7 @@ export class SPolylineItem extends SGraphItem {
         this._strokeColor = v;
         this.update();
     } // Set strokeColor
+
     /** 填充色 */
     _fillColor: SColor = new SColor("#2196f3");
     get fillColor(): SColor {
@@ -83,6 +84,7 @@ export class SPolylineItem extends SGraphItem {
         this._fillColor = v;
         this.update();
     } // Set fillColor
+
     /** 线条宽度 */
     _lineWidth: number = 1;
     get lineWidth(): number {
@@ -92,6 +94,7 @@ export class SPolylineItem extends SGraphItem {
         this._lineWidth = v;
         this.update();
     } // Set lineWidth
+
     /** 边框样式 */
     _lineStyle: SLineStyle = SLineStyle.Solid;
     get lineStyle(): SLineStyle {
@@ -101,6 +104,7 @@ export class SPolylineItem extends SGraphItem {
         this._lineStyle = v;
         this.update();
     } // Set lineStyle
+
     /** 全局灵敏度 */
     dis: number = 10;
     /** 灵敏度转换为场景长度 */
@@ -109,31 +113,31 @@ export class SPolylineItem extends SGraphItem {
     protected curIndex: number = -1;
     /** 当前点 */
     private curPoint: SPoint | null = null;
-    /** undo/redo堆栈 */
+    /** undo/redo 堆栈 */
     private undoStack: SUndoStack = new SUndoStack();
 
     /**
      * 构造函数
      *
-     * @param   parent  父级
-     * @param   list    坐标集合
-     * */
+     * @param parent    父级
+     * @param list      坐标集合
+     */
     constructor(parent: null | SGraphItem, list: SPoint[]);
 
     /**
      * 构造函数
      *
-     * @param   parent  父级
-     * @param   list    第一个坐标
-     * */
+     * @param parent    父级
+     * @param list      第一个坐标
+     */
     constructor(parent: null | SGraphItem, list: SPoint);
 
     /**
      * 构造函数
      *
-     * @param   parent  父级
-     * @param   list    第一个坐标|坐标集合
-     * */
+     * @param parent    父级
+     * @param list      第一个坐标|坐标集合
+     */
     constructor(parent: null | SGraphItem, list: SPoint | SPoint[]) {
         super(parent);
         if (list instanceof SPoint) {
@@ -146,9 +150,9 @@ export class SPolylineItem extends SGraphItem {
     /**
      * 添加点至数组中
      *
-     * @param   p       添加的点
-     * @param   index   添加到的索引
-     * */
+     * @param p         添加的点
+     * @param index     添加到的索引
+     */
     private addPoint(p: SPoint, index?: number): void {
         if (index && this.canHandle(index)) {
             this.pointList.splice(index, 0, p);
@@ -161,15 +165,16 @@ export class SPolylineItem extends SGraphItem {
             this.pointList.push(p);
             this.recordAction(SGraphPointListInsert, [this.pointList, p]);
         }
+
         this.update();
     } // Function addPoint()
 
     /**
      * 是否可以添加点到数组中
      *
-     * @param   index   要添加到的索引
-     * @return  boolean 是否可添加
-     * */
+     * @param index     要添加到的索引
+     * @return 是否可添加
+     */
     private canHandle(index: number): boolean {
         return index >= 0 && index <= this.pointList.length;
     } // Function canHandle()
@@ -177,8 +182,8 @@ export class SPolylineItem extends SGraphItem {
     /**
      * 根据索引删除点
      *
-     * @param   index   删除点
-     * */
+     * @param index     删除点
+     */
     deletePoint(index: number): void {
         if (this.canHandle(index) && this.pointList.length > 2) {
             const p = new SPoint(
@@ -200,15 +205,16 @@ export class SPolylineItem extends SGraphItem {
     /**
      * 鼠标按下事件
      *
-     * @param   event   鼠标事件
-     * @return  boolean 是否处理事件
-     * */
+     * @param event     鼠标事件
+     * @return 是否处理事件
+     */
     onMouseDown(event: SMouseEvent): boolean {
         this.curIndex = -1;
         this.curPoint = null;
         if (event.shiftKey) {
             event = this.compare(event);
         }
+
         if (event.buttons == 1) {
             if (this.status == SItemStatus.Create) {
                 this.addPoint(new SPoint(event.x, event.y));
@@ -220,29 +226,33 @@ export class SPolylineItem extends SGraphItem {
                 if (this.curIndex < 0) {
                     this.findAddPos(new SPoint(event.x, event.y));
                 }
+
                 // 删除点
                 if (event.altKey && this.canHandle(this.curIndex)) {
                     this.deletePoint(this.curIndex);
                 }
+
                 this.update();
                 return true;
             } else {
                 return super.onMouseDown(event);
             }
         }
+
         return super.onMouseDown(event);
     } // Function onMouseDown()
 
     /**
      * 鼠标移动事件
      *
-     * @param   event   鼠标事件
-     * @return  boolean 是否处理事件
-     * */
+     * @param event     鼠标事件
+     * @return 是否处理事件
+     */
     onMouseMove(event: SMouseEvent): boolean {
         if (event.shiftKey) {
             event = this.compare(event);
         }
+
         if (this.status == SItemStatus.Create) {
             if (this.lastPoint) {
                 this.lastPoint.x = event.x;
@@ -250,6 +260,7 @@ export class SPolylineItem extends SGraphItem {
             } else {
                 this.lastPoint = new SPoint(event.x, event.y);
             }
+
             this.update();
             return true;
         } else if (this.status == SItemStatus.Edit) {
@@ -259,6 +270,7 @@ export class SPolylineItem extends SGraphItem {
                     this.pointList[this.curIndex].y = event.y;
                 }
             }
+
             this.update();
             return true;
         } else {
@@ -269,9 +281,9 @@ export class SPolylineItem extends SGraphItem {
     /**
      * 鼠标移动事件
      *
-     * @param   event   鼠标事件
-     * @return  boolean 是否处理事件
-     * */
+     * @param event     鼠标事件
+     * @return 是否处理事件
+     */
     onMouseUp(event: SMouseEvent): boolean {
         if (this.status == SItemStatus.Edit) {
             if (this.curIndex > -1) {
@@ -290,14 +302,15 @@ export class SPolylineItem extends SGraphItem {
             this.moveToOrigin(this.x, this.y);
             return super.onMouseUp(event);
         }
+
         return true;
     } // Function onMouseUp()
 
     /**
      * 鼠标双击事件
      *
-     * @param	event         事件参数
-     * @return	boolean
+     * @param event     事件参数
+     * @return 是否处理
      */
     onDoubleClick(event: SMouseEvent): boolean {
         if (this.status == SItemStatus.Normal) {
@@ -313,6 +326,7 @@ export class SPolylineItem extends SGraphItem {
                 this.$emit("finishCreated");
             }
         }
+
         this.$emit("onDoubleClick", event);
         return true;
     } // Function onDoubleClick()
@@ -320,7 +334,7 @@ export class SPolylineItem extends SGraphItem {
     /***
      * 键盘按键弹起事件
      *
-     * @param	event         事件参数
+     * @param event     事件参数
      */
     onKeyUp(event: KeyboardEvent): void {
         if (event.keyCode == SKeyCode.Enter) {
@@ -328,10 +342,12 @@ export class SPolylineItem extends SGraphItem {
                 if (this.status == SItemStatus.Create) {
                     this.$emit("finishCreated");
                 }
+
                 this.status = SItemStatus.Normal;
                 this.releaseItem();
             }
         }
+
         // delete删除点
         if (
             event.keyCode == SKeyCode.Delete &&
@@ -344,9 +360,9 @@ export class SPolylineItem extends SGraphItem {
     /**
      * 移动后处理所有坐标,并肩原点置为场景原点
      *
-     * @param   x   x坐标
-     * @param   y   y坐标
-     * */
+     * @param x     x 坐标
+     * @param y     y 坐标
+     */
     moveToOrigin(x: number, y: number): void {
         super.moveToOrigin(x, y);
         this.pointList = this.pointList.map(t => {
@@ -361,8 +377,8 @@ export class SPolylineItem extends SGraphItem {
     /**
      * 获取点击点与点集中距离最近点
      *
-     * @param   p   鼠标点击点
-     * */
+     * @param p     鼠标点击点
+     */
     findNearestPoint(p: SPoint): void {
         let len = this.sceneDis;
         for (let i = 0; i < this.pointList.length; i++) {
@@ -386,8 +402,8 @@ export class SPolylineItem extends SGraphItem {
     /**
      * 计算增加点的位置
      *
-     * @param   p   鼠标点击点
-     * */
+     * @param p     鼠标点击点
+     */
     findAddPos(p: SPoint): void {
         let len = SMathUtil.pointToLine(
                 p,
@@ -406,19 +422,18 @@ export class SPolylineItem extends SGraphItem {
                 }
             }
         }
-        if (len.MinDis < this.sceneDis) {
-            if (len.Point) {
-                this.addPoint(len.Point, index + 1);
-            }
+
+        if (len.MinDis < this.sceneDis && len.Point) {
+            this.addPoint(len.Point, index + 1);
         }
     } // Function findAddPos()
 
     /**
-     * shift垂直水平创建或编辑
+     * shift 垂直水平创建或编辑
      *
-     * @param   event   事件
-     * @return  事件对象
-     * */
+     * @param event     事件
+     * @return 事件对象
+     */
     compare(event: SMouseEvent): SMouseEvent {
         if (this.pointList.length) {
             let last = new SPoint(event.x, event.y);
@@ -429,6 +444,7 @@ export class SPolylineItem extends SGraphItem {
                     last = this.pointList[this.curIndex - 1];
                 }
             }
+
             const dx = Math.abs(event.x - last.x);
             const dy = Math.abs(event.y - last.y);
             if (dy > dx) {
@@ -437,14 +453,15 @@ export class SPolylineItem extends SGraphItem {
                 event.y = last.y;
             }
         }
+
         return event;
     } // Function compare()
 
     /**
      * 记录相关动作并推入栈中
      *
-     * @param	SGraphCommand   相关命令类
-     * @param	any             对应传入参数
+     * @param SGraphCommand     相关命令类
+     * @param any               对应传入参数
      */
     protected recordAction(SGraphCommand: any, any: any[]): void {
         // 记录相关命令并推入堆栈中
@@ -453,10 +470,10 @@ export class SPolylineItem extends SGraphItem {
     } // Function recordAction()
 
     /**
-     * Item对象边界区域
+     * Item 对象边界区域
      *
-     * @return  SRect   外接矩阵
-     * */
+     * @return 外接矩阵
+     */
     boundingRect(): SRect {
         if (this.pointList.length) {
             this.minX = this.pointList[0].x;
@@ -469,17 +486,21 @@ export class SPolylineItem extends SGraphItem {
                 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 SRect(
             this.minX,
             this.minY,
@@ -491,9 +512,9 @@ export class SPolylineItem extends SGraphItem {
     /**
      * 判断点是否在区域内
      *
-     * @param   x
-     * @param   y
-     * @return  true-
+     * @param x     x 坐标
+     * @param y     y 坐标
+     * @return 是否在区域内
      */
     contains(x: number, y: number): boolean {
         let p = new SPoint(x, y);
@@ -516,7 +537,6 @@ export class SPolylineItem extends SGraphItem {
 
     /**
      * 撤销操作
-     *
      */
     undo(): void {
         if (this._status != SItemStatus.Normal) {
@@ -526,7 +546,6 @@ export class SPolylineItem extends SGraphItem {
 
     /**
      * 重做操作
-     *
      */
     redo(): void {
         if (this._status != SItemStatus.Normal) {
@@ -536,8 +555,7 @@ export class SPolylineItem extends SGraphItem {
 
     /**
      * 取消操作执行
-     *
-     * */
+     */
     cancelOperate(): void {
         if (this.status == SItemStatus.Create) {
             this.parent = null;
@@ -551,8 +569,8 @@ export class SPolylineItem extends SGraphItem {
     /**
      * 绘制基本图形
      *
-     * @param   painter painter对象
-     * */
+     * @param painter   绘制对象
+     */
     drawBaseLine(painter: SPainter): void {
         // 绘制基本图形
         if (this.lineStyle == SLineStyle.Dashed) {
@@ -566,14 +584,15 @@ export class SPolylineItem extends SGraphItem {
                 painter.toPx(this.lineWidth)
             ];
         }
+
         painter.pen.color = this.strokeColor;
         painter.drawPolyline(this.pointList);
     } // Function drawBaseLine()
 
     /**
-     * Item绘制操作
+     * Item 绘制操作
      *
-     * @param   painter painter对象
+     * @param painter   绘制对象
      */
     onDraw(painter: SPainter): void {
         // 缓存场景长度
@@ -592,6 +611,7 @@ export class SPolylineItem extends SGraphItem {
                 if (i == this.curIndex) {
                     painter.brush.color = this.fillColor;
                 }
+
                 painter.drawCircle(t.x, t.y, painter.toPx(5));
             });
         } else if (this.status == SItemStatus.Edit) {
@@ -603,6 +623,7 @@ export class SPolylineItem extends SGraphItem {
                 if (i == this.curIndex) {
                     painter.brush.color = this.fillColor;
                 }
+
                 painter.drawCircle(t.x, t.y, painter.toPx(5));
             });
         } else {
@@ -614,6 +635,7 @@ export class SPolylineItem extends SGraphItem {
                 painter.shadow.shadowOffsetX = 5;
                 painter.shadow.shadowOffsetY = 5;
             }
+
             // 绘制基本图形
             this.drawBaseLine(painter);
         }

+ 8 - 8
persagy-web-big/src/items/SRectSelectItem.ts

@@ -30,9 +30,9 @@ import { SMouseEvent } from "@persagy-web/base";
 import { ItemColor, ItemOrder } from "..";
 
 /**
- * 矩形选择item
+ * 矩形选择 item
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export class SRectSelectItem extends SGraphItem {
     /** 起点 */
@@ -55,9 +55,9 @@ export class SRectSelectItem extends SGraphItem {
     } // Constructor
 
     /**
-     * Item对象边界区域
+     * Item 对象边界区域
      *
-     * @return SRect
+     * @return 边界区域
      */
     boundingRect(): SRect {
         return new SRect(this.startPoint, this.endPoint);
@@ -66,8 +66,8 @@ export class SRectSelectItem extends SGraphItem {
     /**
      * 鼠标移动事件
      *
-     * @param	event         事件参数
-     * @return	boolean
+     * @param event     事件参数
+     * @return 是否处理
      */
     onMouseMove(event: SMouseEvent): boolean {
         this.endPoint.x = event.x;
@@ -77,9 +77,9 @@ export class SRectSelectItem extends SGraphItem {
     } // Function onMouseMove()
 
     /**
-     * Item绘制操作
+     * Item 绘制操作
      *
-     * @param   painter       painter对象
+     * @param painter   绘制对象
      */
     onDraw(painter: SPainter): void {
         painter.pen.lineWidth = painter.toPx(2);

+ 2 - 3
persagy-web-big/src/items/STooltipItem.ts

@@ -27,9 +27,8 @@
 import { STextItem } from "@persagy-web/graph";
 
 /**
- * 提示框item
+ * 提示框 item
  *
- * * @author  郝建龙(1061851420@qq.com)
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
-
 export class STooltipItem extends STextItem {} // Class STooltipItem

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

@@ -30,23 +30,23 @@ import { ItemColor } from "../..";
 import { SGraphItem } from "@persagy-web/graph";
 
 /**
- * 建築輪廓item
+ * 建筑轮廓 item
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export class SBoardItem extends SGraphItem {
     /** 空间所有数据 */
     data: Zone;
-    /** 空间轮廓线坐标list */
+    /** 空间轮廓线坐标 list */
     readonly pointArr: SPoint[][][] = [];
-    /** path数组 */
+    /** path 数组 */
     private pathList: SPath[] = [];
 
     /**
      * 构造函数
      *
      * @param parent    指向父对象
-     * @param data      建築輪廓数据
+     * @param data      建筑轮廓数据
      */
     constructor(parent: SGraphItem | null, data: Zone) {
         super(parent);
@@ -80,18 +80,18 @@ export class SBoardItem extends SGraphItem {
     /**
      * 判断点是否在区域内
      *
-     * @param x x坐标
-     * @param y y坐标
-     * @return  是否在区域内
+     * @param x     x 坐标
+     * @param y     y 坐标
+     * @return 是否在区域内
      */
     contains(x: number, y: number): boolean {
         return false;
     } // Function contains()
 
     /**
-     * Item绘制操作
+     * Item 绘制操作
      *
-     * @param   painter painter对象
+     * @param painter   painter 对象
      */
     onDraw(painter: SPainter): void {
         painter.pen.lineWidth = painter.toPx(1);

+ 3 - 5
persagy-web-big/src/items/floor/SColumnItem.ts

@@ -29,9 +29,9 @@ import { ItemOrder } from "../..";
 import { SGraphPolyGroupItem, SGraphItem, Point } from "@persagy-web/graph";
 
 /**
- * 柱子item
+ * 柱子 item
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export class SColumnItem extends SGraphPolyGroupItem {
     /** 柱子数据 */
@@ -56,9 +56,7 @@ export class SColumnItem extends SGraphPolyGroupItem {
         let outline: Point[][] = [];
         if (tempArr && tempArr.length) {
             outline = tempArr.map(t => {
-                return t.map(it => {
-                    return { x: it.X, y: -it.Y };
-                });
+                return t.map(it => ({x: it.X, y: -it.Y}));
             });
         }
 

+ 16 - 16
persagy-web-big/src/items/floor/SDoorItem.ts

@@ -31,14 +31,14 @@ import { ItemOrder, ItemColor } from "../..";
 import { SGraphItem } from "@persagy-web/graph";
 
 /**
- * 门item
+ * 门 item
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export class SDoorItem extends SGraphItem {
     /** 门数据 */
     data: Door;
-    /** 门轮廓线坐标list */
+    /** 门轮廓线坐标 list */
     private readonly pointArr: SPoint[] = [];
     /** 门长度 */
     private readonly r: number = 0;
@@ -46,15 +46,15 @@ export class SDoorItem extends SGraphItem {
     private readonly ang: number = 0;
     /** 旋转点 */
     private readonly p: SPoint = new SPoint(0, 0);
-    /** 旋转起始角度,结束角度+Math.PI/2 */
+    /** 旋转起始角度,结束角度 + Math.PI / 2 */
     private readonly startAng: number = -Math.PI / 2;
-    /** X坐标最小值 */
+    /** X 坐标最小值 */
     private minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值 */
+    /** X 坐标最大值 */
     private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值 */
+    /** Y 坐标最小值 */
     private minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值 */
+    /** Y 坐标最大值 */
     private maxY = Number.MIN_SAFE_INTEGER;
 
     /**
@@ -70,8 +70,8 @@ export class SDoorItem extends SGraphItem {
         if (this.data.OutLine.length) {
             this.pointArr = this.data.OutLine[0].map(
                 (t): SPoint => {
-                    let x = t.X,
-                        y = -t.Y;
+                    let x = t.X;
+                    let y = -t.Y;
                     if (x < this.minX) {
                         this.minX = x;
                     }
@@ -88,8 +88,8 @@ export class SDoorItem extends SGraphItem {
                 }
             );
 
-            let p1 = this.pointArr[0],
-                p2 = this.pointArr[1];
+            let p1 = this.pointArr[0];
+            let p2 = this.pointArr[1];
             // 旋转点
             this.p = p1;
             const HX = (this.data.HandDirection.X = Number(
@@ -125,18 +125,18 @@ export class SDoorItem extends SGraphItem {
     } // Constructor
 
     /**
-     * Item对象边界区域
+     * Item 对象边界区域
      *
-     * @return SRect
+     * @return 边界矩形
      */
     boundingRect(): SRect {
         return new SRect(0, 0, this.r, this.r);
     } // Function boundingRect()
 
     /**
-     * Item绘制操作
+     * Item 绘制操作
      *
-     * @param   painter       painter对象
+     * @param painter   绘制对象
      */
     onDraw(painter: SPainter): void {
         painter.translate(this.p.x, this.p.y);

+ 6 - 5
persagy-web-big/src/items/floor/SHighlightItem.ts

@@ -31,7 +31,7 @@ import { SGraphItem } from "@persagy-web/graph";
 /**
  * 吸附时高亮对象
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export class SHighlightItem extends SGraphItem {
     /** 对象与鼠标位置距离 */
@@ -64,7 +64,7 @@ export class SHighlightItem extends SGraphItem {
     /**
      * 构造函数
      *
-     * @param   parent  指向父对象
+     * @param parent  指向父对象
      */
     constructor(parent: SGraphItem | null) {
         super(parent);
@@ -73,9 +73,9 @@ export class SHighlightItem extends SGraphItem {
     } // Constructor
 
     /**
-     * Item对象边界区域
+     * Item 对象边界区域
      *
-     * @return	SRect
+     * @return	边界矩形
      */
     boundingRect(): SRect {
         return new SRect(this.point.x, this.point.y, 10, 10);
@@ -84,7 +84,7 @@ export class SHighlightItem extends SGraphItem {
     /**
      * Item绘制操作
      *
-     * @param   painter painter对象
+     * @param painter   绘制对象
      */
     onDraw(painter: SPainter): void {
         if (this.type == 2) {
@@ -92,6 +92,7 @@ export class SHighlightItem extends SGraphItem {
             painter.pen.lineWidth = painter.toPx(6);
             painter.drawLine(this.line);
         }
+
         painter.pen.color = SColor.Transparent;
         painter.brush.color = ItemColor.highLightPointColor;
         painter.drawCircle(this.point.x, this.point.y, painter.toPx(5));

+ 12 - 14
persagy-web-big/src/items/floor/SSpaceItem.ts

@@ -27,10 +27,6 @@
 import {
     SColor,
     SPainter,
-    SPath,
-    SPoint,
-    SPolygonUtil,
-    SRect,
     STextAlign
 } from "@persagy-web/draw";
 import { Space } from "../../types/floor/Space";
@@ -38,9 +34,9 @@ import { ItemOrder, ItemColor } from "../..";
 import { SGraphItem, SGraphAreaGroupItem } from "@persagy-web/graph";
 
 /**
- * 模型空间item
+ * 模型空间 item
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export class SSpaceItem extends SGraphAreaGroupItem {
     /** 空间所有数据 */
@@ -54,6 +50,7 @@ export class SSpaceItem extends SGraphAreaGroupItem {
         this._highLightFlag = value;
         this.update();
     } // Set highLightFlag
+
     /** 是否显示名字 */
     private _showBaseName: boolean = false;
     get showBaseName(): boolean {
@@ -63,6 +60,7 @@ export class SSpaceItem extends SGraphAreaGroupItem {
         this._showBaseName = value;
         this.update();
     } // Set showBaseName
+
     /** 是否名字大小 */
     private _nameSize: number = 10;
     get nameSize(): number {
@@ -72,6 +70,7 @@ export class SSpaceItem extends SGraphAreaGroupItem {
         this._nameSize = value;
         this.update();
     } // Set nameSize
+
     /** 名字是否缩放 */
     private _nameTransform: boolean = false;
     get nameTransform(): boolean {
@@ -81,6 +80,7 @@ export class SSpaceItem extends SGraphAreaGroupItem {
         this._nameTransform = value;
         this.update();
     } // Set nameTransform
+
     /** 名字颜色 */
     private _nameColor: string = "#000000";
     get nameColor(): string {
@@ -100,11 +100,7 @@ export class SSpaceItem extends SGraphAreaGroupItem {
     constructor(parent: SGraphItem | null, data: Space) {
         super(parent, {
             outline: [
-                data.OutLine.map(t => {
-                    return t.map(it => {
-                        return { x: it.X, y: -it.Y };
-                    });
-                })
+                data.OutLine.map(t => t.map(it => ({ x: it.X, y: -it.Y })))
             ],
             style: {
                 default: {
@@ -133,6 +129,7 @@ export class SSpaceItem extends SGraphAreaGroupItem {
                 }
             }
         });
+
         this.data = data;
         this.zOrder = ItemOrder.spaceOrder;
         this.name = data.Name || "";
@@ -141,7 +138,8 @@ export class SSpaceItem extends SGraphAreaGroupItem {
     /**
      * 绘制前设置绘制样式
      *
-     * */
+     * @return 当前状态
+     */
     setStyle(): string {
         let status = "default";
         if (this.style) {
@@ -159,9 +157,9 @@ export class SSpaceItem extends SGraphAreaGroupItem {
     } // Function setStyle()
 
     /**
-     * Item绘制操作
+     * Item 绘制操作
      *
-     * @param   painter       painter对象
+     * @param painter   绘制对象
      */
     onDraw(painter: SPainter): void {
         super.onDraw(painter);

+ 4 - 3
persagy-web-big/src/items/floor/SSpaceItems.ts

@@ -37,11 +37,12 @@ import { ItemOrder, ItemColor } from "../..";
 import { SGraphItem } from "@persagy-web/graph";
 
 /**
- * 模型空间item
+ * 模型空间 item
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
+ * @deprecated 万达
  */
-export class SSpaceItem extends SGraphItem {
+export class SSpaceItems extends SGraphItem {
     /** 空间所有数据  */
     data: Space;
     /** 空间轮廓线坐标list  */

+ 11 - 11
persagy-web-big/src/items/floor/SVirtualWallItem.ts

@@ -30,22 +30,22 @@ import { ItemOrder, ItemColor } from "../..";
 import { SGraphItem } from "@persagy-web/graph";
 
 /**
- * 墙item
+ * 虚拟 item
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export class SVirtualWallItem extends SGraphItem {
     /** 虚拟墙数据 */
     data: VirtualWall;
-    /** X坐标最小值 */
+    /** X 坐标最小值 */
     private minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值 */
+    /** X 坐标最大值 */
     private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值 */
+    /** Y 坐标最小值 */
     private minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值 */
+    /** Y 坐标最大值 */
     private maxY = Number.MIN_SAFE_INTEGER;
-    /** 虚拟墙轮廓线坐标list */
+    /** 虚拟墙轮廓线坐标 list */
     private readonly pointArr: SPoint[][] = [];
 
     /**
@@ -89,9 +89,9 @@ export class SVirtualWallItem extends SGraphItem {
     } // Constructor
 
     /**
-     * Item对象边界区域
+     * Item 对象边界区域
      *
-     * @return SRect
+     * @return 边界矩形
      */
     boundingRect(): SRect {
         return new SRect(
@@ -103,9 +103,9 @@ export class SVirtualWallItem extends SGraphItem {
     } // Function boundingRect()
 
     /**
-     * Item绘制操作
+     * Item 绘制操作
      *
-     * @param   painter       painter对象
+     * @param painter   painter对象
      */
     onDraw(painter: SPainter): void {
         painter.pen.lineWidth = painter.toPx(1);

+ 3 - 7
persagy-web-big/src/items/floor/SWallItem.ts

@@ -30,9 +30,9 @@ import { SGraphItem } from "@persagy-web/graph";
 import { Point, SGraphAreaGroupItem } from "@persagy-web/graph";
 
 /**
- * 墙item
+ * 墙 item
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export class SWallItem extends SGraphAreaGroupItem {
     /** 墙数据 */
@@ -56,11 +56,7 @@ export class SWallItem extends SGraphAreaGroupItem {
         let tempArr = data.OutLine;
         let outline: Point[][] = [];
         if (tempArr && tempArr.length) {
-            outline = tempArr.map(t => {
-                return t.map(it => {
-                    return { x: it.X, y: -it.Y };
-                });
-            });
+            outline = tempArr.map(t => t.map(it => ({ x: it.X, y: -it.Y })));
         }
 
         super(parent, {

+ 3 - 2
persagy-web-big/src/items/floor/SWallItems.ts

@@ -32,9 +32,10 @@ import { SGraphItem } from "@persagy-web/graph";
 /**
  * 墙item
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
+ * @deprecated 万达
  */
-export class SWallItem extends SGraphItem {
+export class SWallItems extends SGraphItem {
     /** 墙数据 */
     data: Wall;
     /** X坐标最小值 */

+ 13 - 13
persagy-web-big/src/items/floor/SWindowItem.ts

@@ -31,22 +31,22 @@ import { ItemOrder, ItemColor } from "../..";
 import { SGraphItem } from "@persagy-web/graph";
 
 /**
- * 窗户item
+ * 窗户 item
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export class SWindowItem extends SGraphItem {
     /** 窗户数据 */
     data: Casement;
-    /** 窗户轮廓线坐标list */
+    /** 窗户轮廓线坐标 list */
     private readonly pointArr: SPoint[] = [];
-    /** X坐标最小值 */
+    /** X 坐标最小值 */
     private minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值 */
+    /** X 坐标最大值 */
     private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值 */
+    /** Y 坐标最小值 */
     private minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值 */
+    /** Y 坐标最大值 */
     private maxY = Number.MIN_SAFE_INTEGER;
 
     /**
@@ -62,8 +62,8 @@ export class SWindowItem extends SGraphItem {
         if (this.data.OutLine.length) {
             this.pointArr = this.data.OutLine[0].map(
                 (t): SPoint => {
-                    let x = t.X,
-                        y = -t.Y;
+                    let x = t.X;
+                    let y = -t.Y;
                     if (x < this.minX) {
                         this.minX = x;
                     }
@@ -83,9 +83,9 @@ export class SWindowItem extends SGraphItem {
     } // Constructor
 
     /**
-     * Item对象边界区域
+     * Item 对象边界区域
      *
-     * @return SRect
+     * @return 边界矩形
      */
     boundingRect(): SRect {
         return new SRect(
@@ -97,9 +97,9 @@ export class SWindowItem extends SGraphItem {
     } // Function boundingRect()
 
     /**
-     * Item绘制操作
+     * Item 绘制操作
      *
-     * @param   painter       painter对象
+     * @param painter   绘制对象
      */
     onDraw(painter: SPainter): void {
         painter.pen.color = ItemColor.windowColor;

+ 13 - 9
persagy-web-big/src/items/floor/ZoneItem.ts

@@ -31,9 +31,9 @@ import { ItemColor, ItemOrder, Transparency } from "../..";
 import { Point, SGraphAreaGroupItem, SGraphItem } from "@persagy-web/graph";
 
 /**
- * 业务空间item
+ * 业务空间 item
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export class SZoneItem extends SGraphAreaGroupItem {
     /** 空间所有数据 */
@@ -49,6 +49,7 @@ export class SZoneItem extends SGraphAreaGroupItem {
         this._highLightFlag = value;
         this.update();
     } // Set highLightFlag
+
     /** 透明度 */
     _transparency: number = 20;
     get transparency(): number {
@@ -58,6 +59,7 @@ export class SZoneItem extends SGraphAreaGroupItem {
         this._transparency = value;
         this.update();
     } // Set transparency
+
     /** 受影响状态 */
     _isInfected: boolean = false;
     get isInfected(): boolean {
@@ -118,6 +120,7 @@ export class SZoneItem extends SGraphAreaGroupItem {
                 }
             }
         });
+
         this.data = data;
         this.zOrder = ItemOrder.zoneOrder;
         this.highLightFlag = data.HighLightFlag || false;
@@ -128,8 +131,8 @@ export class SZoneItem extends SGraphAreaGroupItem {
     /**
      * 鼠标单击事件
      *
-     * @param   event   事件参数
-     * @return  boolean
+     * @param event     事件参数
+     * @return 是否处理事件
      */
     onMouseDown(event: SMouseEvent): boolean {
         if (this.selectable) {
@@ -143,8 +146,8 @@ export class SZoneItem extends SGraphAreaGroupItem {
     /**
      * 鼠标抬起事件
      *
-     * @param   event   事件参数
-     * @return  boolean
+     * @param event     事件参数
+     * @return 是否处理事件
      */
     onMouseUp(event: SMouseEvent): boolean {
         return false;
@@ -153,7 +156,8 @@ export class SZoneItem extends SGraphAreaGroupItem {
     /**
      * 绘制前设置绘制样式
      *
-     * */
+     * @return 当前状态
+     */
     setStyle(): string {
         let status = "default";
         if (this.style) {
@@ -180,9 +184,9 @@ export class SZoneItem extends SGraphAreaGroupItem {
     } // Function setStyle()
 
     /**
-     * Item绘制操作
+     * Item 绘制操作
      *
-     * @param   painter painter对象
+     * @param painter   绘制对象
      */
     onDraw(painter: SPainter): void {
         super.onDraw(painter);

+ 27 - 21
persagy-web-big/src/parser/SFloorParser.ts

@@ -40,54 +40,60 @@ import { SVirtualWallItem } from "../items/floor/SVirtualWallItem";
 import { SSpaceItem } from "../items/floor/SSpaceItem";
 
 /**
- *  楼层信息解析器
+ * 楼层信息解析器
  *
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export class SFloorParser extends SParser {
-    /** 墙list */
+    /** 墙 list */
     wallList: SWallItem[] = [];
-    /** 柱子list */
+    /** 柱子 list */
     columnList: SColumnItem[] = [];
-    /** 门list */
+    /** 门 list */
     doorList: SDoorItem[] = [];
-    /** 窗list */
+    /** 窗 list */
     casementList: SWindowItem[] = [];
-    /** 虚拟墙list */
+    /** 虚拟墙 list */
     virtualWallList: SVirtualWallItem[] = [];
-    /** 空间list */
+    /** 空间 list */
     spaceList: SSpaceItem[] = [];
 
     /**
      * 解析数据
      *
-     * @param   data    楼层数据
-     * */
+     * @param data  楼层数据
+     */
     parseData(data: FloorData): void {
         if (data.Walls) {
             data.Walls.forEach((t: Wall): void => {
                 this.addWall(t);
             });
         }
+
         if (data.Columns) {
             data.Columns.forEach((t: Column): void => {
                 this.addColumn(t);
             });
         }
+
         if (data.Windows) {
             data.Windows.forEach((t: Casement): void => {
                 this.addCasement(t);
             });
         }
+
         if (data.VirtualWalls) {
             data.VirtualWalls.forEach((t: VirtualWall): void => {
                 this.addVirtualWall(t);
             });
         }
+
         if (data.Doors) {
             data.Doors.forEach((t: Door): void => {
                 this.addDoor(t);
             });
         }
+
         if (data.Spaces) {
             data.Spaces.forEach((t: Space): void => {
                 this.addSpace(t);
@@ -98,8 +104,8 @@ export class SFloorParser extends SParser {
     /**
      * 添加墙至场景中
      *
-     * @param   t       墙数据
-     * */
+     * @param t     墙数据
+     */
     private addWall(t: Wall): void {
         let item = this.factory.createWall(t);
         this.wallList.push(item);
@@ -108,8 +114,8 @@ export class SFloorParser extends SParser {
     /**
      * 添加柱子至场景中
      *
-     * @param   t       柱子数据
-     * */
+     * @param   t   柱子数据
+     */
     private addColumn(t: Column): void {
         let item = this.factory.createColumn(t);
         this.columnList.push(item);
@@ -118,8 +124,8 @@ export class SFloorParser extends SParser {
     /**
      * 添加窗户至场景中
      *
-     * @param   t       窗户数据
-     * */
+     * @param t     窗户数据
+     */
     private addCasement(t: Casement): void {
         let item = this.factory.createWindow(t);
         this.casementList.push(item);
@@ -128,8 +134,8 @@ export class SFloorParser extends SParser {
     /**
      * 添加虚拟墙至场景中
      *
-     * @param   t       虚拟墙数据
-     * */
+     * @param t     虚拟墙数据
+     */
     private addVirtualWall(t: VirtualWall): void {
         let item = this.factory.createVirtualWall(t);
         this.virtualWallList.push(item);
@@ -138,8 +144,8 @@ export class SFloorParser extends SParser {
     /**
      * 添加门至场景中
      *
-     * @param   t       门数据
-     * */
+     * @param t     门数据
+     */
     private addDoor(t: Door): void {
         let item = this.factory.createDoor(t);
         this.doorList.push(item);
@@ -148,8 +154,8 @@ export class SFloorParser extends SParser {
     /**
      * 添加空间至场景中
      *
-     * @param   t       空间数据
-     * */
+     * @param t     空间数据
+     */
     private addSpace(t: Space): void {
         let item = this.factory.createSpace(t);
         this.spaceList.push(item);

+ 3 - 2
persagy-web-big/src/parser/SParser.ts

@@ -27,8 +27,9 @@
 import { SItemFactory } from "..";
 
 /**
- *  解析器基类
+ * 解析器基类
  *
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export abstract class SParser {
     /** 解析器工厂 */
@@ -37,7 +38,7 @@ export abstract class SParser {
     /**
      * 构造函数
      *
-     * @param   factory 解析工厂
+     * @param factory   解析工厂
      * */
     constructor(factory: SItemFactory | null = null) {
         if (factory) {

+ 12 - 9
persagy-web-big/src/parser/STopologyParser.ts

@@ -31,33 +31,36 @@ import { Node } from "../types/topology/Node";
 import { Relation } from "../types/topology/Relation";
 
 /**
- *  拓扑图信息解析器
+ * 拓扑图信息解析器
  *
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export class STopologyParser extends SParser {
-    /** 节点list */
+    /** 节点 list */
     nodeList = [];
-    /** 标记list */
+    /** 标记 list */
     markList = [];
-    /** 关系list */
+    /** 关系 list */
     relationList = [];
 
     /**
      * 解析数据
      *
-     * @param   data    楼层数据
-     * */
+     * @param data  楼层数据
+     */
     parseData(data: TopologyData): void {
         if (data.Marks) {
             data.Marks.forEach((t: MarkerTopo): void => {
                 this.addMarks(t);
             });
         }
+
         if (data.Nodes) {
             data.Nodes.forEach((t: Node): void => {
                 this.addNodes(t);
             });
         }
+
         if (data.Relations) {
             data.Relations.forEach((t: Relation): void => {
                 this.addRelations(t);
@@ -67,16 +70,16 @@ export class STopologyParser extends SParser {
 
     /**
      * 添加标识对象
-     * */
+     */
     private addMarks(t: MarkerTopo): void {} // Function addMarks
 
     /**
      * 添加关系对象
-     * */
+     */
     private addRelations(t: Relation): void {} // Function addRelations
 
     /**
      * 添加节点对象
-     * */
+     */
     private addNodes(t: Node): void {} // Function addNodes
 } // class STopologyParser

+ 9 - 10
persagy-web-big/src/parser/SZoneParser.ts

@@ -31,31 +31,30 @@ import { Zone } from "../types/floor/Zone";
 /**
  * 业务空间信息解析器
  *
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export class SZoneParser extends SParser {
-    /** 业务空间list */
+    /** 业务空间 list */
     zoneList: SZoneItem[] = [];
 
     /**
      * 解析业务空间数据
      *
-     * @param   data    业务空间数据
-     * */
+     * @param data  业务空间数据
+     */
     parseData(data: Zone[]): void {
         if (data && data.length) {
-            data.forEach((t): void => {
-                this.addZone(t);
-            });
+            data.forEach((z): void => this.addZone(z));
         }
     } // Function parseData()
 
     /**
      * 添加业务空间至场景中
      *
-     * @param   t   业务空间数据
-     * */
-    private addZone(t: Zone): void {
-        let item = this.factory.createZone(t);
+     * @param z     业务空间数据
+     */
+    private addZone(z: Zone): void {
+        let item = this.factory.createZone(z);
         this.zoneList.push(item);
     } // Function addZone()
 } // class SZoneParser

+ 4 - 1
persagy-web-big/src/types/BigPoint.ts

@@ -26,10 +26,13 @@
 /**
  * 轮廓坐标接口
  *
- * @author  郝建龙
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export interface BigPoint {
+    /** x 坐标 */
     X: number;
+    /** y 坐标 */
     Y: number;
+    /** z 坐标 */
     Z?: number;
 } // Interface BigPoint

+ 8 - 2
persagy-web-big/src/types/FloorData.ts

@@ -32,15 +32,21 @@ import { Wall } from "./floor/Wall";
 import { Casement } from "./floor/Casement";
 
 /**
- * json数据接口
+ * json 数据接口
  *
- * @author  郝建龙
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export interface FloorData {
+    /** 柱子列表 */
     Columns: Column[];
+    /** 门列表 */
     Doors: Door[];
+    /** 空间 */
     Spaces: Space[];
+    /** 虚拟墙 */
     VirtualWalls: VirtualWall[];
+    /** 墙 */
     Walls: Wall[];
+    /** 窗户 */
     Windows: Casement[];
 } // Interface FloorData

+ 6 - 6
persagy-web-big/src/types/ImageData.ts

@@ -25,20 +25,20 @@
  */
 
 /**
- * 图片item数据接口
+ * 图片 item 数据接口
  *
- * @author  郝建龙
+ * @author 郝建龙  <haojianlong@sagacloud.cn>
  */
 export interface ImageData {
-    /** 图片的id */
+    /** 图片的 id */
     id?: string;
     /** 图片的名称 */
     name?: string;
-    /** X坐标 */
+    /** X 坐标 */
     x: number;
-    /** Y坐标 */
+    /** Y 坐标 */
     y: number;
-    /** 图片url */
+    /** 图片 url */
     url: string;
     /** 绘制图片的宽 */
     width: number;

+ 5 - 5
persagy-web-big/src/types/Marker.ts

@@ -25,17 +25,17 @@
  */
 
 /**
- * 标记item接口
+ * 标记 item 接口
  *
- * @author  郝建龙
+ * @author 郝建龙  <haojianlong@sagacloud.cn>
  */
 export interface Marker {
-    /** 标记的id */
+    /** 标记的 id */
     id?: string;
     /** 标记的名称 */
     name?: string;
-    /** X坐标 */
+    /** X 坐标 */
     x: number;
-    /** Y坐标 */
+    /** Y 坐标 */
     y: number;
 } // Interface Marker

+ 1 - 1
persagy-web-big/src/types/MinDis.ts

@@ -29,7 +29,7 @@ import { Point } from "@persagy-web/graph";
 /**
  * 距离最短点接口
  *
- * @author  郝建龙
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export interface MinDis {
     /** 最短距离 */

+ 1 - 1
persagy-web-big/src/types/Outline.ts

@@ -29,7 +29,7 @@ import { SPoint } from "@persagy-web/draw";
 /**
  * 轮廓线接口
  *
- * @author  郝建龙
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export interface Outline {
     /** 外轮廓 */

+ 3 - 1
persagy-web-big/src/types/Place.ts

@@ -29,9 +29,11 @@ import { BigPoint } from "./BigPoint";
 /**
  * 位置接口
  *
- * @author  郝建龙
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export interface Place {
+    /** 定位 */
     Points: BigPoint[];
+    /** 类型 */
     Type: string;
 } // Interface Place

+ 4 - 1
persagy-web-big/src/types/PointToLine.ts

@@ -29,10 +29,13 @@ import { SLine, SPoint } from "@persagy-web/draw";
 /**
  * 距离最短线接口
  *
- * @author  郝建龙
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export interface PointToLine {
+    /** 最短距离 */
     MinDis: number;
+    /** 最短距离的线 */
     Line: SLine | undefined;
+    /** 最短距离的点 */
     Point: SPoint | undefined;
 } // Interface Space

+ 3 - 1
persagy-web-big/src/types/Size.ts

@@ -27,9 +27,11 @@
 /**
  * 大小接口
  *
- * @author  张宇
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export interface Size {
+    /** 宽 */
     width: number;
+    /** 高 */
     height: number;
 } // Interface Size

+ 5 - 5
persagy-web-big/src/types/TextData.ts

@@ -27,18 +27,18 @@
 import { STextAlign, STextBaseLine, STextDirection } from "@persagy-web/draw";
 
 /**
- * 文本item数据接口
+ * 文本 item 数据接口
  *
- * @author  郝建龙
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export interface TextData {
-    /** 文本的id */
+    /** 文本的 id */
     id?: string;
     /** 文本内容 */
     text: string;
-    /** X坐标 */
+    /** X 坐标 */
     x: number;
-    /** Y坐标 */
+    /** Y 坐标 */
     y: number;
     /** 文本最大宽 */
     width?: number;

+ 3 - 1
persagy-web-big/src/types/TopologyData.ts

@@ -30,7 +30,9 @@ import { Relation } from "./topology/Relation";
 
 /**
  * 对象关系
- * */
+ *
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
+ */
 export interface TopologyData {
     /** 图例节点 */
     Nodes: Node[];

+ 5 - 5
persagy-web-big/src/types/floor/Casement.ts

@@ -29,22 +29,22 @@ import { Point } from "@persagy-web/graph";
 import { BigPoint } from "../BigPoint";
 
 /**
- * 窗户item接口
+ * 窗户 item 接口
  *
- * @author  郝建龙
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export interface Casement {
     /** 位置 */
     Location: Place;
-    /** 模型id(外键) */
+    /** 模型 id (外键) */
     ModelId: string;
     /** 名称 */
     Name: string;
     /** 轮廓线 */
     OutLine: BigPoint[][];
-    /** 拥有者的RevitId */
+    /** 拥有者的 RevitId */
     Owner: string;
-    /** 对应Revit模型id */
+    /** 对应 Revit 模型 id */
     SourceId: string;
     /** 厚度 */
     Thick: number;

+ 4 - 4
persagy-web-big/src/types/floor/Column.ts

@@ -29,9 +29,9 @@ import { Place } from "../Place";
 import { BigPoint } from "../BigPoint";
 
 /**
- * 柱子item接口
+ * 柱子 item 接口
  *
- * @author  郝建龙
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export interface Column {
     /** 名称 */
@@ -42,8 +42,8 @@ export interface Column {
     RoomBoundary?: boolean;
     /** 位置 */
     Location?: Place;
-    /** 模型id(外键) */
+    /** 模型 id (外键) */
     ModelId?: string;
-    /** 对应Revit模型id */
+    /** 对应 Revit 模型 id */
     SourceId?: string;
 } // Interface Column

+ 5 - 5
persagy-web-big/src/types/floor/Door.ts

@@ -29,9 +29,9 @@ import { Place } from "../Place";
 import { BigPoint } from "../BigPoint";
 
 /**
- * 门item接口
+ * 门 item 接口
  *
- * @author  郝建龙
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export interface Door {
     /** 面朝方向 */
@@ -40,15 +40,15 @@ export interface Door {
     HandDirection: BigPoint;
     /** 位置 */
     Location: Place;
-    /** 模型id(外键) */
+    /** 模型 id (外键) */
     ModelId: string;
     /** 名称 */
     Name: string;
     /** 轮廓线 */
     OutLine: BigPoint[][];
-    /** 拥有者的RevitId */
+    /** 拥有者的 RevitId */
     Owner: string;
-    /** 对应Revit模型id */
+    /** 对应 Revit 模型 id */
     SourceId: string;
     /** 厚度 */
     Thick: number;

+ 4 - 4
persagy-web-big/src/types/floor/Space.ts

@@ -29,9 +29,9 @@ import { Place } from "../Place";
 import { BigPoint } from "../BigPoint";
 
 /**
- * 空间item接口
+ * 空间 item 接口
  *
- * @author  郝建龙
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export interface Space {
     /** 轮廓线段 */
@@ -40,13 +40,13 @@ export interface Space {
     Location: Place;
     /** 高度 */
     Height?: number;
-    /** 模型id(外键) */
+    /** 模型 id (外键) */
     ModelId?: string;
     /** 名称 */
     Name?: string;
     /** 轮廓线 */
     OutLine: BigPoint[][];
-    /** 对应Revit模型id */
+    /** 对应 Revit 模型 id */
     SourceId?: string;
     /** 补充信息 */
     Tag?: string;

+ 4 - 5
persagy-web-big/src/types/floor/VirtualWall.ts

@@ -24,24 +24,23 @@
  * *********************************************************************************************************************
  */
 
-import { Point } from "@persagy-web/graph";
 import { Place } from "../Place";
 import { BigPoint } from "../BigPoint";
 
 /**
- * 虚拟墙item接口
+ * 虚拟墙 item 接口
  *
- * @author  郝建龙
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export interface VirtualWall {
     /** 位置 */
     Location?: Place;
-    /** 模型id(外键) */
+    /** 模型 id (外键) */
     ModelId?: string;
     /** 名称 */
     Name?: string;
     /** 轮廓线 */
     OutLine: BigPoint[][];
-    /** 对应Revit模型id */
+    /** 对应 Revit 模型 id */
     SourceId?: string;
 } // interface VirtualWall

+ 5 - 6
persagy-web-big/src/types/floor/Wall.ts

@@ -24,21 +24,20 @@
  * *********************************************************************************************************************
  */
 
-import { Point } from "@persagy-web/graph";
 import { Place } from "../Place";
 import { BigPoint } from "../BigPoint";
 
 /**
- * 墙item接口
+ * 墙 item 接口
  *
- * @author  郝建龙
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export interface Wall {
-    /** 层id */
+    /** 层 id */
     LevelId?: string;
     /** 位置 */
     Location?: Place;
-    /** 模型id(外键) */
+    /** 模型 id (外键) */
     ModelId?: string;
     /** 名称 */
     Name?: string;
@@ -46,7 +45,7 @@ export interface Wall {
     OutLine: BigPoint[][];
     /** 轮廓线 */
     Holes?: BigPoint[][];
-    /** 对应Revit模型id */
+    /** 对应 Revit 模型 id */
     SourceId?: string;
     /** 厚度 */
     Width?: number;

+ 3 - 4
persagy-web-big/src/types/floor/Zone.ts

@@ -24,20 +24,19 @@
  * *********************************************************************************************************************
  */
 
-import { Point } from "@persagy-web/graph";
 import { BigPoint } from "../BigPoint";
 
 /**
- * 业务空间item接口
+ * 业务空间 item 接口
  *
- * @author  郝建龙
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
 export interface Zone {
     /** 名称 */
     RoomLocalName: string;
     /** 轮廓线 */
     OutLine: BigPoint[][][];
-    /** 业务空间id */
+    /** 业务空间 id */
     RoomID: string;
     /** 颜色 */
     Color: string;

+ 3 - 1
persagy-web-big/src/types/topology/Anchor.ts

@@ -28,7 +28,9 @@ import { Point } from "@persagy-web/graph/lib";
 
 /**
  * 锚点
- * */
+ *
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
+ */
 export interface Anchor {
     /** ID */
     id: string;

+ 2 - 1
persagy-web-big/src/types/topology/MarkerTopo.ts

@@ -30,7 +30,8 @@ import { Size } from "../Size";
 /**
  * 标识对象接口
  *
- * */
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
+ */
 export interface MarkerTopo {
     /** ID */
     id: string;

+ 4 - 2
persagy-web-big/src/types/topology/Node.ts

@@ -30,7 +30,9 @@ import { Anchor } from "./Anchor";
 
 /**
  * 图例节点
- * */
+ *
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
+ */
 export interface Node {
     /** ID */
     id: string;
@@ -38,7 +40,7 @@ export interface Node {
     name: string;
     /** 图例类型 */
     graphElementType: string;
-    /** 对应的图元ID */
+    /** 对应的图元 ID */
     graphElementId: string;
     /** 图例数量 */
     num: number;

+ 8 - 6
persagy-web-big/src/types/topology/Relation.ts

@@ -29,21 +29,23 @@ import { Point } from "@persagy-web/graph/lib";
 
 /**
  * 对象关系
- * */
+ *
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
+ */
 export interface Relation {
     /** ID */
     id: string;
     /** 名称 */
     name: string;
-    /** 对应的图元ID */
+    /** 对应的图元 ID */
     graphElementId: string;
-    /** 关联节点1_id */
+    /** 关联节点 1_id */
     node1Id: string;
-    /** 关联节点2_id */
+    /** 关联节点 2_id */
     node2Id: string;
-    /** 关联锚点1_id */
+    /** 关联锚点 1_id */
     anchor1Id: string;
-    /** 关联锚点2_id */
+    /** 关联锚点 2_id */
     anchor2ID: string;
     /** 方向 */
     dir: SRelationDir;

+ 47 - 46
persagy-web-big/src/utils/SMathUtil.ts

@@ -32,15 +32,20 @@ import { Outline } from "../types/Outline";
 // @ts-ignore
 import { intersect } from "polybooljs";
 
+/**
+ * 数学工具类
+ *
+ * @author 郝建龙 <haojianlong@sagacloud.cn>
+ */
 export class SMathUtil {
     /**
      * 计算点到点距离
      *
+     * @param x1    点 1 的 x 坐标
+     * @param y1    点 1 的 y 坐标
+     * @param x2    点 2 的 x 坐标
+     * @param y2    点 2 的 y 坐标
      * @return  距离
-     * @param x1
-     * @param y1
-     * @param x2
-     * @param y2
      */
     static pointDistance(
         x1: number,
@@ -54,14 +59,15 @@ export class SMathUtil {
     /**
      * 计算点到点集中点最小距离,返回该点和该距离
      *
-     * @param   p       第一个点
-     * @param   arr     点集
-     * @return  距离,点坐标
+     * @param p     第一个点
+     * @param arr   点集
+     * @return 距离,点坐标
      */
     static getMinDisPoint(p: SPoint, arr: Point[]): MinDis | null {
         if (!arr.length) {
             return null;
         }
+
         let minDis = {
             // @ts-ignore
             MinDis: SMathUtil.pointDistance(
@@ -94,9 +100,9 @@ export class SMathUtil {
     /**
      * 计算点到线段垂线与线段的交点
      *
-     * @param   p
-     * @param   l   线段
-     * @return  距离
+     * @param p
+     * @param l     线段
+     * @return 距离
      */
     static pointToLine(p: SPoint, l: SLine): PointToLine {
         let d = {
@@ -138,20 +144,22 @@ export class SMathUtil {
                 d.Point = new SPoint(x, y);
             }
         }
+
         return d;
     } // Function pointDistance()
 
     /**
      * 计算点到点集中线段最小距离,返回该点和该距离
      *
-     * @param   p       第一个点
-     * @param   arr     点集
-     * @return  距离,点坐标
+     * @param p     第一个点
+     * @param arr   点集
+     * @return 距离,点坐标
      */
     static getMinDisLine(p: SPoint, arr: Point[]): PointToLine | null {
         if (arr.length < 2) {
             return null;
         }
+
         let PTL = SMathUtil.pointToLine(
             p,
             new SLine(
@@ -189,9 +197,9 @@ export class SMathUtil {
     /**
      * 计算矩形是否有交集(外包矩形算法)
      *
-     * @param   rect1   矩形1
-     * @param   rect2   矩形2
-     * @return  boolean
+     * @param rect1     矩形1
+     * @param rect2     矩形2
+     * @return 是否有交集
      * */
     static rectIntersection(rect1: SRect, rect2: SRect): boolean {
         let minX = rect1.x < rect2.x ? rect1.x : rect2.x;
@@ -207,9 +215,9 @@ export class SMathUtil {
     /**
      * 计算线段交点
      *
-     * @param   line1   线段1
-     * @param   line2   线段2
-     * @return  SPoint  交点 null 平行但不重合 'repeat' 重合
+     * @param line1     线段1
+     * @param line2     线段2
+     * @return 交点 null 平行但不重合 'repeat' 重合
      */
     static lineIntersection(
         line1: SLine,
@@ -223,8 +231,10 @@ export class SMathUtil {
             if (b1 == b2) {
                 return "repeat";
             }
+
             return null;
         }
+
         let intersectionX = (b2 - b1) / (k1 - k2);
         let intersectionY = k1 * intersectionX + b1;
         let minX = Math.min(line1.x1, line1.x2);
@@ -232,38 +242,35 @@ export class SMathUtil {
         if (intersectionX >= minX && intersectionX <= maxX) {
             return new SPoint(intersectionX, intersectionY);
         }
+
         return null;
     } // Function lineIntersection()
 
     /**
      * 转化数据格式为[][]
      *
-     * @param  SP  SPoint[]
-     * @return Arr number[][]
+     * @param SP    点数组
+     * @return 点二维数组
      */
     static transferToArray(SP: SPoint[]): number[][] {
-        return SP.map((t): number[] => {
-            return [t.x, t.y];
-        });
+        return SP.map((t): number[] =>([t.x, t.y]));
     } // Function transferToArray()
 
     /**
-     * 转化数据格式为SPoint[]
+     * 转化数据格式为 SPoint[]
      *
-     * @param   arr number[][]
-     * @return  SP  SPoint[]
+     * @param arr 点二维数组
+     * @return 点数组
      */
     static transferToSPoint(arr: number[][]): SPoint[] {
-        return arr.map(
-            (t): SPoint => {
-                return new SPoint(t[0], t[1]);
-            }
-        );
+        return arr.map((t): SPoint => new SPoint(t[0], t[1]));
     } // Function transferToSPoint()
 
     /**
      * 计算数组中每一项的交集,并返回外轮廓与内轮廓
      *
+     * @param array     三维数组描述轮廓
+     * @return outline 列表
      */
     static getIntersectInArray(array: number[][][]): Outline[] {
         let outlineList: Outline[] = [];
@@ -298,7 +305,6 @@ export class SMathUtil {
                 // @ts-ignore
                 poly1.regions.push(array[i]);
                 let intersectObj = intersect(poly1, poly2);
-                console.log(intersectObj);
                 if (!intersectObj.regions.length) {
                     indexArr.unshift(i);
                     poly2.regions = [];
@@ -307,7 +313,6 @@ export class SMathUtil {
                 }
             }
             indexArr.unshift(0);
-            console.log(indexArr);
             for (let i = 0; i < indexArr.length - 1; i++) {
                 let axArr = array.slice(
                     i == 0 ? 0 : indexArr[i] + 1,
@@ -318,27 +323,22 @@ export class SMathUtil {
                     Inner: []
                 };
                 outline.Outer = array[indexArr[i + 1]].map(
-                    (t): SPoint => {
-                        return new SPoint(t[0], t[1]);
-                    }
+                    (t): SPoint =>  new SPoint(t[0], t[1]));
+                outline.Inner = axArr.map((t): SPoint[] =>
+                    t.map((item): SPoint =>  new SPoint(item[0], item[1]))
                 );
-                outline.Inner = axArr.map((t): SPoint[] => {
-                    return t.map(
-                        (item): SPoint => {
-                            return new SPoint(item[0], item[1]);
-                        }
-                    );
-                });
                 outlineList.push(outline);
             }
         }
-        console.log(outlineList);
         return outlineList;
     } // Function getIntersectInArray()
 
     /**
      * 计算轮廓线面积
-     * */
+     *
+     * @param arr   轮廓线
+     * @return 面积(毫米)
+     */
     static calculateArea(arr: SPoint[]): number {
         let sum = 0;
         let n = arr.length;
@@ -346,6 +346,7 @@ export class SMathUtil {
         for (let i = 1; i <= n; i++) {
             sum += arr[i].x * arr[i - 1].y - arr[i - 1].x * arr[i].y;
         }
+
         return sum / 2;
     } // Function calculateArea()
 } // Class SMathUtil

+ 1 - 1
persagy-web-draw/src/enums/SArrowStyleType.ts

@@ -27,7 +27,7 @@
 /**
  * 线端端点箭头样式
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export enum SArrowStyleType {
     None,

+ 1 - 1
persagy-web-draw/src/enums/SCompositeType.ts

@@ -27,7 +27,7 @@
 /**
  * 融合方式
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export enum SCompositeType {
     /** 显示源图像。忽略目标图像。   */

+ 1 - 1
persagy-web-edit/src/enums/SGraphLayoutType.ts

@@ -27,7 +27,7 @@
 /**
  * 布局对齐方式
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export enum SGraphLayoutType {
     /** 垂直分布    */

+ 1 - 1
persagy-web-edit/src/enums/SOrderSetType.ts

@@ -27,7 +27,7 @@
 /**
  * 图层操作
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export enum SOrderSetType {
     /** 置顶  */

+ 1 - 1
persagy-web-graph/src/SGraphSelectContainer.ts

@@ -34,7 +34,7 @@ import { SMouseEvent } from "@persagy-web/base";
 /**
  * 基本选择器
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export class SGraphSelectContainer extends SGraphItem {
     /** 选择对象list */

+ 1 - 1
persagy-web-graph/src/enums/SGraphLayoutType.ts

@@ -27,7 +27,7 @@
 /**
  * 布局对齐方式
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export enum SGraphLayoutType {
     /** 垂直分布    */

+ 1 - 1
persagy-web-graph/src/enums/SOrderSetType.ts

@@ -27,7 +27,7 @@
 /**
  * 图层操作
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export enum SOrderSetType {
     /** 置顶  */

+ 1 - 1
persagy-web-graph/src/items/SAnchorItem.ts

@@ -31,7 +31,7 @@ import { v1 as uuidv1 } from "uuid";
 /**
  * 锚点item
  *
- * @author  郝建龙(1061851420@qq.com)
+ * @author  郝建龙 <haojianlong@sagacloud.cn>(1061851420@qq.com)
  */
 export class SAnchorItem extends SGraphItem {
     /** 锚点宽 */

+ 1 - 1
persagy-web-graph/src/items/SGraphAreaGroupItem.ts

@@ -38,7 +38,7 @@ import { AreaGroup } from "../types/AreaGroup";
 /**
  * 区域组
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export class SGraphAreaGroupItem extends SGraphShape {
     /** X坐标最小值 */

+ 1 - 1
persagy-web-graph/src/items/SGraphPolyGroupItem.ts

@@ -32,7 +32,7 @@ import { PolyGroup } from "..";
 /**
  * 多边形组
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export class SGraphPolyGroupItem extends SGraphShape {
     /** X坐标最小值 */

+ 1 - 1
persagy-web-graph/src/items/SGraphShape.ts

@@ -37,7 +37,7 @@ import {
 /**
  * 图形item基类
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export class SGraphShape extends SGraphItem {
     /** 当前item的风格 */

+ 1 - 1
persagy-web-graph/src/items/SGraphSvgItem.ts

@@ -32,7 +32,7 @@ import { SGraphSvg } from "../types/SGraphSvg";
 /**
  * SVG图片item
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export class SGraphSvgItem extends SGraphShape {
     /** 图片dom */

+ 1 - 1
persagy-web-graph/src/items/SObjectItem.ts

@@ -31,7 +31,7 @@ import { SGraphItem } from "..";
 /**
  * 对象item
  *
- * @author  郝建龙(1061851420@qq.com)
+ * @author  郝建龙 <haojianlong@sagacloud.cn>(1061851420@qq.com)
  */
 export abstract class SObjectItem extends SGraphItem {
     /** 锚点list  */

+ 1 - 1
persagy-web-graph/src/types/Point.ts

@@ -26,7 +26,7 @@
 /**
  * 轮廓坐标接口
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export interface Point {
     x: number;

+ 1 - 1
persagy-web-graph/src/types/SGraphStyle.ts

@@ -27,7 +27,7 @@
 /**
  * 风格接口
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export interface SGraphStyle {
     /** 边框颜色 */

+ 1 - 1
persagy-web-graph/src/types/Style.ts

@@ -29,7 +29,7 @@ import { SGraphStyle } from "./SGraphStyle";
 /**
  * item 风格接口
  *
- * @author  郝建龙
+ * @author  郝建龙 <haojianlong@sagacloud.cn>
  */
 export interface Style {
     [propName: string]: SGraphStyle;