浏览代码

Merge branch 'master' of http://39.106.8.246:3003/web/persagy-web

haojianlong 4 年之前
父节点
当前提交
cb86ac976a
共有 29 个文件被更改,包括 1113 次插入931 次删除
  1. 1 1
      persagy-web-big/src/enums/SItemStatus.ts
  2. 8 8
      persagy-web-big/src/factories/SItemFactory.ts
  3. 8 8
      persagy-web-big/src/items/SArrowItem.ts
  4. 17 12
      persagy-web-big/src/items/SArrowPoly.ts
  5. 80 56
      persagy-web-big/src/items/SIconTextItem.ts
  6. 93 50
      persagy-web-big/src/items/SLineItem.ts
  7. 75 73
      persagy-web-big/src/items/SPolygonItem.ts
  8. 4 3
      persagy-web-big/src/items/SPolylineItem.ts
  9. 6 5
      persagy-web-big/src/items/floor/SBoardItem.ts
  10. 19 8
      persagy-web-big/src/items/floor/SDoorItem.ts
  11. 8 8
      persagy-web-big/src/items/floor/SHighlightItem.ts
  12. 31 23
      persagy-web-big/src/items/floor/SSpaceItem.ts
  13. 60 34
      persagy-web-big/src/items/floor/SSpaceItems.ts
  14. 21 11
      persagy-web-big/src/items/floor/SVirtualWallItem.ts
  15. 3 2
      persagy-web-big/src/items/floor/SWallItem.ts
  16. 37 19
      persagy-web-big/src/items/floor/SWallItems.ts
  17. 20 12
      persagy-web-big/src/items/floor/SWindowItem.ts
  18. 34 26
      persagy-web-big/src/items/floor/ZoneItem.ts
  19. 527 521
      persagy-web-edit/src/items/SBaseArrowEdit.ts
  20. 2 0
      persagy-web-edit/src/items/SBaseIconTextEdit.ts
  21. 19 18
      persagy-web-edit/src/items/SBaseImageEdit.ts
  22. 7 6
      persagy-web-edit/src/items/SBaseLineEdit.ts
  23. 1 0
      persagy-web-edit/src/items/SBasePolygonEdit.ts
  24. 4 3
      persagy-web-edit/src/items/SBasePolylineEdit.ts
  25. 23 23
      persagy-web-edit/src/items/SBaseTextEdit.ts
  26. 1 0
      persagy-web-graph/src/SGraphItem.ts
  27. 1 0
      persagy-web-graph/src/items/SGraphShape.ts
  28. 2 0
      persagy-web-graph/src/items/SImageItem.ts
  29. 1 1
      persagy-web-graph/src/items/STextItem.ts

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

@@ -25,7 +25,7 @@
  */
 
 /**
- * item状态
+ * item 状态
  *
  * @author  郝建龙 <haojianlong@sagacloud.cn>
  * @deprecated move to edit

+ 8 - 8
persagy-web-big/src/factories/SItemFactory.ts

@@ -40,7 +40,7 @@ import { SZoneItem } from "../items/floor/ZoneItem";
 import { Zone } from "../types/floor/Zone";
 
 /**
- * item创建工厂
+ * item 创建工厂
  *
  * @author 郝建龙 <haojianlong@sagacloud.cn>
  */
@@ -51,7 +51,7 @@ export class SItemFactory {
     constructor() {} // Constructor
 
     /**
-     * 创建柱子item
+     * 创建柱子 item
      *
      * @param data    柱子数据
      * @return 柱子 item
@@ -61,7 +61,7 @@ export class SItemFactory {
     } // Function createColumn()
 
     /**
-     * 创建墙item
+     * 创建墙 item
      *
      * @param data    墙数据
      * @return 墙 item
@@ -71,7 +71,7 @@ export class SItemFactory {
     } // Function createWall()
 
     /**
-     * 创建虚拟墙item
+     * 创建虚拟墙 item
      *
      * @param data    虚拟墙数据
      * @return 虚拟墙 item
@@ -81,7 +81,7 @@ export class SItemFactory {
     } // Function createVirtualWall()
 
     /**
-     * 创建空间item
+     * 创建空间 item
      *
      * @param data    空间数据
      * @return 空间 item
@@ -91,7 +91,7 @@ export class SItemFactory {
     } // Function createSpace()
 
     /**
-     * 创建门item
+     * 创建门 item
      *
      * @param data    门数据
      * @return 门item
@@ -101,7 +101,7 @@ export class SItemFactory {
     } // Function createDoor()
 
     /**
-     * 创建窗item
+     * 创建窗 item
      *
      * @param data    窗户数据
      * @return 窗户 item
@@ -111,7 +111,7 @@ export class SItemFactory {
     } // Function createWindow()
 
     /**
-     * 创建业务空间item
+     * 创建业务空间 item
      *
      * @param data    业务空间数据
      * @return 业务空间 item

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

@@ -38,21 +38,21 @@ 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
+    }
 
     /**
      * 绘制基本图形
@@ -60,13 +60,13 @@ export class SArrowItem extends SPolylineItem {
      * @param painter   绘制对象
     */
     drawBaseLine(painter: SPainter): void {
-        // 绘制基本图形
+        // 绘制基本图形,线样式是虚线时
         if (this.lineStyle == SLineStyle.Dashed) {
             painter.pen.lineDash = [
                 painter.toPx(this.lineWidth * 3),
                 painter.toPx(this.lineWidth * 7)
             ];
-        } else if (this.lineStyle == SLineStyle.Dotted) {
+        } else if (this.lineStyle == SLineStyle.Dotted) { // 绘制基本图形,线样式是点线时
             painter.pen.lineDash = [
                 painter.toPx(this.lineWidth),
                 painter.toPx(this.lineWidth)
@@ -87,5 +87,5 @@ export class SArrowItem extends SPolylineItem {
             }
         );
         painter.drawPolyline(this.pointList);
-    } // Function drawBaseLine()
-} // Class SArrowItem
+    }
+}

+ 17 - 12
persagy-web-big/src/items/SArrowPoly.ts

@@ -24,10 +24,10 @@
  * *********************************************************************************************************************
  */
 
-import { SLineItem } from "./SLineItem";
-import { SColor, SLine, SPainter, SPoint } from "@persagy-web/draw";
-import { SMathUtil } from "@persagy-web/graph/lib/utils/SMathUtil";
-import { SItemStatus } from "..";
+import {SLineItem} from "./SLineItem";
+import {SColor, SLine, SPainter, SPoint} from "@persagy-web/draw";
+import {SMathUtil} from "@persagy-web/graph/lib/utils/SMathUtil";
+import {SItemStatus} from "..";
 
 /**
  * 箭头多边形类型
@@ -46,26 +46,29 @@ export class SArrowPoly extends SLineItem {
     _isSingle: boolean = true;
     get isSingle(): boolean {
         return this._isSingle;
-    } // Get isSingle
+    }
+
     set isSingle(v: boolean) {
         this._isSingle = v;
         this.update();
-    } // Set isSingle
+    }
 
     /** 多边形填充色 */
     private _polyFillColor: SColor = SColor.White;
     get polyFillColor(): SColor {
         return this._polyFillColor;
-    } // Get polyFillColor
+    }
+
     set polyFillColor(v: SColor) {
         this._polyFillColor = v;
         this.update();
-    } // Set polyFillColor
+    }
 
     /**
      * 根据两个顶点生成多边形数组
      */
     pointChange(): void {
+        // 如果线段的长度大于1
         if (this.line.length > 1) {
             const line = new SLine(this.line[0], this.line[1]);
             const dis = SMathUtil.pointDistance(
@@ -81,6 +84,7 @@ export class SArrowPoly extends SLineItem {
                 this._ang = line.dy > 0 ? Math.PI / 2 : (3 * Math.PI) / 2;
             }
 
+            // 是否为单向箭头 是-只绘制末端箭头
             if (this.isSingle) {
                 this.pointList = [
                     new SPoint(0, this.arrowWidth / 2),
@@ -106,7 +110,7 @@ export class SArrowPoly extends SLineItem {
                 ];
             }
         }
-    } // Function pointChange()
+    }
 
     /**
      * 绘制
@@ -114,6 +118,7 @@ export class SArrowPoly extends SLineItem {
      * @param painter   绘制对象
      */
     onDraw(painter: SPainter): void {
+        // 如果线段存在
         if (this.line.length) {
             painter.save();
             painter.pen.lineWidth = painter.toPx(this.lineWidth);
@@ -123,7 +128,7 @@ export class SArrowPoly extends SLineItem {
             painter.brush.color = this.polyFillColor;
             painter.drawPolygon(this.pointList);
             painter.restore();
-
+            // item 状态为编辑或创建时
             if (
                 this.status == SItemStatus.Edit ||
                 this.status == SItemStatus.Create
@@ -138,5 +143,5 @@ export class SArrowPoly extends SLineItem {
                 });
             }
         }
-    } // Function onDraw()
-} // Class SArrowPoly
+    }
+}

+ 80 - 56
persagy-web-big/src/items/SIconTextItem.ts

@@ -31,8 +31,8 @@ import {
     SAnchorItem,
     SGraphItem
 } from "@persagy-web/graph";
-import { SItemStatus, ItemOrder } from "..";
-import { SMouseEvent } from "@persagy-web/base";
+import {SItemStatus, ItemOrder} from "..";
+import {SMouseEvent} from "@persagy-web/base";
 import {
     SSize,
     SRect,
@@ -41,7 +41,7 @@ import {
     SFont,
     SPoint
 } from "@persagy-web/draw";
-import { Anchor } from "../types/topology/Anchor";
+import {Anchor} from "../types/topology/Anchor";
 
 /**
  * 图例 item
@@ -56,49 +56,55 @@ export class SIconTextItem extends SObjectItem {
     } // Get status
     set status(v: SItemStatus) {
         this._status = v;
+        // 标准状态时
         if (v == SItemStatus.Normal) {
             this.moveable = true;
             this.textItem.moveable = false;
             this.img.moveable = false;
-        } else if (v == SItemStatus.Edit) {
+        } else if (v == SItemStatus.Edit) { // 编辑状态时
             this.moveable = false;
             this.textItem.moveable = true;
             this.img.moveable = true;
-        } else if (v == SItemStatus.Create) {
+        } else if (v == SItemStatus.Create) { // 创建状态时
             this.moveable = true;
             this.textItem.moveable = false;
             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;
         }
         this._showText = v;
+        // 是否显示文字
         if (v) {
             this.textItem.show();
         } else {
             this.textItem.hide();
         }
-    } // Set showText
+    }
 
     /** 是否被选中 */
     get selected(): boolean {
         return this._selected && this.selectable && this.enabled;
-    } // Get selected
+    }
+
     set selected(value: boolean) {
         // 如果选择状态未变更
         if (this.selected == value) {
             return;
         }
         this._selected = value;
+        // 选中时
         if (value) {
             this.img.scale = 1.25;
             this.zOrder = ItemOrder.highLightOrder;
@@ -107,15 +113,17 @@ export class SIconTextItem extends SObjectItem {
             this.zOrder = ItemOrder.markOrder;
         }
         this.update();
-    } // Set selected
+    }
 
     /** 是否激活 */
     _isActive: boolean = false;
     get isActive(): boolean {
         return this._isActive;
-    } // Get isActive
+    }
+
     set isActive(v: boolean) {
         this._isActive = v;
+        // 激活状态
         if (v) {
             this.cursor = "pointer";
             this.textItem.cursor = "pointer";
@@ -126,42 +134,46 @@ export class SIconTextItem extends SObjectItem {
             this.img.cursor = "auto";
         }
         this.update();
-    } // Set isActive
+    }
 
     /** 激活显示颜色 */
     _activeColor: SColor = new SColor("#00000033");
     get activeColor(): SColor {
         return this._activeColor;
-    } // Get activeColor
+    }
+
     set activeColor(v: SColor) {
         this._activeColor = v;
         this.update();
-    } // Set activeColor
+    }
 
     /** X 轴坐标 */
     get x(): number {
         return this.pos.x;
-    } // Get x
+    }
+
     set x(v: number) {
         this.pos.x = v;
         this.$emit("changePos");
         this.update();
-    } // Set x
+    }
 
     /** Y 轴坐标 */
     get y(): number {
         return this.pos.y;
-    } // Get y
+    }
+
     set y(v: number) {
         this.pos.y = v;
         this.$emit("changePos");
         this.update();
-    } // Set y
+    }
 
     /** icon宽 */
     get sWidth(): number {
         return this.img.width;
-    } // Get sWidth
+    }
+
     set sWidth(v: number) {
         this.img.width = v;
         this.img.origin = new SPoint(
@@ -170,12 +182,13 @@ 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(
@@ -184,46 +197,50 @@ 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);
@@ -236,7 +253,7 @@ export class SIconTextItem extends SObjectItem {
      *
      * @param parent  父类
      * @param data    锚点数据
-    */
+     */
     constructor(parent: SGraphItem | null, data?: Anchor[]) {
         super(parent);
         this.img.width = 32;
@@ -247,6 +264,7 @@ export class SIconTextItem extends SObjectItem {
         );
         this.img.connect("onMove", this, this.changeAnchorPoint.bind(this));
         let anchorPoint;
+        // 锚点数据存在时
         if (data && data.length) {
             anchorPoint = data.map(t => {
                 return {
@@ -257,10 +275,10 @@ export class SIconTextItem extends SObjectItem {
             });
         } else {
             anchorPoint = [
-                { x: this.img.x, y: this.img.y, id: "" },
-                { x: this.img.x, y: this.img.y, id: "" },
-                { x: this.img.x, y: this.img.y, id: "" },
-                { x: this.img.x, y: this.img.y, id: "" }
+                {x: this.img.x, y: this.img.y, id: ""},
+                {x: this.img.x, y: this.img.y, id: ""},
+                {x: this.img.x, y: this.img.y, id: ""},
+                {x: this.img.x, y: this.img.y, id: ""}
                 // { x: this.img.x, y: this.img.y + this.img.height / 2, id: "" },
                 // { x: this.img.x, y: this.img.y - this.img.height / 2, id: "" },
                 // { x: this.img.x - this.img.width / 2, y: this.img.y, id: "" },
@@ -285,19 +303,19 @@ export class SIconTextItem extends SObjectItem {
         );
         this.moveable = true;
         this.selectable = true;
-    } // Constructor
+    }
 
     /**
      * 计算并移动锚点的位置
-    */
+     */
     private changeAnchorPoint(): void {
         // 判断是否有锚点
         if (this.anchorList.length) {
             let anchorPoint = [
-                { x: this.img.x, y: this.img.y },
-                { x: this.img.x, y: this.img.y },
-                { x: this.img.x, y: this.img.y },
-                { x: this.img.x, y: this.img.y }
+                {x: this.img.x, y: this.img.y},
+                {x: this.img.x, y: this.img.y},
+                {x: this.img.x, y: this.img.y},
+                {x: this.img.x, y: this.img.y}
                 // { x: this.img.x, y: this.img.y + this.img.height / 2 },
                 // { x: this.img.x, y: this.img.y - this.img.height / 2 },
                 // { x: this.img.x - this.img.width / 2, y: this.img.y },
@@ -307,61 +325,63 @@ export class SIconTextItem extends SObjectItem {
                 item.moveTo(anchorPoint[index].x, anchorPoint[index].y);
             });
         }
-    } // Function changeAnchorPoint()
+    }
 
     /**
      * 鼠标按下事件
      *
      * @param event   事件对象
      * @return 是否处理事件
-    */
+     */
     onMouseDown(event: SMouseEvent): boolean {
+        // 如果为show状态 双击改对象则需改为编辑状态
         if (this.status == SItemStatus.Normal) {
             return super.onMouseDown(event);
-        } else if (this.status == SItemStatus.Edit) {
+        } else if (this.status == SItemStatus.Edit) { // 编辑状态时
             return super.onMouseDown(event);
         }
         return true;
-    } // Function onMouseDown()
+    }
 
     /**
      * 宽高发发生变化
      *
      * @param oldSize 改之前的大小
      * @param newSize 改之后大小
-    */
+     */
     onResize(oldSize: SSize, newSize: SSize): void {
         console.log(arguments);
-    } // Function onResize()
+    }
 
     /**
      * 鼠标双击事件
      *
      * @param event   鼠标事件
      * @return 是否处理事件
-    */
+     */
     onDoubleClick(event: SMouseEvent): boolean {
-        // 如果show状态 双击改对象则需改为编辑状态
+        // 如果show状态 双击改对象则需改为编辑状态,处于编辑状态时
         if (SItemStatus.Normal == this.status) {
             this.status = SItemStatus.Edit;
             this.grabItem(this);
-        } else if (SItemStatus.Edit == this.status) {
+        } else if (SItemStatus.Edit == this.status) { // 处于编辑状态时
             this.status = SItemStatus.Normal;
             this.releaseItem();
         }
         this.update();
         return true;
-    } // Function onDoubleClick()
+    }
 
     /**
      * Item 对象边界区域
      *
      * @return 边界矩阵
-    */
+     */
     boundingRect(): SRect {
         let rect = this.img
             .boundingRect()
             .adjusted(this.img.pos.x, this.img.pos.y, 0, 0);
+        // 显示文字时
         if (this.showText) {
             rect = rect.unioned(
                 this.textItem
@@ -371,14 +391,15 @@ export class SIconTextItem extends SObjectItem {
         }
 
         return rect.adjusted(-5, -5, 10, 10);
-    } // Function boundingRect()
+    }
 
     /**
      * Item 绘制操作
      *
      * @param painter   绘制对象
-    */
+     */
     onDraw(painter: SPainter): void {
+        // 编辑状态时
         if (this.status == SItemStatus.Edit) {
             painter.pen.lineWidth = painter.toPx(1);
             painter.pen.lineDash = [painter.toPx(3), painter.toPx(7)];
@@ -387,9 +408,11 @@ export class SIconTextItem extends SObjectItem {
             painter.drawRect(this.boundingRect());
         }
 
+        // 处于激活状态时
         if (this.isActive) {
             painter.pen.color = SColor.Transparent;
             painter.brush.color = this.activeColor;
+            // 是否选中
             if (this.selected) {
                 painter.shadow.shadowBlur = 10;
                 painter.shadow.shadowColor = this.activeColor;
@@ -408,6 +431,7 @@ export class SIconTextItem extends SObjectItem {
                 );
             }
         } else {
+            // 是否选中
             if (this.selected) {
                 painter.pen.color = SColor.Transparent;
                 painter.brush.color = SColor.Transparent;
@@ -418,5 +442,5 @@ export class SIconTextItem extends SObjectItem {
                 painter.drawCircle(this.img.x, this.img.y, this.sWidth / 2.0);
             }
         }
-    } // Function onDraw()
-} // Class SIconTextItem
+    }
+}

+ 93 - 50
persagy-web-big/src/items/SLineItem.ts

@@ -24,10 +24,10 @@
  * *********************************************************************************************************************
  */
 
-import { SColor, SLine, SPainter, SPoint, SRect } from "@persagy-web/draw";
-import { SMouseButton, SMouseEvent, SUndoStack } from "@persagy-web/base";
-import { SMathUtil } from "../utils/SMathUtil";
-import { SItemStatus } from "..";
+import {SColor, SLine, SPainter, SPoint, SRect} from "@persagy-web/draw";
+import {SMouseButton, SMouseEvent, SUndoStack} from "@persagy-web/base";
+import {SMathUtil} from "../utils/SMathUtil";
+import {SItemStatus} from "..";
 import {
     SGraphItem,
     SGraphPointListInsert,
@@ -54,72 +54,79 @@ export class SLineItem extends SGraphItem {
     private _line: SPoint[] = [];
     get line(): SPoint[] {
         return this._line;
-    } // Get line
+    }
+
     set line(arr: SPoint[]) {
         this._line = arr;
         this.update();
-    } // Set line
+    }
 
     /** 是否完成绘制 */
     protected _status: SItemStatus = SItemStatus.Normal;
     get status(): SItemStatus {
         return this._status;
-    } // Get status
+    }
+
     set status(v: SItemStatus) {
         this._status = v;
         this.undoStack.clear();
         this.update();
-    } // Set status
+    }
 
     /** 线条颜色 */
     private _strokeColor: SColor = SColor.Black;
     get strokeColor(): SColor {
         return this._strokeColor;
-    } // Get strokeColor
+    }
+
     set strokeColor(v: SColor) {
         this._strokeColor = v;
         this.update();
-    } // Set strokeColor
+    }
 
     /** 线条样式 */
     private _lineStyle: SLineStyle = SLineStyle.Solid;
     get lineStyle(): SLineStyle {
         return this._lineStyle;
-    } // Get lineStyle
+    }
+
     set lineStyle(v: SLineStyle) {
         this._lineStyle = v;
         this.update();
-    } // Set lineStyle
+    }
 
     /** 端点填充色 */
     private _fillColor: SColor = SColor.White;
     get fillColor(): SColor {
         return this._fillColor;
-    } // Get fillColor
+    }
+
     set fillColor(v: SColor) {
         this._fillColor = v;
         this.update();
-    } // Set fillColor
+    }
 
     /** 选中端点填充色 */
     private _activeFillColor: SColor = new SColor("#2196f3");
     get activeFillColor(): SColor {
         return this._activeFillColor;
-    } // Get activeFillColor
+    }
+
     set activeFillColor(v: SColor) {
         this._activeFillColor = v;
         this.update();
-    } // Set activeFillColor
+    }
 
     /** 线条宽度 */
     private _lineWidth: number = 1;
     get lineWidth(): number {
         return this._lineWidth;
-    } // Get lineWidth
+    }
+
     set lineWidth(v: number) {
         this._lineWidth = v;
         this.update();
-    } // Set lineWidth
+    }
 
     /** 拖动灵敏度 */
     dis: number = 5;
@@ -167,23 +174,25 @@ export class SLineItem extends SGraphItem {
      */
     constructor(parent: SGraphItem | null, line?: SPoint | SPoint[]) {
         super(parent);
+        //  坐标集合存在时
         if (line) {
+            // 坐标集合出现在 SPoint 的实例对象上
             if (line instanceof SPoint) {
                 this.line.push(line);
-            } else {
+            } else { // 没有在 SPoint 的实例对象上
                 this.line = line;
             }
-        } else {
+        } else { // 坐标集合不存在时
             this.line = [];
         }
-    } // Constructor
+    }
 
     /**
      * 点发生变化
      */
     protected pointChange(): void {
         // do nothing
-    } // Function pointChange()
+    }
 
     /**
      * 添加点至数组中
@@ -191,10 +200,11 @@ export class SLineItem extends SGraphItem {
      * @param p 添加的点
      */
     private addPoint(p: SPoint): void {
+        // 坐标集合长度大于2时
         if (this.line.length < 2) {
             this.line.push(p);
             this.recordAction(SGraphPointListInsert, [this.line, p]);
-        } else {
+        } else {  // 坐标集合长度不大于2时
             this.line[1] = p;
             this.recordAction(SGraphPointListInsert, [this.line, p, 1]);
             this.status = SItemStatus.Normal;
@@ -203,7 +213,7 @@ export class SLineItem extends SGraphItem {
             this.pointChange();
         }
         this.update();
-    } // Function addPoint()
+    }
 
     /**
      * 鼠标双击事件
@@ -212,16 +222,17 @@ export class SLineItem extends SGraphItem {
      * @return 是否处理事件
      */
     onDoubleClick(event: SMouseEvent): boolean {
+        // 如果为show状态 双击改对象则需改为编辑状态
         if (this.status == SItemStatus.Normal) {
             this.status = SItemStatus.Edit;
             this.grabItem(this);
-        } else if (this.status == SItemStatus.Edit) {
+        } else if (this.status == SItemStatus.Edit) { // 处于编辑状态时
             this.status = SItemStatus.Normal;
             this.releaseItem();
         }
         this.update();
         return true;
-    } // Function onDoubleClick()
+    }
 
     /**
      * 鼠标按下事件
@@ -232,23 +243,25 @@ export class SLineItem extends SGraphItem {
     onMouseDown(event: SMouseEvent): boolean {
         this.curIndex = -1;
         this.curPoint = null;
+        // 按下 shiftKey 键
         if (event.shiftKey) {
             event = this.compare(event);
         }
+        // 按下鼠标左键
         if (event.buttons == SMouseButton.LeftButton) {
-            if (this.status == SItemStatus.Normal) {
+            if (this.status == SItemStatus.Normal) { //标准状态时
                 return super.onMouseDown(event);
-            } else if (this.status == SItemStatus.Edit) {
+            } else if (this.status == SItemStatus.Edit) { // 编辑状态时
                 // 判断是否点击到端点上(获取端点索引值)
                 this.findNearestPoint(new SPoint(event.x, event.y));
-            } else if (this.status == SItemStatus.Create) {
+            } else if (this.status == SItemStatus.Create) { // 创建状态时
                 this.addPoint(new SPoint(event.x, event.y));
                 return true;
             }
         }
 
         return true;
-    } // Function onMouseDown()
+    }
 
     /**
      * 鼠标抬起事件
@@ -257,7 +270,9 @@ export class SLineItem extends SGraphItem {
      * @return 是否处理事件
      */
     onMouseUp(event: SMouseEvent): boolean {
+        // 处于编辑状态时
         if (this.status == SItemStatus.Edit) {
+            // 当前点索引大于 -1 时
             if (this.curIndex > -1) {
                 const p = new SPoint(
                     this.line[this.curIndex].x,
@@ -270,7 +285,7 @@ export class SLineItem extends SGraphItem {
                     this.curIndex
                 ]);
             }
-        } else if (this.status == SItemStatus.Normal) {
+        } else if (this.status == SItemStatus.Normal) { // 标准状态时
             this.moveToOrigin(this.x, this.y);
             return super.onMouseUp(event);
         }
@@ -278,7 +293,7 @@ export class SLineItem extends SGraphItem {
         this.curIndex = -1;
         this.curPoint = null;
         return true;
-    } // Function onMouseUp()
+    }
 
     /**
      * 鼠标移动事件
@@ -287,16 +302,19 @@ export class SLineItem extends SGraphItem {
      * @return 是否处理事件
      */
     onMouseMove(event: SMouseEvent): boolean {
+        // 按下 shiftKey 键
         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);
                 this.pointChange();
             }
-        } else if (this.status == SItemStatus.Edit) {
+        } else if (this.status == SItemStatus.Edit) { // 处于编辑状态时
+            // 当前索引不等于 -1 时
             if (-1 != this.curIndex) {
                 this.line[this.curIndex].x = event.x;
                 this.line[this.curIndex].y = event.y;
@@ -308,7 +326,7 @@ export class SLineItem extends SGraphItem {
 
         this.update();
         return true;
-    } // Function onMouseMove()
+    }
 
     /**
      * 获取点击点与 Point[] 中的点距离最近点
@@ -316,21 +334,24 @@ export class SLineItem extends SGraphItem {
      * @param p     鼠标点击点
      */
     findNearestPoint(p: SPoint): void {
+        // 拖动灵敏度
         let len = this.sceneDis;
         for (let i = 0; i < this.line.length; i++) {
+            // 计算点到点距离
             let dis = SMathUtil.pointDistance(
                 p.x,
                 p.y,
                 this.line[i].x,
                 this.line[i].y
             );
+            // 点到点的距离大于灵敏度时
             if (dis < len) {
                 len = dis;
                 this.curIndex = i;
                 this.curPoint = new SPoint(this.line[this.curIndex]);
             }
         }
-    } // Function findNearestPoint()
+    }
 
     /**
      * 记录相关动作并推入栈中
@@ -342,7 +363,7 @@ export class SLineItem extends SGraphItem {
         // 记录相关命令并推入堆栈中 todo
         const command = new SGraphCommand(this.scene, this, ...any);
         this.undoStack.push(command);
-    } // Function recordAction()
+    }
 
     /**
      * 移动后处理所有坐标,并肩原点置为场景原点
@@ -359,7 +380,7 @@ export class SLineItem extends SGraphItem {
         });
         this.x = 0;
         this.y = 0;
-    } // Function moveToOrigin()
+    }
 
     /**
      * shift 垂直水平创建或编辑
@@ -368,14 +389,17 @@ export class SLineItem extends SGraphItem {
      * @return 处理后的事件对象
      */
     compare(event: SMouseEvent): SMouseEvent {
+        // 线段长度存在时
         if (this.line.length) {
             let last = new SPoint(event.x, event.y);
+            // 处于创建状态时
             if (this.status == SItemStatus.Create) {
                 last = this.line[0];
-            } else if (this.status == SItemStatus.Edit) {
+            } else if (this.status == SItemStatus.Edit) {   // 处于编辑状态时
+                // 当前索引等于 1 时
                 if (this.curIndex == 1) {
                     last = this.line[0];
-                } else if (this.curIndex == 0) {
+                } else if (this.curIndex == 0) { // 当前索引等于 0 时
                     last = this.line[1];
                 }
             }
@@ -389,7 +413,7 @@ export class SLineItem extends SGraphItem {
         }
 
         return event;
-    } // Function compare()
+    }
 
     /**
      * 判断点是否在区域内
@@ -399,8 +423,10 @@ export class SLineItem extends SGraphItem {
      * @return 是否包含
      */
     contains(x: number, y: number): boolean {
+        // 线段长度大于 2 时
         if (this.line.length == 2) {
             let p = new SPoint(x, y);
+            // 计算点到线段垂线与线段的交点
             if (
                 SMathUtil.pointToLine(p, new SLine(this.line[0], this.line[1]))
                     .MinDis < this.dis
@@ -410,38 +436,41 @@ export class SLineItem extends SGraphItem {
         }
 
         return false;
-    } // Function contains()
+    }
 
     /**
      * 撤销操作
      */
     undo(): void {
+        // 处于标准状态时
         if (this.status != SItemStatus.Normal) {
             this.undoStack.undo();
         }
-    } // Function undo()
+    }
 
     /**
      * 重做操作
      */
     redo(): void {
+        // 处于标准状态时
         if (this.status != SItemStatus.Normal) {
             this.undoStack.redo();
         }
-    } // Function redo()
+    }
 
     /**
      * 取消操作 item 事件
      */
     cancelOperate(): void {
+        // 处于创建状态时
         if (this.status == SItemStatus.Create) {
             this.parent = null;
             this.releaseItem();
-        } else if (this.status == SItemStatus.Edit) {
+        } else if (this.status == SItemStatus.Edit) { // 处于编辑状态时
             this.status = SItemStatus.Normal;
             this.releaseItem();
         }
-    } // Function cancelOperate()
+    }
 
     /**
      * Item 对象边界区域
@@ -449,6 +478,7 @@ export class SLineItem extends SGraphItem {
      * @return 边界区域
      */
     boundingRect(): SRect {
+        // 线段长度存在时
         if (this.line.length) {
             this.minX = this.line[0].x;
             this.maxX = this.line[0].x;
@@ -457,15 +487,23 @@ export class SLineItem extends SGraphItem {
             this.line.forEach(it => {
                 let x = it.x,
                     y = it.y;
+
+                // 如果数据 x 坐标小于 x 坐标最小值
                 if (x < this.minX) {
                     this.minX = x;
                 }
+
+                // 如果数据 y 坐标小于 y 坐标最小值
                 if (y < this.minY) {
                     this.minY = y;
                 }
+
+                // 如果数据 x 坐标大于 x 坐标最小值
                 if (x > this.maxX) {
                     this.maxX = x;
                 }
+
+                // 如果数据 y 坐标大于 y 坐标最小值
                 if (y > this.maxY) {
                     this.maxY = y;
                 }
@@ -478,7 +516,7 @@ export class SLineItem extends SGraphItem {
             this.maxX - this.minX,
             this.maxY - this.minY
         );
-    } // Function boundingRect()
+    }
 
     /**
      * Item 绘制操作
@@ -489,21 +527,24 @@ export class SLineItem extends SGraphItem {
         this.sceneDis = painter.toPx(this.dis);
         painter.pen.lineWidth = painter.toPx(this.lineWidth);
         painter.pen.color = this.strokeColor;
+        // 线段长度等于 2 时
         if (this.line.length == 2) {
             // 绘制直线
             painter.pen.color = new SColor(this.strokeColor);
+            // 绘制基本图形,线样式是虚线时
             if (this.lineStyle == SLineStyle.Dashed) {
                 painter.pen.lineDash = [
                     painter.toPx(this.lineWidth * 3),
                     painter.toPx(this.lineWidth * 7)
                 ];
-            } else if (this.lineStyle == SLineStyle.Dotted) {
+            } else if (this.lineStyle == SLineStyle.Dotted) { // 绘制基本图形,线样式是点线时
                 painter.pen.lineDash = [
                     painter.toPx(this.lineWidth),
                     painter.toPx(this.lineWidth)
                 ];
             }
 
+            // 选中状态并且处于标准状态
             if (this.selected && this.status == SItemStatus.Normal) {
                 painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
                 painter.shadow.shadowBlur = 10;
@@ -513,6 +554,7 @@ export class SLineItem extends SGraphItem {
             }
 
             painter.drawLine(this.line[0], this.line[1]);
+            // 处于编辑状态或创建状态时
             if (
                 this.status == SItemStatus.Edit ||
                 this.status == SItemStatus.Create
@@ -527,7 +569,8 @@ export class SLineItem extends SGraphItem {
                     painter.drawCircle(p.x, p.y, painter.toPx(5));
                 });
             }
-        } else if (this.line.length == 1) {
+        } else if (this.line.length == 1) { // 线段长度等于 1 时
+            // 处于编辑状态或创建状态时
             if (
                 this.status == SItemStatus.Edit ||
                 this.status == SItemStatus.Create
@@ -541,5 +584,5 @@ export class SLineItem extends SGraphItem {
                 );
             }
         }
-    } // Function onDraw()
-} // Class SLineItem
+    }
+}

+ 75 - 73
persagy-web-big/src/items/SPolygonItem.ts

@@ -31,7 +31,7 @@ import {
     SGraphPointListUpdate,
     SLineStyle
 } from "@persagy-web/graph";
-import { SKeyCode, SMouseEvent, SUndoStack } from "@persagy-web/base/";
+import {SKeyCode, SMouseEvent, SUndoStack} from "@persagy-web/base/";
 import {
     SColor,
     SLine,
@@ -41,8 +41,8 @@ import {
     SPolygonUtil,
     SRect
 } from "@persagy-web/draw";
-import { SItemStatus } from "..";
-import { SMathUtil } from "../utils/SMathUtil";
+import {SItemStatus} from "..";
+import {SMathUtil} from "../utils/SMathUtil";
 
 /**
  * 编辑多边形
@@ -61,65 +61,66 @@ export class SPolygonItem extends SGraphItem {
 
     /** 轮廓线坐标 */
     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");
     /** 画笔颜色 */
     get strokeColor(): SColor {
         return this._strokeColor;
-    } // Get strokeColor
+    }
     set strokeColor(v: SColor) {
         this._strokeColor = v;
         this.update();
-    } // Set strokeColor
+    }
 
     /** 填充颜色 */
     _fillColor: SColor = new SColor("#1EE887");
     get fillColor(): SColor {
         return this._fillColor;
-    } // Get fillColor
+    }
     set fillColor(v: SColor) {
         this._fillColor = v;
         this.update();
-    } // Set fillColor
+    }
 
     /** 边框样式 */
     _lineStyle: SLineStyle = SLineStyle.Solid;
     get lineStyle(): SLineStyle {
         return this._lineStyle;
-    } // Get lineStyle
+    }
     set lineStyle(v: SLineStyle) {
         this._lineStyle = v;
         this.update();
-    } // Set lineStyle
+    }
 
     /** 边框的宽 只可输入像素宽 */
     _lineWidth: number = 4;
     get lineWidth(): number {
         return this._lineWidth;
-    } // Get lineWidth
+    }
     set lineWidth(v: number) {
         this._lineWidth = v;
         this.update();
-    } // Set lineWidth
+    }
 
     /** 是否闭合 */
     closeFlag: boolean = false;
@@ -142,10 +143,10 @@ export class SPolygonItem extends SGraphItem {
      * 构造函数
      *
      * @param parent    指向父对象
-    */
+     */
     constructor(parent: SGraphItem | null) {
         super(parent);
-    } // Constructor
+    }
 
     //////////////////
     //  以下为对pointList 数组的操作方法
@@ -157,7 +158,7 @@ export class SPolygonItem extends SGraphItem {
      * @param y   点位得 y 坐标
      * @param i   储存所在索引
      * @return SPoint 添加的顶点
-    */
+     */
     insertPoint(x: number, y: number, i: number | null = null): SPoint {
         const point = new SPoint(x, y);
         if (i == null) {
@@ -167,14 +168,14 @@ export class SPolygonItem extends SGraphItem {
         }
         this.update();
         return point;
-    } // Function insertPoint()
+    }
 
     /**
      * 删除点位
      *
      * @param i   删除点所在的索引
      * @return 索引不在数组范围则返回 null
-    */
+     */
     deletePoint(i: number | null = null): SPoint | null {
         let point = null;
         if (i != null) {
@@ -196,7 +197,7 @@ export class SPolygonItem extends SGraphItem {
         this.curPoint = null;
         this.update();
         return point;
-    } // Function deletePoint()
+    }
 
     /**
      * 多边形顶点的移动位置
@@ -205,7 +206,7 @@ export class SPolygonItem extends SGraphItem {
      * @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) {
@@ -219,7 +220,7 @@ export class SPolygonItem extends SGraphItem {
 
         point = this.pointList[i];
         return point;
-    } // Function movePoint()
+    }
 
     ////////////
     //  以下为三种状态下的绘制多边形方法
@@ -229,7 +230,7 @@ export class SPolygonItem extends SGraphItem {
      *
      * @param painter      绘制类
      * @param pointList    绘制多边形数组
-    */
+     */
     protected drawShowPolygon(painter: SPainter, pointList: SPoint[]): void {
         painter.save();
         painter.pen.lineCapStyle = SLineCapStyle.Square;
@@ -248,6 +249,7 @@ export class SPolygonItem extends SGraphItem {
             ];
         }
 
+        // 是否选中
         if (this.selected) {
             painter.shadow.shadowBlur = 10;
             painter.shadow.shadowColor = new SColor(`#00000033`);
@@ -259,14 +261,14 @@ export class SPolygonItem extends SGraphItem {
 
         painter.drawPolygon([...pointList]);
         painter.restore();
-    } // Function drawShowPolygon()
+    }
 
     /**
      * 创建状态 --绘制多边形数组
      *
      * @param painter      绘制类
      * @param pointList    绘制多边形数组
-    */
+     */
     protected drawCreatePolygon(painter: SPainter, pointList: SPoint[]): void {
         painter.pen.lineCapStyle = SLineCapStyle.Square;
         painter.pen.color = this.strokeColor;
@@ -316,14 +318,14 @@ export class SPolygonItem extends SGraphItem {
         } else {
             painter.drawPolygon(pointList);
         }
-    } // Function drawCreatePolygon()
+    }
 
     /**
      * 编辑状态 --绘制多边形数组
      *
      * @param painter       绘制类
      * @param pointList    绘制多边形数组
-    */
+     */
     protected drawEditPolygon(painter: SPainter, pointList: SPoint[]): void {
         // 展示多边形
         painter.pen.lineCapStyle = SLineCapStyle.Square;
@@ -342,13 +344,13 @@ export class SPolygonItem extends SGraphItem {
 
             painter.drawCircle(item.x, item.y, painter.toPx(this.len / 2));
         });
-    } // Function drawCreatePolygon()
+    }
 
     /**
      * 编辑状态操作多边形数组
      *
      * @param event    鼠标事件
-    */
+     */
     protected editPolygonPoint(event: SMouseEvent): void {
         //  判断是否为删除状态 isAlt = true为删除状态
         if (this.isAlt) {
@@ -407,8 +409,8 @@ export class SPolygonItem extends SGraphItem {
             // 2判断是否点击在多边形得边上
             if (-1 == lenIndex) {
                 let len = SMathUtil.pointToLine(
-                        new SPoint(event.x, event.y),
-                        new SLine(this.pointList[0], this.pointList[1])
+                    new SPoint(event.x, event.y),
+                    new SLine(this.pointList[0], this.pointList[1])
                     ),
                     index = 0;
                 if (this.pointList.length > 2) {
@@ -457,42 +459,42 @@ export class SPolygonItem extends SGraphItem {
             // 刷新视图
             this.update();
         }
-    } // Function editPolygonPoint()
+    }
 
     /////////////////////
-    // undo、redo相关操作
+
 
     /**
      * 记录相关动作并推入栈中
      *
-     * @param	SGraphCommand   相关命令类
-     * @param	any             对应传入参数
-    */
+     * @param    SGraphCommand   相关命令类
+     * @param    any             对应传入参数
+     */
     protected recordAction(SGraphCommand: any, any: any[]): void {
         // 记录相关命令并推入堆栈中
         const sgraphcommand = new SGraphCommand(this.scene, this, ...any);
         this.undoStack.push(sgraphcommand);
-    } // Function recordAction()
+    }
 
     /**
      * 执行取消操作执行
-    */
+     */
     undo(): void {
         if (this.status == SItemStatus.Normal) {
             return;
         }
         this.undoStack.undo();
-    } // Function undo()
+    }
 
     /**
      * 执行重做操作执行
-    */
+     */
     redo(): void {
         if (this.status == SItemStatus.Normal) {
             return;
         }
         this.undoStack.redo();
-    } // Function redo()
+    }
 
     ///////////////////////////////
     // 以下为鼠标事件
@@ -502,7 +504,7 @@ export class SPolygonItem extends SGraphItem {
      *
      * @param event   事件参数
      * @return 是否处理
-    */
+     */
     onDoubleClick(event: SMouseEvent): boolean {
         // 如果位show状态 双击改对象则需改为编辑状态
         if (SItemStatus.Normal == this.status) {
@@ -515,14 +517,14 @@ export class SPolygonItem extends SGraphItem {
 
         this.update();
         return true;
-    } // Function onDoubleClick()
+    }
 
     /**
      * 键盘事件
      *
      * @param event     事件参数
      * @return 是否处理
-    */
+     */
 
     onKeyDown(event: KeyboardEvent): boolean {
         if (this.status == SItemStatus.Normal) {
@@ -546,14 +548,14 @@ export class SPolygonItem extends SGraphItem {
 
         this.update();
         return true;
-    } // Function onKeyDown()
+    }
 
     /**
      * 键盘键抬起事件
      *
      * @param event     事件参数
      * @return 是否处理
-    */
+     */
     onKeyUp(event: KeyboardEvent): void {
         if (this.status == SItemStatus.Edit) {
             if (event.key == "Alt") {
@@ -567,14 +569,14 @@ export class SPolygonItem extends SGraphItem {
         }
 
         this.update();
-    } // Function onKeyUp()
+    }
 
     /**
      * 鼠标按下事件
      *
      * @param event     事件参数
      * @return 是否处理
-    */
+     */
     onMouseDown(event: SMouseEvent): boolean {
         if (event.shiftKey) {
             event = this.compare(event);
@@ -613,34 +615,34 @@ export class SPolygonItem extends SGraphItem {
         }
 
         return true;
-    } // Function onMouseDown()
+    }
 
     /**
      * 鼠标移入事件
      *
      * @param event     事件参数
      * @return 是否处理
-    */
+     */
     onMouseEnter(event: SMouseEvent): boolean {
         return true;
-    } // Function onMouseEnter()
+    }
 
     /**
      * 鼠标移出事件
      *
      * @param event     事件参数
      * @return 是否处理
-    */
+     */
     onMouseLeave(event: SMouseEvent): boolean {
         return true;
-    } // Function onMouseLeave()
+    }
 
     /**
      * 鼠标移动事件
      *
      * @param event     事件参数
      * @return 是否处理
-    */
+     */
     onMouseMove(event: SMouseEvent): boolean {
         if (event.shiftKey) {
             event = this.compare(event);
@@ -665,14 +667,14 @@ export class SPolygonItem extends SGraphItem {
         }
 
         return true;
-    } // Function onMouseMove()
+    }
 
     /**
      * shift 垂直水平创建或编辑
      *
      * @param event     事件
      * @return 处理后的事件
-    */
+     */
     compare(event: SMouseEvent): SMouseEvent {
         if (this.pointList.length) {
             let last = new SPoint(event.x, event.y);
@@ -694,14 +696,14 @@ export class SPolygonItem extends SGraphItem {
         }
 
         return event;
-    } // Function compare()
+    }
 
     /**
      * 鼠标抬起事件
      *
      * @param event     事件参数
      * @return 是否处理
-    */
+     */
     onMouseUp(event: SMouseEvent): boolean {
         if (this.status == SItemStatus.Edit) {
             if (-1 != this.curIndex) {
@@ -722,14 +724,14 @@ export class SPolygonItem extends SGraphItem {
         }
 
         return true;
-    } // Function onMouseUp()
+    }
 
     /**
      * 移动后处理所有坐标,并肩原点置为场景原点
      *
      * @param x   x 坐标
      * @param y   y 坐标
-    */
+     */
     moveToOrigin(x: number, y: number): void {
         super.moveToOrigin(x, y);
         this.pointList = this.pointList.map(t => {
@@ -739,21 +741,21 @@ export class SPolygonItem extends SGraphItem {
         });
         this.x = 0;
         this.y = 0;
-    } // Function moveToOrigin()
+    }
 
     /**
      * 适配事件
      *
      * @param event     事件参数
      * @return 是否处理
-    */
+     */
     onResize(event: SMouseEvent): boolean {
         return true;
-    } // Function onResize()
+    }
 
     /**
      * 取消操作
-    */
+     */
     cancelOperate(): void {
         // 当状态为展示状态
         if (this.status == SItemStatus.Create) {
@@ -765,13 +767,13 @@ export class SPolygonItem extends SGraphItem {
         }
 
         this.update();
-    } // Function cancelOperate()
+    }
 
     /**
      * Item 对象边界区域
      *
      * @return 边界区域
-    */
+     */
     boundingRect(): SRect {
         if (this.pointList.length) {
             this.minX = this.pointList[0].x;
@@ -806,7 +808,7 @@ export class SPolygonItem extends SGraphItem {
             this.maxX - this.minX,
             this.maxY - this.minY
         );
-    } // Function boundingRect()
+    }
 
     /**
      * 判断点是否在区域内
@@ -814,7 +816,7 @@ export class SPolygonItem extends SGraphItem {
      * @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)) {
@@ -822,13 +824,13 @@ export class SPolygonItem extends SGraphItem {
         }
 
         return true;
-    } // Function contains()
+    }
 
     /**
      * Item 绘制操作
      *
      * @param painter   绘制对象
-    */
+     */
     onDraw(painter: SPainter): void {
         this.scenceLen = painter.toPx(this.len);
         // 当状态为展示状态
@@ -842,5 +844,5 @@ export class SPolygonItem extends SGraphItem {
             // 编辑状态
             this.drawEditPolygon(painter, this.pointList);
         }
-    } // Function onDraw()
-} // Class SPolygonItem
+    }
+}

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

@@ -313,13 +313,14 @@ export class SPolylineItem extends SGraphItem {
      * @return 是否处理
     */
     onDoubleClick(event: SMouseEvent): boolean {
+        // 如果为show状态 双击改对象则需改为编辑状态
         if (this.status == SItemStatus.Normal) {
             this.status = SItemStatus.Edit;
             this.grabItem(this);
-        } else if (this.status == SItemStatus.Edit) {
+        } else if (this.status == SItemStatus.Edit) { // 编辑状态
             this.status = SItemStatus.Normal;
             this.releaseItem();
-        } else if (this.status == SItemStatus.Create) {
+        } else if (this.status == SItemStatus.Create) { // 创建状态
             if (this.pointList.length > 1) {
                 this.status = SItemStatus.Normal;
                 this.releaseItem();
@@ -627,7 +628,7 @@ export class SPolylineItem extends SGraphItem {
                 painter.drawCircle(t.x, t.y, painter.toPx(5));
             });
         } else {
-            // 查看状态
+            // 查看状态,是否选中
             if (this.selected) {
                 painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
                 painter.shadow.shadowBlur = 10;

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

@@ -52,6 +52,7 @@ export class SBoardItem extends SGraphItem {
         super(parent);
         this.data = data;
         this.zOrder = 0;
+        // 判断是否有轮廓数据
         if (
             this.data.OutLine.length &&
             this.data.OutLine[0] &&
@@ -75,7 +76,7 @@ export class SBoardItem extends SGraphItem {
                 return tempArr;
             });
         }
-    } // Constructor
+    }
 
     /**
      * 判断点是否在区域内
@@ -86,12 +87,12 @@ export class SBoardItem extends SGraphItem {
     */
     contains(x: number, y: number): boolean {
         return false;
-    } // Function contains()
+    }
 
     /**
      * Item 绘制操作
      *
-     * @param painter   painter 对象
+     * @param painter   绘制对象
     */
     onDraw(painter: SPainter): void {
         painter.pen.lineWidth = painter.toPx(1);
@@ -100,5 +101,5 @@ export class SBoardItem extends SGraphItem {
         this.pathList.forEach((t): void => {
             painter.drawPath(t);
         });
-    } // Function onDraw()
-} // Class SBoardItem
+    }
+}

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

@@ -24,11 +24,11 @@
  * *********************************************************************************************************************
  */
 
-import { Door } from "../../types/floor/Door";
-import { SPainter, SPoint, SRect } from "@persagy-web/draw";
-import { SMathUtil } from "../../utils/SMathUtil";
-import { ItemOrder, ItemColor } from "../..";
-import { SGraphItem } from "@persagy-web/graph";
+import {Door} from "../../types/floor/Door";
+import {SPainter, SPoint, SRect} from "@persagy-web/draw";
+import {SMathUtil} from "../../utils/SMathUtil";
+import {ItemOrder, ItemColor} from "../..";
+import {SGraphItem} from "@persagy-web/graph";
 
 /**
  * 门 item
@@ -62,28 +62,37 @@ export class SDoorItem extends SGraphItem {
      *
      * @param parent    指向父对象
      * @param data      门数据
-    */
+     */
     constructor(parent: SGraphItem | null, data: Door) {
         super(parent);
         this.data = data;
         this.zOrder = ItemOrder.doorOrder;
+        // 如果有轮廓数据
         if (this.data.OutLine.length) {
             this.pointArr = this.data.OutLine[0].map(
                 (t): SPoint => {
                     let x = t.X;
                     let y = -t.Y;
+                    // 如果数据 x 坐标小于 x 坐标最小值
                     if (x < this.minX) {
                         this.minX = x;
                     }
+
+                    // 如果数据 y 坐标小于 y 坐标最小值
                     if (y < this.minY) {
                         this.minY = y;
                     }
+
+                    // 如果数据 x 坐标大于 x 坐标最小值
                     if (x > this.maxX) {
                         this.maxX = x;
                     }
+
+                    // 如果数据 y 坐标大于 y 坐标最小值
                     if (y > this.maxY) {
                         this.maxY = y;
                     }
+
                     return new SPoint(t.X, -t.Y);
                 }
             );
@@ -106,6 +115,7 @@ export class SDoorItem extends SGraphItem {
             ));
             // 向量点乘 => x1 * x2 + y1 * y2,大于0同向
             let dotProduct = (p2.x - p1.x) * HX + (p2.y - p1.y) * -HY;
+            // 如果同向
             if (dotProduct > 0) {
                 this.p = p2;
                 p2 = p1;
@@ -118,6 +128,7 @@ export class SDoorItem extends SGraphItem {
             this.ang = FX > 0 ? fo : fo + Math.PI;
             // 向量叉乘 => x1 * y2 - x2 * y1,小于0是顺时针
             let direction = (p2.x - p1.x) * -FY - (p2.y - p1.y) * FX;
+            // 如果逆时针
             if (direction > 0) {
                 this.startAng = 0;
             }
@@ -128,7 +139,7 @@ export class SDoorItem extends SGraphItem {
      * Item 对象边界区域
      *
      * @return 边界矩形
-    */
+     */
     boundingRect(): SRect {
         return new SRect(0, 0, this.r, this.r);
     } // Function boundingRect()
@@ -137,7 +148,7 @@ export class SDoorItem extends SGraphItem {
      * Item 绘制操作
      *
      * @param painter   绘制对象
-    */
+     */
     onDraw(painter: SPainter): void {
         painter.translate(this.p.x, this.p.y);
         painter.rotate(this.ang);

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

@@ -43,23 +43,23 @@ export class SHighlightItem extends SGraphItem {
     _point: SPoint = new SPoint();
     get point(): SPoint {
         return this._point;
-    } // Get point
+    }
     set point(v: SPoint) {
         this._point = v;
         this.type = 1;
         this.update();
-    } // Set point
+    }
 
     /** 点对象数据 */
     _line: SLine = new SLine();
     get line(): SLine {
         return this._line;
-    } // Get line
+    }
     set line(v: SLine) {
         this._line = v;
         this.type = 2;
         this.update();
-    } // Set line
+    }
 
     /**
      * 构造函数
@@ -70,7 +70,7 @@ export class SHighlightItem extends SGraphItem {
         super(parent);
         this.visible = false;
         this.zOrder = ItemOrder.highLightOrder;
-    } // Constructor
+    }
 
     /**
      * Item 对象边界区域
@@ -79,7 +79,7 @@ export class SHighlightItem extends SGraphItem {
     */
     boundingRect(): SRect {
         return new SRect(this.point.x, this.point.y, 10, 10);
-    } // Function boundingRect()
+    }
 
     /**
      * Item绘制操作
@@ -96,5 +96,5 @@ export class SHighlightItem extends SGraphItem {
         painter.pen.color = SColor.Transparent;
         painter.brush.color = ItemColor.highLightPointColor;
         painter.drawCircle(this.point.x, this.point.y, painter.toPx(5));
-    } // Function onDraw()
-} // Class SHighlightItem
+    }
+}

+ 31 - 23
persagy-web-big/src/items/floor/SSpaceItem.ts

@@ -29,9 +29,9 @@ import {
     SPainter,
     STextAlign
 } from "@persagy-web/draw";
-import { Space } from "../../types/floor/Space";
-import { ItemOrder, ItemColor } from "../..";
-import { SGraphItem, SGraphAreaGroupItem } from "@persagy-web/graph";
+import {Space} from "../../types/floor/Space";
+import {ItemOrder, ItemColor} from "../..";
+import {SGraphItem, SGraphAreaGroupItem} from "@persagy-web/graph";
 
 /**
  * 模型空间 item
@@ -45,62 +45,67 @@ export class SSpaceItem extends SGraphAreaGroupItem {
     private _highLightFlag: boolean = false;
     get highLightFlag(): boolean {
         return this._highLightFlag;
-    } // Get highLightFlag
+    }
+
     set highLightFlag(value: boolean) {
         this._highLightFlag = value;
         this.update();
-    } // Set highLightFlag
+    }
 
     /** 是否显示名字 */
     private _showBaseName: boolean = false;
     get showBaseName(): boolean {
         return this._showBaseName;
-    } // Get showBaseName
+    }
+
     set showBaseName(value: boolean) {
         this._showBaseName = value;
         this.update();
-    } // Set showBaseName
+    }
 
     /** 是否名字大小 */
     private _nameSize: number = 10;
     get nameSize(): number {
         return this._nameSize;
-    } // Get nameSize
+    }
+
     set nameSize(value: number) {
         this._nameSize = value;
         this.update();
-    } // Set nameSize
+    }
 
     /** 名字是否缩放 */
     private _nameTransform: boolean = false;
     get nameTransform(): boolean {
         return this._nameTransform;
-    } // Get nameTransform
+    }
+
     set nameTransform(value: boolean) {
         this._nameTransform = value;
         this.update();
-    } // Set nameTransform
+    }
 
     /** 名字颜色 */
     private _nameColor: string = "#000000";
     get nameColor(): string {
         return this._nameColor;
-    } // Get nameColor
+    }
+
     set nameColor(value: string) {
         this._nameColor = value;
         this.update();
-    } // Set nameColor
+    }
 
     /**
      * 构造函数
      *
      * @param parent    指向父对象
      * @param data      空间数据
-    */
+     */
     constructor(parent: SGraphItem | null, data: Space) {
         super(parent, {
             outline: [
-                data.OutLine.map(t => t.map(it => ({ x: it.X, y: -it.Y })))
+                data.OutLine.map(t => t.map(it => ({x: it.X, y: -it.Y})))
             ],
             style: {
                 default: {
@@ -133,20 +138,22 @@ export class SSpaceItem extends SGraphAreaGroupItem {
         this.data = data;
         this.zOrder = ItemOrder.spaceOrder;
         this.name = data.Name || "";
-    } // Constructor
+    }
 
     /**
      * 绘制前设置绘制样式
      *
      * @return 当前状态
-    */
+     */
     setStyle(): string {
         let status = "default";
+        // 如果存在样式
         if (this.style) {
+            // 如果处于高亮状态
             if (this.highLightFlag) {
                 status = "highlight";
-            } else if (this.enabled) {
-                if (this.selected) {
+            } else if (this.enabled) { // 是否可用,true 可用
+                if (this.selected) { // 是否选中
                     status = "selected";
                 }
             } else {
@@ -154,15 +161,16 @@ export class SSpaceItem extends SGraphAreaGroupItem {
             }
         }
         return status;
-    } // Function setStyle()
+    }
 
     /**
      * Item 绘制操作
      *
      * @param painter   绘制对象
-    */
+     */
     onDraw(painter: SPainter): void {
         super.onDraw(painter);
+        // 如果显示名字
         if (this.showBaseName) {
             if (this.name && this.name != "null") {
                 painter.brush.color = new SColor(this.nameColor);
@@ -179,5 +187,5 @@ export class SSpaceItem extends SGraphAreaGroupItem {
                 );
             }
         }
-    } // Function onDraw()
-} // Class SSpaceItem
+    }
+}

+ 60 - 34
persagy-web-big/src/items/floor/SSpaceItems.ts

@@ -32,9 +32,9 @@ import {
     SRect,
     STextAlign
 } from "@persagy-web/draw";
-import { Space } from "../../types/floor/Space";
-import { ItemOrder, ItemColor } from "../..";
-import { SGraphItem } from "@persagy-web/graph";
+import {Space} from "../../types/floor/Space";
+import {ItemOrder, ItemColor} from "../..";
+import {SGraphItem} from "@persagy-web/graph";
 
 /**
  * 模型空间 item
@@ -45,76 +45,86 @@ import { SGraphItem } from "@persagy-web/graph";
 export class SSpaceItems extends SGraphItem {
     /** 空间所有数据 */
     data: Space;
-    /** 空间轮廓线坐标list */
+    /** 空间轮廓线坐标 list */
     readonly pointArr: SPoint[][] = [];
-    /** X坐标最小值 */
+    /** X 坐标最小值 */
     minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值 */
+    /** X 坐标最大值 */
     maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值 */
+    /** Y 坐标最小值 */
     minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值 */
+    /** Y 坐标最大值 */
     maxY = Number.MIN_SAFE_INTEGER;
-    /** path对象     */
+    /** path 对象 */
     // private path = new SPath2D();
-    /** 高亮状态   */
+    /** 高亮状态 */
     private _highLightFlag: boolean = false;
     get highLightFlag(): boolean {
         return this._highLightFlag;
-    } // Get highLightFlag
+    }
+
     set highLightFlag(value: boolean) {
         this._highLightFlag = value;
         this.update();
-    } // Set highLightFlag
+    }
+
     /** 是否显示名字 */
     private _showBaseName: boolean = false;
     get showBaseName(): boolean {
         return this._showBaseName;
-    } // Get showBaseName
+    }
+
     set showBaseName(value: boolean) {
         this._showBaseName = value;
         this.update();
-    } // Set showBaseName
+    }
+
     /** 是否名字大小 */
     private _nameSize: number = 10;
     get nameSize(): number {
         return this._nameSize;
-    } // Get nameSize
+    }
+
     set nameSize(value: number) {
         this._nameSize = value;
         this.update();
-    } // Set nameSize
+    }
+
     /** 名字是否缩放 */
     private _nameTransform: boolean = false;
     get nameTransform(): boolean {
         return this._nameTransform;
-    } // Get nameTransform
+    }
+
     set nameTransform(value: boolean) {
         this._nameTransform = value;
         this.update();
-    } // Set nameTransform
+    }
+
     /** 名字颜色   */
     private _nameColor: string = "#000000";
     get nameColor(): string {
         return this._nameColor;
-    } // Get nameColor
+    }
+
     set nameColor(value: string) {
         this._nameColor = value;
         this.update();
-    } // Set nameColor
+    }
 
     /**
      * 构造函数
      *
      * @param parent    指向父对象
      * @param data      空间数据
-    */
+     */
     constructor(parent: SGraphItem | null, data: Space) {
         super(parent);
         this.data = data;
         this.zOrder = ItemOrder.spaceOrder;
         let tempArr = this.data.OutLine;
         this.name = data.Name || "";
+        // 如果数据存在
         if (tempArr && tempArr.length) {
             this.minX = tempArr[0][0].X;
             this.maxX = this.minX;
@@ -125,18 +135,27 @@ export class SSpaceItems extends SGraphItem {
                     (it): SPoint => {
                         let x = it.X,
                             y = -it.Y;
+
+                        // 如果数据 x 坐标小于 x 坐标最小值
                         if (x < this.minX) {
                             this.minX = x;
                         }
+
+                        // 如果数据 y 坐标小于 y 坐标最小值
                         if (y < this.minY) {
                             this.minY = y;
                         }
+
+                        // 如果数据 x 坐标大于 x 坐标最小值
                         if (x > this.maxX) {
                             this.maxX = x;
                         }
+
+                        // 如果数据 y 坐标大于 y 坐标最小值
                         if (y > this.maxY) {
                             this.maxY = y;
                         }
+
                         return new SPoint(x, y);
                     }
                 );
@@ -144,13 +163,13 @@ export class SSpaceItems extends SGraphItem {
                 return temp;
             });
         }
-    } // Constructor
+    }
 
     /**
      * Item对象边界区域
      *
      * @return SRect
-    */
+     */
     boundingRect(): SRect {
         return new SRect(
             this.minX,
@@ -158,7 +177,7 @@ export class SSpaceItems extends SGraphItem {
             this.maxX - this.minX,
             this.maxY - this.minY
         );
-    } // Function boundingRect()
+    }
 
     // /**
     //  * 鼠标单击事件
@@ -170,7 +189,7 @@ export class SSpaceItems extends SGraphItem {
     //     console.log("spaceDown");
     //     this.$emit("click", event);
     //     return true;
-    // } // Function onMouseDown()
+    // }
 
     // /**
     //  * 鼠标移动事件
@@ -179,7 +198,7 @@ export class SSpaceItems extends SGraphItem {
     // */
     // onMouseMove(event: SMouseEvent): boolean {
     //     return false;
-    // } // Function onMouseMove()
+    // }
 
     // /**
     //  * 鼠标抬起事件
@@ -190,51 +209,58 @@ export class SSpaceItems extends SGraphItem {
     // onMouseUp(event: SMouseEvent): boolean {
     //     console.log("spaceUp");
     //     return false;
-    // } // Function onClick()
+    // }
 
     /**
      * 判断点是否在区域内
      *
      * @param x
      * @param y
-    */
+     */
     contains(x: number, y: number): boolean {
         let arr = this.pointArr;
+        // 空间轮廓线不存在或者不在多边形内
         if (arr.length < 1 || !SPolygonUtil.pointIn(x, y, arr[0])) {
             return false;
         }
 
         for (let i = 1; i < arr.length; i++) {
+            // 在多边形内
             if (SPolygonUtil.pointIn(x, y, arr[i])) {
                 return false;
             }
         }
         return true;
-    } // Function contains()
+    }
 
     /**
-     * Item绘制操作
+     * Item 绘制操作
      *
      * @param painter    绘制对象
-    */
+     */
     onDraw(painter: SPainter): void {
         painter.pen.color = ItemColor.spaceBorderColor;
+        // 是否选中
         if (this.selected) {
             painter.brush.color = ItemColor.selectColor;
-        } else if (this.highLightFlag) {
+        } else if (this.highLightFlag) { // 如果处于高亮状态
             painter.brush.color = ItemColor.spaceHighColor;
         } else {
             painter.brush.color = ItemColor.spaceColor;
         }
         painter.pen.lineWidth = painter.toPx(1);
         // painter.drawPath(this.path);
+        // 如果轮廓坐标 list 存在
         if (this.pointArr.length) {
             painter.drawPolygon(this.pointArr[0]);
         }
 
+        // 如果显示名字
         if (this.showBaseName) {
+            // name 存在并且不为 null
             if (this.name && this.name != "null") {
                 painter.brush.color = new SColor(this.nameColor);
+                // 如果需要缩放
                 if (this.nameTransform) {
                     painter.font.size = this.nameSize;
                 } else {
@@ -249,5 +275,5 @@ export class SSpaceItems extends SGraphItem {
                 );
             }
         }
-    } // Function onDraw()
-} // Class SSpaceItem
+    }
+}

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

@@ -24,10 +24,10 @@
  * *********************************************************************************************************************
  */
 
-import { SPainter, SPoint, SRect } from "@persagy-web/draw";
-import { VirtualWall } from "../../types/floor/VirtualWall";
-import { ItemOrder, ItemColor } from "../..";
-import { SGraphItem } from "@persagy-web/graph";
+import {SPainter, SPoint, SRect} from "@persagy-web/draw";
+import {VirtualWall} from "../../types/floor/VirtualWall";
+import {ItemOrder, ItemColor} from "../..";
+import {SGraphItem} from "@persagy-web/graph";
 
 /**
  * 虚拟墙 item
@@ -53,12 +53,13 @@ export class SVirtualWallItem extends SGraphItem {
      *
      * @param parent    指向父对象
      * @param data      虚拟墙数据
-    */
+     */
     constructor(parent: SGraphItem | null, data: VirtualWall) {
         super(parent);
         this.data = data;
         this.zOrder = ItemOrder.virtualWallOrder;
         let tempArr = this.data.OutLine;
+        // 如果数据存在
         if (tempArr && tempArr.length) {
             this.minX = tempArr[0][0].X;
             this.maxX = this.minX;
@@ -69,30 +70,39 @@ export class SVirtualWallItem extends SGraphItem {
                     (it): SPoint => {
                         let x = it.X,
                             y = -it.Y;
+
+                        // 如果数据 x 坐标小于 x 坐标最小值
                         if (x < this.minX) {
                             this.minX = x;
                         }
+
+                        // 如果数据 y 坐标小于 y 坐标最小值
                         if (y < this.minY) {
                             this.minY = y;
                         }
+
+                        // 如果数据 x 坐标大于 x 坐标最小值
                         if (x > this.maxX) {
                             this.maxX = x;
                         }
+
+                        // 如果数据 y 坐标大于 y 坐标最小值
                         if (y > this.maxY) {
                             this.maxY = y;
                         }
+
                         return new SPoint(x, y);
                     }
                 );
             });
         }
-    } // Constructor
+    }
 
     /**
      * Item 对象边界区域
      *
      * @return 边界矩形
-    */
+     */
     boundingRect(): SRect {
         return new SRect(
             this.minX,
@@ -100,13 +110,13 @@ export class SVirtualWallItem extends SGraphItem {
             this.maxX - this.minX,
             this.maxY - this.minY
         );
-    } // Function boundingRect()
+    }
 
     /**
      * Item 绘制操作
      *
      * @param painter   绘制对象
-    */
+     */
     onDraw(painter: SPainter): void {
         painter.pen.lineWidth = painter.toPx(1);
         painter.pen.color = ItemColor.virtualWallColor;
@@ -114,5 +124,5 @@ export class SVirtualWallItem extends SGraphItem {
         this.pointArr.forEach((t): void => {
             painter.drawPolyline(t);
         });
-    } // Function onDraw()
-} // Class SVirtualWallItem
+    }
+}

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

@@ -55,6 +55,7 @@ export class SWallItem extends SGraphAreaGroupItem {
         };
         let tempArr = data.OutLine;
         let outline: Point[][] = [];
+        // 如果数据存在
         if (tempArr && tempArr.length) {
             outline = tempArr.map(t => t.map(it => ({ x: it.X, y: -it.Y })));
         }
@@ -66,5 +67,5 @@ export class SWallItem extends SGraphAreaGroupItem {
 
         this.data = data;
         this.zOrder = ItemOrder.wallOrder;
-    } // Constructor
-} // Class SWallItem
+    }
+}

+ 37 - 19
persagy-web-big/src/items/floor/SWallItems.ts

@@ -24,10 +24,10 @@
  * *********************************************************************************************************************
  */
 
-import { SPainter, SPath, SPoint, SRect } from "@persagy-web/draw";
-import { Wall } from "../../types/floor/Wall";
-import { ItemOrder, ItemColor } from "../..";
-import { SGraphItem } from "@persagy-web/graph";
+import {SPainter, SPath, SPoint, SRect} from "@persagy-web/draw";
+import {Wall} from "../../types/floor/Wall";
+import {ItemOrder, ItemColor} from "../..";
+import {SGraphItem} from "@persagy-web/graph";
 
 /**
  * 墙item
@@ -38,19 +38,19 @@ import { SGraphItem } from "@persagy-web/graph";
 export class SWallItems extends SGraphItem {
     /** 墙数据 */
     data: Wall;
-    /** 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[][] = [];
-    /** 墙内轮廓线坐标list */
+    /** 墙内轮廓线坐标 list */
     private readonly holesArr: SPoint[][] = [];
-    /** path对象 */
+    /** path 对象 */
     private path = new SPath();
 
     /**
@@ -58,13 +58,14 @@ export class SWallItems extends SGraphItem {
      *
      * @param parent    指向父对象
      * @param data      墙数据
-    */
+     */
     constructor(parent: SGraphItem | null, data: Wall) {
         super(parent);
         this.data = data;
         this.zOrder = ItemOrder.wallOrder;
         let tempArr = this.data.OutLine;
         let holes = data.Holes;
+        // 如果数据存在
         if (tempArr && tempArr.length) {
             this.minX = tempArr[0][0].X;
             this.maxX = this.minX;
@@ -75,15 +76,23 @@ export class SWallItems extends SGraphItem {
                 (it): SPoint => {
                     let x = it.X,
                         y = -it.Y;
+
+                    // 如果数据 x 坐标小于 x 坐标最小值
                     if (x < this.minX) {
                         this.minX = x;
                     }
+
+                    // 如果数据 y 坐标小于 y 坐标最小值
                     if (y < this.minY) {
                         this.minY = y;
                     }
+
+                    // 如果数据 x 坐标大于 x 坐标最小值
                     if (x > this.maxX) {
                         this.maxX = x;
                     }
+
+                    // 如果数据 y 坐标大于 y 坐标最小值
                     if (y > this.maxY) {
                         this.maxY = y;
                     }
@@ -94,25 +103,34 @@ export class SWallItems extends SGraphItem {
             this.path.polygon(WLine);
             // 外轮廓
             this.pointArr.push(WLine);
-            // 内轮廓
+            // 内轮廓存在
             if (holes && holes.length) {
                 this.holesArr = holes.map(t => {
                     let temp = t.map(
                         (it): SPoint => {
                             let x = it.X,
                                 y = -it.Y;
+
+                            // 如果数据 x 坐标小于 x 坐标最小值
                             if (x < this.minX) {
                                 this.minX = x;
                             }
+
+                            // 如果数据 y 坐标小于 y 坐标最小值
                             if (y < this.minY) {
                                 this.minY = y;
                             }
+
+                            // 如果数据 x 坐标大于 x 坐标最小值
                             if (x > this.maxX) {
                                 this.maxX = x;
                             }
+
+                            // 如果数据 y 坐标大于 y 坐标最小值
                             if (y > this.maxY) {
                                 this.maxY = y;
                             }
+
                             return new SPoint(x, y);
                         }
                     );
@@ -121,13 +139,13 @@ export class SWallItems extends SGraphItem {
                 });
             }
         }
-    } // Constructor
+    }
 
     /**
      * Item对象边界区域
      *
      * @return SRect
-    */
+     */
     boundingRect(): SRect {
         return new SRect(
             this.minX,
@@ -135,17 +153,17 @@ export class SWallItems extends SGraphItem {
             this.maxX - this.minX,
             this.maxY - this.minY
         );
-    } // Function boundingRect()
+    }
 
     /**
      * Item绘制操作
      *
      * @param painter    绘制对象
-    */
+     */
     onDraw(painter: SPainter): void {
         painter.pen.color = ItemColor.wallColor;
         painter.pen.lineWidth = painter.toPx(1);
         painter.brush.color = ItemColor.wallColor;
         painter.drawPath(this.path);
-    } // Function onDraw()
-} // Class SWallItem
+    }
+}

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

@@ -1,4 +1,3 @@
-
 /*
  * *********************************************************************************************************************
  *
@@ -25,10 +24,10 @@
  * *********************************************************************************************************************
  */
 
-import { SPainter, SPoint, SRect } from "@persagy-web/draw";
-import { Casement } from "../../types/floor/Casement";
-import { ItemOrder, ItemColor } from "../..";
-import { SGraphItem } from "@persagy-web/graph";
+import {SPainter, SPoint, SRect} from "@persagy-web/draw";
+import {Casement} from "../../types/floor/Casement";
+import {ItemOrder, ItemColor} from "../..";
+import {SGraphItem} from "@persagy-web/graph";
 
 /**
  * 窗户 item
@@ -54,7 +53,7 @@ export class SWindowItem extends SGraphItem {
      *
      * @param parent    指向父对象
      * @param data      窗户数据
-    */
+     */
     constructor(parent: SGraphItem | null, data: Casement) {
         super(parent);
         this.data = data;
@@ -64,29 +63,38 @@ export class SWindowItem extends SGraphItem {
                 (t): SPoint => {
                     let x = t.X;
                     let y = -t.Y;
+
+                    // 如果数据 x 坐标小于 x 坐标最小值
                     if (x < this.minX) {
                         this.minX = x;
                     }
+
+                    // 如果数据 y 坐标小于 y 坐标最小值
                     if (y < this.minY) {
                         this.minY = y;
                     }
+
+                    // 如果数据 x 坐标大于 x 坐标最小值
                     if (x > this.maxX) {
                         this.maxX = x;
                     }
+
+                    // 如果数据 y 坐标大于 y 坐标最小值
                     if (y > this.maxY) {
                         this.maxY = y;
                     }
+
                     return new SPoint(x, y);
                 }
             );
         }
-    } // Constructor
+    }
 
     /**
      * Item 对象边界区域
      *
      * @return 边界矩形
-    */
+     */
     boundingRect(): SRect {
         return new SRect(
             this.minX,
@@ -94,16 +102,16 @@ export class SWindowItem extends SGraphItem {
             this.maxX - this.minX,
             this.maxY - this.minY
         );
-    } // Function boundingRect()
+    }
 
     /**
      * Item 绘制操作
      *
      * @param painter   绘制对象
-    */
+     */
     onDraw(painter: SPainter): void {
         painter.pen.color = ItemColor.windowColor;
         painter.pen.lineWidth = painter.toPx(1);
         painter.drawPolyline(this.pointArr);
-    } // Function onDraw()
-} // Class SWindowItem
+    }
+}

+ 34 - 26
persagy-web-big/src/items/floor/ZoneItem.ts

@@ -24,11 +24,11 @@
  * *********************************************************************************************************************
  */
 
-import { SColor, SPainter, SPoint, SRect } from "@persagy-web/draw";
-import { SMouseEvent } from "@persagy-web/base";
-import { Zone } from "../../types/floor/Zone";
-import { ItemColor, ItemOrder, Transparency } from "../..";
-import { Point, SGraphAreaGroupItem, SGraphItem } from "@persagy-web/graph";
+import {SColor, SPainter, SPoint, SRect} from "@persagy-web/draw";
+import {SMouseEvent} from "@persagy-web/base";
+import {Zone} from "../../types/floor/Zone";
+import {ItemColor, ItemOrder, Transparency} from "../..";
+import {Point, SGraphAreaGroupItem, SGraphItem} from "@persagy-web/graph";
 
 /**
  * 业务空间 item
@@ -44,45 +44,48 @@ export class SZoneItem extends SGraphAreaGroupItem {
     private _highLightFlag: boolean = false;
     get highLightFlag(): boolean {
         return this._highLightFlag;
-    } // Get highLightFlag
+    }
+
     set highLightFlag(value: boolean) {
         this._highLightFlag = value;
         this.update();
-    } // Set highLightFlag
+    }
 
     /** 透明度 */
     _transparency: number = 20;
     get transparency(): number {
         return this._transparency;
-    } // Get transparency
+    }
+
     set transparency(value: number) {
         this._transparency = value;
         this.update();
-    } // Set transparency
+    }
 
     /** 受影响状态 */
     _isInfected: boolean = false;
     get isInfected(): boolean {
         return this._isInfected;
-    } // Get isInfected
+    }
+
     set isInfected(value: boolean) {
         this._isInfected = value;
         this.update();
-    } // Set isInfected
+    }
 
     /**
      * 构造函数
      *
      * @param parent    指向父对象
      * @param data      空间数据
-    */
+     */
     constructor(parent: SGraphItem | null, data: Zone) {
         super(parent, {
             outline: data.OutLine.map((t): Point[][] => {
                 return t.map((it): Point[] => {
                     return it.map(
                         (item): Point => {
-                            return { x: item.X, y: -item.Y };
+                            return {x: item.X, y: -item.Y};
                         }
                     );
                 });
@@ -126,53 +129,57 @@ export class SZoneItem extends SGraphAreaGroupItem {
         this.highLightFlag = data.HighLightFlag || false;
         this.transparency = data.Transparency || 20;
         this.isInfected = data.Infected || false;
-    } // Constructor
+    }
 
     /**
      * 鼠标单击事件
      *
      * @param event     事件参数
      * @return 是否处理事件
-    */
+     */
     onMouseDown(event: SMouseEvent): boolean {
+        // 是否可选中
         if (this.selectable) {
             this.selected = !this.selected;
             this.clickPoint = new SPoint(event.x, event.y);
         }
         this.$emit("click", event);
         return true;
-    } // Function onMouseDown()
+    }
 
     /**
      * 鼠标抬起事件
      *
      * @param event     事件参数
      * @return 是否处理事件
-    */
+     */
     onMouseUp(event: SMouseEvent): boolean {
         return false;
-    } // Function onMouseUp()
+    }
 
     /**
      * 绘制前设置绘制样式
      *
      * @return 当前状态
-    */
+     */
     setStyle(): string {
         let status = "default";
+        // 是否存在样式
         if (this.style) {
+            // 是否可选中
             if (!this.selectable) {
                 status = "unselect";
             } else {
+                // 是否选中
                 if (this.selected) {
                     status = "selected";
-                } else if (this.highLightFlag) {
+                } else if (this.highLightFlag) { // 高亮状态
                     status = "highlight";
-                } else if (this.isInfected) {
+                } else if (this.isInfected) { // 受影响
                     status = "infected";
                 } else {
                     status = "default";
-                    if (this.data.Color) {
+                    if (this.data.Color) { // 数据是否存在 color
                         this.style.default.fill = `${this.data.Color}${
                             Transparency[this.transparency]
                         }`;
@@ -181,17 +188,18 @@ export class SZoneItem extends SGraphAreaGroupItem {
             }
         }
         return status;
-    } // Function setStyle()
+    }
 
     /**
      * Item 绘制操作
      *
      * @param painter   绘制对象
-    */
+     */
     onDraw(painter: SPainter): void {
         super.onDraw(painter);
         painter.brush.color = SColor.Black;
         painter.font.size = painter.toPx(10);
+        // 是否点击位置坐标
         if (this.clickPoint) {
             painter.drawText(
                 this.data.RoomLocalName,
@@ -199,5 +207,5 @@ export class SZoneItem extends SGraphAreaGroupItem {
                 this.clickPoint.y
             );
         }
-    } // Function onDraw()
-} // Class ZoneItem
+    }
+}

文件差异内容过多而无法显示
+ 527 - 521
persagy-web-edit/src/items/SBaseArrowEdit.ts


+ 2 - 0
persagy-web-edit/src/items/SBaseIconTextEdit.ts

@@ -390,6 +390,7 @@ export class SBaseIconTextEdit extends SGraphEdit {
         if (this.isActive) {
             painter.pen.color = SColor.Transparent;
             painter.brush.color = this.activeColor;
+            // 是否选中
             if (this.selected) {
                 painter.shadow.shadowBlur = 10;
                 painter.shadow.shadowColor = this.activeColor;
@@ -408,6 +409,7 @@ export class SBaseIconTextEdit extends SGraphEdit {
                 );
             }
         } else {
+            // 是否选中
             if (this.selected) {
                 painter.pen.color = SColor.Transparent;
                 painter.brush.color = SColor.Transparent;

+ 19 - 18
persagy-web-edit/src/items/SBaseImageEdit.ts

@@ -52,52 +52,52 @@ export class SBaseImageEdit extends SGraphEdit {
     private _showType: SImageShowType = SImageShowType.Full;
     get showType(): SImageShowType {
         return this._showType;
-    } //Get showType
+    }
     set showType(v: SImageShowType) {
         this._showType = v;
         this.computeImgSize();
         this.update();
-    } //Set showType
+    }
 
     /** 边框色 */
     private _strokeColor: SColor = SColor.Transparent;
     get strokeColor(): SColor {
         return this._strokeColor;
-    }  //Get strokeColor
+    }
     set strokeColor(v: SColor) {
         this._strokeColor = v;
         this.update();
-    } //Set strokeColor
+    }
 
     /** 边框宽度 */
     private _lineWidth: number = 1;
     get lineWidth(): number {
         return this._lineWidth;
-    } //Get lineWidth
+    }
     set lineWidth(v: number) {
         this._lineWidth = v;
         this.update();
-    } //Set lineWidth
+    }
 
     /** 原点位置 */
     private _originPosition: STextOrigin = STextOrigin.LeftTop;
     get originPosition(): STextOrigin {
         return this._originPosition;
-    } //Get originPosition
+    }
     set originPosition(v: STextOrigin) {
         this._originPosition = v;
         this.update();
-    } //Set originPosition
+    }
 
     /** 线条样式 */
     private _lineStyle: SLineStyle = SLineStyle.Solid;
     get lineStyle(): SLineStyle {
         return this._lineStyle;
-    } //Get lineStyle
+    }
     set lineStyle(v: SLineStyle) {
         this._lineStyle = v;
         this.update();
-    } //Set lineStyle
+    }
 
     /** 图片加载是否完成 */
     isLoadOver: boolean = false;
@@ -112,7 +112,7 @@ export class SBaseImageEdit extends SGraphEdit {
     private _url: string = "";
     get url(): string {
         return this._url;
-    } //Get url
+    }
     set url(v: string) {
         this._url = v;
         this.img = new Image();
@@ -147,7 +147,7 @@ export class SBaseImageEdit extends SGraphEdit {
         };
 
         this.img.src = v;
-    }  //Set url
+    }
 
     /** 锚点 list */
     anchorList: SAnchorItem[] = [];
@@ -157,7 +157,7 @@ export class SBaseImageEdit extends SGraphEdit {
     origin = new SPoint();
     get width(): number {
         return this._width;
-    }//Get width
+    }
     set width(v: number) {
         if (v > 0) {
             if (v != this._width) {
@@ -169,13 +169,13 @@ export class SBaseImageEdit extends SGraphEdit {
                 );
             }
         }
-    } //Set width
+    }
 
     /** 高度 */
     private _height: number = 64;
     get height(): number {
         return this._height;
-    } //Get height
+    }
     set height(v: number) {
         if (v > 0) {
             if (v != this._height) {
@@ -187,13 +187,13 @@ export class SBaseImageEdit extends SGraphEdit {
                 );
             }
         }
-    } //Set height
+    }
 
     /**编辑状态 */
     protected _status: SItemStatus = SItemStatus.Normal;
     get status(): SItemStatus {
         return this._status;
-    } //Get status
+    }
     set status(value: SItemStatus) {
         const oldStatus = this._status;
         const newStatus = value;
@@ -201,7 +201,7 @@ export class SBaseImageEdit extends SGraphEdit {
         //状态变更触发事件
         this.$emit('StatusChange', oldStatus, newStatus)
         this.update();
-    } //Set status
+    }
 
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // 函数
@@ -417,6 +417,7 @@ export class SBaseImageEdit extends SGraphEdit {
             painter.drawImage(this.img, 0, 0, this.imgWidth, this.imgHeight);
         }
 
+        // 是否选中
         if (this.selected) {
             painter.shadow.shadowBlur = 10;
             painter.shadow.shadowColor = new SColor(`#00000033`);

+ 7 - 6
persagy-web-edit/src/items/SBaseLineEdit.ts

@@ -119,27 +119,27 @@ export class SBaseLineEdit extends SGraphEdit {
     set fillColor(v: SColor) {
         this._fillColor = v;
         this.update();
-    } //Set fillColor
+    }
 
     /** 选中端点填充色 */
     private _activeFillColor: SColor = new SColor("#2196f3");
     get activeFillColor(): SColor {
         return this._activeFillColor;
-    } //Get activeFillColor
+    }
     set activeFillColor(v: SColor) {
         this._activeFillColor = v;
         this.update();
-    } //Set activeFillColor
+    }
 
     /** 线条宽度 */
     private _lineWidth: number = 1;
     get lineWidth(): number {
         return this._lineWidth;
-    } //Get lineWidth
+    }
     set lineWidth(v: number) {
         this._lineWidth = v;
         this.update();
-    } //Set lineWidth
+    }
 
     /** 拖动灵敏度 */
     dis: number = 5;
@@ -218,10 +218,11 @@ export class SBaseLineEdit extends SGraphEdit {
      * @return	该事件是否被处理
      */
     onDoubleClick(event: SMouseEvent): boolean {
+        // 如果为show状态 双击改对象则需改为编辑状态
         if (this.status == SItemStatus.Normal) {
             this.status = SItemStatus.Edit;
             this.grabItem(this);
-        } else if (this.status == SItemStatus.Edit) {
+        } else if (this.status == SItemStatus.Edit) { // 编辑状态
             this.status = SItemStatus.Normal;
             this.releaseItem();
         }

+ 1 - 0
persagy-web-edit/src/items/SBasePolygonEdit.ts

@@ -325,6 +325,7 @@ export class SBasePolygonEdit extends SGraphEdit {
             ];
         }
 
+        // 是否选中
         if (this.selected) {
             painter.shadow.shadowBlur = 10;
             painter.shadow.shadowColor = new SColor(`#00000033`);

+ 4 - 3
persagy-web-edit/src/items/SBasePolylineEdit.ts

@@ -339,13 +339,14 @@ export class SBasePolylineEdit extends SGraphEdit {
      * @return 是否处理事件
      */
     onDoubleClick(event: SMouseEvent): boolean {
+        // 如果为show状态 双击改对象则需改为编辑状态
         if (this.status == SItemStatus.Normal) {
             this.status = SItemStatus.Edit;
             this.grabItem(this);
-        } else if (this.status == SItemStatus.Edit) {
+        } else if (this.status == SItemStatus.Edit) { // 编辑状态
             this.status = SItemStatus.Normal;
             this.releaseItem();
-        } else if (this.status == SItemStatus.Create) {
+        } else if (this.status == SItemStatus.Create) { // 创建状态
             if (this.pointList.length > 1) {
                 this.status = SItemStatus.Normal;
                 this.releaseItem();
@@ -673,7 +674,7 @@ export class SBasePolylineEdit extends SGraphEdit {
                 painter.drawCircle(t.x, t.y, painter.toPx(5));
             });
         } else {
-            // 查看状态
+            // 查看状态,是否选中
             if (this.selected) {
                 painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
                 painter.shadow.shadowBlur = 10;

+ 23 - 23
persagy-web-edit/src/items/SBaseTextEdit.ts

@@ -48,7 +48,7 @@ export class SBaseTextEdit extends SGraphEdit {
     protected _status: SItemStatus = SItemStatus.Normal;
     get status(): SItemStatus {
         return this._status;
-    } //Get status
+    }
     set status(value: SItemStatus) {
         const oldStatus = this._status;
         const newStatus = value;
@@ -56,7 +56,7 @@ export class SBaseTextEdit extends SGraphEdit {
         //状态变更触发事件
         this.$emit('StatusChange', oldStatus, newStatus)
         this.update();
-    } //Set status
+    }
 
     /** 记录 painter */
     private _painter: SPainter | null = null;
@@ -65,13 +65,13 @@ export class SBaseTextEdit extends SGraphEdit {
     private _text: string = "";
     get text(): string {
         return this._text;
-    } //Get text
+    }
     set text(v: string) {
         this._text = v;
         this._textArr = this.text.split(/\n/g);
         this.drawFormatText();
         this.update();
-    } //Set text
+    }
 
     /** 切割后的文本数组 */
     private _textArr: string[] = [];
@@ -81,7 +81,7 @@ export class SBaseTextEdit extends SGraphEdit {
     private _width: number = 64;
     get width(): number {
         return this._width;
-    } //Get width
+    }
     set width(v: number) {
         if (v > 0) {
             if (v != this._width) {
@@ -93,13 +93,13 @@ export class SBaseTextEdit extends SGraphEdit {
                 );
             }
         }
-    } //Set width
+    }
 
     /** 高度 */
     private _height: number = 64;
     get height(): number {
         return this._height;
-    } //Get height
+    }
     set height(v: number) {
         if (v > 0) {
             if (v != this._height) {
@@ -111,7 +111,7 @@ export class SBaseTextEdit extends SGraphEdit {
                 );
             }
         }
-    } //Set height
+    }
 
     /** 原点 */
     origin = new SPoint();
@@ -120,72 +120,72 @@ export class SBaseTextEdit extends SGraphEdit {
     private _color: SColor = new SColor("#333333");
     get color(): SColor {
         return this._color;
-    } //Get color
+    }
     set color(v: SColor) {
         this._color = v;
         this.update();
-    } //Set color
+    }
 
     /** 字体 */
     private _font: SFont = new SFont("sans-serif", 12);
     get font(): SFont {
         return this._font;
-    } //Get font
+    }
     set font(v: SFont) {
         this._font = v;
         this.drawFormatText();
         this.update();
-    } //Set font
+    }
 
     /** 背景色 */
     private _backgroundColor: SColor = SColor.Transparent;
     get backgroundColor(): SColor {
         return this._backgroundColor;
-    } //Get backgroundColor
+    }
     set backgroundColor(v: SColor) {
         this._backgroundColor = v;
         this.update();
-    } //Set backgroundColor
+    }
 
     /** 边框色 */
     private _strokeColor: SColor = SColor.Transparent;
     get strokeColor(): SColor {
         return this._strokeColor;
-    } //Get strokeColor
+    }
     set strokeColor(v: SColor) {
         this._strokeColor = v;
         this.update();
-    } //Set strokeColor
+    }
 
     /** 边框宽度 */
     private _lineWidth: number = 1;
     get lineWidth(): number {
         return this._lineWidth;
-    } //Get lineWidth
+    }
     set lineWidth(v: number) {
         this._lineWidth = v;
         this.update();
-    } //Set lineWidth
+    }
 
     /** 边框样式 */
     private _borderStyle: SLineStyle = SLineStyle.None;
     get borderStyle(): SLineStyle {
         return this._borderStyle;
-    } //Get borderStyle
+    }
     set borderStyle(v: SLineStyle) {
         this._borderStyle = v;
         this.update();
-    } //Set borderStyle
+    }
 
     /** 原点位置 */
     private _originPosition: STextOrigin = STextOrigin.LeftTop;
     get originPosition(): STextOrigin {
         return this._originPosition;
-    } //Get originPosition
+    }
     set originPosition(v: STextOrigin) {
         this._originPosition = v;
         this.update();
-    } //Set originPosition
+    }
 
     /** 文本绘制最大宽 */
     maxWidth: number | undefined = undefined;
@@ -271,7 +271,7 @@ export class SBaseTextEdit extends SGraphEdit {
      */
     protected drawShowText(painter: SPainter): void {
         painter.translate(-this.origin.x, -this.origin.y);
-        //绘制矩形轮廓
+        //绘制矩形轮廓,是否选中
         if (this.selected) {
             painter.shadow.shadowBlur = 10;
             painter.shadow.shadowColor = new SColor(`#00000033`);

+ 1 - 0
persagy-web-graph/src/SGraphItem.ts

@@ -541,6 +541,7 @@ export class SGraphItem extends SObject {
 
         // 选择
         let select = false;
+        // 是否可选中
         if (this.selectable) {
             select = this.clickSelect(event);
         }

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

@@ -63,6 +63,7 @@ export class SGraphShape extends SGraphItem {
         let status = "default";
         if (this.style) {
             if (this.enabled) {
+                // 是否选中
                 if (this.selected) {
                     status = "selected";
                 }

+ 2 - 0
persagy-web-graph/src/items/SImageItem.ts

@@ -249,6 +249,8 @@ export class SImageItem extends SObjectItem {
             // @ts-ignore
             painter.drawImage(this.img, 0, 0, this.imgWidth, this.imgHeight);
         }
+
+        // 是否选中
         if (this.selected) {
             painter.shadow.shadowBlur = 10;
             painter.shadow.shadowColor = new SColor(`#00000033`);

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

@@ -172,7 +172,7 @@ export class STextItem extends SObjectItem {
     */
     protected drawShowText(painter: SPainter): void {
         painter.translate(-this.origin.x, -this.origin.y);
-        //绘制矩形轮廓
+        //绘制矩形轮廓,是否选中
         if (this.selected) {
             painter.shadow.shadowBlur = 10;
             painter.shadow.shadowColor = new SColor(`#00000033`);