Browse Source

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

haojianlong 4 years ago
parent
commit
1e0ce5cca8
100 changed files with 4502 additions and 639 deletions
  1. 18 18
      persagy-web-base/src/SMatrix.ts
  2. 1 1
      persagy-web-base/src/SMouseEvent.ts
  3. 3 3
      persagy-web-base/src/SObject.ts
  4. 3 3
      persagy-web-base/src/SObjectObserver.ts
  5. 56 4
      persagy-web-base/src/enums/SKeyCode.ts
  6. 6 6
      persagy-web-base/src/undo/SUndoCommand.ts
  7. 9 9
      persagy-web-base/src/undo/SUndoStack.ts
  8. 1 1
      persagy-web-base/src/utils/SNetUtil.ts
  9. 3 3
      persagy-web-base/src/utils/SStringBuilder.ts
  10. 1 1
      persagy-web-base/src/utils/SStringUtil.ts
  11. 1 1
      persagy-web-base/src/utils/SUuid.ts
  12. 9 0
      persagy-web-big-edit/.editorconfig
  13. 58 0
      persagy-web-big-edit/.eslintrc.js
  14. 13 0
      persagy-web-big-edit/.npmignore
  15. 37 0
      persagy-web-big-edit/README.md
  16. 38 0
      persagy-web-big-edit/jest.config.js
  17. 46 0
      persagy-web-big-edit/package.json
  18. 58 0
      persagy-web-big-edit/publish.js
  19. 131 0
      persagy-web-big-edit/src/BigEditFactory.ts
  20. 418 0
      persagy-web-big-edit/src/SBaseEditScene.ts
  21. 13 0
      persagy-web-big-edit/src/index.ts
  22. 134 0
      persagy-web-big-edit/src/items/SBaseArrow.ts
  23. 56 0
      persagy-web-big-edit/src/items/SBaseEquipment.ts
  24. 69 0
      persagy-web-big-edit/src/items/SBaseExpainEdit.ts
  25. 27 51
      persagy-web-edit/src/items/ImageEdit.ts
  26. 85 0
      persagy-web-big-edit/src/items/SBasePipeUninTool.ts
  27. 1 0
      persagy-web-big-edit/src/parsers/bigEditParse.ts
  28. 39 0
      persagy-web-big-edit/src/types/Anchor.ts
  29. 43 0
      persagy-web-big-edit/src/types/ElementData.ts
  30. 68 0
      persagy-web-big-edit/src/types/Legend.ts
  31. 54 0
      persagy-web-big-edit/src/types/Marker.ts
  32. 58 0
      persagy-web-big-edit/src/types/Relation.ts
  33. 9 0
      persagy-web-big-edit/src/until.ts
  34. 16 0
      persagy-web-big-edit/tsconfig.json
  35. 6 0
      persagy-web-big-edit/typedoc.json
  36. 8 8
      persagy-web-big/src/factories/SItemFactory.ts
  37. 1 1
      persagy-web-big/src/items/SArrowItem.ts
  38. 7 7
      persagy-web-big/src/items/SIconTextItem.ts
  39. 19 19
      persagy-web-big/src/items/SLineItem.ts
  40. 27 27
      persagy-web-big/src/items/SPolygonItem.ts
  41. 23 23
      persagy-web-big/src/items/SPolylineItem.ts
  42. 4 4
      persagy-web-big/src/items/SRectSelectItem.ts
  43. 3 3
      persagy-web-big/src/items/floor/SBoardItem.ts
  44. 1 1
      persagy-web-big/src/items/floor/SColumnItem.ts
  45. 3 3
      persagy-web-big/src/items/floor/SDoorItem.ts
  46. 3 3
      persagy-web-big/src/items/floor/SHighlightItem.ts
  47. 3 3
      persagy-web-big/src/items/floor/SSpaceItem.ts
  48. 19 19
      persagy-web-big/src/items/floor/SSpaceItems.ts
  49. 4 4
      persagy-web-big/src/items/floor/SVirtualWallItem.ts
  50. 1 1
      persagy-web-big/src/items/floor/SWallItem.ts
  51. 3 3
      persagy-web-big/src/items/floor/SWallItems.ts
  52. 3 3
      persagy-web-big/src/items/floor/SWindowItem.ts
  53. 5 5
      persagy-web-big/src/items/floor/ZoneItem.ts
  54. 7 7
      persagy-web-big/src/parser/SFloorParser.ts
  55. 1 1
      persagy-web-big/src/parser/SParser.ts
  56. 4 4
      persagy-web-big/src/parser/STopologyParser.ts
  57. 2 2
      persagy-web-big/src/parser/SZoneParser.ts
  58. 10 10
      persagy-web-big/src/utils/SMathUtil.ts
  59. 5 5
      persagy-web-draw/src/SBrush.ts
  60. 29 29
      persagy-web-draw/src/SCanvasView.ts
  61. 33 15
      persagy-web-draw/src/SColor.ts
  62. 4 4
      persagy-web-draw/src/SFont.ts
  63. 4 4
      persagy-web-draw/src/SGradient.ts
  64. 1 1
      persagy-web-draw/src/SGradientStop.ts
  65. 4 4
      persagy-web-draw/src/SLinearGradient.ts
  66. 46 46
      persagy-web-draw/src/SPainter.ts
  67. 12 12
      persagy-web-draw/src/SPath.ts
  68. 4 4
      persagy-web-draw/src/SPen.ts
  69. 4 4
      persagy-web-draw/src/SRadialGradient.ts
  70. 4 4
      persagy-web-draw/src/SShadow.ts
  71. 30 30
      persagy-web-draw/src/engines/SCanvasPaintEngine.ts
  72. 21 21
      persagy-web-draw/src/engines/SPaintEngine.ts
  73. 1 1
      persagy-web-draw/src/engines/SPaintState.ts
  74. 18 18
      persagy-web-draw/src/engines/SSvgPaintEngine.ts
  75. 9 9
      persagy-web-draw/src/types/SLine.ts
  76. 10 10
      persagy-web-draw/src/types/SPoint.ts
  77. 19 19
      persagy-web-draw/src/types/SRect.ts
  78. 11 11
      persagy-web-draw/src/types/SSize.ts
  79. 2 2
      persagy-web-draw/src/utils/SPolygonUtil.ts
  80. 7 7
      persagy-web-edit/package.json
  81. 47 13
      persagy-web-edit/src/SGraphEdit.ts
  82. 479 0
      persagy-web-edit/src/SGraphEditScene.ts
  83. 13 15
      persagy-web-edit/src/commands/SGraphAddCommand.ts
  84. 3 3
      persagy-web-edit/src/commands/SGraphCommand.ts
  85. 19 20
      persagy-web-edit/src/commands/SGraphMoveCommand.ts
  86. 13 9
      persagy-web-edit/src/commands/SGraphPointListDelete.ts
  87. 12 11
      persagy-web-edit/src/commands/SGraphPointListInsert.ts
  88. 13 12
      persagy-web-edit/src/commands/SGraphPointListUpdate.ts
  89. 11 11
      persagy-web-edit/src/commands/SGraphPropertyCommand.ts
  90. 5 5
      persagy-web-edit/src/enums/SGraphLayoutType.ts
  91. 3 3
      persagy-web-edit/src/enums/SImageShowType.ts
  92. 5 5
      persagy-web-edit/src/enums/SLineStyle.ts
  93. 5 5
      persagy-web-edit/src/enums/SOrderSetType.ts
  94. 3 3
      persagy-web-edit/src/enums/STextOrigin.ts
  95. 22 2
      persagy-web-edit/src/index.ts
  96. 561 0
      persagy-web-edit/src/items/SBaseArrowEdit.ts
  97. 392 0
      persagy-web-edit/src/items/SBaseCircleEdit.ts
  98. 422 0
      persagy-web-edit/src/items/SBaseIconTextEdit.ts
  99. 447 0
      persagy-web-edit/src/items/SBaseImageEdit.ts
  100. 0 0
      persagy-web-edit/src/items/LineEdit.ts

+ 18 - 18
persagy-web-base/src/SMatrix.ts

@@ -59,35 +59,35 @@ export class SMatrix {
     set a(v: number) {
         this.m11 = v;
     } // Set a
-    /** x 轴方向斜切  */
+    /** x 轴方向斜切 */
     get b(): number {
         return this.m12;
     } // Get b
     set b(v: number) {
         this.m12 = v;
     } // Set b
-    /** y轴方向斜切  */
+    /** y轴方向斜切 */
     get c(): number {
         return this.m21;
     } // Get c
     set c(v: number) {
         this.m21 = v;
     } // Set c
-    /** y轴方向缩放比例    */
+    /** y轴方向缩放比例   */
     get d(): number {
         return this.m22;
     } // Get d
     set d(v: number) {
         this.m22 = v;
     } // Set d
-    /** x轴方向平移  */
+    /** x轴方向平移 */
     get e(): number {
         return this.m41;
     } // Get e
     set e(v: number) {
         this.m41 = v;
     } // Set e
-    /** y轴方向平移  */
+    /** y轴方向平移 */
     get f(): number {
         return this.m42;
     } // Get f
@@ -97,14 +97,14 @@ export class SMatrix {
 
     /**
      * 是否为 2D 矩阵
-     */
+    */
     get is2D(): boolean {
         return true;
     } // Get is2D
 
     /**
      * 是否为单位矩阵
-     */
+    */
     get isIdentity(): boolean {
         return (
             this.m11 == 1 &&
@@ -130,7 +130,7 @@ export class SMatrix {
      * 重置变换矩阵
      *
      * @return 返回自身
-     */
+    */
     reset(): SMatrix {
         this.m11 = 1;
         this.m21 = 0;
@@ -159,7 +159,7 @@ export class SMatrix {
      *
      * @param mat   给定的变换矩阵
      * @return 返回自身
-     */
+    */
     multiply(mat: SMatrix): SMatrix {
         [
             this.m11,
@@ -260,7 +260,7 @@ export class SMatrix {
      * @param dy    Y 轴位移
      * @param dz    Z 轴位移
      * @return 返回自身
-     */
+    */
     translate(dx: number, dy: number, dz = 0): SMatrix {
         const mat = new SMatrix();
         mat.m41 = dx;
@@ -276,7 +276,7 @@ export class SMatrix {
      * @param sx    X 轴缩放比例
      * @param sy    Y 轴缩放比例
      * @return 返回自身
-     */
+    */
     scale(sx: number, sy: number): SMatrix {
         const mat = new SMatrix();
         mat.m11 = sx;
@@ -290,7 +290,7 @@ export class SMatrix {
      *
      * @param angle     绕 Z 轴旋转角度(单位角度度)
      * @return 返回自身
-     */
+    */
     rotate(angle: number): SMatrix;
 
     /**
@@ -300,7 +300,7 @@ export class SMatrix {
      * @param rotY  绕 X 轴旋转角度(单位角度 度)
      * @param rotZ  绕 X 轴旋转角度(单位角度 度)
      * @return 返回自身
-     */
+    */
     rotate(rotX: number, rotY: number, rotZ: number): SMatrix;
 
     /**
@@ -310,7 +310,7 @@ export class SMatrix {
      * @param rotY  绕 X 轴旋转角度(单位度)
      * @param rotZ  绕 X 轴旋转角度(单位度)
      * @return 返回自身
-     */
+    */
     rotate(rotX: number, rotY?: number, rotZ?: number): SMatrix {
         const matZ = new SMatrix();
         if (rotY != undefined && rotZ != undefined) {
@@ -348,7 +348,7 @@ export class SMatrix {
      * 转置当前矩阵
      *
      * @return 返回自身
-     */
+    */
     transpose(): SMatrix {
         [this.m12, this.m21] = [this.m21, this.m12];
         [this.m13, this.m31] = [this.m31, this.m13];
@@ -365,7 +365,7 @@ export class SMatrix {
      * 返回当前矩阵的逆矩阵
      *
      * @return 当前矩阵的逆矩阵
-     */
+    */
     inversed(): SMatrix {
         const detMat = this.det();
         const d = this.value();
@@ -396,7 +396,7 @@ export class SMatrix {
      * 返回当前矩阵的伴随矩阵
      *
      * @return 当前矩阵的伴随矩阵
-     */
+    */
     det(): SMatrix {
         const m = new SMatrix();
         m.m11 =
@@ -529,7 +529,7 @@ export class SMatrix {
      * 返回当前矩阵的值
      *
      * @return 当前矩阵的值
-     */
+    */
     value(): number {
         return (
             this.m11 *

+ 1 - 1
persagy-web-base/src/SMouseEvent.ts

@@ -65,7 +65,7 @@ export class SMouseEvent {
      * 构造函数
      *
      * @param event     系统鼠标事件
-     */
+    */
     constructor(event: MouseEvent | SMouseEvent) {
         // let bbox = (this.type = event.type); //event.srcElement.getBoundingClientRect()
         this.type = event.type;

+ 3 - 3
persagy-web-base/src/SObject.ts

@@ -36,7 +36,7 @@ export class SObject {
     name: string = "";
     /** 监听数组 */
     private listeners = {};
-    /** 对象id    */
+    /** 对象id   */
     id: string = "";
 
     /**
@@ -70,7 +70,7 @@ export class SObject {
      *
      * @param name        信息名称
      * @param receiver    信号接收者
-     */
+    */
     // eslint-disable-next-line @typescript-eslint/no-explicit-any
     disconnect(name: string, receiver: any): void {
         // @ts-ignore
@@ -98,7 +98,7 @@ export class SObject {
      *
      * @param name    事件名称
      * @param args    参数
-     */
+    */
     // eslint-disable-next-line @typescript-eslint/no-explicit-any
     $emit(name: string, ...args: any): void {
         // @ts-ignore

+ 3 - 3
persagy-web-base/src/SObjectObserver.ts

@@ -41,7 +41,7 @@ export class SObjectObserver {
      *
      * @param receiver  信号接收者
      * @param callback  回调函数
-     */
+    */
     // eslint-disable-next-line @typescript-eslint/no-explicit-any
     constructor(receiver: any, callback: Function) {
         this.receiver = receiver;
@@ -52,7 +52,7 @@ export class SObjectObserver {
      * 发送通知
      *
      * @param args  参数
-     */
+    */
     // eslint-disable-next-line @typescript-eslint/no-explicit-any
     notify(...args: any): void {
         this.callback.call(this.receiver, ...args);
@@ -63,7 +63,7 @@ export class SObjectObserver {
      *
      * @param receiver  信号接收者
      * @return 是否相同
-     */
+    */
     // eslint-disable-next-line @typescript-eslint/no-explicit-any
     compar(receiver: any): boolean {
         return receiver == this.receiver;

+ 56 - 4
persagy-web-base/src/enums/SKeyCode.ts

@@ -35,8 +35,60 @@ export enum SKeyCode {
     /** Esc键 */
     Esc = 27,
     /** 删除键 */
-    Delete = 46,
-    /** Z 键 */
-    Z = 90
+    Delete = 127,
+    /** A - Z 键 */
+    A = 65,
+    B = 66,
+    C = 67,
+    D = 68,
+    E = 69,
+    F = 70,
+    G = 71,
+    H = 72,
+    I = 73,
+    J = 74,
+    K = 75,
+    L = 76,
+    M = 77,
+    N = 78,
+    O = 79,
+    P = 80,
+    Q = 81,
+    R = 82,
+    S = 83,
+    T = 84,
+    U = 85,
+    V = 86,
+    W = 87,
+    X = 88,
+    Y = 89,
+    Z = 90,
+    /** a - z 键 */
+    a = 97,
+    b = 98,
+    c = 99,
+    d = 100,
+    e = 101,
+    f = 102,
+    g = 103,
+    h = 104,
+    i = 105,
+    j = 106,
+    k = 107,
+    l = 108,
+    m = 109,
+    n = 110,
+    o = 111,
+    p = 112,
+    q = 113,
+    r = 114,
+    s = 115,
+    t = 116,
+    u = 117,
+    v = 118,
+    w = 119,
+    x = 120,
+    y = 121,
+    z = 122
 } // Enum SKeyCode
-//todo a-z 0-9 郝洁补充
+

+ 6 - 6
persagy-web-base/src/undo/SUndoCommand.ts

@@ -39,17 +39,17 @@ export abstract class SUndoCommand {
      * 构造函数
      *
      * @param  parent   指向父命令
-     */
+    */
     protected constructor(parent: SUndoCommand | null = null) {} // Constructor
 
     /**
      * undo回调
-     */
+    */
     abstract undo(): void;
 
     /**
      * redo回调
-     */
+    */
     abstract redo(): void;
 
     /**
@@ -57,21 +57,21 @@ export abstract class SUndoCommand {
      *
      * @param command     合并的命令
      * @return 成功能返回true,否则返回false
-     */
+    */
     mergeWith(command: SUndoCommand): boolean {
         return false;
     } // Function mergeWith()
 
     /**
      * 命令 ID 。如果命令不能合并,则返回 -1 。如果支持合并则返回一个正整数。
-     */
+    */
     id(): number {
         return -1;
     } // Function id()
 
     /**
      * 命令转为描述谢姐
-     */
+    */
     toString(): string {
         return "";
     } // toString()

+ 9 - 9
persagy-web-base/src/undo/SUndoStack.ts

@@ -53,7 +53,7 @@ export class SUndoStack extends SObject {
 
     /**
      * 执行 redo 操作
-     */
+    */
     redo(): void {
         if (!this.canRedo()) { // 不能执行 redo ,直接返回
             return;
@@ -66,7 +66,7 @@ export class SUndoStack extends SObject {
 
     /**
      * 执行 undo 操作
-     */
+    */
     undo(): void {
         if (!this.canUndo()) { // 不能执行 undo ,直接返回
             return;
@@ -81,7 +81,7 @@ export class SUndoStack extends SObject {
      * 是否可以执行 Redo 操作
      *
      * @return 可以执行,返回 true ;否则返回 false 。
-     */
+    */
     canRedo(): boolean {
         return this.index + 1 < this.cmdStack.length;
     } // Function canRedo()
@@ -90,14 +90,14 @@ export class SUndoStack extends SObject {
      * 是否可以执行 Undo 操作
      *
      * @return 可以执行,返回 true ;否则返回 false 。
-     */
+    */
     canUndo(): boolean {
         return this.index >= 0;
     } // Function canUndo()
 
     /**
      * 清空堆栈
-     */
+    */
     clear(): void {
         this.cmdStack.length = 0;
         this._index = -1;
@@ -108,7 +108,7 @@ export class SUndoStack extends SObject {
      * 返回指定索引的命令
      *
      * @param index     命令在栈中的索引
-     */
+    */
     command(index: number): SUndoCommand | null {
         if (index < 0 || index >= this.cmdStack.length) { // 如果索引越界
             // 返回null
@@ -120,7 +120,7 @@ export class SUndoStack extends SObject {
 
     /**
      * 统计命令栈中命令的数量
-     */
+    */
     count(): number {
         return this.cmdStack.length;
     } // Function count()
@@ -129,7 +129,7 @@ export class SUndoStack extends SObject {
      * 将命令添加到命令栈
      *
      * @param cmd     被添加的命令
-     */
+    */
     push(cmd: SUndoCommand): void {
         this.cmdStack.length = this._index + 1;
         if (this._index >= 0 && cmd.mergeWith(this.cmdStack[this._index])) {
@@ -143,7 +143,7 @@ export class SUndoStack extends SObject {
 
     /**
      * 将命令堆栈转为日志(命令数组)
-     */
+    */
     toLog(): SCommandLog[] {
         let stackList: SCommandLog[] = [];
         for (let i = 0; i <= this.index; i++) {

+ 1 - 1
persagy-web-base/src/utils/SNetUtil.ts

@@ -34,7 +34,7 @@ export class SNetUtil {
      *
      * @param name  下载文件名称
      * @param url   下载url地址
-     */
+    */
     static downLoad(name: string, url: string): void {
         let oA = document.createElement("a");
         oA.download = name;

+ 3 - 3
persagy-web-base/src/utils/SStringBuilder.ts

@@ -37,7 +37,7 @@ export class SStringBuilder {
      * 构造函数
      *
      * @param msg   初始字符串
-     */
+    */
     constructor(msg?: string) {
         if (msg != undefined) {
             this.append(msg);
@@ -49,7 +49,7 @@ export class SStringBuilder {
      *
      * @param msg   追加的字符串
      * @return 字符串 builder 对象
-     */
+    */
     append(msg: string): SStringBuilder {
         this._strArray.push(msg);
         return this;
@@ -60,7 +60,7 @@ export class SStringBuilder {
      *
      * @param gap   分隔符,默认换行 (\n)
      * @return 转换后的字符串
-     */
+    */
     toString(gap: string = "\n"): string {
         return this._strArray.join(gap);
     } // Function toString()

+ 1 - 1
persagy-web-base/src/utils/SStringUtil.ts

@@ -35,7 +35,7 @@ export class SStringUtil {
      * @param n         要转换的数值
      * @param len       转换后的长度(默认为 2)
      * @return 转换后的数据
-     */
+    */
     static num2Hex(n: number, len: number = 2): string {
         let hex = "";
         let numStr: string[] = [

+ 1 - 1
persagy-web-base/src/utils/SUuid.ts

@@ -34,7 +34,7 @@ export class SUuid {
      *
      * @param len       要生成的 uuid 的长度
      * @param radix     生成 uuid 的基数
-     */
+    */
     static uuid(len: number, radix: number): string {
         const chars = "0123456789abcdef".split("");
         let uuid = [],

+ 9 - 0
persagy-web-big-edit/.editorconfig

@@ -0,0 +1,9 @@
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 4
+end_of_line =lf
+insert_final_newline = true
+trim_trailing_whitespace = true

+ 58 - 0
persagy-web-big-edit/.eslintrc.js

@@ -0,0 +1,58 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+module.exports = {
+    root: true,
+    parser: '@typescript-eslint/parser',
+    extends: [
+        'plugin:@typescript-eslint/recommended',
+        // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
+        'prettier/@typescript-eslint',
+        // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
+        // 此行必须在最后
+        'plugin:prettier/recommended'
+    ],
+    env: {
+        es6: true,
+        node: true
+    },
+    parserOptions: {
+        // 支持最新 JavaScript
+        ecmaVersion: 2018,
+        sourceType: 'module'
+    },
+    rules: {
+        // 缩进
+        'indent': ['error', 4, { SwitchCase: 1 }],      // 缩进控制4空格
+        'max-len': ['error', 120],                      // 每行字符不超过120
+        'no-mixed-spaces-and-tabs': 'error',            // 禁止使用空格和tab混合缩进
+        // 语句
+        'curly': ["error", "multi-line"],               // if、else if、else、for、while强制使用大括号,但允许在单行中省略大括号。
+        'semi': ['error', 'always'],                    //不得省略语句结束的分号
+        '@typescript-eslint/no-unused-vars': 'off',     // 取消未使用变量检查
+        '@typescript-eslint/explicit-member-accessibility': ['error', { accessibility: 'no-public' }]       // public访问不需加访问修饰符
+    }
+};

+ 13 - 0
persagy-web-big-edit/.npmignore

@@ -0,0 +1,13 @@
+# 发布时排除
+api/
+docs/
+src/
+.editorconfig
+.eslintrc.js
+*.iml
+coverage
+jest.config.js
+tsconfig.json
+typedoc.json
+publish.js
+package-lock.json

+ 37 - 0
persagy-web-big-edit/README.md

@@ -0,0 +1,37 @@
+# 博锐尚格二维图形编辑器
+## 安装
+安装有三种方式: 全局安装,现有项目安装,package.json 方式。
+* 注:安装前需要在安装其他包完成后,修改npm 源;因为该包为公司私有包。
+```
+npm config set registry http://dev.dp.sagacloud.cn:8082/repository/npm-saga/
+```
+
+### 全局安装
+```
+# persagy-web-edit 全局安装
+npm install -g @persagy-web/edit
+```
+### 现有项目
+如果你想在一个现有项目中使用 @persagy-web/edit,则应该将 @persagy-web/edit 安装为本地依赖。
+```
+# 将 @persagy-web/edit 作为一个本地依赖安装
+npm install -D @persagy-web/edit
+```
+### package.json
+```
+  "dependencies": {
+        "@persagy-web/graph": "2.2.1",
+        "@persagy-web/big": "2.2.1",
+        "@types/uuid": "^8.0.0"
+    }
+```
+在项目文件夹执行如下命令安装项目依赖。
+```
+npm install
+```
+## 参考
+### 开发文档
+* [http://adm.sagacloud.cn:8080/doc/web/guides/edit/](http://adm.sagacloud.cn:8080/doc/web/guides/edit/)
+
+### api 参考
+* [http://adm.sagacloud.cn:8080/api/web/edit/](http://adm.sagacloud.cn:8080/api/web/edit/)

+ 38 - 0
persagy-web-big-edit/jest.config.js

@@ -0,0 +1,38 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+module.exports = {
+    preset: "ts-jest",
+    moduleFileExtensions: ["js", "ts"],
+    transform: {
+        "^.+\\.tsx?$": "ts-jest"
+    },
+    transformIgnorePatterns: ["/node_modules/"],
+    moduleNameMapper: {
+        "^@/(.*)$": "<rootDir>/src/$1"
+    },
+    collectCoverage: true
+};

+ 46 - 0
persagy-web-big-edit/package.json

@@ -0,0 +1,46 @@
+{
+    "name": "@persagy-web/bigedit",
+    "version": "2.2.1",
+    "description": "博锐尚格二维图形编辑器。",
+    "main": "lib/index.js",
+    "types": "lib/index.d.js",
+    "remote": {
+        "host": "47.93.22.124",
+        "path": "/opt/web/doc/api/web/bigedit",
+        "user": "doc",
+        "password": "saga2020(^cloud==",
+        "local": "api"
+    },
+    "scripts": {
+        "build": "tsc",
+        "publish": "npm publish",
+        "lint": "eslint src/**/*.{js,ts,tsx}",
+        "test": "echo \"Error: no test specified\" && exit 1",
+        "typedoc": "typedoc --out api --hideGenerator src",
+        "publish-api": "node publish.js"
+    },
+    "keywords": [
+        "graph-big-edit"
+    ],
+    "author": "韩耀龙 <han_yao_long@163.com> ",
+    "license": "ISC",
+    "publishConfig": {
+        "registry": "http://dev.dp.sagacloud.cn:8082/repository/npm-hosted/"
+    },
+    "devDependencies": {
+        "@typescript-eslint/eslint-plugin": "^1.12.0",
+        "@typescript-eslint/parser": "^1.12.0",
+        "eslint": "^6.0.1",
+        "eslint-config-prettier": "^6.0.0",
+        "eslint-plugin-prettier": "^3.1.0",
+        "node-ssh": "^6.0.0",
+        "prettier": "^1.18.2",
+        "ts-jest": "^24.0.2",
+        "typedoc": "^0.17.4",
+        "typescript": "^3.5.3"
+    },
+    "dependencies": {
+        "@persagy-web/graph": "2.2.22",
+        "@types/uuid": "^8.0.0"
+    }
+}

+ 58 - 0
persagy-web-big-edit/publish.js

@@ -0,0 +1,58 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+const Client = require("node-ssh");
+const ssh = new Client();
+
+ssh.connect({
+    host: process.env.npm_package_remote_host,
+    port: "22",
+    username: process.env.npm_package_remote_user,
+    password: process.env.npm_package_remote_password
+}).then(() => {
+    const failedList = [];
+    ssh.putDirectory(
+        process.env.npm_package_remote_local,
+        process.env.npm_package_remote_path,
+        {
+            recursive: true,
+            concurrency: 1,
+            tick: function(localPath, remotePath, error) {
+                if (error) {
+                    failedList.push(localPath);
+                }
+            }
+        }
+    ).then(status => {
+        if (failedList.length > 0) {
+            console.log("发布失败");
+            console.log("failed transfers", failedList.join(", "));
+        } else {
+            console.log(status ? "发布成功" : "发布失败");
+        }
+        ssh.dispose();
+    });
+});

+ 131 - 0
persagy-web-big-edit/src/BigEditFactory.ts

@@ -0,0 +1,131 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import {
+    SBaseCircleEdit,
+    SBaseImageEdit,
+    SBaseLineEdit,
+    SBasePolygonEdit,
+    SBaseRectEdit,
+    SBaseTextEdit
+} from "@persagy-web/edit/lib/";
+import {Marker, SBaseArrow, SBaseExpainEdit} from "./"
+import {SItemFactory} from "@persagy-web/big"
+
+/**
+ * item 创建工厂
+ *
+ * @author 韩耀龙 <han_yao_long@163.com>
+ */
+export class BigEditFactory extends SItemFactory {
+    /**
+     * 构造函数
+     */
+    constructor() {
+        super()
+    } // Constructor
+
+    /**
+     * 创建基础直线
+     *
+     * @param data  数据
+     * @return  线
+     */
+    createBaseLineEdit(data: Marker): SBaseLineEdit {
+        return new SBaseLineEdit(null, data);
+    } // Function createBaseLineEdit()
+
+    /**
+     * 创建基础文本
+     *
+     * @param data  数据
+     * @return  文本
+     */
+    createBaseTextEdit(data: Marker): SBaseTextEdit {
+        return new SBaseTextEdit(null, data);
+    } // Function createBaseTextEdit()
+
+    /**
+     * 创建基础图片
+     *
+     * @param data  数据
+     * @return  图片
+     */
+    createBaseImageEdit(data: Marker): SBaseImageEdit {
+        return new SBaseImageEdit(null, data);
+    } // Function createBaseImageEdit()
+
+    /**
+     * 创建基础矩形
+     *
+     * @param data  数据
+     * @return  矩形
+     */
+    createBaseRectEdit(data: Marker): SBaseRectEdit {
+        return new SBaseRectEdit(null, data);
+    } // Function createBaseRectEdit()
+
+    /**
+     * 创建基础圆
+     *
+     * @param data  数据
+     * @return  圆
+     */
+    createBaseCircleEdit(data: Marker): SBaseCircleEdit {
+        return new SBaseCircleEdit(null, data);
+    } // Function createBaseRectEdit()
+
+    /**
+     * 创建基础注释
+     *
+     * @param data     数据
+     * @return  注释
+     */
+    createBaseExpainEdit(data: Marker): SBaseExpainEdit {
+        return new SBaseExpainEdit(null, data);
+    } // Function createBaseExpainEdit()
+
+    /**
+     * 创建基础多边形
+     *
+     * @param data     数据
+     * @return  注释
+     */
+    createBasePolygonEdit(data: Marker): SBasePolygonEdit {
+        return new SBasePolygonEdit(null, data);
+    } // Function createBasePolygonEdit()
+
+    /**
+     * 创建基础基础箭头(折线)
+     *
+     * @param data     数据
+     * @return  注释
+     */
+    createBaseArrow(data: Marker): SBaseArrow {
+        return new SBaseArrow(null, data);
+    } // Function createBasePolygonEdit()
+
+} // Class BigEditFactory

+ 418 - 0
persagy-web-big-edit/src/SBaseEditScene.ts

@@ -0,0 +1,418 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import { SGraphAddCommand, SGraphEditScene, SGraphEdit } from "@persagy-web/edit/lib"
+import { SMouseEvent } from "@persagy-web/base/lib";
+import { SArrowStyleType, SPoint, SRect } from '@persagy-web/draw';
+import { SItemStatus, SRectSelectItem } from '@persagy-web/big/lib';
+import { SGraphItem, SGraphSelectContainer } from "@persagy-web/graph/lib/";
+import { uuid } from "./until";
+import { SBaseArrow, SBaseEquipment, SBaseExpainEdit, SBasePipeUninTool, SBasePipe } from "./"
+
+
+/**
+ * big-edit 场景
+ *
+ * @author 韩耀龙 <han_yao_long@163.com>
+ */
+export class SBaseEditScene extends SGraphEditScene {
+    /** 图例节点 */
+    Nodes: any = [];  // 图例节点,所有与工程信息化相关的图例(图标类型与区域)
+    /** 图例节点 */  // 与工程信息无关的标识对象(增加文本注释,图上的图片说明)
+    Markers: any = [];
+    /** 管线对象 */
+    Relations: any = [];
+    /** 复制的对象 */
+    copyString: any[] = [];
+    grabItem: null | SGraphEdit | SGraphItem  = null
+
+    /**
+     * 构造函数
+     *
+     */
+    constructor() {
+        super()
+    } // Constructor
+
+    /**
+     * 新增基础类注释
+     *
+     * @param event   鼠标事件参数
+     */
+    addExplainItem(event: SMouseEvent): void {
+        const data = {
+            /** 名称 */
+            name: '基础注释文本',
+            /** 图标 */
+            type: "Text",
+            /** 位置 */
+            pos: { x: event.x, y: event.y },
+            /** 由应用自己定义 */
+            properties: {
+                type: "BaseExplain",
+            },
+            style: {
+                default: {
+                    text: '请在右侧属性栏输入文字!',
+                    color: "#646c73",
+                    font: 14,
+                    backgroundcolor: "#f7f9facc",
+                }
+            }
+        };
+        const item = new SBaseExpainEdit(null, data);
+        item.moveTo(event.x, event.y);
+        item.selectable = true;
+        item.moveable = true;
+        this.addItem(item);
+        this.undoStack.push(new SGraphAddCommand(this, item));
+        this.grabItem = null;
+        this.finishCreated(item);
+    } // Function addExplainItem()
+
+    /**
+     * 新增基础箭头(折线)
+     *
+     * @param event 鼠标事件
+     */
+    addPolyLineArrow(event: SMouseEvent): void {
+        const data = {
+            name: '基础箭头',
+            type: "Arrow",
+            pos: { x: 0, y: 0 },
+            properties: {
+                type: "BaseArrow",
+            },
+            style: {
+                outLine: [{ x: event.x, y: event.y }],
+                begin: SArrowStyleType.None,  //开端箭头样式
+                end: SArrowStyleType.None,    //结尾箭头样式
+                isMove: true,                 //是否可以移动
+                default: {}
+            }
+        };
+        const item = new SBaseArrow(null, data);
+        item.status = SItemStatus.Create;
+        item.selectable = true;
+        this.addItem(item);
+        this.undoStack.push(new SGraphAddCommand(this, item));
+        this.grabItem = item;
+        item.connect("finishCreated", this, this.finishCreated);
+        item.connect("onContextMenu", this, this.getItem);
+        if (this.view) {
+            this.view.update();
+        }
+    } // Function addPolyLineArrow()
+
+    /**
+     * 添加基本设备 item
+     *
+     * @param event     鼠标事件
+     * @param legendObj 图例样式
+     */
+    addEuqipment(event: SMouseEvent, legendObj: any): void {
+        const data = {
+            /** 名称 */
+            name: '基础设备',
+            num: 1,
+            size: { width: 50, height: 50 },
+            /** 图标 (Image),线类型 (Line) */
+            type: "Image",
+            /** 位置 */
+            pos: { x: event.x, y: event.y },
+            /** 由应用自己定义 */
+            properties: {
+                type: "baseEquipment",
+            },
+            style: {
+                default: {
+                    strokecolor: "#c0ccda",
+                    // url: require('./../../../assets/images/equip/' + legendObj.url),
+                }
+            }
+        }
+        const item = new SBaseEquipment(null, data);
+        item.status = SItemStatus.Create;
+        this.addItem(item);
+        this.undoStack.push(new SGraphAddCommand(this, item));
+        item.selectable = true;
+        item.moveable = true;
+        this.grabItem = item;
+        item.connect("finishCreated", this, this.finishCreated);
+        item.connect("onContextMenu", this, this.getItem);
+        if (this.view) {
+            this.view.update();
+        }
+    } // Function addEuqipment()
+
+    /**
+     * 新增管道
+     *
+     * @param event 鼠标事件
+     */
+    addBasePipe(event: SMouseEvent) {
+        const data = {
+            name: '管道',
+            type: "line",
+            pos: { x: 0, y: 0 },
+            properties: {
+                type: "BasePolyline",
+            },
+            style: {
+                outLine: [{ x: event.x, y: event.y }],
+                default: {
+                }
+            }
+        };
+        const item = new SBasePipe(null, data);
+        item.status = SItemStatus.Create;
+        item.selectable = true;
+        this.addItem(item);
+        this.undoStack.push(new SGraphAddCommand(this, item));
+        this.grabItem = item;
+        item.connect("finishCreated", this, this.finishCreated);
+        item.connect("onContextMenu", this, this.getItem);
+        if (this.view) {
+            this.view.update();
+        }
+    } // Function addBasePipe()
+
+    /**
+     * 添加基本管道联通器
+     *
+     * @param event     鼠标事件
+     * @param cmd       命令
+     */
+    addPipeUninTool(event: SMouseEvent, cmd: string): void {
+        const cmdList = {
+            'wantou': 2,
+            'santong': 3,
+            'sitong': 4,
+        }
+        const data = {
+            /** 名称 */
+            name: '基础管道接头',
+            /** 图标 (Image),线类型 (Line) */
+            type: "Image",
+            /** 位置 */
+            pos: { x: event.x, y: event.y },
+            /** 由应用自己定义 */
+            properties: {
+                type: "BasePipeUninTool",
+            },
+            style: {
+                uninToolType: cmdList[cmd] ? cmdList[cmd] : 2,  //2,3,4 分别分二头连接器、三头连接器、四头连接器
+                default: {
+                    strokecolor: "#c0ccda",
+                }
+            }
+        };
+        const item = new SBasePipeUninTool(null, data);
+        item.status = SItemStatus.Create;
+        item.selectable = true;
+        item.moveable = true;
+        this.addItem(item);
+        this.undoStack.push(new SGraphAddCommand(this, item));
+        this.grabItem = item;
+        item.connect("finishCreated", this, this.finishCreated);
+        item.connect("onContextMenu", this, this.getItem);
+        if (this.view) {
+            this.view.update();
+        }
+    } // Function addPipeUninTool()
+
+    /**
+     * 重做
+     */
+    redo(): void {
+        if (this.grabItem && this.grabItem instanceof SGraphEdit) {
+            this.grabItem.redo()
+        } else {
+            this.undoStack.redo();
+        }
+    } // Function redo()
+
+    /**
+     * 撤销
+     */
+    undo(): void {
+        if (this.grabItem && this.grabItem instanceof SGraphEdit) {
+            this.grabItem.undo()
+        } else {
+            this.undoStack.undo();
+        }
+    } // Function undo()
+
+    /**
+     * 删除
+     *
+     * @return 删除的图例
+     */
+    deleteItem(): any {
+        if (this.selectContainer.count == 0) {
+            return []
+        }
+        let itemList = this.selectContainer.itemList;
+        itemList.forEach((element: any) => {
+            this.removeItem(element)
+        });
+        if (this.view) {
+            this.view.update()
+        }
+        return itemList
+    } // Function deleteItem()
+
+    /**
+     * 框选
+     */
+    addRectSelect(event: SMouseEvent): void {
+        let point = new SPoint(event.x, event.y);
+        let rect = new SRectSelectItem(null, point);
+        this.addItem(rect);
+        this.grabItem = rect;
+    } // Function addRectSelect()
+
+    /**
+     * 计算框选交集
+     *
+     * @param ctrl  是否点击ctrl
+     */
+    groupSelect(ctrl: boolean) {
+        // if (!ctrl) {
+        //     this.selectContainer.clear()
+        // }
+        if (this.grabItem instanceof SRectSelectItem) {
+            const rect = this.grabItem.boundingRect();
+            this.arrToSelect(this.root.children, rect)
+        }
+    } // Function groupSelect()
+
+    /**
+     * 选中item:框选
+     *
+     * @param arr   实例数组
+     * @param rect  框选矩形区域
+     */
+    private arrToSelect(arr: SGraphItem[], rect: SRect) {
+        if (Array.isArray(arr) && arr.length) {
+            arr.forEach(t => {
+                if (!(t instanceof SGraphSelectContainer) && t.parent) {
+                    let temp = t.boundingRect();
+                    let lefttop = t.mapToScene(temp.left, temp.top)
+                    let rightbottom = t.mapToScene(temp.right, temp.bottom)
+                    let r = new SRect(lefttop, rightbottom)
+                    if (rect.isIn(r)) {
+                        this.selectContainer.toggleItem(t)
+                    }
+                }
+            })
+        }
+    } // Function arrToSelect()
+
+    /////////////////////////////////////////////////////////////////////
+    // 鼠标事件
+
+    /**
+     * 鼠标左键按下
+     *
+     * @param event   鼠标事件参数
+     */
+    onMouseDown(event: SMouseEvent): any {
+        if (!super.onMouseDown(event) && 1 == event.buttons) {
+            this.addRectSelect(event);
+        }
+    } // Function onMouseDown()
+
+    /**
+     * 鼠标抬起
+     *
+     * @param event   鼠标事件参数
+     */
+    onMouseUp(event: SMouseEvent): boolean {
+        if (this.grabItem) {
+            // 鼠标抬起时,如果grabItem为框选则删除框选item
+            if (this.grabItem instanceof SRectSelectItem) {
+                this.removeItem(this.grabItem);
+                this.groupSelect(false);
+                this.grabItem = null;
+
+                if (this.view) {
+                    this.view.update()
+                }
+                return true;
+            }
+            return this.grabItem.onMouseUp(event);
+        }
+        return super.onMouseUp(event)
+    } // Function onMouseUp()
+
+    /**
+     * 复制
+     */
+    copy(): void {
+        const itemList = this.selectContainer.itemList
+        if (itemList.length) {
+            itemList.forEach(t => {
+                const data = JSON.parse(JSON.stringify(t.toData()))
+                data.ID = uuid()
+                this.copyString.push(data)
+
+            })
+            // 生成复制字符串
+            console.log(this.copyString)
+            // 获取input dom
+            const input = document.createElement('input');
+            input.setAttribute('id', 'COPYINPUT')
+            input.value = JSON.stringify(this.copyString)
+            sessionStorage.setItem("copyString", input.value);
+            document.body.appendChild(input);
+            input.select()
+            document.execCommand('copy');
+            input.style.display = 'none';
+            console.log(input.value, Date.now());
+            document.body.removeChild(input)
+        }
+    } // Function copy()
+
+    /**
+     * 粘贴
+     */
+    paste(): void {
+        const copyList = JSON.parse(JSON.stringify(this.copyString));
+        copyList.forEach((t: any) => {
+            if (this.view) {
+                t.Pos.X += 10,
+                    t.Pos.Y += 10
+            }
+
+            t.moveable = true;
+            console.log('t', t)
+            this.addItem(t)
+        });
+        this.view ? this.view.update() : ''
+        console.log(this.view)
+    } // Function paste()
+} // Class SBaseEditScene

+ 13 - 0
persagy-web-big-edit/src/index.ts

@@ -0,0 +1,13 @@
+import { SBaseEditScene } from "./SBaseEditScene"
+import { SBaseExpainEdit } from "./items/SBaseExpainEdit"
+import { SBasePipeUninTool } from "./items/SBasePipeUninTool"
+import { SBasePipe } from "./items/SBasePipe"
+import { SBaseArrow } from "./items/SBaseArrow"
+import { Anchor } from "./types/Anchor"
+import { ElementData } from "./types/ElementData"
+import { Legend } from "./types/Legend"
+import { Marker } from "./types/Marker"
+import { Relation } from "./types/Relation"
+import { BigEditFactory } from "./BigEditFactory"
+import { SBaseEquipment } from "./items/SBaseEquipment"
+export { SBaseArrow, SBasePipe, SBasePipeUninTool, SBaseEquipment, BigEditFactory, Anchor, Legend, Marker, Relation, ElementData, SBaseEditScene, SBaseExpainEdit }

+ 134 - 0
persagy-web-big-edit/src/items/SBaseArrow.ts

@@ -0,0 +1,134 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import { SColor, SFont, SPainter, SArrowStyleType } from "@persagy-web/draw/";
+import { SBasePolylineEdit } from '@persagy-web/edit/lib';
+import { SGraphItem, SLineStyle } from "@persagy-web/graph/lib";
+import { Marker } from "./../types/Marker";
+import { SMouseEvent } from "@persagy-web/base/lib";
+import { ItemOrder } from '@persagy-web/big/lib';
+
+/**
+ * 编辑箭头(折线)
+ *
+ * @author 韩耀龙 <han_yao_long@163.com>
+ */
+export class SBaseArrow extends SBasePolylineEdit {
+    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    //属性
+    /** 起始点样式 */
+    _begin = SArrowStyleType.None;
+    get begin(): SArrowStyleType {
+        return this._begin;
+    } // Get begin
+    set begin(v: SArrowStyleType) {
+        this._begin = v;
+        this.update();
+    } // Set begin
+
+    /** 结束点样式 */
+    _end = SArrowStyleType.None;
+    get end(): SArrowStyleType {
+        return this._end;
+    } // Get end
+    set end(v: SArrowStyleType) {
+        this._end = v;
+        this.update();
+    } // Set end
+
+    /**
+     * 构造函数
+     *
+     * @param parent    指向父对象
+     * @param data      数据
+     */
+    constructor(parent: SGraphItem | null, data: Marker) {
+        super(parent, data);
+        this.data = data;
+        // 设置箭头
+        if (data && data.style) {
+            this.begin = data.style.begin ? data.style.begin : SArrowStyleType.None;
+            this.end = data.style.end ? data.style.end : SArrowStyleType.None
+        }
+    } // Constructor
+
+    /**
+     * 鼠标按下事件
+     *
+     * @param event   保存事件参数
+     * @return  事件是否处理
+     */
+    onMouseDown(event: SMouseEvent): boolean {
+        super.onMouseDown(event)
+        return true;
+    } // Function onMouseDown()
+
+    /**
+     * 绘制基本图形
+     *
+     * @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) {
+            painter.pen.lineDash = [
+                painter.toPx(this.lineWidth),
+                painter.toPx(this.lineWidth)
+            ];
+        }
+
+        painter.pen.color = this.strokeColor;
+        painter.drawArrowLine(this.pointList[0], this.pointList[1], {
+            begin: this.begin,
+            end: SArrowStyleType.None
+        });
+        painter.drawArrowLine(
+            this.pointList[this.pointList.length - 2],
+            this.pointList[this.pointList.length - 1],
+            {
+                begin: SArrowStyleType.None,
+                end: this.end
+            }
+        );
+        painter.drawPolyline(this.pointList);
+    } // Function drawBaseLine()
+
+    /**
+     * 返回对象储存的相关数据
+     *
+     * @return 对象储存的相关数据
+     */
+    toData(): any {
+        this.data.style.begin = this.begin;
+        this.data.style.end = this.end;
+        return super.toData();
+    } // Function toData()
+} // Class SBaseArrow

+ 56 - 0
persagy-web-big-edit/src/items/SBaseEquipment.ts

@@ -0,0 +1,56 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import { SGraphItem } from "@persagy-web/graph/lib";
+import { Marker } from "./../types/Marker";
+import { SBaseImageEdit } from '@persagy-web/edit/lib';
+
+/**
+ * 编辑基础设备类
+ *
+ * @author 韩耀龙 <han_yao_long@163.com>
+ */
+export class SBaseEquipment extends SBaseImageEdit {
+
+    /**
+     * 构造函数
+     *
+     * @param parent    指向父对象
+     * @param data      数据
+     */
+    constructor(parent: SGraphItem | null, data: Marker) {
+        super(parent, data);
+    } // Constructor
+
+    /**
+     * 返回对象储存的相关数据
+     *
+     * @return	对象储存的相关数据
+     */
+    toData(): any {
+        return super.toData()
+    } // Function toData
+} // Class SBaseEquipment

+ 69 - 0
persagy-web-big-edit/src/items/SBaseExpainEdit.ts

@@ -0,0 +1,69 @@
+/*
+* *********************************************************************************************************************
+*
+*          !!
+*        .F88X
+*        X8888Y
+*      .}888888N;
+*        i888888N;        .:!              .I$WI:
+*          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+*          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+*            +888888N;  .8888888Y                                  "&&8Y.}8,
+*            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+*              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+*              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+*            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+*            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+*          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+*        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+*      .:R888888I
+*      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+*        ~8888'
+*        .!88~                                                                     All rights reserved.
+*
+* *********************************************************************************************************************
+*/
+
+import {SBaseTextEdit} from '@persagy-web/edit/lib';
+import {SGraphItem} from "@persagy-web/graph/lib";
+import {Marker} from "./../types/Marker";
+import {SMouseEvent} from "@persagy-web/base/lib";
+
+/**
+  * 编辑基础注释类
+  *
+  * @author 韩耀龙 <han_yao_long@163.com>
+  */
+ export class SBaseExpainEdit extends SBaseTextEdit {
+     ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+     //属性
+     /**
+      * 构造函数
+      *
+      * @param parent    指向父对象
+      * @param data      数据
+      */
+     constructor(parent: SGraphItem | null, data: Marker) {
+         super(parent, data);
+     } // Constructor
+
+     /**
+      * 鼠标按下事件
+      *
+      * @param event   保存事件参数
+      * @return 是否处理该事件
+      */
+     onMouseDown(event: SMouseEvent): boolean {
+         super.onMouseDown(event);
+         return true;
+     } // Function onMouseDown()
+
+     /**
+      * 返回对象储存的相关数据
+      *
+      * @return 相关数据
+      */
+     toData(): any {
+         return super.toData()
+     } // Function toData()
+ } // Class SBaseExpainEdit

+ 27 - 51
persagy-web-edit/src/items/ImageEdit.ts

@@ -24,70 +24,46 @@
  * *********************************************************************************************************************
  */
 
-import { SPainter, SRect, SSize, SColor, SPoint } from "@persagy-web/draw";
-import { SImageShowType, STextOrigin } from "@persagy-web/graph";
-import { SGraphItem, SImageItem } from "@persagy-web/graph";
-import { SItemStatus } from "@persagy-web/big";
+import {SBasePolylineEdit} from '@persagy-web/edit/lib';
+import {SGraphItem} from "@persagy-web/graph/lib/";
+import {Marker} from "./../types/Marker";
+import {SMouseEvent} from "@persagy-web/base/lib";
 
 /**
- * 图片编辑类
+ * 编辑基础管道
  *
- * @author  韩耀龙(han_yao_long@163.com)
+ * @author 韩耀龙 <han_yao_long@163.com>
  */
-export class ImageEdit extends SImageItem {
-    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+export class SBasePipe extends SBasePolylineEdit {
+    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //属性
-    /**编辑状态 */
-    protected _status: SItemStatus = SItemStatus.Normal;
-    get status(): SItemStatus {
-        return this._status;
-    }
-    set status(value: SItemStatus) {
-        const oldStatus = this._status;
-        const newStatus = value;
-        this._status = value;
-        //状态变更触发事件
-        this.$emit('StatusChange', oldStatus, newStatus)
-        this.update();
-    }
-
-    //////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    //函数
     /**
      * 构造函数
      *
-     * @param parent      指向父对象
+     * @param parent    指向父对象
+     * @param data      数据
      */
-    constructor(parent: SGraphItem | null, url: string) {
-        super(parent);
-        this.url = url;
-        // this.initItem();
-        this.origin = new SPoint(this.width / 2, this.height / 2);
-    }
+    constructor(parent: SGraphItem | null, data: Marker) {
+        super(parent, data);
+    } // Constructor
 
     /**
-     * 将类中得数据转换为方便存储格式的方法
+     * 鼠标按下事件
      *
-     * return   any         针对item类型保持相应的格式
+     * @param event   保存事件参数
+     * @return 是否处理该事件
      */
-    toData(): any {
-
-    }
-    // 初始化item
-    // initItem() {
-    //     if (!this.url) {
-    //         this.strokeColor = SColor.Black;
-    //         this.width = 100;
-    //         this.height = 100
-    //     }
-    // }
+    onMouseDown(event: SMouseEvent): boolean {
+        super.onMouseDown(event);
+        return true;
+    } // Function onMouseDown()
 
     /**
-     * 根据显示模式计算图片的宽高
+     * 返回对象储存的相关数据
+     *
+     * @return 相关数据
      */
-    computeImgSize(): void {
-        super.computeImgSize();
-        this.origin = new SPoint(this.width / 2, this.height / 2);
-        this.update();
-    } // Function computeImgSize()
-} // Class SImageItem
+    toData(): any {
+        return super.toData()
+    } // Function toData()
+} // Class SBasePipe

+ 85 - 0
persagy-web-big-edit/src/items/SBasePipeUninTool.ts

@@ -0,0 +1,85 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import {SBaseImageEdit} from '@persagy-web/edit/lib';
+import {SGraphItem} from "@persagy-web/graph/lib";
+import {Marker} from "./../types/Marker";
+import {SMouseEvent} from "@persagy-web/base/lib";
+
+/**
+ * 编辑基础管道接头类
+ *
+ * @author 韩耀龙 <han_yao_long@163.com>
+ */
+export class SBasePipeUninTool extends SBaseImageEdit {
+    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    //属性
+    /**
+     * 构造函数
+     *
+     * @param parent    指向父对象
+     * @param data      数据
+     */
+    constructor(parent: SGraphItem | null, data: Marker) {
+        super(parent, data);
+        if (data && data.style) {
+            switch (data.style.uninToolType) {
+                // case 2:
+                //     this.url = require('./../../../../assets/images/leftImgs/wantou.png');
+                //     break;
+                // case 3:
+                //     this.url = require('./../../../../assets/images/leftImgs/santong.png');
+                //     break;
+                // case 4:
+                //     this.url = require('./../../../../assets/images/leftImgs/sitong.png');
+                //     break;
+                // default:
+                //     this.url = require('./../../../../assets/images/leftImgs/wantou.png');
+                //     break;
+            }
+        }
+    } // Constructor
+
+    /**
+     * 鼠标按下事件
+     *
+     * @param event   保存事件参数
+     * @return 是否处理该事件
+     */
+    onMouseDown(event: SMouseEvent): boolean {
+        super.onMouseDown(event);
+        return true;
+    } // Function onMouseDown()
+
+    /**
+     * 返回对象储存的相关数据
+     *
+     * @return 相关数据
+     */
+    toData(): any {
+        return super.toData()
+    } // Function toData()
+} // Class SBasePipeUninTool

+ 1 - 0
persagy-web-big-edit/src/parsers/bigEditParse.ts

@@ -0,0 +1 @@
+import { SBaseExpainEdit, } from "./../index"

+ 39 - 0
persagy-web-big-edit/src/types/Anchor.ts

@@ -0,0 +1,39 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import { Point } from "@persagy-web/edit/lib/type/Point";
+
+/**
+ * 锚点 item 接口
+ *
+ * @author 韩耀龙 <han_yao_long@163.com>
+ */
+export interface Anchor {
+    /** 锚点 ID */
+    ID: string;
+    /** 锚点的坐标 */
+    Pos: Point;
+} // Interface Anchor

+ 43 - 0
persagy-web-big-edit/src/types/ElementData.ts

@@ -0,0 +1,43 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import { Legend } from "./Legend";
+import { Marker } from "./Marker";
+import { Relation } from "./Relation";
+
+/**
+ * 系统图数据接口
+ *
+ * @author 韩耀龙 <han_yao_long@163.com>
+ */
+export interface ElementData {
+    /** 在数据中台有数据的节点 */
+    Nodes: Legend[];
+    /** 说明型节点 */
+s: Marker[];
+    /** 关系类节点 */
+    Relations: Relation[];
+} // Interface ElementData

+ 68 - 0
persagy-web-big-edit/src/types/Legend.ts

@@ -0,0 +1,68 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import { Anchor } from "./Anchor";
+import { Point } from "@persagy-web/edit/lib/type/Point";
+import { Size } from "@persagy-web/big/lib/types/Size";
+import { SPoint } from '@persagy-web/draw/';
+
+/**
+ * 图例节点接口
+ *
+ * @author 韩耀龙 <han_yao_long@163.com>
+ */
+export interface Legend {
+    /** ID */
+    ID: string;
+    /** 名称 */
+    Name: string;
+    /** 返回工程信息化对象 ID 列表 */
+    AttachObjectIds?: any[];
+    /** 图标,区域类型 */
+    GraphElementType: string;
+    /** 对应的图例 ID */
+    GraphElementId: string;
+    /** 图例数量 */
+    Num?: number;
+    /** 位置 */
+    Pos: Point;
+    /** item 类型 */
+    Type: string
+    /** 缩放 */
+    Scale?: Point;
+    /** 旋转 */
+    Rolate?: Point;
+    /** 大小 */
+    Size?: Size;
+    /** 锚点 List */
+    AnchorList?: Anchor[];
+    /** 轮廓线 */
+    OutLine?: Point[] | SPoint[];
+    /** 由应用自己定义 */
+    Properties?: any;
+     /** zone 区分防火分区和石材铺装 */
+    SubType?:string
+} // Interface Legend

+ 54 - 0
persagy-web-big-edit/src/types/Marker.ts

@@ -0,0 +1,54 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import { Point } from "@persagy-web/edit/lib/type/Point";
+import { Size } from "@persagy-web/big/lib/types/Size";
+
+/**
+ * 标识对象接口
+ *
+ * @author 韩耀龙 <han_yao_long@163.com>
+ */
+export interface Marker {
+    /** ID */
+    iD?: string;
+    /** 名称 */
+    name: string;
+    /** 图标 (Image),线类型 (Line) */
+    type: string;
+    /** 位置 */
+    pos: Point;
+    /** 缩放 */
+    scale?: Point;
+    /** 旋转 */
+    rolate?: Point;
+    /** 大小 */
+    size?: Size;
+    /** 绘制时得数据以及样式 */
+    style: any;
+    /** 由应用自己定义 */
+    properties?: any;
+} // Interface Marker

+ 58 - 0
persagy-web-big-edit/src/types/Relation.ts

@@ -0,0 +1,58 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import { SRelationDir } from "@persagy-web/big/lib/enums/SRelationDir";
+import { Point } from "@persagy-web/edit/lib/type/Point";
+
+/**
+ * 管线对象关系接口
+ *
+ * @author 韩耀龙 <han_yao_long@163.com>
+ */
+export interface Relation {
+    /** ID */
+    ID: string;
+    /** 名称 */
+    Name: string;
+    /** 对应的图例 ID */
+    GraphElementId: string;
+    /** 关联节点 1_id */
+    Node1ID?: string;
+    /** 关联节点 2_id */
+    Node2ID?: string;
+    /** 关联锚点 1_id */
+    Anchor1ID?: string;
+    /** 关联锚点 2_id */
+    Anchor2ID?: string;
+    /** 方向(0:无向,1:节点 1 到节点2,2:节点 2 到节点 1) */
+    Dir?: SRelationDir;
+    /** 线类型(0:直线,1:水平/垂直线,2:曲线) */
+    LineType: string;
+    /** 线的顶点坐标 */
+    PointList: Point[];
+    /** 线的绘图样式 */
+    Properties?: any;
+} // Interface Relation

+ 9 - 0
persagy-web-big-edit/src/until.ts

@@ -0,0 +1,9 @@
+//  生成uuid
+export function uuid() {
+  // do nothing
+}
+
+export function rgbaNum(rgba: string) {
+    let val = rgba.match(/(\d(\.\d+)?)+/g);
+    return val;
+}

+ 16 - 0
persagy-web-big-edit/tsconfig.json

@@ -0,0 +1,16 @@
+{
+    "compilerOptions": {
+        "target": "es6",                            // Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'.
+        "module": "commonjs",                       // Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'.
+        "outDir": "./lib",                          // 编译后生成的文件目录
+        "strict": true,                             // 开启严格的类型检测
+        "declaration": true,                        // 生成 `.d.ts` 文件
+        "experimentalDecorators": true,             // 开启装饰器
+        "removeComments": true,                     // 去除注释
+        "noImplicitAny": false,                      // 在表达式和声明上有隐含的 any类型时报错。
+        "esModuleInterop": true,                    // 支持别名导入
+        "moduleResolution": "node"                  // 此处设置为node,才能解析import xx from 'xx'
+    },
+    "include": ["./src"],
+    "exclude": ["node_modules"]
+}

+ 6 - 0
persagy-web-big-edit/typedoc.json

@@ -0,0 +1,6 @@
+{
+    "name": "博锐尚格绘制引擎",
+    "mode": "file",
+    "out": "doc",
+    "exclude": ["**/*+(index|.test).ts"]
+}

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

@@ -47,7 +47,7 @@ import { Zone } from "../types/floor/Zone";
 export class SItemFactory {
     /**
      * 构造函数
-     */
+    */
     constructor() {} // Constructor
 
     /**
@@ -55,7 +55,7 @@ export class SItemFactory {
      *
      * @param data    柱子数据
      * @return 柱子 item
-     */
+    */
     createColumn(data: Column): SColumnItem {
         return new SColumnItem(null, data);
     } // Function createColumn()
@@ -65,7 +65,7 @@ export class SItemFactory {
      *
      * @param data    墙数据
      * @return 墙 item
-     */
+    */
     createWall(data: Wall): SWallItem {
         return new SWallItem(null, data);
     } // Function createWall()
@@ -75,7 +75,7 @@ export class SItemFactory {
      *
      * @param data    虚拟墙数据
      * @return 虚拟墙 item
-     */
+    */
     createVirtualWall(data: VirtualWall): SVirtualWallItem {
         return new SVirtualWallItem(null, data);
     } // Function createVirtualWall()
@@ -85,7 +85,7 @@ export class SItemFactory {
      *
      * @param data    空间数据
      * @return 空间 item
-     */
+    */
     createSpace(data: Space): SSpaceItem {
         return new SSpaceItem(null, data);
     } // Function createSpace()
@@ -95,7 +95,7 @@ export class SItemFactory {
      *
      * @param data    门数据
      * @return 门item
-     */
+    */
     createDoor(data: Door): SDoorItem {
         return new SDoorItem(null, data);
     } // Function createDoor()
@@ -105,7 +105,7 @@ export class SItemFactory {
      *
      * @param data    窗户数据
      * @return 窗户 item
-     */
+    */
     createWindow(data: Casement): SWindowItem {
         return new SWindowItem(null, data);
     } // Function createWindow()
@@ -115,7 +115,7 @@ export class SItemFactory {
      *
      * @param data    业务空间数据
      * @return 业务空间 item
-     */
+    */
     createZone(data: Zone): SZoneItem {
         return new SZoneItem(null, data);
     } // Function createZone()

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

@@ -58,7 +58,7 @@ export class SArrowItem extends SPolylineItem {
      * 绘制基本图形
      *
      * @param painter   绘制对象
-     */
+    */
     drawBaseLine(painter: SPainter): void {
         // 绘制基本图形
         if (this.lineStyle == SLineStyle.Dashed) {

+ 7 - 7
persagy-web-big/src/items/SIconTextItem.ts

@@ -236,7 +236,7 @@ export class SIconTextItem extends SObjectItem {
      *
      * @param parent  父类
      * @param data    锚点数据
-     */
+    */
     constructor(parent: SGraphItem | null, data?: Anchor[]) {
         super(parent);
         this.img.width = 32;
@@ -289,7 +289,7 @@ export class SIconTextItem extends SObjectItem {
 
     /**
      * 计算并移动锚点的位置
-     */
+    */
     private changeAnchorPoint(): void {
         // 判断是否有锚点
         if (this.anchorList.length) {
@@ -314,7 +314,7 @@ export class SIconTextItem extends SObjectItem {
      *
      * @param event   事件对象
      * @return 是否处理事件
-     */
+    */
     onMouseDown(event: SMouseEvent): boolean {
         if (this.status == SItemStatus.Normal) {
             return super.onMouseDown(event);
@@ -329,7 +329,7 @@ export class SIconTextItem extends SObjectItem {
      *
      * @param oldSize 改之前的大小
      * @param newSize 改之后大小
-     */
+    */
     onResize(oldSize: SSize, newSize: SSize): void {
         console.log(arguments);
     } // Function onResize()
@@ -339,7 +339,7 @@ export class SIconTextItem extends SObjectItem {
      *
      * @param event   鼠标事件
      * @return 是否处理事件
-     */
+    */
     onDoubleClick(event: SMouseEvent): boolean {
         // 如果位show状态 双击改对象则需改为编辑状态
         if (SItemStatus.Normal == this.status) {
@@ -357,7 +357,7 @@ export class SIconTextItem extends SObjectItem {
      * Item 对象边界区域
      *
      * @return 边界矩阵
-     */
+    */
     boundingRect(): SRect {
         let rect = this.img
             .boundingRect()
@@ -377,7 +377,7 @@ export class SIconTextItem extends SObjectItem {
      * Item 绘制操作
      *
      * @param painter   绘制对象
-     */
+    */
     onDraw(painter: SPainter): void {
         if (this.status == SItemStatus.Edit) {
             painter.pen.lineWidth = painter.toPx(1);

+ 19 - 19
persagy-web-big/src/items/SLineItem.ts

@@ -140,7 +140,7 @@ export class SLineItem extends SGraphItem {
      * 构造函数
      *
      * @param parent  父级
-     */
+    */
     constructor(parent: SGraphItem | null);
 
     /**
@@ -148,7 +148,7 @@ export class SLineItem extends SGraphItem {
      *
      * @param parent  父级
      * @param line    坐标集合
-     */
+    */
     constructor(parent: SGraphItem | null, line: SPoint[]);
 
     /**
@@ -156,7 +156,7 @@ export class SLineItem extends SGraphItem {
      *
      * @param parent  父级
      * @param point   第一个点坐标
-     */
+    */
     constructor(parent: SGraphItem | null, point: SPoint);
 
     /**
@@ -164,7 +164,7 @@ export class SLineItem extends SGraphItem {
      *
      * @param parent    父级
      * @param line      坐标集合|第一个点坐标
-     */
+    */
     constructor(parent: SGraphItem | null, line?: SPoint | SPoint[]) {
         super(parent);
         if (line) {
@@ -182,7 +182,7 @@ export class SLineItem extends SGraphItem {
      * 添加点至数组中
      *
      * @param p 添加的点
-     */
+    */
     private addPoint(p: SPoint): void {
         if (this.line.length < 2) {
             this.line.push(p);
@@ -202,7 +202,7 @@ export class SLineItem extends SGraphItem {
      *
      * @param event     事件参数
      * @return 是否处理事件
-     */
+    */
     onDoubleClick(event: SMouseEvent): boolean {
         if (this.status == SItemStatus.Normal) {
             this.status = SItemStatus.Edit;
@@ -220,7 +220,7 @@ export class SLineItem extends SGraphItem {
      *
      * @param event     鼠标事件
      * @return 是否处理事件
-     */
+    */
     onMouseDown(event: SMouseEvent): boolean {
         this.curIndex = -1;
         this.curPoint = null;
@@ -247,7 +247,7 @@ export class SLineItem extends SGraphItem {
      *
      * @param event     事件参数
      * @return 是否处理事件
-     */
+    */
     onMouseUp(event: SMouseEvent): boolean {
         if (this.status == SItemStatus.Edit) {
             if (this.curIndex > -1) {
@@ -277,7 +277,7 @@ export class SLineItem extends SGraphItem {
      *
      * @param event     事件参数
      * @return 是否处理事件
-     */
+    */
     onMouseMove(event: SMouseEvent): boolean {
         if (event.shiftKey) {
             event = this.compare(event);
@@ -304,7 +304,7 @@ export class SLineItem extends SGraphItem {
      * 获取点击点与 Point[] 中的点距离最近点
      *
      * @param p     鼠标点击点
-     */
+    */
     findNearestPoint(p: SPoint): void {
         let len = this.sceneDis;
         for (let i = 0; i < this.line.length; i++) {
@@ -327,7 +327,7 @@ export class SLineItem extends SGraphItem {
      *
      * @param SGraphCommand 相关命令类
      * @param any           对应传入参数
-     */
+    */
     protected recordAction(SGraphCommand: any, any: any[]): void {
         // 记录相关命令并推入堆栈中 todo
         const command = new SGraphCommand(this.scene, this, ...any);
@@ -339,7 +339,7 @@ export class SLineItem extends SGraphItem {
      *
      * @param x     x 坐标
      * @param y     y 坐标
-     */
+    */
     moveToOrigin(x: number, y: number): void {
         super.moveToOrigin(x, y);
         this.line = this.line.map(t => {
@@ -356,7 +356,7 @@ export class SLineItem extends SGraphItem {
      *
      * @param event     事件
      * @return 处理后的事件对象
-     */
+    */
     compare(event: SMouseEvent): SMouseEvent {
         if (this.line.length) {
             let last = new SPoint(event.x, event.y);
@@ -387,7 +387,7 @@ export class SLineItem extends SGraphItem {
      * @param x     x 坐标
      * @param y     y 坐标
      * @return 是否包含
-     */
+    */
     contains(x: number, y: number): boolean {
         if (this.line.length == 2) {
             let p = new SPoint(x, y);
@@ -404,7 +404,7 @@ export class SLineItem extends SGraphItem {
 
     /**
      * 撤销操作
-     */
+    */
     undo(): void {
         if (this.status != SItemStatus.Normal) {
             this.undoStack.undo();
@@ -413,7 +413,7 @@ export class SLineItem extends SGraphItem {
 
     /**
      * 重做操作
-     */
+    */
     redo(): void {
         if (this.status != SItemStatus.Normal) {
             this.undoStack.redo();
@@ -422,7 +422,7 @@ export class SLineItem extends SGraphItem {
 
     /**
      * 取消操作 item 事件
-     */
+    */
     cancelOperate(): void {
         if (this.status == SItemStatus.Create) {
             this.parent = null;
@@ -437,7 +437,7 @@ export class SLineItem extends SGraphItem {
      * Item 对象边界区域
      *
      * @return 边界区域
-     */
+    */
     boundingRect(): SRect {
         if (this.line.length) {
             this.minX = this.line[0].x;
@@ -474,7 +474,7 @@ export class SLineItem extends SGraphItem {
      * Item 绘制操作
      *
      * @param painter   绘制对象
-     */
+    */
     onDraw(painter: SPainter): void {
         this.sceneDis = painter.toPx(this.dis);
         painter.pen.lineWidth = painter.toPx(this.lineWidth);

+ 27 - 27
persagy-web-big/src/items/SPolygonItem.ts

@@ -82,7 +82,7 @@ export class SPolygonItem extends SGraphItem {
 
     /** 边框颜色 */
     _strokeColor: SColor = new SColor("#0091FF");
-    /**  画笔颜色 */
+    /** 画笔颜色 */
     get strokeColor(): SColor {
         return this._strokeColor;
     } // Get strokeColor
@@ -142,7 +142,7 @@ export class SPolygonItem extends SGraphItem {
      * 构造函数
      *
      * @param parent    指向父对象
-     */
+    */
     constructor(parent: SGraphItem | null) {
         super(parent);
     } // Constructor
@@ -157,7 +157,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) {
@@ -174,7 +174,7 @@ export class SPolygonItem extends SGraphItem {
      *
      * @param i   删除点所在的索引
      * @return 索引不在数组范围则返回 null
-     */
+    */
     deletePoint(i: number | null = null): SPoint | null {
         let point = null;
         if (i != null) {
@@ -205,7 +205,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) {
@@ -229,7 +229,7 @@ export class SPolygonItem extends SGraphItem {
      *
      * @param painter      绘制类
      * @param pointList    绘制多边形数组
-     */
+    */
     protected drawShowPolygon(painter: SPainter, pointList: SPoint[]): void {
         painter.save();
         painter.pen.lineCapStyle = SLineCapStyle.Square;
@@ -266,7 +266,7 @@ export class SPolygonItem extends SGraphItem {
      *
      * @param painter      绘制类
      * @param pointList    绘制多边形数组
-     */
+    */
     protected drawCreatePolygon(painter: SPainter, pointList: SPoint[]): void {
         painter.pen.lineCapStyle = SLineCapStyle.Square;
         painter.pen.color = this.strokeColor;
@@ -323,7 +323,7 @@ export class SPolygonItem extends SGraphItem {
      *
      * @param painter       绘制类
      * @param pointList    绘制多边形数组
-     */
+    */
     protected drawEditPolygon(painter: SPainter, pointList: SPoint[]): void {
         // 展示多边形
         painter.pen.lineCapStyle = SLineCapStyle.Square;
@@ -348,7 +348,7 @@ export class SPolygonItem extends SGraphItem {
      * 编辑状态操作多边形数组
      *
      * @param event    鼠标事件
-     */
+    */
     protected editPolygonPoint(event: SMouseEvent): void {
         //  判断是否为删除状态 isAlt = true为删除状态
         if (this.isAlt) {
@@ -467,7 +467,7 @@ export class SPolygonItem extends SGraphItem {
      *
      * @param	SGraphCommand   相关命令类
      * @param	any             对应传入参数
-     */
+    */
     protected recordAction(SGraphCommand: any, any: any[]): void {
         // 记录相关命令并推入堆栈中
         const sgraphcommand = new SGraphCommand(this.scene, this, ...any);
@@ -476,7 +476,7 @@ export class SPolygonItem extends SGraphItem {
 
     /**
      * 执行取消操作执行
-     */
+    */
     undo(): void {
         if (this.status == SItemStatus.Normal) {
             return;
@@ -486,7 +486,7 @@ export class SPolygonItem extends SGraphItem {
 
     /**
      * 执行重做操作执行
-     */
+    */
     redo(): void {
         if (this.status == SItemStatus.Normal) {
             return;
@@ -502,7 +502,7 @@ export class SPolygonItem extends SGraphItem {
      *
      * @param event   事件参数
      * @return 是否处理
-     */
+    */
     onDoubleClick(event: SMouseEvent): boolean {
         // 如果位show状态 双击改对象则需改为编辑状态
         if (SItemStatus.Normal == this.status) {
@@ -522,7 +522,7 @@ export class SPolygonItem extends SGraphItem {
      *
      * @param event     事件参数
      * @return 是否处理
-     */
+    */
 
     onKeyDown(event: KeyboardEvent): boolean {
         if (this.status == SItemStatus.Normal) {
@@ -553,7 +553,7 @@ export class SPolygonItem extends SGraphItem {
      *
      * @param event     事件参数
      * @return 是否处理
-     */
+    */
     onKeyUp(event: KeyboardEvent): void {
         if (this.status == SItemStatus.Edit) {
             if (event.key == "Alt") {
@@ -574,7 +574,7 @@ export class SPolygonItem extends SGraphItem {
      *
      * @param event     事件参数
      * @return 是否处理
-     */
+    */
     onMouseDown(event: SMouseEvent): boolean {
         if (event.shiftKey) {
             event = this.compare(event);
@@ -620,7 +620,7 @@ export class SPolygonItem extends SGraphItem {
      *
      * @param event     事件参数
      * @return 是否处理
-     */
+    */
     onMouseEnter(event: SMouseEvent): boolean {
         return true;
     } // Function onMouseEnter()
@@ -630,7 +630,7 @@ export class SPolygonItem extends SGraphItem {
      *
      * @param event     事件参数
      * @return 是否处理
-     */
+    */
     onMouseLeave(event: SMouseEvent): boolean {
         return true;
     } // Function onMouseLeave()
@@ -640,7 +640,7 @@ export class SPolygonItem extends SGraphItem {
      *
      * @param event     事件参数
      * @return 是否处理
-     */
+    */
     onMouseMove(event: SMouseEvent): boolean {
         if (event.shiftKey) {
             event = this.compare(event);
@@ -672,7 +672,7 @@ export class SPolygonItem extends SGraphItem {
      *
      * @param event     事件
      * @return 处理后的事件
-     */
+    */
     compare(event: SMouseEvent): SMouseEvent {
         if (this.pointList.length) {
             let last = new SPoint(event.x, event.y);
@@ -701,7 +701,7 @@ export class SPolygonItem extends SGraphItem {
      *
      * @param event     事件参数
      * @return 是否处理
-     */
+    */
     onMouseUp(event: SMouseEvent): boolean {
         if (this.status == SItemStatus.Edit) {
             if (-1 != this.curIndex) {
@@ -729,7 +729,7 @@ export class SPolygonItem extends SGraphItem {
      *
      * @param x   x 坐标
      * @param y   y 坐标
-     */
+    */
     moveToOrigin(x: number, y: number): void {
         super.moveToOrigin(x, y);
         this.pointList = this.pointList.map(t => {
@@ -746,14 +746,14 @@ export class SPolygonItem extends SGraphItem {
      *
      * @param event     事件参数
      * @return 是否处理
-     */
+    */
     onResize(event: SMouseEvent): boolean {
         return true;
     } // Function onResize()
 
     /**
      * 取消操作
-     */
+    */
     cancelOperate(): void {
         // 当状态为展示状态
         if (this.status == SItemStatus.Create) {
@@ -771,7 +771,7 @@ export class SPolygonItem extends SGraphItem {
      * Item 对象边界区域
      *
      * @return 边界区域
-     */
+    */
     boundingRect(): SRect {
         if (this.pointList.length) {
             this.minX = this.pointList[0].x;
@@ -814,7 +814,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)) {
@@ -828,7 +828,7 @@ export class SPolygonItem extends SGraphItem {
      * Item 绘制操作
      *
      * @param painter   绘制对象
-     */
+    */
     onDraw(painter: SPainter): void {
         this.scenceLen = painter.toPx(this.len);
         // 当状态为展示状态

+ 23 - 23
persagy-web-big/src/items/SPolylineItem.ts

@@ -121,7 +121,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param parent    父级
      * @param list      坐标集合
-     */
+    */
     constructor(parent: null | SGraphItem, list: SPoint[]);
 
     /**
@@ -129,7 +129,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param parent    父级
      * @param list      第一个坐标
-     */
+    */
     constructor(parent: null | SGraphItem, list: SPoint);
 
     /**
@@ -137,7 +137,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param parent    父级
      * @param list      第一个坐标|坐标集合
-     */
+    */
     constructor(parent: null | SGraphItem, list: SPoint | SPoint[]) {
         super(parent);
         if (list instanceof SPoint) {
@@ -152,7 +152,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param p         添加的点
      * @param index     添加到的索引
-     */
+    */
     private addPoint(p: SPoint, index?: number): void {
         if (index && this.canHandle(index)) {
             this.pointList.splice(index, 0, p);
@@ -174,7 +174,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param index     要添加到的索引
      * @return 是否可添加
-     */
+    */
     private canHandle(index: number): boolean {
         return index >= 0 && index <= this.pointList.length;
     } // Function canHandle()
@@ -183,7 +183,7 @@ export class SPolylineItem extends SGraphItem {
      * 根据索引删除点
      *
      * @param index     删除点
-     */
+    */
     deletePoint(index: number): void {
         if (this.canHandle(index) && this.pointList.length > 2) {
             const p = new SPoint(
@@ -207,7 +207,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param event     鼠标事件
      * @return 是否处理事件
-     */
+    */
     onMouseDown(event: SMouseEvent): boolean {
         this.curIndex = -1;
         this.curPoint = null;
@@ -247,7 +247,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param event     鼠标事件
      * @return 是否处理事件
-     */
+    */
     onMouseMove(event: SMouseEvent): boolean {
         if (event.shiftKey) {
             event = this.compare(event);
@@ -283,7 +283,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param event     鼠标事件
      * @return 是否处理事件
-     */
+    */
     onMouseUp(event: SMouseEvent): boolean {
         if (this.status == SItemStatus.Edit) {
             if (this.curIndex > -1) {
@@ -311,7 +311,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param event     事件参数
      * @return 是否处理
-     */
+    */
     onDoubleClick(event: SMouseEvent): boolean {
         if (this.status == SItemStatus.Normal) {
             this.status = SItemStatus.Edit;
@@ -335,7 +335,7 @@ export class SPolylineItem extends SGraphItem {
      * 键盘按键弹起事件
      *
      * @param event     事件参数
-     */
+    */
     onKeyUp(event: KeyboardEvent): void {
         if (event.keyCode == SKeyCode.Enter) {
             if (this.pointList.length > 1) {
@@ -362,7 +362,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param x     x 坐标
      * @param y     y 坐标
-     */
+    */
     moveToOrigin(x: number, y: number): void {
         super.moveToOrigin(x, y);
         this.pointList = this.pointList.map(t => {
@@ -378,7 +378,7 @@ export class SPolylineItem extends SGraphItem {
      * 获取点击点与点集中距离最近点
      *
      * @param p     鼠标点击点
-     */
+    */
     findNearestPoint(p: SPoint): void {
         let len = this.sceneDis;
         for (let i = 0; i < this.pointList.length; i++) {
@@ -403,7 +403,7 @@ export class SPolylineItem extends SGraphItem {
      * 计算增加点的位置
      *
      * @param p     鼠标点击点
-     */
+    */
     findAddPos(p: SPoint): void {
         let len = SMathUtil.pointToLine(
                 p,
@@ -433,7 +433,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param event     事件
      * @return 事件对象
-     */
+    */
     compare(event: SMouseEvent): SMouseEvent {
         if (this.pointList.length) {
             let last = new SPoint(event.x, event.y);
@@ -462,7 +462,7 @@ export class SPolylineItem extends SGraphItem {
      *
      * @param SGraphCommand     相关命令类
      * @param any               对应传入参数
-     */
+    */
     protected recordAction(SGraphCommand: any, any: any[]): void {
         // 记录相关命令并推入堆栈中
         const command = new SGraphCommand(this.scene, this, ...any);
@@ -473,7 +473,7 @@ export class SPolylineItem extends SGraphItem {
      * Item 对象边界区域
      *
      * @return 外接矩阵
-     */
+    */
     boundingRect(): SRect {
         if (this.pointList.length) {
             this.minX = this.pointList[0].x;
@@ -515,7 +515,7 @@ export class SPolylineItem extends SGraphItem {
      * @param x     x 坐标
      * @param y     y 坐标
      * @return 是否在区域内
-     */
+    */
     contains(x: number, y: number): boolean {
         let p = new SPoint(x, y);
         for (let i = 1; i < this.pointList.length; i++) {
@@ -537,7 +537,7 @@ export class SPolylineItem extends SGraphItem {
 
     /**
      * 撤销操作
-     */
+    */
     undo(): void {
         if (this._status != SItemStatus.Normal) {
             this.undoStack.undo();
@@ -546,7 +546,7 @@ export class SPolylineItem extends SGraphItem {
 
     /**
      * 重做操作
-     */
+    */
     redo(): void {
         if (this._status != SItemStatus.Normal) {
             this.undoStack.redo();
@@ -555,7 +555,7 @@ export class SPolylineItem extends SGraphItem {
 
     /**
      * 取消操作执行
-     */
+    */
     cancelOperate(): void {
         if (this.status == SItemStatus.Create) {
             this.parent = null;
@@ -570,7 +570,7 @@ export class SPolylineItem extends SGraphItem {
      * 绘制基本图形
      *
      * @param painter   绘制对象
-     */
+    */
     drawBaseLine(painter: SPainter): void {
         // 绘制基本图形
         if (this.lineStyle == SLineStyle.Dashed) {
@@ -593,7 +593,7 @@ export class SPolylineItem extends SGraphItem {
      * Item 绘制操作
      *
      * @param painter   绘制对象
-     */
+    */
     onDraw(painter: SPainter): void {
         // 缓存场景长度
         this.sceneDis = painter.toPx(this.dis);

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

@@ -45,7 +45,7 @@ export class SRectSelectItem extends SGraphItem {
      *
      * @param parent    指向父对象
      * @param point     起点数据
-     */
+    */
     constructor(parent: SGraphItem | null, point: SPoint) {
         super(parent);
         this.startPoint = point;
@@ -58,7 +58,7 @@ export class SRectSelectItem extends SGraphItem {
      * Item 对象边界区域
      *
      * @return 边界区域
-     */
+    */
     boundingRect(): SRect {
         return new SRect(this.startPoint, this.endPoint);
     } // Function boundingRect()
@@ -68,7 +68,7 @@ export class SRectSelectItem extends SGraphItem {
      *
      * @param event     事件参数
      * @return 是否处理
-     */
+    */
     onMouseMove(event: SMouseEvent): boolean {
         this.endPoint.x = event.x;
         this.endPoint.y = event.y;
@@ -80,7 +80,7 @@ export class SRectSelectItem extends SGraphItem {
      * Item 绘制操作
      *
      * @param painter   绘制对象
-     */
+    */
     onDraw(painter: SPainter): void {
         painter.pen.lineWidth = painter.toPx(2);
         painter.pen.color = ItemColor.rectSelectOutColor;

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

@@ -47,7 +47,7 @@ export class SBoardItem extends SGraphItem {
      *
      * @param parent    指向父对象
      * @param data      建筑轮廓数据
-     */
+    */
     constructor(parent: SGraphItem | null, data: Zone) {
         super(parent);
         this.data = data;
@@ -83,7 +83,7 @@ export class SBoardItem extends SGraphItem {
      * @param x     x 坐标
      * @param y     y 坐标
      * @return 是否在区域内
-     */
+    */
     contains(x: number, y: number): boolean {
         return false;
     } // Function contains()
@@ -92,7 +92,7 @@ export class SBoardItem extends SGraphItem {
      * Item 绘制操作
      *
      * @param painter   painter 对象
-     */
+    */
     onDraw(painter: SPainter): void {
         painter.pen.lineWidth = painter.toPx(1);
         painter.brush.color = ItemColor.spaceColor;

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

@@ -42,7 +42,7 @@ export class SColumnItem extends SGraphPolyGroupItem {
      *
      * @param parent    指向父对象
      * @param data      柱子数据
-     */
+    */
     constructor(parent: SGraphItem | null, data: Column) {
         const style = {
             default: {

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

@@ -62,7 +62,7 @@ export class SDoorItem extends SGraphItem {
      *
      * @param parent    指向父对象
      * @param data      门数据
-     */
+    */
     constructor(parent: SGraphItem | null, data: Door) {
         super(parent);
         this.data = data;
@@ -128,7 +128,7 @@ export class SDoorItem extends SGraphItem {
      * Item 对象边界区域
      *
      * @return 边界矩形
-     */
+    */
     boundingRect(): SRect {
         return new SRect(0, 0, this.r, this.r);
     } // Function boundingRect()
@@ -137,7 +137,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);

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

@@ -65,7 +65,7 @@ export class SHighlightItem extends SGraphItem {
      * 构造函数
      *
      * @param parent  指向父对象
-     */
+    */
     constructor(parent: SGraphItem | null) {
         super(parent);
         this.visible = false;
@@ -76,7 +76,7 @@ export class SHighlightItem extends SGraphItem {
      * Item 对象边界区域
      *
      * @return	边界矩形
-     */
+    */
     boundingRect(): SRect {
         return new SRect(this.point.x, this.point.y, 10, 10);
     } // Function boundingRect()
@@ -85,7 +85,7 @@ export class SHighlightItem extends SGraphItem {
      * Item绘制操作
      *
      * @param painter   绘制对象
-     */
+    */
     onDraw(painter: SPainter): void {
         if (this.type == 2) {
             painter.pen.color = ItemColor.highLightLineColor;

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

@@ -96,7 +96,7 @@ export class SSpaceItem extends SGraphAreaGroupItem {
      *
      * @param parent    指向父对象
      * @param data      空间数据
-     */
+    */
     constructor(parent: SGraphItem | null, data: Space) {
         super(parent, {
             outline: [
@@ -139,7 +139,7 @@ export class SSpaceItem extends SGraphAreaGroupItem {
      * 绘制前设置绘制样式
      *
      * @return 当前状态
-     */
+    */
     setStyle(): string {
         let status = "default";
         if (this.style) {
@@ -160,7 +160,7 @@ export class SSpaceItem extends SGraphAreaGroupItem {
      * Item 绘制操作
      *
      * @param painter   绘制对象
-     */
+    */
     onDraw(painter: SPainter): void {
         super.onDraw(painter);
         if (this.showBaseName) {

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

@@ -43,21 +43,21 @@ import { SGraphItem } from "@persagy-web/graph";
  * @deprecated 万达
  */
 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;
@@ -66,7 +66,7 @@ export class SSpaceItems extends SGraphItem {
         this._highLightFlag = value;
         this.update();
     } // Set highLightFlag
-    /** 是否显示名字  */
+    /** 是否显示名字 */
     private _showBaseName: boolean = false;
     get showBaseName(): boolean {
         return this._showBaseName;
@@ -75,7 +75,7 @@ export class SSpaceItems extends SGraphItem {
         this._showBaseName = value;
         this.update();
     } // Set showBaseName
-    /** 是否名字大小  */
+    /** 是否名字大小 */
     private _nameSize: number = 10;
     get nameSize(): number {
         return this._nameSize;
@@ -84,7 +84,7 @@ export class SSpaceItems extends SGraphItem {
         this._nameSize = value;
         this.update();
     } // Set nameSize
-    /** 名字是否缩放  */
+    /** 名字是否缩放 */
     private _nameTransform: boolean = false;
     get nameTransform(): boolean {
         return this._nameTransform;
@@ -93,7 +93,7 @@ export class SSpaceItems extends SGraphItem {
         this._nameTransform = value;
         this.update();
     } // Set nameTransform
-    /** 名字颜色    */
+    /** 名字颜色   */
     private _nameColor: string = "#000000";
     get nameColor(): string {
         return this._nameColor;
@@ -108,7 +108,7 @@ export class SSpaceItems extends SGraphItem {
      *
      * @param parent    指向父对象
      * @param data      空间数据
-     */
+    */
     constructor(parent: SGraphItem | null, data: Space) {
         super(parent);
         this.data = data;
@@ -150,7 +150,7 @@ export class SSpaceItems extends SGraphItem {
      * Item对象边界区域
      *
      * @return SRect
-     */
+    */
     boundingRect(): SRect {
         return new SRect(
             this.minX,
@@ -165,7 +165,7 @@ export class SSpaceItems extends SGraphItem {
     //  *
     //  * @param	event         事件参数
     //  * @return	boolean
-    //  */
+    // */
     // onMouseDown(event: SMouseEvent): boolean {
     //     console.log("spaceDown");
     //     this.$emit("click", event);
@@ -176,7 +176,7 @@ export class SSpaceItems extends SGraphItem {
     //  * 鼠标移动事件
     //  *
     //  * @param event 事件参数
-    //  */
+    // */
     // onMouseMove(event: SMouseEvent): boolean {
     //     return false;
     // } // Function onMouseMove()
@@ -186,7 +186,7 @@ export class SSpaceItems extends SGraphItem {
     //  *
     //  * @param	event         事件参数
     //  * @return	boolean
-    //  */
+    // */
     // onMouseUp(event: SMouseEvent): boolean {
     //     console.log("spaceUp");
     //     return false;
@@ -197,7 +197,7 @@ export class SSpaceItems extends SGraphItem {
      *
      * @param x
      * @param y
-     */
+    */
     contains(x: number, y: number): boolean {
         let arr = this.pointArr;
         if (arr.length < 1 || !SPolygonUtil.pointIn(x, y, arr[0])) {
@@ -216,7 +216,7 @@ export class SSpaceItems extends SGraphItem {
      * Item绘制操作
      *
      * @param painter    绘制对象
-     */
+    */
     onDraw(painter: SPainter): void {
         painter.pen.color = ItemColor.spaceBorderColor;
         if (this.selected) {

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

@@ -53,7 +53,7 @@ export class SVirtualWallItem extends SGraphItem {
      *
      * @param parent    指向父对象
      * @param data      虚拟墙数据
-     */
+    */
     constructor(parent: SGraphItem | null, data: VirtualWall) {
         super(parent);
         this.data = data;
@@ -92,7 +92,7 @@ export class SVirtualWallItem extends SGraphItem {
      * Item 对象边界区域
      *
      * @return 边界矩形
-     */
+    */
     boundingRect(): SRect {
         return new SRect(
             this.minX,
@@ -105,8 +105,8 @@ export class SVirtualWallItem extends SGraphItem {
     /**
      * Item 绘制操作
      *
-     * @param painter   painter对象
-     */
+     * @param painter   绘制对象
+    */
     onDraw(painter: SPainter): void {
         painter.pen.lineWidth = painter.toPx(1);
         painter.pen.color = ItemColor.virtualWallColor;

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

@@ -43,7 +43,7 @@ export class SWallItem extends SGraphAreaGroupItem {
      *
      * @param parent    指向父对象
      * @param data      墙数据
-     */
+    */
     constructor(parent: SGraphItem | null, data: Wall) {
         const style = {
             default: {

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

@@ -58,7 +58,7 @@ export class SWallItems extends SGraphItem {
      *
      * @param parent    指向父对象
      * @param data      墙数据
-     */
+    */
     constructor(parent: SGraphItem | null, data: Wall) {
         super(parent);
         this.data = data;
@@ -127,7 +127,7 @@ export class SWallItems extends SGraphItem {
      * Item对象边界区域
      *
      * @return SRect
-     */
+    */
     boundingRect(): SRect {
         return new SRect(
             this.minX,
@@ -141,7 +141,7 @@ export class SWallItems extends SGraphItem {
      * Item绘制操作
      *
      * @param painter    绘制对象
-     */
+    */
     onDraw(painter: SPainter): void {
         painter.pen.color = ItemColor.wallColor;
         painter.pen.lineWidth = painter.toPx(1);

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

@@ -54,7 +54,7 @@ export class SWindowItem extends SGraphItem {
      *
      * @param parent    指向父对象
      * @param data      窗户数据
-     */
+    */
     constructor(parent: SGraphItem | null, data: Casement) {
         super(parent);
         this.data = data;
@@ -86,7 +86,7 @@ export class SWindowItem extends SGraphItem {
      * Item 对象边界区域
      *
      * @return 边界矩形
-     */
+    */
     boundingRect(): SRect {
         return new SRect(
             this.minX,
@@ -100,7 +100,7 @@ export class SWindowItem extends SGraphItem {
      * Item 绘制操作
      *
      * @param painter   绘制对象
-     */
+    */
     onDraw(painter: SPainter): void {
         painter.pen.color = ItemColor.windowColor;
         painter.pen.lineWidth = painter.toPx(1);

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

@@ -75,7 +75,7 @@ export class SZoneItem extends SGraphAreaGroupItem {
      *
      * @param parent    指向父对象
      * @param data      空间数据
-     */
+    */
     constructor(parent: SGraphItem | null, data: Zone) {
         super(parent, {
             outline: data.OutLine.map((t): Point[][] => {
@@ -133,7 +133,7 @@ export class SZoneItem extends SGraphAreaGroupItem {
      *
      * @param event     事件参数
      * @return 是否处理事件
-     */
+    */
     onMouseDown(event: SMouseEvent): boolean {
         if (this.selectable) {
             this.selected = !this.selected;
@@ -148,7 +148,7 @@ export class SZoneItem extends SGraphAreaGroupItem {
      *
      * @param event     事件参数
      * @return 是否处理事件
-     */
+    */
     onMouseUp(event: SMouseEvent): boolean {
         return false;
     } // Function onMouseUp()
@@ -157,7 +157,7 @@ export class SZoneItem extends SGraphAreaGroupItem {
      * 绘制前设置绘制样式
      *
      * @return 当前状态
-     */
+    */
     setStyle(): string {
         let status = "default";
         if (this.style) {
@@ -187,7 +187,7 @@ export class SZoneItem extends SGraphAreaGroupItem {
      * Item 绘制操作
      *
      * @param painter   绘制对象
-     */
+    */
     onDraw(painter: SPainter): void {
         super.onDraw(painter);
         painter.brush.color = SColor.Black;

+ 7 - 7
persagy-web-big/src/parser/SFloorParser.ts

@@ -62,7 +62,7 @@ export class SFloorParser extends SParser {
      * 解析数据
      *
      * @param data  楼层数据
-     */
+    */
     parseData(data: FloorData): void {
         if (data.Walls) {
             data.Walls.forEach((t: Wall): void => {
@@ -105,7 +105,7 @@ export class SFloorParser extends SParser {
      * 添加墙至场景中
      *
      * @param t     墙数据
-     */
+    */
     private addWall(t: Wall): void {
         let item = this.factory.createWall(t);
         this.wallList.push(item);
@@ -115,7 +115,7 @@ export class SFloorParser extends SParser {
      * 添加柱子至场景中
      *
      * @param t   柱子数据
-     */
+    */
     private addColumn(t: Column): void {
         let item = this.factory.createColumn(t);
         this.columnList.push(item);
@@ -125,7 +125,7 @@ export class SFloorParser extends SParser {
      * 添加窗户至场景中
      *
      * @param t     窗户数据
-     */
+    */
     private addCasement(t: Casement): void {
         let item = this.factory.createWindow(t);
         this.casementList.push(item);
@@ -135,7 +135,7 @@ export class SFloorParser extends SParser {
      * 添加虚拟墙至场景中
      *
      * @param t     虚拟墙数据
-     */
+    */
     private addVirtualWall(t: VirtualWall): void {
         let item = this.factory.createVirtualWall(t);
         this.virtualWallList.push(item);
@@ -145,7 +145,7 @@ export class SFloorParser extends SParser {
      * 添加门至场景中
      *
      * @param t     门数据
-     */
+    */
     private addDoor(t: Door): void {
         let item = this.factory.createDoor(t);
         this.doorList.push(item);
@@ -155,7 +155,7 @@ export class SFloorParser extends SParser {
      * 添加空间至场景中
      *
      * @param t     空间数据
-     */
+    */
     private addSpace(t: Space): void {
         let item = this.factory.createSpace(t);
         this.spaceList.push(item);

+ 1 - 1
persagy-web-big/src/parser/SParser.ts

@@ -39,7 +39,7 @@ export abstract class SParser {
      * 构造函数
      *
      * @param factory   解析工厂
-     */
+    */
     constructor(factory: SItemFactory | null = null) {
         if (factory) {
             this.factory = factory;

+ 4 - 4
persagy-web-big/src/parser/STopologyParser.ts

@@ -47,7 +47,7 @@ export class STopologyParser extends SParser {
      * 解析数据
      *
      * @param data  楼层数据
-     */
+    */
     parseData(data: TopologyData): void {
         if (data.Marks) {
             data.Marks.forEach((t: MarkerTopo): void => {
@@ -70,16 +70,16 @@ export class STopologyParser extends SParser {
 
     /**
      * 添加标识对象
-     */
+    */
     private addMarks(t: MarkerTopo): void {} // Function addMarks
 
     /**
      * 添加关系对象
-     */
+    */
     private addRelations(t: Relation): void {} // Function addRelations
 
     /**
      * 添加节点对象
-     */
+    */
     private addNodes(t: Node): void {} // Function addNodes
 } // class STopologyParser

+ 2 - 2
persagy-web-big/src/parser/SZoneParser.ts

@@ -41,7 +41,7 @@ export class SZoneParser extends SParser {
      * 解析业务空间数据
      *
      * @param data  业务空间数据
-     */
+    */
     parseData(data: Zone[]): void {
         if (data && data.length) {
             data.forEach((z): void => this.addZone(z));
@@ -52,7 +52,7 @@ export class SZoneParser extends SParser {
      * 添加业务空间至场景中
      *
      * @param z     业务空间数据
-     */
+    */
     private addZone(z: Zone): void {
         let item = this.factory.createZone(z);
         this.zoneList.push(item);

+ 10 - 10
persagy-web-big/src/utils/SMathUtil.ts

@@ -46,7 +46,7 @@ export class SMathUtil {
      * @param x2    点 2 的 x 坐标
      * @param y2    点 2 的 y 坐标
      * @return 距离
-     */
+    */
     static pointDistance(
         x1: number,
         y1: number,
@@ -62,7 +62,7 @@ export class SMathUtil {
      * @param p     第一个点
      * @param arr   点集
      * @return 距离,点坐标
-     */
+    */
     static getMinDisPoint(p: SPoint, arr: Point[]): MinDis | null {
         if (!arr.length) {
             return null;
@@ -103,7 +103,7 @@ export class SMathUtil {
      * @param p     点
      * @param l     线段
      * @return 距离
-     */
+    */
     static pointToLine(p: SPoint, l: SLine): PointToLine {
         let d = {
             MinDis: Number.MAX_SAFE_INTEGER,
@@ -154,7 +154,7 @@ export class SMathUtil {
      * @param p     第一个点
      * @param arr   点集
      * @return 距离,点坐标
-     */
+    */
     static getMinDisLine(p: SPoint, arr: Point[]): PointToLine | null {
         if (arr.length < 2) {
             return null;
@@ -200,7 +200,7 @@ export class SMathUtil {
      * @param rect1     矩形1
      * @param rect2     矩形2
      * @return 是否有交集
-     */
+    */
     static rectIntersection(rect1: SRect, rect2: SRect): boolean {
         let minX = rect1.x < rect2.x ? rect1.x : rect2.x;
         let minY = rect1.y < rect2.y ? rect1.y : rect2.y;
@@ -218,7 +218,7 @@ export class SMathUtil {
      * @param line1     线段1
      * @param line2     线段2
      * @return 交点 null 平行但不重合 'repeat' 重合
-     */
+    */
     static lineIntersection(
         line1: SLine,
         line2: SLine
@@ -251,7 +251,7 @@ export class SMathUtil {
      *
      * @param SP    点数组
      * @return 点二维数组
-     */
+    */
     static transferToArray(SP: SPoint[]): number[][] {
         return SP.map((t): number[] =>([t.x, t.y]));
     } // Function transferToArray()
@@ -261,7 +261,7 @@ export class SMathUtil {
      *
      * @param arr 点二维数组
      * @return 点数组
-     */
+    */
     static transferToSPoint(arr: number[][]): SPoint[] {
         return arr.map((t): SPoint => new SPoint(t[0], t[1]));
     } // Function transferToSPoint()
@@ -271,7 +271,7 @@ export class SMathUtil {
      *
      * @param array     三维数组描述轮廓
      * @return outline 列表
-     */
+    */
     static getIntersectInArray(array: number[][][]): Outline[] {
         let outlineList: Outline[] = [];
         if (!array.length) {
@@ -338,7 +338,7 @@ export class SMathUtil {
      *
      * @param arr   轮廓线
      * @return 面积(毫米)
-     */
+    */
     static calculateArea(arr: SPoint[]): number {
         let sum = 0;
         let n = arr.length;

+ 5 - 5
persagy-web-draw/src/SBrush.ts

@@ -58,35 +58,35 @@ export class SBrush {
 
     /**
      * 构造函数
-     */
+    */
     constructor();
 
     /**
      * 构造函数
      *
      * @param brush     画刷
-     */
+    */
     constructor(brush: SBrush);
 
     /**
      * 构造函数
      *
      * @param color     颜色
-     */
+    */
     constructor(color: SColor);
 
     /**
      * 构造函数
      *
      * @param gradient    过渡
-     */
+    */
     constructor(gradient: SGradient);
 
     /**
      * 构造函数(重载实现)
      *
      * @param brush     画笔
-     */
+    */
     constructor(brush?: SColor | SGradient | SBrush) {
         if (brush == undefined) {
             return;

+ 29 - 29
persagy-web-draw/src/SCanvasView.ts

@@ -122,7 +122,7 @@ export class SCanvasView extends SObject {
      * 构造函数
      *
      * @param id      画布对象 ID
-     */
+    */
     constructor(id: string) {
         super();
         this.canvasView = document.getElementById(id) as HTMLCanvasElement;
@@ -133,7 +133,7 @@ export class SCanvasView extends SObject {
 
     /**
      * 更新视图
-     */
+    */
     update(): void {
         this._needDraw = true;
     } // Function update()
@@ -143,7 +143,7 @@ export class SCanvasView extends SObject {
      *
      * @param name    名称
      * @param type    图像类型
-     */
+    */
     saveImage(name: string, type: string): void {
         let url = this.canvasView.toDataURL(`image/${type}`);
         SNetUtil.downLoad(name, url);
@@ -153,7 +153,7 @@ export class SCanvasView extends SObject {
      * 图像的 URL
      *
      * @param type    图像类型
-     */
+    */
     imageUrl(type: string): string {
         return this.canvasView.toDataURL(`image/${type}`);
     } // Function imageUrl()
@@ -162,7 +162,7 @@ export class SCanvasView extends SObject {
      * 视图内容保存为 SVG 文件
      *
      * @param name    文件名
-     */
+    */
     saveSvg(name: string): void {
         let url = URL.createObjectURL(
             new Blob([this.svgData()], { type: "text/xml,charset=UTF-8" })
@@ -174,7 +174,7 @@ export class SCanvasView extends SObject {
      * 视图 SVG 图形的数据
      *
      * @return URL 地址
-     */
+    */
     svgData(): string {
         let engine = new SSvgPaintEngine(this.width, this.height);
         let painter = new SPainter(engine);
@@ -188,7 +188,7 @@ export class SCanvasView extends SObject {
      * @param zoom        缩放比例
      * @param x0          缩放计算的中心点 X 坐标
      * @param y0          缩放计算的中心点 Y 坐标
-     */
+    */
     scaleByPoint(zoom: number, x0: number, y0: number): void {
         if (!this.scalable) {
             return;
@@ -197,7 +197,7 @@ export class SCanvasView extends SObject {
         let z = zoom;
         /**
          * 缩放比例在最小比例和最大比例范围内
-         */
+        */
         if (this.scale * zoom >= this.maxScale) {
             z = this.maxScale / this.scale;
             this.scale = this.maxScale;
@@ -216,7 +216,7 @@ export class SCanvasView extends SObject {
     //
     /**
      * 循环
-     */
+    */
     protected loop(): void {
         /** painter 对象 */
         let ctx = this.canvas;
@@ -232,28 +232,28 @@ export class SCanvasView extends SObject {
      * 绘制视图
      *
      * @param painter     painter 对象
-     */
+    */
     protected onDraw(painter: SPainter): void {} // Function onDraw()
 
     /**
      * 鼠标单击事件
      *
      * @param event       事件参数
-     */
+    */
     protected onClick(event: MouseEvent): void {} // Function onClick()
 
     /**
      * 鼠标双击事件
      *
      * @param event       事件参数
-     */
+    */
     protected onDoubleClick(event: MouseEvent): void {} // Function onDoubleClick()
 
     /**
      * 鼠标按下事件
      *
      * @param event       事件参数
-     */
+    */
     protected onMouseDown(event: MouseEvent): void {
         let se = new SMouseEvent(event);
         if (se.buttons & SMouseButton.MidButton) {
@@ -266,7 +266,7 @@ export class SCanvasView extends SObject {
      * 鼠标移动事件
      *
      * @param event       事件参数
-     */
+    */
     protected onMouseMove(event: MouseEvent): void {
         // 如果可以移动
         if (this.moveable) {
@@ -287,21 +287,21 @@ export class SCanvasView extends SObject {
      * 鼠标松开事件
      *
      * @param event       事件参数
-     */
+    */
     protected onMouseUp(event: MouseEvent): void {} // Function onMouseUp()
 
     /**
      * 上下文菜单事件
      *
      * @param event       事件参数
-     */
+    */
     protected onContextMenu(event: MouseEvent): void {} // Function onContextMenu()
 
     /**
      * 鼠标滚轮事件
      *
      * @param event       事件参数
-     */
+    */
     protected onMouseWheel(event: WheelEvent): void {
         if (event.deltaY < 0) {
             this.scaleByPoint(this.wheelZoom, event.offsetX, event.offsetY);
@@ -314,28 +314,28 @@ export class SCanvasView extends SObject {
      * 按键按下事件
      *
      * @param event       事件参数
-     */
+    */
     protected onKeyDown(event: KeyboardEvent): void {} // Function onKeydown()
 
     /**
      * 按键press事件
      *
      * @param event       事件参数
-     */
+    */
     protected onKeyPress(event: KeyboardEvent): void {} // Function onKeypress()
 
     /**
      * 按键松开事件
      *
      * @param event       事件参数
-     */
+    */
     protected onKeyUp(event: KeyboardEvent): void {} // Function onKeyup()
 
     /**
      * 开始触摸事件
      *
      * @param event       事件参数
-     */
+    */
     protected onTouchStart(event: TouchEvent): void {
         let touches = event.touches;
         if (touches.length == 1) {
@@ -352,7 +352,7 @@ export class SCanvasView extends SObject {
      * 触摸移动事件
      *
      * @param event       事件参数
-     */
+    */
     protected onTouchMove(event: TouchEvent): void {
         let touches = event.touches;
         if (touches.length == 1) {
@@ -370,7 +370,7 @@ export class SCanvasView extends SObject {
      * 结束触摸事件
      *
      * @param event       事件参数
-     */
+    */
     protected onTouchEnd(event: TouchEvent): void {
         this._touchState = STouchState.None;
     } // Function onTouchEnd()
@@ -379,14 +379,14 @@ export class SCanvasView extends SObject {
      * View大小变更事件
      *
      * @param event       事件参数
-     */
+    */
     protected onResize(event: UIEvent): void {} // Function onClick()
 
     /**
      * 绑定事件
      *
      * @param element     要绑定事件的元素
-     */
+    */
     private bindEvent(element: HTMLElement): void {
         // 绑定鼠标事件
         element.onclick = this.onClick.bind(this);
@@ -415,7 +415,7 @@ export class SCanvasView extends SObject {
      * 启动动画帧(即指定时间执行回调函数)
      *
      * @param callback        回调函数
-     */
+    */
     private requestAnimationFrame(callback: FrameRequestCallback): number {
         let currTime = new Date().getTime();
         let timeToCall = Math.max(0, 16 - (currTime - this._lastFrameTime));
@@ -430,7 +430,7 @@ export class SCanvasView extends SObject {
      * 缩放视图
      *
      * @param event       触摸事件
-     */
+    */
     private viewZoom(event: TouchEvent): boolean {
         if (this._touchState == STouchState.Zoom) {
             // 获取两点的距离
@@ -454,7 +454,7 @@ export class SCanvasView extends SObject {
      *
      * @param event       触摸事件
      * @return 两手指之间的距离
-     */
+    */
     private getDistance(event: TouchEvent): number {
         if (event.touches.length < 2) {
             return 0;
@@ -470,7 +470,7 @@ export class SCanvasView extends SObject {
      *
      * @param event     触摸事件
      * @return 得到视图的 x 坐标中点
-     */
+    */
     private getMiddlePoint(event: TouchEvent): SPoint {
         return new SPoint(
             (event.touches[0].clientX + event.touches[1].clientX) / 2,

+ 33 - 15
persagy-web-draw/src/SColor.ts

@@ -32,46 +32,64 @@ import { SStringUtil } from "@persagy-web/base";
  * @author 庞利祥 <sybotan@126.com>
  */
 export class SColor {
+    /** 透明色 */
     static readonly Transparent = new SColor("#00000000");
+    /** 黑色 */
     static readonly Black = new SColor("#000000");
+    /** 深蓝色 */
     static readonly DarkBlue = new SColor("#000080");
+    /** 蓝色 */
     static readonly Blue = new SColor("#0000FF");
+    /** 深绿色 */
     static readonly DarkGreen = new SColor("#008000");
+    /** 绿色 */
     static readonly Green = new SColor("#00FF00");
+    /** 深青色 */
     static readonly DarkCyan = new SColor("#008080");
+    /** 青色 */
     static readonly Cyan = new SColor("#00FFFF");
+    /** 深红色 */
     static readonly DarkRed = new SColor("#800000");
+    /** 红色 */
     static readonly Red = new SColor("#FF0000");
+    /** 深洋红色 */
     static readonly DarkMagenta = new SColor("#800080");
+    /** 洋红色 */
     static readonly Magenta = new SColor("#FF00FF");
+    /** 深黄色 */
     static readonly DarkYellow = new SColor("#808000");
+    /** 黄色 */
     static readonly Yellow = new SColor("#FFFF00");
+    /** 白色 */
     static readonly White = new SColor("#FFFFFF");
+    /** 深灰色 */
     static readonly DarkGray = new SColor("#808080");
+    /** 灰色 */
     static readonly Gray = new SColor("#A0A0A0");
+    /** 浅灰色 */
     static readonly LightGray = new SColor("#C0C0C0");
 
     /**
-     * 根据rgb分量生成颜色
+     * 根据 rgb 分量生成颜色
      *
      * @param r       红色分量
      * @param g       绿色分量
      * @param b       蓝色分量
      * @return 颜色
-     */
+    */
     static rgb(r: number, g: number, b: number): SColor {
         return new SColor(r, g, b);
     }
 
     /**
-     * 根据rgba分量生成颜色
+     * 根据 rgba 分量生成颜色
      *
      * @param r       红色分量
      * @param g       绿色分量
      * @param b       蓝色分量
      * @param a       透明度分量
      * @return 颜色
-     */
+    */
     static rgba(r: number, g: number, b: number, a: number): SColor {
         return new SColor(r, g, b, a);
     } // Function rgb()
@@ -136,7 +154,7 @@ export class SColor {
     // 构造函数
     /**
      * 构造函数
-     */
+    */
     constructor();
 
     /**
@@ -145,7 +163,7 @@ export class SColor {
      * @param r       红色分量
      * @param g       绿色分量
      * @param b       蓝色分量
-     */
+    */
     constructor(r: number, g: number, b: number);
 
     /**
@@ -155,21 +173,21 @@ export class SColor {
      * @param g       绿色分量
      * @param b       蓝色分量
      * @param a       透明度分量 0 - 255
-     */
+    */
     constructor(r: number, g: number, b: number, a: number);
 
     /**
      * 构造函数
      *
      * @param color   颜色
-     */
+    */
     constructor(color: string);
 
     /**
      * 构造函数
      *
      * @param color   颜色
-     */
+    */
     constructor(color: SColor);
 
     /**
@@ -179,7 +197,7 @@ export class SColor {
      * @param g       绿色分量
      * @param b       蓝色分量
      * @param a       透明度分量 0 - 255
-     */
+    */
     constructor(
         r?: number | string | SColor,
         g?: number,
@@ -205,7 +223,7 @@ export class SColor {
      * @param r       红色分量
      * @param g       绿色分量
      * @param b       蓝色分量
-     */
+    */
     private setRgb(r: number, g: number, b: number): void {
         this._value =
             ((r as number) << 24) +
@@ -221,7 +239,7 @@ export class SColor {
      * @param g       绿色分量
      * @param b       蓝色分量
      * @param a       透明度分量 0 - 255
-     */
+    */
     private setRgba(r: number, g: number, b: number, a: number): void {
         this._value =
             ((r as number) << 24) +
@@ -234,7 +252,7 @@ export class SColor {
      * 颜色转 rgb
      *
      * @return rgb 字符串
-     */
+    */
     toRgb(): string {
         return `rgb(${this.red}, ${this.green}, ${this.blue})`;
     } // Function toRgb()
@@ -243,7 +261,7 @@ export class SColor {
      * 颜色转 rgba
      *
      * @return rgba 字符串
-     */
+    */
     toRgba(): string {
         return `rgba(${this.red}, ${this.green}, ${this.blue}, ${this.alpha /
             255.0})`;
@@ -253,7 +271,7 @@ export class SColor {
      * 颜色转 6 位 16 进制
      *
      * @return 6 位 16 进制颜色
-     */
+    */
     toVal(): string {
         return "#" + SStringUtil.num2Hex(this._value, 6);
     } // Function toRgb()

+ 4 - 4
persagy-web-draw/src/SFont.ts

@@ -54,14 +54,14 @@ export class SFont {
     // 构造函数
     /**
      * 构造函数
-     */
+    */
     constructor();
 
     /**
      * 构造函数
      *
      * @param font  FONT
-     */
+    */
     constructor(font: SFont);
 
     /**
@@ -69,14 +69,14 @@ export class SFont {
      *
      * @param name        字体
      * @param size        字号
-     */
+    */
     constructor(name: string, size?: number);
     /**
      * 构造函数
      *
      * @param name        字体 | SFont
      * @param size        字号
-     */
+    */
     constructor(name?: string | SFont, size?: number) {
         if (name == undefined) {
             return;

+ 4 - 4
persagy-web-draw/src/SGradient.ts

@@ -80,7 +80,7 @@ export abstract class SGradient {
      *
      * @param pos     位置[0 - 1]
      * @param color   颜色
-     */
+    */
     addColorStop(pos: number, color: SColor): void {
         this.stopList.push(new SGradientStop(pos, color));
     } // Function addColorStop()
@@ -90,7 +90,7 @@ export abstract class SGradient {
      *
      * @param x       X 坐标
      * @param y       Y 坐标
-     */
+    */
     setStart(x: number, y: number): void {
         this.start.x = x;
         this.start.y = y;
@@ -101,7 +101,7 @@ export abstract class SGradient {
      *
      * @param x       X 坐标
      * @param y       Y 坐标
-     */
+    */
     setEnd(x: number, y: number): void {
         this.end.x = x;
         this.end.y = y;
@@ -111,6 +111,6 @@ export abstract class SGradient {
      * 转为字符串保存
      *
      * @return 转为字符串保存
-     */
+    */
     abstract value(): string;
 } // Class SGradientStop

+ 1 - 1
persagy-web-draw/src/SGradientStop.ts

@@ -54,7 +54,7 @@ export class SGradientStop {
      *
      * @param pos         节点位置
      * @param color       节点颜色
-     */
+    */
     constructor(pos: number, color: SColor) {
         this.pos = pos;
         this.color = color;

+ 4 - 4
persagy-web-draw/src/SLinearGradient.ts

@@ -37,7 +37,7 @@ export class SLinearGradient extends SGradient {
      *
      * @param start   起点坐标
      * @param end     终点坐标
-     */
+    */
     constructor(start: SPoint, end: SPoint);
 
     /**
@@ -47,7 +47,7 @@ export class SLinearGradient extends SGradient {
      * @param y1      起点 Y 坐标
      * @param x2      终点 X 坐标
      * @param y2      终点 Y 坐标
-     */
+    */
     constructor(x1: number, y1: number, x2: number, y2: number);
 
     /**
@@ -57,7 +57,7 @@ export class SLinearGradient extends SGradient {
      * @param y1      起点 Y 坐标
      * @param x2      终点 X 坐标
      * @param y2      终点 Y 坐标
-     */
+    */
     constructor(
         x1: number | SPoint,
         y1: number | SPoint,
@@ -78,7 +78,7 @@ export class SLinearGradient extends SGradient {
      * 转为字符串保存
      *
      * @return 转为字符串保存
-     */
+    */
     value(): string {
         let str = `SLinearGradient{`;
         str += `${this.x1},${this.y1};`;

+ 46 - 46
persagy-web-draw/src/SPainter.ts

@@ -112,7 +112,7 @@ export class SPainter extends SObject {
      * 构造函数
      *
      * @param engine    绘制引擎
-     */
+    */
     constructor(engine: SCanvasView | SPaintEngine) {
         super();
         if (engine instanceof SCanvasView) {
@@ -131,14 +131,14 @@ export class SPainter extends SObject {
 
     /**
      * 保存 painter 状态
-     */
+    */
     save(): void {
         this.engine.save();
     } // Function save()
 
     /**
      * 恢复 painter 状态
-     */
+    */
     restore(): void {
         this.engine.restore();
     } // Function restore()
@@ -150,7 +150,7 @@ export class SPainter extends SObject {
      *
      * @param x       X 轴方向平移
      * @param y       Y 轴方向平移
-     */
+    */
     translate(x: number, y: number): void {
         this.engine.translate(x, y);
     } // Function translate()
@@ -160,7 +160,7 @@ export class SPainter extends SObject {
      *
      * @param x       X 轴方向缩放
      * @param y       Y 轴方向缩放
-     */
+    */
     scale(x: number, y: number): void {
         this.engine.scale(x, y);
     } // Function scale()
@@ -169,7 +169,7 @@ export class SPainter extends SObject {
      * 旋转
      *
      * @param angle   旋转角度(单位弧度)
-     */
+    */
     rotate(angle: number): void {
         this.engine.rotate(angle);
     } // Function rotate()
@@ -183,7 +183,7 @@ export class SPainter extends SObject {
      * @param m22     竖直方向的缩放
      * @param dx      水平方向的移动
      * @param dy      竖直方向的移动
-     */
+    */
     transform(
         m11: number,
         m12: number,
@@ -204,7 +204,7 @@ export class SPainter extends SObject {
      * @param m22     竖直方向的缩放
      * @param dx      水平方向的移动
      * @param dy      竖直方向的移动
-     */
+    */
     setTransform(
         m11: number,
         m12: number,
@@ -218,7 +218,7 @@ export class SPainter extends SObject {
 
     /**
      * 重置当前变形为单位矩阵。等价于调用 setTransform(1, 0, 0, 1, 0, 0)
-     */
+    */
     resetTransform(): void {
         this.engine.resetTransform();
     } // Function resetTransform()
@@ -230,7 +230,7 @@ export class SPainter extends SObject {
      * 清空矩形区域
      *
      * @param rect  矩形
-     */
+    */
     clearRect(rect: SRect): void;
 
     /**
@@ -238,7 +238,7 @@ export class SPainter extends SObject {
      *
      * @param leftTop         左上角坐标
      * @param rightBottom     右下角坐标
-     */
+    */
     clearRect(leftTop: SPoint, rightBottom: SPoint): void;
 
     /**
@@ -246,7 +246,7 @@ export class SPainter extends SObject {
      *
      * @param leftTop     左上角坐标
      * @param size        大小
-     */
+    */
     clearRect(leftTop: SPoint, size: SSize): void;
 
     /**
@@ -256,7 +256,7 @@ export class SPainter extends SObject {
      * @param y       Y 坐标
      * @param w       宽度
      * @param h       高度
-     */
+    */
     clearRect(x: number, y: number, w: number, h: number): void;
 
     /**
@@ -266,7 +266,7 @@ export class SPainter extends SObject {
      * @param y       Y 坐标 | 右下角坐标 | 大小
      * @param w       宽度
      * @param h       高度
-     */
+    */
     clearRect(
         x: number | SPoint | SRect,
         y?: number | SPoint | SSize,
@@ -290,7 +290,7 @@ export class SPainter extends SObject {
      * 绘制矩形
      *
      * @param rect        矩形
-     */
+    */
     drawRect(rect: SRect): void;
 
     /**
@@ -298,7 +298,7 @@ export class SPainter extends SObject {
      *
      * @param leftTop         左上角坐标
      * @param rightBottom     右下角坐标
-     */
+    */
     drawRect(leftTop: SPoint, rightBottom: SPoint): void;
 
     /**
@@ -306,7 +306,7 @@ export class SPainter extends SObject {
      *
      * @param leftTop     左上角坐标
      * @param size        大小
-     */
+    */
     drawRect(leftTop: SPoint, size: SSize): void;
 
     /**
@@ -316,7 +316,7 @@ export class SPainter extends SObject {
      * @param y       Y 坐标
      * @param w       宽度
      * @param h       高度
-     */
+    */
     drawRect(x: number, y: number, w: number, h: number): void;
 
     /**
@@ -326,7 +326,7 @@ export class SPainter extends SObject {
      * @param y       Y 坐标 | 右下角坐标 | 大小
      * @param w       宽度
      * @param h       高度
-     */
+    */
     drawRect(
         x: number | SPoint | SRect,
         y?: number | SPoint | SSize,
@@ -357,7 +357,7 @@ export class SPainter extends SObject {
      *
      * @param rect        矩形
      * @param r           导角半径
-     */
+    */
     drawRoundRect(rect: SRect, r: number): void;
 
     /**
@@ -366,7 +366,7 @@ export class SPainter extends SObject {
      * @param p1        矩形左上角的点
      * @param p2        矩形右上角的点
      * @param r         导角半径
-     */
+    */
     drawRoundRect(p1: SPoint, p2: SPoint, r: number): void;
 
     /**
@@ -375,7 +375,7 @@ export class SPainter extends SObject {
      * @param pos         左上角位置
      * @param size        大小
      * @param r           导角半径
-     */
+    */
     drawRoundRect(pos: SPoint, size: SSize, r: number): void;
 
     /**
@@ -386,7 +386,7 @@ export class SPainter extends SObject {
      * @param w           宽度
      * @param h           高度
      * @param r           导角半径
-     */
+    */
     drawRoundRect(x: number, y: number, w: number, h: number, r: number): void;
 
     /**
@@ -397,7 +397,7 @@ export class SPainter extends SObject {
      * @param w           宽度
      * @param h           高度
      * @param radius      导角半径
-     */
+    */
     drawRoundRect(
         x: number | SPoint | SRect,
         y: number | SSize | SPoint,
@@ -438,7 +438,7 @@ export class SPainter extends SObject {
      * @param cx          圆心 X 坐标
      * @param cy          圆心 Y 坐标
      * @param r           圆半径
-     */
+    */
     drawCircle(cx: number, cy: number, r: number): void {
         this.engine.drawCircle(cx, cy, r);
     } // Function drawCircle()
@@ -450,7 +450,7 @@ export class SPainter extends SObject {
      * @param cy          圆点 Y 坐标
      * @param rx          水平半径
      * @param ry          垂直半径
-     */
+    */
     drawEllipse(cx: number, cy: number, rx: number, ry: number): void {
         this.engine.drawEllipse(cx, cy, rx, ry);
     } // Function drawEllipse()
@@ -459,7 +459,7 @@ export class SPainter extends SObject {
      * 绘制一条线段
      *
      * @param line    线段
-     */
+    */
     drawLine(line: SLine): void;
 
     /**
@@ -467,7 +467,7 @@ export class SPainter extends SObject {
      *
      * @param p1      启点坐标
      * @param p2      终点坐标
-     */
+    */
     drawLine(p1: SPoint, p2: SPoint): void;
 
     /**
@@ -477,7 +477,7 @@ export class SPainter extends SObject {
      * @param y1      启点 Y 坐标
      * @param x2      终点 X 坐标
      * @param y2      终点 Y 坐标
-     */
+    */
     drawLine(x1: number, y1: number, x2: number, y2: number): void;
 
     /**
@@ -487,7 +487,7 @@ export class SPainter extends SObject {
      * @param y1      启点 Y 坐标 | 终点坐标
      * @param x2      终点 X 坐标
      * @param y2      终点 Y 坐标
-     */
+    */
     drawLine(
         x1: number | SPoint | SLine,
         y1?: number | SPoint,
@@ -514,7 +514,7 @@ export class SPainter extends SObject {
      * 绘制折线
      *
      * @param points      折线折点
-     */
+    */
     drawPolyline(points: SPoint[]): void {
         this.engine.drawPolyline(points);
     } // Function drawPolyline()
@@ -523,7 +523,7 @@ export class SPainter extends SObject {
      * 绘制多边形
      *
      * @param points      多边形顶点
-     */
+    */
     drawPolygon(points: SPoint[]): void {
         this.engine.drawPolygon(points);
     } // Function drawPolygon()
@@ -532,7 +532,7 @@ export class SPainter extends SObject {
      * 绘制路径
      *
      * @param path        路径
-     */
+    */
     drawPath(path: SPath): void {
         this.engine.drawPath(path);
     } // Function drawPath()
@@ -544,7 +544,7 @@ export class SPainter extends SObject {
      * @param x           X 坐标
      * @param y           Y 坐标
      * @param maxWidth    最大宽度
-     */
+    */
     drawText(text: string, x: number, y: number, maxWidth?: number): void {
         this.engine.drawText(text, x, y, maxWidth);
     } // Function drawText()
@@ -557,7 +557,7 @@ export class SPainter extends SObject {
      * @param y         Y 坐标
      * @param width     宽度
      * @param height    高度
-     */
+    */
     drawImage(
         img: CanvasImageSource,
         x: number,
@@ -572,7 +572,7 @@ export class SPainter extends SObject {
      * painter 转实现 view 象素
      *
      * @param p       绘制坐标
-     */
+    */
     toPx(p: number): number {
         return p / this.engine.state.matrix.a;
     } // Function painterToView()
@@ -582,7 +582,7 @@ export class SPainter extends SObject {
      *
      * @param text    文本字符
      * @return 文本所占长度像素
-     */
+    */
     textWidth(text: string): number {
         return this.engine.textWidth(text);
     }
@@ -592,7 +592,7 @@ export class SPainter extends SObject {
      *
      * @param line    线段
      * @param style   末端样式
-     */
+    */
     drawArrowLine(line: SLine, style?: SArrow): void;
 
     /**
@@ -601,7 +601,7 @@ export class SPainter extends SObject {
      * @param p1      启点坐标
      * @param p2      终点坐标
      * @param style   末端样式
-     */
+    */
     drawArrowLine(p1: SPoint, p2: SPoint, style?: SArrow): void;
 
     /**
@@ -612,7 +612,7 @@ export class SPainter extends SObject {
      * @param x2      终点 X 坐标
      * @param y2      终点 Y 坐标
      * @param style   末端样式
-     */
+    */
     drawArrowLine(
         x1: number,
         y1: number,
@@ -629,7 +629,7 @@ export class SPainter extends SObject {
      * @param x2  终点 X 坐标
      * @param y2  终点 Y 坐标
      * @param st  线段两端样式
-     */
+    */
     drawArrowLine(
         x1: number | SPoint | SLine,
         y1?: number | SPoint | SArrow,
@@ -689,7 +689,7 @@ export class SPainter extends SObject {
      *
      * @param line    要加末端样式的线段
      * @param isEnd   是否为结束位置
-     */
+    */
     private drawBasicArrow(line: SLine, isEnd: boolean = true): void {
         // 定义箭头长度
         const d = this.toPx(10);
@@ -728,7 +728,7 @@ export class SPainter extends SObject {
      *
      * @param line    要加末端样式的线段
      * @param isEnd   是否为结束位置
-     */
+    */
     private drawTriangleArrow(line: SLine, isEnd: boolean = true): void {
         // 定义箭头长度
         const d = this.toPx(10);
@@ -767,7 +767,7 @@ export class SPainter extends SObject {
      *
      * @param line    要加末端样式的线段
      * @param isEnd   是否为结束位置
-     */
+    */
     private drawDiamondArrow(line: SLine, isEnd: boolean = true): void {
         // 定义箭头长度
         const d = this.toPx(5);
@@ -808,7 +808,7 @@ export class SPainter extends SObject {
      *
      * @param line    要加末端样式的线段
      * @param isEnd   是否为结束位置
-     */
+    */
     private drawSquareArrow(line: SLine, isEnd: boolean = true): void {
         // 定义箭头长度
         const d = this.toPx(5);
@@ -846,7 +846,7 @@ export class SPainter extends SObject {
      *
      * @param line    要加末端样式的线段
      * @param isEnd   是否为结束位置
-     */
+    */
     private drawCircleArrow(line: SLine, isEnd: boolean = true): void {
         // 定义箭头长度
         const d = this.toPx(5);

+ 12 - 12
persagy-web-draw/src/SPath.ts

@@ -41,7 +41,7 @@ export class SPath {
      *
      * @param cmd         命令
      * @param args        命令参数
-     */
+    */
     private addCommand(cmd: string, ...args: number[]): void {
         this.cmdList.push({ command: cmd, args: args });
     } // Function addCommand()
@@ -50,14 +50,14 @@ export class SPath {
      * 添加一条新路径到对当前路径。
      *
      * @param path  路径对象
-     */
+    */
     addPath(path: SPath): void {
         this.cmdList = this.cmdList.concat(path.cmdList);
     } // Function addPath()
 
     /**
      * 使笔点返回到当前子路径的起始点。它尝试从当前点到起始点绘制一条直线。 如果图形已经是封闭的或者只有一个点,那么此函数不会做任何操作。
-     */
+    */
     closePath(): void {
         this.addCommand("Z");
     } // Function closePath()
@@ -67,7 +67,7 @@ export class SPath {
      *
      * @param x       X 坐标
      * @param y       Y 坐标
-     */
+    */
     moveTo(x: number, y: number): void {
         this.addCommand("M", x, y);
     } // Function moveTo()
@@ -77,7 +77,7 @@ export class SPath {
      *
      * @param x       X 坐标
      * @param y       Y 坐标
-     */
+    */
     lineTo(x: number, y: number): void {
         this.addCommand("L", x, y);
     } // Function lineTo()
@@ -91,7 +91,7 @@ export class SPath {
      * @param startAngle      开始角度
      * @param endAngle        结束角度
      * @param anticlockwise   是否逆时针绘制( 1 是, 0 不是)
-     */
+    */
     arc(
         x: number,
         y: number,
@@ -119,7 +119,7 @@ export class SPath {
      * @param x2        点 2 的 x 坐标
      * @param y2        点 1 的 y 坐标
      * @param radius    半径
-     */
+    */
     arcTo(
         x1: number,
         y1: number,
@@ -137,7 +137,7 @@ export class SPath {
      * @param cp1y    控制点 Y 坐标
      * @param x       结束点 X 坐标
      * @param y       结束点 Y 坐标
-     */
+    */
     quadraticCurveTo(cp1x: number, cp1y: number, x: number, y: number): void {
         this.addCommand("Q", cp1x, cp1y, x, y);
     } // Function quadraticCurveTo()
@@ -151,7 +151,7 @@ export class SPath {
      * @param cp2y    结束点控制点 Y 坐标
      * @param x       结束点 X 坐标
      * @param y       结束点 Y 坐标
-     */
+    */
     bezierCurveTo(
         cp1x: number,
         cp1y: number,
@@ -170,7 +170,7 @@ export class SPath {
      * @param cy          圆点 Y 坐标
      * @param rx          水平半径
      * @param ry          垂直半径
-     */
+    */
     ellipse(cx: number, cy: number, rx: number, ry: number): void {
         this.addCommand("Ellipse", cx, cy, rx, ry);
     } // Function ellipse()
@@ -182,7 +182,7 @@ export class SPath {
      * @param y           Y 坐标
      * @param w           宽度
      * @param h           高度
-     */
+    */
     rect(x: number, y: number, w: number, h: number): void {
         this.addCommand("M", x, y);
         this.addCommand("L", x + w, y);
@@ -195,7 +195,7 @@ export class SPath {
      * 添加多边形
      *
      * @param pList   点集数组
-     */
+    */
     polygon(pList: SPoint[]): void {
         if (pList.length > 2) {
             this.addCommand("M", pList[0].x, pList[0].y);

+ 4 - 4
persagy-web-draw/src/SPen.ts

@@ -59,14 +59,14 @@ export class SPen {
     // 构造函数
     /**
      * 构造函数
-     */
+    */
     constructor();
 
     /**
      * 构造函数
      *
      * @param pen   画笔
-     */
+    */
     constructor(pen: SPen);
 
     /**
@@ -74,7 +74,7 @@ export class SPen {
      *
      * @param color       颜色
      * @param lineWidth   线宽
-     */
+    */
     constructor(color: SColor, lineWidth?: number);
 
     /**
@@ -82,7 +82,7 @@ export class SPen {
      *
      * @param color       颜色 | 画笔
      * @param lineWidth   线宽
-     */
+    */
     constructor(color?: SColor | SPen, lineWidth?: number) {
         if (color == undefined) {
             return;

+ 4 - 4
persagy-web-draw/src/SRadialGradient.ts

@@ -44,7 +44,7 @@ export class SRadialGradient extends SGradient {
      * @param r1      开始圆形半径
      * @param end     结束圆形坐标
      * @param r2      结束圆形半径
-     */
+    */
     constructor(start: SPoint, r1: number, end: SPoint, r2: number);
 
     /**
@@ -56,7 +56,7 @@ export class SRadialGradient extends SGradient {
      * @param x2      结束圆形 X 坐标
      * @param y2      结束圆形 Y 坐标
      * @param r2      结束圆形半径
-     */
+    */
     constructor(
         x1: number,
         y1: number,
@@ -75,7 +75,7 @@ export class SRadialGradient extends SGradient {
      * @param x2      结束圆形 X 坐标 | 结束圆形半径
      * @param y2      结束圆形 Y 坐标
      * @param r2      结束圆形半径
-     */
+    */
     constructor(
         x1: number | SPoint,
         y1: number,
@@ -101,7 +101,7 @@ export class SRadialGradient extends SGradient {
     /**
      * 转为字符串保存
      *
-     */
+    */
     value(): string {
         let str = `SRadialGradient{`;
         str += `${this.x1},${this.y1},${this.r1};`;

+ 4 - 4
persagy-web-draw/src/SShadow.ts

@@ -43,14 +43,14 @@ export class SShadow {
 
     /**
      * 构造函数
-     */
+    */
     constructor();
 
     /**
      * 构造函数
      *
      * @param shadow    阴影画刷
-     */
+    */
     constructor(shadow: SShadow);
 
     /**
@@ -58,7 +58,7 @@ export class SShadow {
      *
      * @param blur    扩散距离
      * @param color   颜色
-     */
+    */
     constructor(blur: number, color: SColor);
 
     /**
@@ -66,7 +66,7 @@ export class SShadow {
      *
      * @param blur    阴影|扩散距离
      * @param color   阴影颜色
-     */
+    */
     constructor(blur?: number | SShadow, color?: SColor) {
         if (blur == undefined) {
             return;

+ 30 - 30
persagy-web-draw/src/engines/SCanvasPaintEngine.ts

@@ -70,7 +70,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * 绘制引擎类型
      *
      * @return 返回 Canvas 绘制引擎类型
-     */
+    */
     get type(): SPaintEngineType {
         return SPaintEngineType.Canvas;
     } // Get type
@@ -81,7 +81,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * 构造函数
      *
      * @param canvas    canvas对象
-     */
+    */
     constructor(canvas: CanvasRenderingContext2D) {
         super();
         this._canvas = canvas;
@@ -96,7 +96,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * 清空矩形区域
      *
      * @param rect  矩形
-     */
+    */
     clearRect(rect: SRect): void {
         this.setMatrix();
         this._canvas.clearRect(rect.x, rect.y, rect.width, rect.height);
@@ -106,7 +106,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * 绘制矩形
      *
      * @param rect  矩形
-     */
+    */
     drawRect(rect: SRect): void {
         this.init(() => {
             this._canvas.beginPath();
@@ -122,7 +122,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * @param cx    圆心 x 坐标
      * @param cy    圆心 y 坐标
      * @param r     圆半径
-     */
+    */
     drawCircle(cx: number, cy: number, r: number): void {
         this.init(() => {
             this._canvas.beginPath();
@@ -139,7 +139,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * @param cy    圆点 Y 坐标
      * @param rx    水平半径
      * @param ry    垂直半径
-     */
+    */
     drawEllipse(cx: number, cy: number, rx: number, ry: number): void {
         this.init(() => {
             this._canvas.beginPath();
@@ -153,7 +153,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * 绘制线段
      *
      * @param line  线段
-     */
+    */
     drawLine(line: SLine): void {
         this.init(() => {
             this._canvas.beginPath();
@@ -167,7 +167,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * 绘制折线
      *
      * @param points    折线折点
-     */
+    */
     drawPolyline(points: SPoint[]): void {
         // 折线至少要有2个节点
         if (points.length < 2) {
@@ -188,7 +188,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * 绘制多边形
      *
      * @param points    多边形顶点
-     */
+    */
     drawPolygon(points: SPoint[]): void {
         // 多边形至少要有3个节点
         if (points.length < 3) {
@@ -212,7 +212,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * 绘制路径
      *
      * @param path  路径
-     */
+    */
     drawPath(path: SPath): void {
         this.init(() => {
             this.drawWay(path);
@@ -226,7 +226,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * @param x         X 坐标
      * @param y         Y 坐标
      * @param maxWidth  最大宽度
-     */
+    */
     drawText(text: string, x: number, y: number, maxWidth?: number): void {
         this.init(() => {
             this.setFont();
@@ -246,7 +246,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * @param y         Y 坐标
      * @param width     宽度
      * @param height    高度
-     */
+    */
     drawImage(
         img: CanvasImageSource,
         x: number,
@@ -272,7 +272,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      *
      * @param text  预测的文本
      * @return 文本长度像素
-     */
+    */
     textWidth(text: string): number {
         return this._canvas.measureText(text).width;
     } // Function textWidth()
@@ -284,7 +284,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * @param cp1y    控制点 Y 坐标
      * @param x       结束点 X 坐标
      * @param y       结束点 Y 坐标
-     */
+    */
     quadraticCurveTo(cp1x: number, cp1y: number, x: number, y: number): void {
         this._canvas.quadraticCurveTo(cp1x, cp1y, x, y);
     } // Function quadraticCurveTo()
@@ -298,7 +298,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * @param cp2y    结束点控制点 Y 坐标
      * @param x       结束点X坐标
      * @param y       结束点Y坐标
-     */
+    */
     bezierCurveTo(
         cp1x: number,
         cp1y: number,
@@ -315,7 +315,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      *
      * @param rect    矩形
      * @param r       导角半径
-     */
+    */
     drawRoundRect(rect: SRect, r: number): void {
         this.init(() => {
             this._canvas.beginPath();
@@ -352,7 +352,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * 设置字体
      *
      * @param font  字体
-     */
+    */
     changeFont(font: SFont): void {
         this._canvas.font = `${font.size}px ${font.name}`;
         this.setTextAlign(font.textAlign);
@@ -367,7 +367,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * 设置整体绘制状态
      *
      * @param fn    绘制图形的具体函数
-     */
+    */
     private init(fn: Function): void {
         this.setMatrix();
         this.setPen();
@@ -380,7 +380,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
 
     /**
      * 设置画笔
-     */
+    */
     private setPen(): void {
         //this._canvas.strokeStyle = this.state.pen.color.value;
         this._canvas.strokeStyle = `rgba(${this.state.pen.color.red}, ${
@@ -406,7 +406,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * 线段端点风格
      *
      * @param style     风格
-     */
+    */
     private setLineCapStyle(style: SLineCapStyle): void {
         if (style == undefined) return;
         if (style == SLineCapStyle.Round) {
@@ -420,7 +420,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
 
     /**
      * 设置画刷
-     */
+    */
     private setBrush(): void {
         // this._canvas.fillStyle = this.state.brush.color.value;
         if (this.state.brush.type == SBrushType.Color) {
@@ -465,7 +465,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
 
     /**
      * 设置融合
-     */
+    */
     private setComposite(): void {
         this._canvas.globalCompositeOperation =
             SCanvasPaintEngine.gcoList[this.state._composite];
@@ -473,7 +473,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
 
     /**
      * 设置阴影
-     */
+    */
     private setShadow(): void {
         if (this.state.shadow.shadowBlur > 0 && this.state.shadow.shadowColor) {
             this._canvas.shadowBlur = this.state.shadow.shadowBlur;
@@ -494,7 +494,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
 
     /**
      * 设置字体
-     */
+    */
     private setFont(): void {
         this._canvas.font = `${this.state.font.size}px ${this.state.font.name}`;
         this.setTextAlign(this.state.font.textAlign);
@@ -506,7 +506,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * 文本对齐选项
      *
      * @param value     对齐方式
-     */
+    */
     private setTextAlign(value: STextAlign): void {
         if (value == undefined) {
             return;
@@ -528,7 +528,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * 设置文本基线对齐选项
      *
      * @param value     对齐方式
-     */
+    */
     private setBaseLine(value: STextBaseLine): void {
         if (value == undefined) {
             return;
@@ -552,7 +552,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
      * 设置文本方向选项
      *
      * @param value     文本方向
-     */
+    */
     private setTextDirection(value: STextDirection): void {
         if (value == undefined) {
             return;
@@ -568,7 +568,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
 
     /**
      * 设置变型矩阵
-     */
+    */
     private setMatrix(): void {
         this._canvas.setTransform(
             this.state.matrix.a,
@@ -583,7 +583,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
     /**
      * 设置裁剪路径
      *
-     */
+    */
     setClip(): void {
         if (this.state.clip) {
             this.drawWay(this.state.clip);
@@ -594,7 +594,7 @@ export class SCanvasPaintEngine extends SPaintEngine {
     /**
      * 绘制路径
      *
-     */
+    */
     private drawWay(path: SPath): void {
         this._canvas.beginPath();
         path.cmdList.forEach(cmd => {

+ 21 - 21
persagy-web-draw/src/engines/SPaintEngine.ts

@@ -51,7 +51,7 @@ export abstract class SPaintEngine {
 
     /**
      * 保存 painter 状态
-     */
+    */
     save(): void {
         let state = new SPaintState(this.state);
         this.stateStack.push(state);
@@ -59,7 +59,7 @@ export abstract class SPaintEngine {
 
     /**
      * 恢复 painter 状态
-     */
+    */
     restore(): void {
         if (this.stateStack.length > 0) {
             this.state = this.stateStack.pop() as SPaintState;
@@ -73,7 +73,7 @@ export abstract class SPaintEngine {
      *
      * @param x     X 轴方向平移
      * @param y     Y 辆方向平移
-     */
+    */
     translate(x: number, y: number): void {
         this.state.matrix.translate(x, y);
     } // Function translate()
@@ -83,7 +83,7 @@ export abstract class SPaintEngine {
      *
      * @param x     X 轴方向缩放
      * @param y     Y 轴方向缩放
-     */
+    */
     scale(x: number, y: number): void {
         this.state.matrix.scale(x, y);
     } // Function scale()
@@ -92,7 +92,7 @@ export abstract class SPaintEngine {
      * 旋转
      *
      * @param angle     旋转角度(单位弧度)
-     */
+    */
     rotate(angle: number): void {
         this.state.matrix.rotate(0, 0, angle);
     } // Function rotate()
@@ -106,7 +106,7 @@ export abstract class SPaintEngine {
      * @param m22   竖直方向的缩放
      * @param dx    水平方向的移动
      * @param dy    竖直方向的移动
-     */
+    */
     transform(
         m11: number,
         m12: number,
@@ -125,7 +125,7 @@ export abstract class SPaintEngine {
      * @param m22   竖直方向的缩放
      * @param dx    水平方向的移动
      * @param dy    竖直方向的移动
-     */
+    */
     setTransform(
         m11: number,
         m12: number,
@@ -137,7 +137,7 @@ export abstract class SPaintEngine {
 
     /**
      * 重置当前变形为单位矩阵。等价于调用 setTransform(1, 0, 0, 1, 0, 0)
-     */
+    */
     resetTransform(): void {
         this.state.matrix = new SMatrix();
     } // Function resetTransform()
@@ -149,14 +149,14 @@ export abstract class SPaintEngine {
      * 清空矩形区域
      *
      * @param rect  矩形
-     */
+    */
     abstract clearRect(rect: SRect): void;
 
     /**
      * 绘制空心矩形
      *
      * @param rect  矩形
-     */
+    */
     abstract drawRect(rect: SRect): void;
 
     /**
@@ -165,7 +165,7 @@ export abstract class SPaintEngine {
      * @param cx    圆心 X 坐标
      * @param cy    圆心 Y 坐标
      * @param r     圆半径
-     */
+    */
     abstract drawCircle(cx: number, cy: number, r: number): void;
 
     /**
@@ -175,35 +175,35 @@ export abstract class SPaintEngine {
      * @param cy    圆点 Y 坐标
      * @param rx    水平半径
      * @param ry    垂直半径
-     */
+    */
     abstract drawEllipse(cx: number, cy: number, rx: number, ry: number): void;
 
     /**
      * 绘制线段
      *
      * @param line  线段
-     */
+    */
     abstract drawLine(line: SLine): void;
 
     /**
      * 绘制折线
      *
      * @param points    折线折点
-     */
+    */
     abstract drawPolyline(points: SPoint[]): void;
 
     /**
      * 绘制多边形
      *
      * @param points    多边形顶点
-     */
+    */
     abstract drawPolygon(points: SPoint[]): void;
 
     /**
      * 绘制路径
      *
      * @param path  路径
-     */
+    */
     abstract drawPath(path: SPath): void;
 
     /**
@@ -213,7 +213,7 @@ export abstract class SPaintEngine {
      * @param x             X 坐标
      * @param y             Y 坐标
      * @param maxWidth      最大宽度
-     */
+    */
     abstract drawText(
         text: string,
         x: number,
@@ -229,7 +229,7 @@ export abstract class SPaintEngine {
      * @param y         Y 坐标
      * @param width     宽度
      * @param height    高度
-     */
+    */
     abstract drawImage(
         img: CanvasImageSource,
         x: number,
@@ -242,14 +242,14 @@ export abstract class SPaintEngine {
      * 预测量文本宽度
      *
      * @param text  预测的文本
-     */
+    */
     abstract textWidth(text: string): number;
 
     /**
      * 修改字体
      *
      * @param font  字体
-     */
+    */
     abstract changeFont(font: SFont): void;
 
     /**
@@ -257,6 +257,6 @@ export abstract class SPaintEngine {
      *
      * @param rect    矩形
      * @param r       导角半径
-     */
+    */
     abstract drawRoundRect(rect: SRect, r: number): void;
 } // class SPaintEngine

+ 1 - 1
persagy-web-draw/src/engines/SPaintState.ts

@@ -95,7 +95,7 @@ export class SPaintState {
      * 构造函数
      *
      * @param state     绘制状态
-     */
+    */
     constructor(state?: SPaintState) {
         if (state != undefined) {
             this.pen = new SPen(state.pen);

+ 18 - 18
persagy-web-draw/src/engines/SSvgPaintEngine.ts

@@ -57,7 +57,7 @@ export class SSvgPaintEngine extends SPaintEngine {
      * 绘制引擎类型
      *
      * @return 返回 SVG 绘制引擎类型
-     */
+    */
     get type(): SPaintEngineType {
         return SPaintEngineType.SVG;
     } // Get type
@@ -69,7 +69,7 @@ export class SSvgPaintEngine extends SPaintEngine {
      *
      * @param w     宽度
      * @param h     高度
-     */
+    */
     constructor(w: number, h: number) {
         super();
         this.width = w;
@@ -92,7 +92,7 @@ export class SSvgPaintEngine extends SPaintEngine {
      * 转 svg 图像
      *
      * @return svg图像
-     */
+    */
     toSvg(): string {
         return this._builder.toString("\n") + "</svg>\n";
     } // Function toSvg()
@@ -104,14 +104,14 @@ export class SSvgPaintEngine extends SPaintEngine {
      * 清空矩形区域
      *
      * @param rect  矩形
-     */
+    */
     clearRect(rect: SRect): void {} // Function clearRect()
 
     /**
      * 绘制空心矩形
      *
      * @param rect  矩形
-     */
+    */
     drawRect(rect: SRect): void {
         this._builder.append(
             // eslint-disable-next-line max-len
@@ -127,7 +127,7 @@ export class SSvgPaintEngine extends SPaintEngine {
      * @param cx    圆心 X 坐标
      * @param cy    圆心 Y 坐标
      * @param r     圆半径
-     */
+    */
     drawCircle(cx: number, cy: number, r: number): void {
         this._builder.append(
             `<circle cx="${cx}" cy="${cy}" r="${r}" ${this.getStyle(
@@ -145,7 +145,7 @@ export class SSvgPaintEngine extends SPaintEngine {
      * @param cy    圆点 Y 坐标
      * @param rx    水平半径
      * @param ry    垂直半径
-     */
+    */
     drawEllipse(cx: number, cy: number, rx: number, ry: number): void {
         this._builder.append(
             `<ellipse  cx="${cx}" cy="${cy}" rx="${rx}" ry="${ry}" ${this.getStyle(
@@ -160,7 +160,7 @@ export class SSvgPaintEngine extends SPaintEngine {
      * 绘制线段
      *
      * @param line  线段
-     */
+    */
     drawLine(line: SLine): void {
         this._builder.append(
             `<line x1="${line.x1}" y1="${line.y1}" x2="${line.x2}" y2="${
@@ -173,7 +173,7 @@ export class SSvgPaintEngine extends SPaintEngine {
      * 绘制折线
      *
      * @param points    折线折点
-     */
+    */
     drawPolyline(points: SPoint[]): void {
         this._builder.append(
             `<polyline points="${SSvgPaintEngine.pointsToStr(
@@ -186,7 +186,7 @@ export class SSvgPaintEngine extends SPaintEngine {
      * 绘制多边形
      *
      * @param points    多边形顶点
-     */
+    */
     drawPolygon(points: SPoint[]): void {
         this._builder.append(
             `<polygon points="${SSvgPaintEngine.pointsToStr(
@@ -199,7 +199,7 @@ export class SSvgPaintEngine extends SPaintEngine {
      * 绘制路径
      *
      * @param path  路径
-     */
+    */
     drawPath(path: SPath): void {
         // this._builder.append(
         //     `<path d="${path.svgPath()}" ${this.getStyle(
@@ -217,7 +217,7 @@ export class SSvgPaintEngine extends SPaintEngine {
      * @param x           X 坐标
      * @param y           Y 坐标
      * @param maxWidth    最大宽度
-     */
+    */
     drawText(text: string, x: number, y: number, maxWidth?: number): void {
         this._builder.append(
             `<text x="${x}" y="${y}" ${this.getStyle(
@@ -236,7 +236,7 @@ export class SSvgPaintEngine extends SPaintEngine {
      * @param y         Y 坐标
      * @param width     宽度
      * @param height    高度
-     */
+    */
     drawImage(
         img: CanvasImageSource,
         x: number,
@@ -252,7 +252,7 @@ export class SSvgPaintEngine extends SPaintEngine {
      *
      * @param text  预测的文本
      * @return 文本长度像素
-     */
+    */
     textWidth(text: string): number {
         return 0;
     } // Function textWidth()
@@ -261,14 +261,14 @@ export class SSvgPaintEngine extends SPaintEngine {
      * 设置字体
      *
      * @param font  字体
-     */
+    */
     changeFont(font: SFont): void {} // Function changeFont()
 
     /**
      * 获得svg需要的变形信息
      *
      * @return 变换信息
-     */
+    */
     private getSvgMatrix(): string {
         // eslint-disable-next-line max-len
         return `transform="matrix(${this.state.matrix.a}, ${this.state.matrix.b}, ${this.state.matrix.c}, ${this.state.matrix.d}, ${this.state.matrix.e}, ${this.state.matrix.f})"`;
@@ -279,7 +279,7 @@ export class SSvgPaintEngine extends SPaintEngine {
      *
      * @param points    被转换的点
      * @return 点列表字符串
-     */
+    */
     private static pointsToStr(points: SPoint[]): string {
         let strBuilder = new SStringBuilder();
         for (let p of points) {
@@ -334,6 +334,6 @@ export class SSvgPaintEngine extends SPaintEngine {
 
     /**
      * 绘制圆角矩形
-     */
+    */
     drawRoundRect(): void {} // Function drawRoundRect()
 } // Class SSvgPaintEngine

+ 9 - 9
persagy-web-draw/src/types/SLine.ts

@@ -84,14 +84,14 @@ export class SLine {
     // 构造函数
     /**
      * 构造函数
-     */
+    */
     constructor();
 
     /**
      * 构造函数
      *
      * @param line    线段
-     */
+    */
     constructor(line: SLine);
 
     /**
@@ -99,7 +99,7 @@ export class SLine {
      *
      * @param p1      启点坐标
      * @param p2      终点坐标
-     */
+    */
     constructor(p1: SPoint, p2: SPoint);
 
     /**
@@ -109,7 +109,7 @@ export class SLine {
      * @param y1      启点 Y 坐标
      * @param x2      终点 X 坐标
      * @param y2      终点 Y 坐标
-     */
+    */
     constructor(x1: number, y1: number, x2: number, y2: number);
 
     /**
@@ -119,7 +119,7 @@ export class SLine {
      * @param y1      启点 Y 坐标 | 终点坐标
      * @param x2      终点 X 坐标
      * @param y2      终点 Y 坐标
-     */
+    */
     constructor(
         x1?: number | SPoint | SLine,
         y1?: number | SPoint,
@@ -145,7 +145,7 @@ export class SLine {
      * 判断线段是否为空
      *
      * @return 如果线段长度为零,返回 true,否则返回 false。
-     */
+    */
     isNull(): boolean {
         return (
             Math.abs(this.p1.x - this.p2.x) + Math.abs(this.p1.y - this.p2.y) <
@@ -157,7 +157,7 @@ export class SLine {
      * 返回线段的中点
      *
      * @return 线段的中点
-     */
+    */
     center(): SPoint {
         return new SPoint(
             (this.p1.x + this.p2.x) / 2,
@@ -170,7 +170,7 @@ export class SLine {
      *
      * @param dx    X 轴方向平衡量
      * @param dy    Y 轴方向平衡量
-     */
+    */
     translate(dx: number, dy: number): void {
         this.p1.x += dx;
         this.p2.x += dx;
@@ -184,7 +184,7 @@ export class SLine {
      * @param dx    X 轴方向平衡量
      * @param dy    Y 轴方向平衡量
      * @return 平移后的线段
-     */
+    */
     translated(dx: number, dy: number): SLine {
         return new SLine(
             this.p1.x + dx,

+ 10 - 10
persagy-web-draw/src/types/SPoint.ts

@@ -43,14 +43,14 @@ export class SPoint {
     // 构造函数
     /**
      * 构造函数
-     */
+    */
     constructor();
 
     /**
      * 构造函数
      *
      * @param p     点
-     */
+    */
     constructor(p: SPoint);
 
     /**
@@ -58,7 +58,7 @@ export class SPoint {
      *
      * @param x     X 轴坐标
      * @param y     Y 轴坐标
-     */
+    */
     constructor(x: number, y: number);
 
     /**
@@ -66,7 +66,7 @@ export class SPoint {
      *
      * @param x     X 轴坐标 | 点 | undefined
      * @param y     Y 轴坐标
-     */
+    */
     constructor(x?: number | SPoint, y?: number) {
         if (x == undefined) {
             this.x = 0;
@@ -84,7 +84,7 @@ export class SPoint {
      * 设置点
      *
      * @param pos   点
-     */
+    */
     setPoint(pos: SPoint): void;
 
     /**
@@ -92,7 +92,7 @@ export class SPoint {
      *
      * @param x     X 轴坐标
      * @param y     Y 轴坐标
-     */
+    */
     setPoint(x: number, y: number): void;
 
     /**
@@ -100,7 +100,7 @@ export class SPoint {
      *
      * @param x     X 轴坐标 | 点
      * @param y     Y 轴坐标
-     */
+    */
     setPoint(x: number | SPoint, y?: number): void {
         if (x instanceof SPoint) {
             this.x = x.x;
@@ -115,7 +115,7 @@ export class SPoint {
      * 布线长度
      *
      * @return 返回 |X| + |Y|
-     */
+    */
     manhattanLength(): number {
         // noinspection JSSuspiciousNameCombination
         return Math.abs(this.x) + Math.abs(this.y);
@@ -125,7 +125,7 @@ export class SPoint {
      * 返回点矩阵变换后的值
      *
      * @return 变换后的点
-     */
+    */
     matrixTransform(mat: SMatrix): SPoint {
         const p = new SPoint();
         p.x = this.x * mat.a + this.y * mat.b + mat.e;
@@ -138,7 +138,7 @@ export class SPoint {
      *
      * @param dx    X 轴位移
      * @param dy    Y 轴位移
-     */
+    */
     translate(dx: number, dy: number): void {
         this.x += dx;
         this.y += dy;

+ 19 - 19
persagy-web-draw/src/types/SRect.ts

@@ -108,7 +108,7 @@ export class SRect {
     // 构造函数
     /**
      * 构造函数
-     */
+    */
     constructor();
 
     /**
@@ -116,7 +116,7 @@ export class SRect {
      *
      * @param leftTop       左上角坐标
      * @param rightBottom   右下角坐标
-     */
+    */
     constructor(leftTop: SPoint, rightBottom: SPoint);
 
     /**
@@ -124,7 +124,7 @@ export class SRect {
      *
      * @param leftTop   左上角坐标
      * @param size      大小
-     */
+    */
     constructor(leftTop: SPoint, size: SSize);
 
     /**
@@ -134,7 +134,7 @@ export class SRect {
      * @param y         Y 轴坐标
      * @param width     宽度
      * @param height    高度
-     */
+    */
     constructor(x: number, y: number, width: number, height: number);
 
     /**
@@ -144,7 +144,7 @@ export class SRect {
      * @param y         Y 轴坐标 | 右下角坐标 | 大小
      * @param width     宽度
      * @param height    高度
-     */
+    */
     constructor(
         x?: number | SPoint,
         y?: number | SPoint | SSize,
@@ -176,7 +176,7 @@ export class SRect {
      * @return width 或 height 小于等于 0,返回 true,否则返回 false。
      *
      * @see isNull(), isValid()
-     */
+    */
     isEmpty(): boolean {
         return this.size.isEmpty();
     } // Function isEmpty()
@@ -187,7 +187,7 @@ export class SRect {
      * @return width 与 height 都等于 0,返回 true,否则返回 false。
      *
      * @see isEmpty(), isValid()
-     */
+    */
     isNull(): boolean {
         return this.size.isNull();
     } // Function isNull()
@@ -198,7 +198,7 @@ export class SRect {
      * @return width 与 height 都大于 0,返回 true,否则返回 false。
      *
      * @see isEmpty(), isNull()
-     */
+    */
     isValid(): boolean {
         return this.size.isValid();
     } // Function isValid()
@@ -207,7 +207,7 @@ export class SRect {
      * 是否包含另一个矩阵
      *
      * @return true     包含
-     */
+    */
     isIn(rect: SRect): boolean {
         return (
             this.left <= rect.left &&
@@ -223,7 +223,7 @@ export class SRect {
      * @param x       X 坐标
      * @param y       Y 坐标
      * @return 如果包含返回 true, 否则返回 false
-     */
+    */
     contains(x: number, y: number): boolean {
         return (
             x >= this.left &&
@@ -237,7 +237,7 @@ export class SRect {
      * 计算中心点
      *
      * @return 中心点坐标
-     */
+    */
     center(): SPoint {
         return new SPoint(
             this.x + this.width / 2.0,
@@ -250,7 +250,7 @@ export class SRect {
      *
      * @param dx    X 轴位移
      * @param dy    Y 轴位移
-     */
+    */
     translate(dx: number, dy: number): void {
         this.x += dx;
         this.y += dy;
@@ -262,7 +262,7 @@ export class SRect {
      * @param dx    X 轴位移
      * @param dy    Y 轴位移
      * @return 移动后的矩形
-     */
+    */
     translated(dx: number, dy: number): SRect {
         return new SRect(this.x + dx, this.y + dy, this.width, this.height);
     } // Function translated()
@@ -274,7 +274,7 @@ export class SRect {
      * @param dy          Y 轴位移
      * @param dw          宽度调整
      * @param dh          高度调整
-     */
+    */
     adjust(dx: number, dy: number, dw: number, dh: number): void {
         this.x += dx;
         this.y += dy;
@@ -290,7 +290,7 @@ export class SRect {
      * @param dw          宽度调整
      * @param dh          高度调整
      * @return 调整后的矩形
-     */
+    */
     adjusted(dx: number, dy: number, dw: number, dh: number): SRect {
         return new SRect(
             this.x + dx,
@@ -304,7 +304,7 @@ export class SRect {
      * 合并矩形
      *
      * @param rect    合并的矩形
-     */
+    */
     union(rect: SRect): void {
         let r = this.unioned(rect);
         this.x = r.x;
@@ -318,7 +318,7 @@ export class SRect {
      *
      * @param rect    合并的矩形
      * @return 返回合并后的矩形
-     */
+    */
     unioned(rect: SRect): SRect {
         let left = Math.min(this.left, rect.left);
         let top = Math.min(this.top, rect.top);
@@ -332,7 +332,7 @@ export class SRect {
      *
      * @param rect    合并的矩形
      * @return 返回合并后的矩形
-     */
+    */
     intersected(rect: SRect): SRect {
         let minX = this.left < rect.left ? this.left : rect.left;
         let minY = this.top < rect.top ? this.top : rect.top;
@@ -351,7 +351,7 @@ export class SRect {
      * 相交矩形
      *
      * @param rect    合并的矩形
-     */
+    */
     intersect(rect: SRect): SRect {
         let left = Math.min(this.left, rect.left);
         let top = Math.min(this.top, rect.top);

+ 11 - 11
persagy-web-draw/src/types/SSize.ts

@@ -43,14 +43,14 @@ export class SSize {
     // 构造函数
     /**
      * 构造函数
-     */
+    */
     constructor();
 
     /**
      * 构造函数
      *
      * @param size    大小
-     */
+    */
     constructor(size: SSize);
 
     /**
@@ -58,7 +58,7 @@ export class SSize {
      *
      * @param width   宽度
      * @param height  高度
-     */
+    */
     constructor(width: number, height: number);
 
     /**
@@ -66,7 +66,7 @@ export class SSize {
      *
      * @param width   宽度
      * @param height  高度
-     */
+    */
     constructor(width?: number | SSize, height?: number) {
         if (width == undefined) {
             this.width = 0;
@@ -88,7 +88,7 @@ export class SSize {
      * @return width 或 height 小于等于 0,返回 true,否则返回 false。
      *
      * @see isNull(), isValid()
-     */
+    */
     isEmpty(): boolean {
         return this.width <= 0 || this.height <= 0;
     } // Function isEmpty()
@@ -99,7 +99,7 @@ export class SSize {
      * @return width 与 height 都等于 0,返回 true,否则返回 false。
      *
      * @see isEmpty(), isValid()
-     */
+    */
     isNull(): boolean {
         return this.width == 0 && this.height == 0;
     } // Function isNull()
@@ -110,7 +110,7 @@ export class SSize {
      * @return width与 height 都大于 0,返回 true,否则返回 false。
      *
      * @see isEmpty(), isNull()
-     */
+    */
     isValid(): boolean {
         return this.width > 0 && this.height > 0;
     } // Function isValid()
@@ -121,7 +121,7 @@ export class SSize {
      * @param width       宽度
      * @param height      高度
      * @param mode        缩放模式
-     */
+    */
     scale(
         width: number,
         height: number,
@@ -139,7 +139,7 @@ export class SSize {
      * @param height      高度
      * @param mode        缩放模式
      * @return 缩放大小
-     */
+    */
     scaled(
         width: number,
         height: number,
@@ -167,7 +167,7 @@ export class SSize {
      * 互换 width 与 height
      *
      * @see transposed()
-     */
+    */
     transpose(): void {
         let size = this.transposed();
         this.width = size.width;
@@ -180,7 +180,7 @@ export class SSize {
      * @return 返回互换 width 与 height 的 SSize。
      *
      * @see transpose()
-     */
+    */
     transposed(): SSize {
         return new SSize(this.height, this.width);
     } // Function transposed()

+ 2 - 2
persagy-web-draw/src/utils/SPolygonUtil.ts

@@ -38,7 +38,7 @@ export class SPolygonUtil {
      * @param x           点的 x 坐标
      * @param y           点的 y 坐标
      * @param pointList   多边形顶点
-     */
+    */
     static pointIn(x: number, y: number, pointList: SPoint[]): boolean {
         let crossNum = 0;
         for (let i = 0; i < pointList.length; i++) {
@@ -73,7 +73,7 @@ export class SPolygonUtil {
      *
      * @param pointList   多边形顶点
      * @return 为负,顺时针;为正,逆时针;0,点在直线上。
-     */
+    */
     static clockDir(pointList: SPoint[]): number {
         if (pointList.length < 3) {
             return 0;

+ 7 - 7
persagy-web-edit/package.json

@@ -5,10 +5,10 @@
     "main": "lib/index.js",
     "types": "lib/index.d.js",
     "remote": {
-        "host": "47.94.89.44",
-        "path": "/opt/tomcat9/webapps/api/web/edit",
-        "user": "user1",
-        "password": "@)!^sagacloud",
+        "host": "47.93.22.124",
+        "path": "/opt/web/doc/api/web/edit",
+        "user": "doc",
+        "password": "saga2020(^cloud==",
         "local": "api"
     },
     "scripts": {
@@ -22,7 +22,7 @@
     "keywords": [
         "graph-edit"
     ],
-    "author": "韩耀龙(han_yao_long@163.com)",
+    "author": "韩耀龙 <han_yao_long@163.com> ",
     "license": "ISC",
     "publishConfig": {
         "registry": "http://dev.dp.sagacloud.cn:8082/repository/npm-hosted/"
@@ -40,7 +40,7 @@
         "typescript": "^3.5.3"
     },
     "dependencies": {
-        "@persagy-web/big": "2.2.13",
+        "@persagy-web/graph": "2.2.22",
         "@types/uuid": "^8.0.0"
     }
-}
+}

+ 47 - 13
persagy-web-edit/src/SGraphEdit.ts

@@ -26,41 +26,75 @@
 
 import { SGraphItem } from "@persagy-web/graph/";
 import { SItemStatus } from "@persagy-web/big";
+import { SMouseEvent } from "@persagy-web/base/";
 
 /**
  * 编辑基类
  *
- * @author  韩耀龙(han_yao_long@163.com)
+ * @author 韩耀龙 <han_yao_long@163.com>
  */
 export class SGraphEdit extends SGraphItem {
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //属性
-    /**编辑状态 */
+    /** 编辑状态 */
     protected _status: SItemStatus = SItemStatus.Normal;
     get status(): SItemStatus {
         return this._status;
-    }
+    } // Get status
     set status(value: SItemStatus) {
         const oldStatus = this._status;
         const newStatus = value;
         this._status = value;
         //状态变更触发事件
-        this.$emit('StatusChange', oldStatus, newStatus)
+        this.$emit('statusChange', oldStatus, newStatus);
         this.update();
-    }
+    } // Set status
 
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //函数
     /**
-     * 将类中得数据转换为方便存储格式的方法
+     * 构造函数
      *
-     * return   any         针对item类型保持相应的格式
+     * @param parent      指向父对象
      */
-    toData(): any {
+    constructor(parent: SGraphItem | null) {
+        super();
+        if (parent) {
+            this.parent = parent;
+        }
+
+        this.selectable = true;
+    } // Constructor
 
-    }
+    /**
+     * 重做
+     */
+    redo(): void {
+        // do nothing
+    } // Function redo()
 
-    constructor(parent: SGraphItem | null, ) {
-        super(parent)
-    }
-}
+    /**
+     * 撤销
+     */
+    undo(): void {
+        // do nothing
+    } // Function undo()
+
+    /**
+     * 将类中得数据转换为方便存储格式的方法
+     *
+     * @return 针对 item 类型保持相应的格式
+     */
+    toData(): any {
+        // do nothing
+    } // Function toData()
+    /**
+     * 将类中得数据转换为方便存储格式的方法
+     *
+     * @return 针对 item 类型保持相应的格式
+     */
+    onContextMenu(event: SMouseEvent): boolean {
+        this.$emit('onContextMenu', event);
+        return true;
+    } // Function onContextMenu()
+} // Class SGraphEdit

+ 479 - 0
persagy-web-edit/src/SGraphEditScene.ts

@@ -0,0 +1,479 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import { SGraphScene, SGraphItem } from "@persagy-web/graph";
+import { SPoint } from "@persagy-web/draw";
+import { SMouseEvent, SUndoStack, } from "@persagy-web/base";
+import { SRectSelectItem, SItemStatus } from "@persagy-web/big";
+import { SBaseArrowEdit, SBasePolygonEdit, SBaseCircleEdit, SBaseLineEdit, SGraphAddCommand, SGraphEdit, SBasePolylineEdit, SBaseTextEdit, SBaseImageEdit, SBaseRectEdit, SBaseTriangleEdit } from './'
+
+/**
+ * Graph 图形引擎编辑场景类
+ *
+ * @author 韩耀龙 <han_yao_long@126.com>
+ */
+export class SGraphEditScene extends SGraphScene {
+    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    //属性
+    /** undo/redo 存储栈 */
+    protected undoStack = new SUndoStack();
+    // get undoStack(): SUndoStack {
+    //     return this._undoStack
+    // }
+    // // set undoStack(val: SUndoStack) {
+    // //     this._undoStack = val
+    // // }
+    /** 编辑命令 */
+    _editCmd: string = ""
+    get editCmd(): string {
+        return this._editCmd
+    } // Get editCmd
+    set editCmd(val: string) {
+        this._editCmd = val;
+    } // Set editCmd
+
+    /** 是否可编辑 */
+    _isEditStatus: Boolean = true;
+    set isEditStatus(bol: Boolean) {
+        this._isEditStatus = bol;
+    } // Get isEditStatus
+    get isEditStatus(): Boolean {
+        return this._isEditStatus;
+    } // Set isEditStatus
+
+    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    //函数
+    /**
+     * 构造函数
+     */
+    constructor() {
+        super()
+        // // 选择绑定选额item事件
+        this.selectContainer.connect("selectChange", this, this.selectChange);
+    } // Constructor
+
+    /**
+     * 选中 item 触发方法
+     *
+     * @param obj 变化后的对象
+     */
+    selectChange(obj: any) {
+        // do nothing
+    } // Function selectChange
+
+    /**
+     * 新增基础类直线
+     *
+     * @param event   鼠标事件参数
+     */
+     addLine(event: SMouseEvent): void {
+        const data = {
+            /** 名称 */
+            name: '基础直线',
+            /** 图标(Image),线类型(Line) */
+            type: "Line",
+            /** 缩放比例(Image),线类型(Line) */
+            scale: { x: 1, y: 1, z: 1 },
+            /** 缩放比例(Image),线类型(Line) */
+            rolate: { x: 0, y: 0, z: 0 },
+            /** 位置 */
+            pos: { x: 0, y: 0 },
+            /** 由应用自己定义 */
+            properties: {
+                type: "BaseLine"           // 自定义类型用于区分mark与node
+            },
+            style: {
+                line: [{ x: event.x, y: event.y }],
+                default: {
+                }
+            }
+        }
+        const lineItem = new SBaseLineEdit(null, data);
+        lineItem.status = SItemStatus.Create;
+        this.addItem(lineItem);
+        this.undoStack.push(new SGraphAddCommand(this, lineItem));
+        lineItem.selectable = true;
+        this.grabItem = lineItem;
+        lineItem.connect("finishCreated", this, this.finishCreated);
+        lineItem.connect("onContextMenu", this, this.getItem);
+        if (this.view) {
+            this.view.update();
+        }
+    } // Function addLine()
+
+    /**
+     * 新增折线
+     *
+     * @param event 鼠标事件
+     */
+    addPolyLine(event: SMouseEvent): void {
+        const data = {
+            name: '基础折线',
+            type: "line",
+            pos: { x: 0, y: 0 },
+            properties: {
+                type: "BasePolyline",
+            },
+            style: {
+                outLine: [{ x: event.x, y: event.y }],
+                default: {
+                }
+            }
+        }
+        const item = new SBasePolylineEdit(null, data);
+        item.status = SItemStatus.Create;
+        item.selectable = true;
+        this.addItem(item);
+        this.undoStack.push(new SGraphAddCommand(this, item));
+        this.grabItem = item;
+        item.connect("finishCreated", this, this.finishCreated);
+        item.connect("onContextMenu", this, this.getItem);
+        if (this.view) {
+            this.view.update();
+        }
+    } // Function addPolyLine()
+
+    /**
+     * 新增基础类图片
+     *
+     * @param event   鼠标事件参数
+     */
+    addImageItem(event: SMouseEvent): void {
+        const data = {
+            /** 名称 */
+            name: '基础图片',
+            num: 1,
+            /** 图标(Image),线类型(Line) */
+            type: "Image",
+            /** 位置 */
+            pos: { x: event.x, y: event.y },
+            /** 由应用自己定义 */
+            properties: {
+                type: "BaseImage",
+            },
+            style: {
+                default: {
+                    strokecolor: "#c0ccda",
+                    url: '',
+                }
+            }
+        }
+        const item = new SBaseImageEdit(null, data);
+        item.selectable = true;
+        item.moveable = true;
+        this.addItem(item);
+        this.undoStack.push(new SGraphAddCommand(this, item));
+        this.finishCreated(item);
+    } // Function addImageItem()
+
+    /**
+     * 新增基础类文本
+     *
+     * @param event   鼠标事件参数
+     */
+    addTextItem(event: SMouseEvent): void {
+        const data = {
+            /** 名称 */
+            name: '基础文本',
+            /** 图标 */
+            type: "Text",
+            /** 位置 */
+            pos: { x: event.x, y: event.y },
+            size: { width: 0, height: 0 },
+            /** 由应用自己定义 */
+            properties: {
+                type: "BaseText"           // 自定义类型用于区分mark与node
+            },
+            style: {
+                default: {
+                    text: '请在右侧属性栏输入文字!',
+                    color: "#646c73",
+                    font: 14,
+                    backgroundcolor: "#f7f9facc",
+                }
+            }
+        };
+        const item = new SBaseTextEdit(null, data);
+        item.moveTo(event.x, event.y);
+        item.moveable = true;
+        this.addItem(item);
+        this.undoStack.push(new SGraphAddCommand(this, item));
+        this.grabItem = null;
+        item.connect("onContextMenu", this, this.getItem);
+        this.finishCreated(item);
+    } // Function addTextItem()
+
+    /**
+     * 添加基本矩形 item
+     *
+     * @param event 鼠标事件
+     */
+    addRectItem(event: SMouseEvent): void {
+        const data = {
+            name: '基础矩形',
+            /** 图标(Image),线类型(Line) */
+            type: "Zone",
+            /** 位置 */
+            pos: { x: 0, y: 0 },
+            properties: {
+                type: "BaseRect",
+            },
+            style: {
+                default: {
+                    line: [{ x: event.x, y: event.y }],
+                }
+            }
+        }
+
+        const rectItem = new SBaseRectEdit(null, data);
+        rectItem.status = SItemStatus.Create;
+        this.addItem(rectItem);
+        this.undoStack.push(new SGraphAddCommand(this, rectItem));
+        rectItem.selectable = true;
+        rectItem.moveable = true;
+        this.grabItem = rectItem;
+        rectItem.isTransform = true
+        rectItem.connect("finishCreated", this, this.finishCreated);
+        rectItem.connect("onContextMenu", this, this.getItem);
+        if (this.view) {
+            this.view.update();
+        }
+    } // Function addRectItem()
+
+    /**
+     * 添加基本三角形 item
+     *
+     * @param event 鼠标事件
+     */
+    addTriangleItem(event: SMouseEvent): void {
+        const data = {
+            name: '基础三角形',
+            type: "Zone",
+            pos: { x: 0, y: 0 },
+            properties: {
+                type: "BaseTriangle",
+            },
+            style: {
+                default: {
+                    line: [{ x: event.x, y: event.y }],
+                }
+            }
+        }
+        const triangleItem = new SBaseTriangleEdit(null, data);
+        triangleItem.status = SItemStatus.Create;
+        this.addItem(triangleItem);
+        this.undoStack.push(new SGraphAddCommand(this, triangleItem));
+        triangleItem.selectable = true;
+        triangleItem.moveable = true;
+        this.grabItem = triangleItem;
+        triangleItem.connect("finishCreated", this, this.finishCreated);
+        triangleItem.connect("onContextMenu", this, this.getItem);
+        if (this.view) {
+            this.view.update();
+        }
+    } // Function addTriangleItem()
+
+    /**
+     * 添加基本圆
+     *
+     * @param event 鼠标事件
+     */
+    addCircleItem(event: SMouseEvent): void {
+        const data = {
+            name: '基础圆形',
+            type: "Zone",
+            pos: { x: 0, y: 0 },
+            properties: {
+                type: "BaseCircle",
+            },
+            style: {
+                default: {
+                },
+                line: [{ x: event.x, y: event.y }],
+            }
+        }
+        const circleItem = new SBaseCircleEdit(null, data);
+        circleItem.status = SItemStatus.Create;
+        circleItem.selectable = true;
+        this.grabItem = circleItem;
+        this.addItem(circleItem);
+        this.undoStack.push(new SGraphAddCommand(this, circleItem));
+        circleItem.connect("finishCreated", this, this.finishCreated);
+        circleItem.connect("onContextMenu", this, this.getItem);
+        if (this.view) {
+            this.view.update();
+        }
+    } // Function addCircleItem()
+
+    /**
+     * 添加基本多边形
+     *
+     * @param event     鼠标事件
+     */
+    addPolygonItem(event: SMouseEvent): void {
+        const data = {
+            name: '基础多边形',
+            type: "Zone",
+            pos: { x: 0, y: 0 },
+            properties: {
+                type: "BasePolygon",
+            },
+            style: {
+                outLine: [{ x: event.x, y: event.y }],
+                default: {
+                }
+            }
+        };
+        const polygonItem = new SBasePolygonEdit(null, data);
+        polygonItem.status = SItemStatus.Create;
+        polygonItem.selectable = true;
+        this.addItem(polygonItem);
+        this.undoStack.push(new SGraphAddCommand(this, polygonItem));
+        this.grabItem = polygonItem;
+        polygonItem.connect("finishCreated", this, this.finishCreated);
+        polygonItem.connect("onContextMenu", this, this.getItem);
+        if (this.view) {
+            this.view.update();
+        };
+    } // Function addPolygonItem()
+
+    /**
+     * 添加基本箭头 item (直线类)
+     *
+     * @param event     鼠标事件
+     */
+    addBaseArrowsItem(event: SMouseEvent): void {
+        const data = {
+            name: '基础箭头',
+            type: "Zone",
+            pos: { x: 0, y: 0 },
+            properties: {
+                type: "BaseArrow",
+            },
+            style: {
+                default: {
+                    line: [{ x: event.x, y: event.y }],
+                }
+            }
+        }
+        const arrowItem = new SBaseArrowEdit(null, data);
+        arrowItem.status = SItemStatus.Create;
+        arrowItem.moveable = true;
+        this.addItem(arrowItem);
+        this.undoStack.push(new SGraphAddCommand(this, arrowItem));
+        arrowItem.selectable = true;
+        this.grabItem = arrowItem;
+        arrowItem.connect("finishCreated", this, this.finishCreated);
+        arrowItem.connect("onContextMenu", this, this.getItem);
+        if (this.view) {
+            this.view.update();
+        }
+    } // Function addBaseArrowsItem()
+
+    /**
+     * 对齐指定 item
+     *
+     * @param v     对齐类型
+     */
+    changeAlignItem(v: any): void {
+        this.selectContainer.layout(v);
+    } // Function changeAlignItem()
+
+    /**
+     * 保存数据
+     *
+     * @return 返回需要保存的数据
+     */
+    saveMsgItem(): any {
+        // do nothing
+    } // Function saveMsgItem()
+
+    /**
+     * 重做
+     */
+    redo(): void {
+        // do nothing
+    } // Function redo()
+
+    /**
+     * 撤销
+     */
+    undo(): void {
+        // do nothing
+    } // Function undo()
+
+    /**
+     * 完成创建的回调函数
+     *
+     * @param item 完成创建的item
+     */
+    finishCreated(item: SGraphItem): void {
+        // do nothing
+    } // Function finishCreated()
+
+    /**
+     * 复制
+     */
+    copy(): void {
+        // do nothing
+    } // Function copy()
+
+    /**
+     * 粘贴
+     */
+    paste(): void { } // Function paste()
+
+    /**
+     *  选中状态方法
+     *
+     *  @param  item    选中的 item
+     */
+    toggleItem(item: SGraphItem): void {
+        this.selectContainer.clear()
+        this.selectContainer.toggleItem(item)
+    } // Function toggleItem()
+
+    /**
+     * 框选
+     */
+    addRectSelect(event: SMouseEvent) {
+        let point = new SPoint(event.x, event.y);
+        let rect = new SRectSelectItem(null, point);
+        this.addItem(rect);
+        this.grabItem = rect;
+    } // Function addRectSelect()
+
+    /**
+     * 获取 item (常用与场景外的调用)
+     *
+     * @param  event    SMouseEvent 鼠标事件
+     * @param  item     SGraphEdit|null 返回 item
+     *
+     */
+    getItem(item: SGraphEdit | null, event: SMouseEvent[]) {
+    } // Function getItem()
+
+}// Class SGraphEditScene

+ 13 - 15
persagy-web-edit/src/commands/SGraphAddCommand.ts

@@ -28,26 +28,25 @@ import { SGraphCommand } from "./SGraphCommand";
 import { SGraphItem,SGraphScene } from "@persagy-web/graph/";
 import { SUndoCommand } from "@persagy-web/base";
 
-
 /**
- * 添加item命令
+ * 添加 item 命令
  *
- * @author  panglixiang
+ * @author 韩耀龙 <han_yao_long@163.com>
  */
 export class SGraphAddCommand extends SGraphCommand {
-    /** 命令名称    */
+    /** 命令名称 */
     readonly command: string;
-    /** 命令item对象    */
+    /** 命令 item 对象 */
     item: SGraphItem;
-    /** 命令item的父类   */
+    /** 命令 item 的父类 */
     parent: SGraphItem | null;
 
     /**
      * 构造函数
      *
-     * @param scene   item所在场景
-     * @param item    命令item对象
-     */
+     * @param scene   item 所在场景
+     * @param item    命令 item 对象
+    */
     constructor(scene: SGraphScene, item: SGraphItem) {
         super(scene);
         this.item = item;
@@ -59,16 +58,16 @@ export class SGraphAddCommand extends SGraphCommand {
     /**
      * 合并命令
      *
-     * @return boolean 是否已执行合并
-     */
+     * @param command   命令对象
+     * @return 是否已执行合并
+    */
     mergeWith(command: SUndoCommand): boolean {
         return false;
     } // Function mergeWith()
 
     /**
      * 重做
-     *
-     */
+    */
     redo(): void {
         this.item.parent = this.parent;
         // @ts-ignore
@@ -77,8 +76,7 @@ export class SGraphAddCommand extends SGraphCommand {
 
     /**
      * 撤销
-     *
-     */
+    */
     undo(): void {
         this.item.parent = null;
         // @ts-ignore

+ 3 - 3
persagy-web-edit/src/commands/SGraphCommand.ts

@@ -28,7 +28,7 @@ import { SUndoCommand } from "@persagy-web/base";
 import { SGraphScene } from "@persagy-web/graph/";
 
 /**
- * Graph命令基类
+ * Graph 命令基类
  *
  * @author 庞利祥 <sybotan@126.com>
  */
@@ -39,8 +39,8 @@ export abstract class SGraphCommand extends SUndoCommand {
     /**
      * 构造函数
      *
-     * @param scene       命令所属的场景类
-     */
+     * @param scene   命令所属的场景类
+    */
     protected constructor(scene: SGraphScene | null) {
         super();
         this.scene = scene;

+ 19 - 20
persagy-web-edit/src/commands/SGraphMoveCommand.ts

@@ -31,29 +31,28 @@ import { SUndoCommand } from "@persagy-web/base";
 import { SGraphScene } from "@persagy-web/graph/";
 
 /**
- * item移动命令
- *
- * @author  panglixiang
+ * item 移动命令
  *
+ * @author 庞利祥 <sybotan@126.com>
  */
 export class SGraphMoveCommand extends SGraphCommand {
-    /** 命令名称    */
+    /** 命令名称 */
     readonly command: string;
-    /** 执行命令的item   */
+    /** 执行命令的 item */
     item: SGraphItem;
-    /** 移动前位置    */
+    /** 移动前位置 */
     old: SPoint;
-    /** 移动后位置   */
+    /** 移动后位置 */
     pos: SPoint;
 
     /**
      * 构造函数
      *
-     * @param scene   当前场景
-     * @param item    item对象
-     * @param old     移动前位置
-     * @param pos     移动后位置
-     */
+     * @param scene    当前场景
+     * @param item     item 对象
+     * @param old      移动前位置
+     * @param pos      移动后位置
+    */
     constructor(
         scene: SGraphScene,
         item: SGraphItem,
@@ -71,21 +70,21 @@ export class SGraphMoveCommand extends SGraphCommand {
     /**
      * 合并命令
      *
-     * @param command 命令
-     * @return boolean 是否已执行合并命令
-     */
+     * @param command      命令
+     * @return 是否已执行合并命令
+    */
     mergeWith(command: SUndoCommand): boolean {
         if (command instanceof SGraphMoveCommand && command.item == this.item) {
             command.pos = this.pos;
             return true;
         }
+
         return false;
     } // Function mergeWith()
 
     /**
      * 重做
-     *
-     */
+    */
     redo(): void {
         this.item.pos = new SPoint(this.pos.x, this.pos.y);
         this.item.update();
@@ -93,8 +92,7 @@ export class SGraphMoveCommand extends SGraphCommand {
 
     /**
      * 撤销
-     *
-     */
+    */
     undo(): void {
         this.item.pos = new SPoint(this.old.x, this.old.y);
         this.item.update();
@@ -103,7 +101,8 @@ export class SGraphMoveCommand extends SGraphCommand {
     /**
      * 命令细节描述
      *
-     */
+     * @return 字符串类型的数据
+    */
     toString(): string {
         return `oldPos=${JSON.stringify(this.old)};\nnewPos=${JSON.stringify(
             this.pos

+ 13 - 9
persagy-web-edit/src/commands/SGraphPointListDelete.ts

@@ -30,29 +30,29 @@ import { SGraphCommand, SGraphItem, SGraphScene } from "@persagy-web/graph/";
 /**
  * 多边形、折线等相关顶点的位置删除命令
  *
- * @author  韩耀龙
+ * @author 韩耀龙 <han_yao_long@163.com>
  */
-
 export class SGraphPointListDelete extends SGraphCommand {
-    /** 命令名称    */
+    /** 命令名称 */
     readonly command: string;
-    /**  指向item对象 */
+    /** 指向 item 对象 */
     item: SGraphItem;
     /** 索引 */
     index: number | null;
-    /**  删除位置 */
+    /** 删除位置 */
     pos: SPoint | null;
     /** 顶点数组 */
     pointList: SPoint[];
 
     /**
      * 构造函数
+     *
      * @param scene       item所在场景
      * @param item        指向item对象
      * @param pointList   顶点数组
      * @param pos         删除的点
      * @param index       索引
-     */
+    */
     constructor(
         scene: SGraphScene,
         item: SGraphItem,
@@ -71,33 +71,37 @@ export class SGraphPointListDelete extends SGraphCommand {
 
     /**
      * 执行重做操作执行
-     */
+    */
     redo(): void {
         if (this.index == null) {
             this.pointList.pop();
         } else {
             this.pointList.splice(this.index, 1);
         }
+
         this.item.update();
     } // Function redo()
 
     /**
      * 执行取消操作执行
-     */
+    */
     undo(): void {
         if (this.pos == null) return;
+
         if (this.index == null) {
             this.pointList.push(this.pos);
         } else {
             this.pointList.splice(this.index, 0, this.pos);
         }
+
         this.item.update();
     } // Function undo()
 
     /**
      * 命令细节描述
      *
-     */
+     * @return 字符串类型数据
+    */
     toString(): string {
         const pointList = `pointList=${JSON.stringify(this.pointList)}`;
         const pos = `pos=${JSON.stringify(this.pos)}`;

+ 12 - 11
persagy-web-edit/src/commands/SGraphPointListInsert.ts

@@ -30,15 +30,14 @@ import { SGraphCommand, SGraphItem, SGraphScene } from "@persagy-web/graph/";
 /**
  * 多边形、折线等相关顶点的位置插入命令
  *
- * @author  韩耀龙
+ * @author 韩耀龙 <han_yao_long@163.com>
  */
-
 export class SGraphPointListInsert extends SGraphCommand {
-    /** 命令名称    */
+    /** 命令名称 */
     readonly command: string;
-    /**  指向item对象 */
+    /** 指向 item 对象 */
     item: SGraphItem;
-    /**  当前位置 */
+    /** 当前位置 */
     pos: SPoint;
     /** 索引 */
     index: number | null;
@@ -47,12 +46,13 @@ export class SGraphPointListInsert extends SGraphCommand {
 
     /**
      * 构造函数
-     * @param scene       item所在场景
-     * @param item        指向item对象
+     *
+     * @param scene       item 所在场景
+     * @param item        指向 item 对象
      * @param pointList   顶点数组
      * @param pos         当前位置
      * @param index       索引
-     */
+    */
     constructor(
         scene: SGraphScene,
         item: SGraphItem,
@@ -71,7 +71,7 @@ export class SGraphPointListInsert extends SGraphCommand {
 
     /**
      * 执行重做操作执行
-     */
+    */
     redo(): void {
         const point = new SPoint(this.pos.x, this.pos.y);
         if (this.index == null) {
@@ -84,7 +84,7 @@ export class SGraphPointListInsert extends SGraphCommand {
 
     /**
      * 执行取消操作执行
-     */
+    */
     undo(): void {
         if (this.index == null) {
             this.pointList.pop();
@@ -97,7 +97,8 @@ export class SGraphPointListInsert extends SGraphCommand {
     /**
      * 命令细节描述
      *
-     */
+     * @return 字符串类型数据
+    */
     toString(): string {
         const pointList = `pointList=${JSON.stringify(this.pointList)}`;
         const pos = `pos=${JSON.stringify(this.pos)}`;

+ 13 - 12
persagy-web-edit/src/commands/SGraphPointListUpdate.ts

@@ -30,17 +30,16 @@ import { SGraphCommand, SGraphItem, SGraphScene } from "@persagy-web/graph/";
 /**
  * 多边形、折线等相关顶点的位置更新命令
  *
- * @author  韩耀龙
+ * @author 韩耀龙 <han_yao_long@163.com>
  */
-
 export class SGraphPointListUpdate extends SGraphCommand {
-    /** 命令名称    */
+    /** 命令名称 */
     readonly command: string;
-    /**  指向item对象 */
+    /** 指向 item 对象 */
     item: SGraphItem;
-    /**  原位置 */
+    /** 原位置 */
     old: SPoint;
-    /**  当前位置 */
+    /** 当前位置 */
     pos: SPoint;
     /** 索引 */
     index: number;
@@ -49,13 +48,14 @@ export class SGraphPointListUpdate extends SGraphCommand {
 
     /**
      * 构造函数
-     * @param scene       item所在场景
-     * @param item        指向item对象
+     *
+     * @param scene       item 所在场景
+     * @param item        指向 item 对象
      * @param pointList   顶点数组
      * @param old         原位置
      * @param pos         当前位置
      * @param index       索引
-     */
+    */
     constructor(
         scene: SGraphScene,
         item: SGraphItem,
@@ -76,7 +76,7 @@ export class SGraphPointListUpdate extends SGraphCommand {
 
     /**
      * 执行重做操作执行
-     */
+    */
     redo(): void {
         this.pointList[this.index].x = this.pos.x;
         this.pointList[this.index].y = this.pos.y;
@@ -85,7 +85,7 @@ export class SGraphPointListUpdate extends SGraphCommand {
 
     /**
      * 执行取消操作执行
-     */
+    */
     undo(): void {
         this.pointList[this.index].x = this.old.x;
         this.pointList[this.index].y = this.old.y;
@@ -95,7 +95,8 @@ export class SGraphPointListUpdate extends SGraphCommand {
     /**
      * 命令细节描述
      *
-     */
+     * @return 字符串型数据
+    */
     toString(): string {
         const pointList = `pointList=${JSON.stringify(this.pointList)}`;
         const old = `old=${JSON.stringify(this.old)}`;

+ 11 - 11
persagy-web-edit/src/commands/SGraphPropertyCommand.ts

@@ -31,13 +31,12 @@ import { SGraphScene } from "@persagy-web/graph/";
 /**
  * 属性修改命令类
  *
- * @author  张宇(taohuzy@163.com)
+ * @author 韩耀龙 <han_yao_long@163.com>
  */
-
 export class SGraphPropertyCommand<T> extends SGraphCommand {
-    /** 命令名称    */
+    /** 命令名称 */
     readonly command: string;
-    /**	指向item对象	*/
+    /**	指向 item 对象 */
     item: SGraphItem;
     /** 属性名称 */
     propName: string;
@@ -50,11 +49,11 @@ export class SGraphPropertyCommand<T> extends SGraphCommand {
      * 构造函数
      *
      * @param scene       命令所属的场景类
-     * @param item        命令所属的item类
+     * @param item        命令所属的 item 
      * @param propName    修改的属性名称
      * @param oldProp     修改前的属性值
      * @param newProp     修改后的属性值
-     */
+    */
     constructor(
         scene: SGraphScene,
         item: SGraphItem,
@@ -72,8 +71,8 @@ export class SGraphPropertyCommand<T> extends SGraphCommand {
     } // Constructor
 
     /**
-     * redo操作
-     */
+     * redo 操作
+    */
     redo(): void {
         // @ts-ignore
         this.item[this.propName] = this.newProp;
@@ -81,8 +80,8 @@ export class SGraphPropertyCommand<T> extends SGraphCommand {
     } // Function redo()
 
     /**
-     * undo操作
-     */
+     * undo 操作
+    */
     undo(): void {
         // @ts-ignore
         this.item[this.propName] = this.oldProp;
@@ -92,7 +91,8 @@ export class SGraphPropertyCommand<T> extends SGraphCommand {
     /**
      * 命令细节描述
      *
-     */
+     * @return 字符串型数据
+    */
     toString(): string {
         const propName = `propName=${this.propName}`;
         const oldProp = `oldProp=${JSON.stringify(this.oldProp)}`;

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

@@ -27,12 +27,12 @@
 /**
  * 布局对齐方式
  *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
+ * @author 韩耀龙 <han_yao_long@163.com>
  */
 export enum SGraphLayoutType {
-    /** 垂直分布    */
+    /** 垂直分布 */
     Vertical,
-    /** 垂直分布    */
+    /** 垂直分布 */
     Horizontal,
     /** 左对齐 */
     Left,
@@ -42,8 +42,8 @@ export enum SGraphLayoutType {
     Top,
     /** 底对齐 */
     Bottom,
-    /** 水平居中    */
+    /** 水平居中 */
     Center,
-    /** 垂直居中    */
+    /** 垂直居中 */
     Middle
 } // Enum SGraphLayoutType

+ 3 - 3
persagy-web-edit/src/enums/SImageShowType.ts

@@ -25,12 +25,12 @@
  */
 
 /**
- * 图片item展示方式
+ * 图片 item 展示方式
  *
- * @author  haojianlong
+ * @author 韩耀龙 <han_yao_long@163.com>
  */
 export enum SImageShowType {
-    /** 铺满  */
+    /** 铺满 */
     Full,
     /** 自适应 */
     AutoFit,

+ 5 - 5
persagy-web-edit/src/enums/SLineStyle.ts

@@ -27,15 +27,15 @@
 /**
  * 线样式
  *
- * @author  张宇
+ * @author 韩耀龙 <han_yao_long@163.com>
  */
 export enum SLineStyle {
-    /** 实线    */
+    /** 实线 */
     Solid,
-    /** 虚线    */
+    /** 虚线 */
     Dashed,
-    /** 点线    */
+    /** 点线 */
     Dotted,
-    /** 无    */
+    /** 无 */
     None
 } // Enum SLineStyle

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

@@ -27,15 +27,15 @@
 /**
  * 图层操作
  *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
+ * @author  韩耀龙 <han_yao_long@163.com>
  */
 export enum SOrderSetType {
-    /** 置顶  */
+    /** 置顶 */
     Top,
-    /** 置底    */
+    /** 置底 */
     Bottom,
-    /** 上移一层    */
+    /** 上移一层 */
     After,
-    /** 下移一层    */
+    /** 下移一层 */
     Before
 } // Enum SOrderSetType

+ 3 - 3
persagy-web-edit/src/enums/STextOrigin.ts

@@ -27,11 +27,11 @@
 /**
  * 文本原点位置
  *
- * @author  张宇
+ * @author  韩耀龙 <han_yao_long@163.com>
  */
 export enum STextOrigin {
-  /** 左上点    */
+  /** 左上点 */
   LeftTop,
-  /** 中心点    */
+  /** 中心点 */
   Center,
 } // Enum STextOrigin

+ 22 - 2
persagy-web-edit/src/index.ts

@@ -23,5 +23,25 @@
  *
  * *********************************************************************************************************************
  */
-import {SGraphEdit} from "./SGraphEdit";
-export {SGraphEdit}
+
+import { SGraphEdit } from "./SGraphEdit";
+import { SGraphEditScene } from "./SGraphEditScene";
+import { SBaseArrowEdit } from "./items/SBaseArrowEdit";
+import { SBaseLineEdit } from "./items/SBaseLineEdit";
+import { SBaseImageEdit } from "./items/SBaseImageEdit";
+import { SBasePolygonEdit } from "./items/SBasePolygonEdit";
+import { SBaseRectEdit } from "./items/SBaseRectEdit";
+import { SBaseCircleEdit } from "./items/SBaseCircleEdit";
+import { SBaseTriangleEdit } from "./items/SBaseTriangleEdit";
+import { SBasePolylineEdit } from "./items/SBasePolylineEdit";
+import { SBaseIconTextEdit } from "./items/SBaseIconTextEdit";
+import { SBaseTextEdit } from "./items/SBaseTextEdit" ;
+import { SGraphCommand } from "./commands/SGraphCommand";
+import { SGraphAddCommand } from "./commands/SGraphAddCommand";
+import { SGraphMoveCommand } from "./commands/SGraphMoveCommand";
+import { SGraphPointListDelete } from "./commands/SGraphPointListDelete";
+import { SGraphPointListInsert } from "./commands/SGraphPointListInsert";
+import { SGraphPointListUpdate } from "./commands/SGraphPointListUpdate";
+import { SGraphPropertyCommand } from "./commands/SGraphPropertyCommand";
+
+export {SBasePolylineEdit, SBaseIconTextEdit, SBasePolygonEdit, SBaseTextEdit, SBaseImageEdit, SBaseLineEdit, SBaseCircleEdit, SBaseTriangleEdit, SBaseRectEdit, SBaseArrowEdit, SGraphEditScene, SGraphEdit, SGraphCommand, SGraphAddCommand, SGraphMoveCommand, SGraphPointListDelete, SGraphPointListInsert, SGraphPointListUpdate, SGraphPropertyCommand }

+ 561 - 0
persagy-web-edit/src/items/SBaseArrowEdit.ts

@@ -0,0 +1,561 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import { SArrowStyleType, SColor, SLine, SPainter, SPoint, SRect } from "@persagy-web/draw";
+import { SMouseButton, SMouseEvent, SUndoStack } from "@persagy-web/base";
+import { SItemStatus } from "@persagy-web/big";;
+import {
+  SLineStyle,
+  SGraphItem, SGraphPointListInsert, SGraphPointListUpdate
+} from "@persagy-web/graph/";
+import { SGraphEdit } from "..";
+import { SMathUtil } from '@persagy-web/big/lib/utils/SMathUtil';
+import { Marker } from "./../type/Marker";
+
+/**
+ * 折线编辑类
+ *
+ * @author 韩耀龙 <han_yao_long@163.com>
+ */
+export class SBaseArrowEdit extends SGraphEdit {
+  /** 编辑相关操作的数据 */
+  data: Marker;
+  /** undo/redo 堆栈 */
+  private undoStack: SUndoStack = new SUndoStack();
+  /** 是否绘制完成 */
+  _status: SItemStatus = SItemStatus.Normal;
+  get status(): SItemStatus {
+    return this._status;
+  } // Get status
+  set status(v: SItemStatus) {
+    this._status = v;
+    if (this.undoStack) {
+      this.undoStack.clear();
+    }
+
+    this.update();
+  } // Set status
+
+  /** 矩形两个对角 */
+  private _line: SPoint[] = [];
+  get line(): SPoint[] {
+    return this._line;
+  } // Get line
+  set line(arr: SPoint[]) {
+    this._line = arr;
+    this.update();
+  } // Get line
+
+  /** 矩形左上角 */
+  private _leftTop: SPoint = new SPoint();
+  /** 矩形右下角 */
+  private _rightBottom: SPoint = new SPoint();
+  /** 拖动灵敏度 */
+  dis: number = 5;
+  /** 拖动灵敏度 */
+  private sceneDis: number = 5;
+  /** 是否垂直水平绘制  */
+  private _verAndLeve: Boolean = false;
+  get verAndLeve(): Boolean {
+    return this._verAndLeve;
+  } // Get verAndLeve
+  set verAndLeve(bool: Boolean) {
+    this._verAndLeve = bool;
+    this.update();
+  } // Set verAndLeve
+
+  /** 当前点索引 */
+  curIndex: number = -1;
+  /** 当前点坐标 */
+  private curPoint: SPoint | null = null;
+  /** 线条颜色 */
+  _strokeColor: SColor = SColor.Black;
+  get strokeColor(): SColor {
+    return this._strokeColor;
+  } // Get strokeColor
+  set strokeColor(v: SColor) {
+    this._strokeColor = v;
+    this.update();
+  } // Set strokeColor
+
+  /** 填充色 */
+  _fillColor: SColor = new SColor("#2196f3");
+  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
+
+  /** 边框样式 */
+  _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 = 1;
+  get lineWidth(): number {
+    return this._lineWidth;
+  } // Get lineWidth
+  set lineWidth(v: number) {
+    this._lineWidth = v;
+    this.update();
+  } // Set lineWidth
+
+  /**
+   * 构造函数
+   *
+   * @param parent    指向父对象
+   * @param data      数据
+   */
+  constructor(parent: SGraphItem | null, data: Marker) {
+    super(parent);
+    this.showSelect = false;
+    this.data = data;
+    if (data.style && data.style.default) {
+      // 关于顶点
+      if (data.style.default.line) {
+        let setPointList: SPoint[];
+        setPointList = data.style.default.line.map(i => {
+          return new SPoint(i.x, i.y)
+        });
+        this.line = setPointList;
+      }
+
+      // 颜色
+      if (data.style.default.strokeColor) {
+        this.strokeColor = new SColor(data.style.default.strokeColor)
+      }
+
+      // 线宽
+      if (data.style.default.LineWidth) {
+        this.lineWidth = data.style.default.lineWidth
+      }
+
+      // 线样式
+      if (data.style.default.LineStyle) {
+        this.lineStyle = data.style.default.lineStyle
+      }
+    }
+  } // Constructor
+
+  /**
+   * 鼠标双击事件
+   *
+   * @param	event   事件参数
+   * @return 是否处理该事件
+  */
+  onDoubleClick(event: SMouseEvent): boolean {
+    if (this.status == SItemStatus.Normal) {
+      this.status = SItemStatus.Edit;
+      this.grabItem(this);
+    } else if (this.status == SItemStatus.Edit) {
+      this.status = SItemStatus.Normal;
+      this.releaseItem();
+    }
+
+    this.update();
+    return true;
+  } // Function onDoubleClick()
+
+  /**
+   * 鼠标按下事件
+   *
+   * @param event   鼠标事件
+   * @return  是否处理该事件
+  */
+  onMouseDown(event: SMouseEvent): boolean {
+    this.curIndex = -1;
+    this.curPoint = null;
+    if (event.shiftKey || this._verAndLeve) {
+      event = this.compare(event);
+    }
+
+    if (event.buttons == SMouseButton.LeftButton) {
+      if (this.status == SItemStatus.Normal) {
+        return super.onMouseDown(event);
+      } else if (this.status == SItemStatus.Edit) {
+        // 判断是否点击到端点上(获取端点索引值)
+        this.findNearestPoint(new SPoint(event.x, event.y));
+      } else if (this.status == SItemStatus.Create) {
+        this.addPoint(new SPoint(event.x, event.y));
+        return true;
+      }
+    }
+
+    return true;
+  } // Function onMouseDown()
+
+  /**
+   * shift 垂直水平创建或编辑
+   *
+   * @param event   事件
+   * @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) {
+        if (this.curIndex == 1) {
+          last = this.line[0];
+        } else if (this.curIndex == 0) {
+          last = this.line[1];
+        }
+      }
+
+      const dx = Math.abs(event.x - last.x);
+      const dy = Math.abs(event.y - last.y);
+      if (dy > dx) {
+        event.x = last.x;
+      } else {
+        event.y = last.y;
+      }
+    }
+
+    return event;
+  } // Function compare()
+
+  /**
+   * 获取点击点与 Point[] 中的点距离最近点
+   *
+   * @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()
+
+  /**
+   * 鼠标移动事件
+   *
+   * @param event   鼠标事件
+   * @return  是否处理事件
+  */
+  onMouseMove(event: SMouseEvent): boolean {
+    if (event.shiftKey || this._verAndLeve) {
+      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.calRect()
+      }
+    } else if (this.status == SItemStatus.Edit) {
+      if (-1 != this.curIndex) {
+        this.line[this.curIndex].x = event.x;
+        this.line[this.curIndex].y = event.y;
+        this.calRect()
+      }
+    } else {
+      return super.onMouseMove(event);
+    }
+
+    this.update();
+    return true;
+  } // Function onMouseMove()
+
+  /**
+   * 鼠标抬起事件
+   *
+   * @param	event   事件参数
+   * @return 是否处理该事件
+  */
+  onMouseUp(event: SMouseEvent): boolean {
+    if (this.status == SItemStatus.Edit) {
+      if (this.curIndex > -1) {
+        const p = new SPoint(
+          this.line[this.curIndex].x,
+          this.line[this.curIndex].y
+        );
+        this.recordAction(SGraphPointListUpdate, [
+          this.line,
+          this.curPoint,
+          p,
+          this.curIndex
+        ]);
+      }
+    } else if (this.status == SItemStatus.Normal) {
+      this.moveToOrigin(this.x, this.y);
+      return super.onMouseUp(event);
+    }
+
+    this.curIndex = -1;
+    this.curPoint = null;
+    return true;
+  } // Function onMouseUp()
+
+  /**
+   * 计算矩形的左上角和右下角
+  */
+  private calRect(): void {
+    if (this.line.length > 1) {
+      const fi = this.line[0];
+      const se = this.line[1];
+      let minx, maxx, miny, maxy;
+      if (fi.x < se.x) {
+        minx = fi.x;
+        maxx = se.x;
+      } else {
+        minx = se.x;
+        maxx = fi.x;
+      }
+
+      if (fi.y < se.y) {
+        miny = fi.y;
+        maxy = se.y;
+      } else {
+        miny = se.y;
+        maxy = fi.y;
+      }
+
+      this._leftTop = new SPoint(minx, miny)
+      this._rightBottom = new SPoint(maxx, maxy)
+    }
+  } // Function calRect
+
+  /**
+   * 添加点至数组中
+   *
+   * @param p   添加的点
+  */
+  private addPoint(p: SPoint): void {
+    if (this.line.length < 2) {
+      this.line.push(p);
+      this.recordAction(SGraphPointListInsert, [this.line, p]);
+    } else {
+      this.line[1] = p;
+      this.recordAction(SGraphPointListInsert, [this.line, p, 1]);
+      this.status = SItemStatus.Normal;
+      this.releaseItem();
+      this.$emit("finishCreated");
+    }
+
+    this.calRect()
+    this.update();
+  } // Function addPoint()
+
+  /**
+   * 移动后处理所有坐标,并肩原点置为场景原点
+   *
+   * @param x   x 坐标
+   * @param y   y 坐标
+  */
+  moveToOrigin(x: number, y: number): void {
+    super.moveToOrigin(x, y);
+    this.line = this.line.map(t => {
+      t.x = t.x + x;
+      t.y = t.y + y;
+      return t;
+    });
+
+    this.x = 0;
+    this.y = 0;
+  } // Function moveToOrigin()
+
+  /**
+   * 记录相关动作并推入栈中
+   *
+   * @param	SGraphCommand   相关命令类
+   * @param	any             对应传入参数
+  */
+  protected recordAction(SGraphCommand: any, any: any[]): void {
+    // 记录相关命令并推入堆栈中
+    const command = new SGraphCommand(this.scene, this, ...any);
+    this.undoStack.push(command);
+  } // Function recordAction()
+
+  /**
+   * 判断点是否在区域内
+   *
+   * @param x   x 横向坐标
+   * @param y   y 纵向坐标
+   * @return  在区域内返回 true, 否则 false
+  */
+  contains(x: number, y: number): boolean {
+    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
+      ) {
+        return true;
+      }
+    }
+
+    return false;
+  } // Function contains()
+
+  /**
+   * Item 对象边界区域
+   *
+   * @return 外接矩阵
+  */
+  boundingRect(): SRect {
+    if (this.line.length > 1) {
+      this.calRect()
+      return new SRect(this._leftTop, this._rightBottom);
+    }
+
+    return new SRect()
+  } // Function boundingRect()
+
+  /**
+   * 撤销操作
+  */
+  undo(): void {
+    if (this._status != SItemStatus.Normal) {
+      this.undoStack.undo();
+    }
+  } // Function undo()
+
+  /**
+   * 重做操作
+  */
+  redo(): void {
+    if (this._status != SItemStatus.Normal) {
+      this.undoStack.redo();
+    }
+  } // Function redo()
+
+  /**
+   * 取消操作执行
+  */
+  cancelOperate(): void {
+    if (this.status == SItemStatus.Create) {
+      this.parent = null;
+      this.releaseItem();
+    } else if (this.status == SItemStatus.Edit) {
+      this.status = SItemStatus.Normal;
+      this.releaseItem();
+    }
+  } // Function cancelOperate()
+
+  /**
+   * Item绘制操作
+   *
+   * @param painter   绘制对象
+  */
+  onDraw(painter: SPainter): void {
+    painter.pen.color = this.strokeColor;
+    if (this.line.length == 2) {
+      painter.brush.color = this.fillColor;
+      painter.pen.lineWidth = this.lineWidth
+      if (this.lineStyle == SLineStyle.Dashed) {
+        painter.pen.lineDash = [
+          painter.toPx(this.lineWidth * 3),
+          painter.toPx(this.lineWidth * 7)
+        ];
+      } else if (this.lineStyle == SLineStyle.Dotted) {
+        painter.pen.lineDash = [
+          painter.toPx(this.lineWidth * 2),
+          painter.toPx(this.lineWidth * 2)
+        ];
+      }
+
+      if (this.selected && this.status == SItemStatus.Normal) {
+        painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
+        painter.shadow.shadowBlur = 10;
+        painter.shadow.shadowColor = new SColor(`#00000033`);
+        painter.shadow.shadowOffsetX = 5;
+        painter.shadow.shadowOffsetY = 5;
+      }
+
+      painter.drawArrowLine(this.line[0], this.line[1], { begin: SArrowStyleType.None, end: SArrowStyleType.Basic });
+      if (
+        this.status == SItemStatus.Edit ||
+        this.status == SItemStatus.Create
+      ) {
+        // 绘制端点
+        this.line.forEach((p, i): void => {
+          painter.brush.color = this.fillColor;
+          if (i == this.curIndex) {
+            painter.brush.color = this.activeFillColor;
+          }
+          painter.drawCircle(p.x, p.y, painter.toPx(5));
+        });
+      }
+
+    } else if (this.line.length == 1) {
+      if (
+        this.status == SItemStatus.Edit ||
+        this.status == SItemStatus.Create
+      ) {
+        // 绘制端点
+        painter.brush.color = this.fillColor;
+        painter.drawCircle(
+          this.line[0].x,
+          this.line[0].y,
+          painter.toPx(5)
+        );
+      }
+    }
+  } // Function onDraw()
+
+  /**
+   * 返回对象储存的相关数据
+   *
+   * @return	实体类保存得数据
+  */
+  toData(): any {
+    const Line = [{ x: this.line[0].x, y: this.line[0].y }, { x: this.line[1].x, y: this.line[1].y }];
+    this.data.style.default.line = Line;
+    this.data.style.default.lineWidth = this.lineWidth;
+    this.data.style.default.lineStyle = this.lineStyle;
+    this.data.style.default.strokeColor = this.strokeColor;
+    return this.data
+  } // Function toData()
+} // Class SArrowEdit

+ 392 - 0
persagy-web-edit/src/items/SBaseCircleEdit.ts

@@ -0,0 +1,392 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import { SColor, SPainter, SPoint, SRect } from "@persagy-web/draw";
+import { SMouseButton, SMouseEvent, SUndoStack } from "@persagy-web/base";
+import { SItemStatus } from "@persagy-web/big";;
+import {
+  SLineStyle,
+  SGraphItem, SGraphPointListInsert
+} from "@persagy-web/graph/";
+import { SGraphEdit } from "..";
+import { Marker } from "../type/Marker";
+
+/**
+ * 折线编辑类
+ *
+ * @author 韩耀龙 <han_yao_long@163.com>
+ */
+export class SBaseCircleEdit extends SGraphEdit {
+  /** 编辑相关操作的数据 */
+  data: Marker
+  _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 _line: SPoint[] = [];
+  get line(): SPoint[] {
+    return this._line;
+  } // Get line
+  set line(arr: SPoint[]) {
+    this._line = arr;
+    this.update();
+  } // Set line
+
+  /** 矩形左上角 */
+  private _leftTop: SPoint = new SPoint();
+  /** 矩形右下角 */
+  private _rightBottom: SPoint = new SPoint();
+  /** 绘制矩形的圆角半径 */
+  private _radius: number = 0;
+  get radius(): number {
+    return this._radius;
+  } // Get radius
+  set radius(v: number) {
+    if (v == this._radius) {
+      return;
+    }
+
+    this._radius = v;
+    this.update();
+  } // Set radius
+
+  /** 线条颜色 */
+  _strokeColor: SColor = SColor.Black;
+  get strokeColor(): SColor {
+    return this._strokeColor;
+  } // Get strokeColor
+  set strokeColor(v: SColor) {
+    this._strokeColor = v;
+    this.update();
+  } // Set strokeColor
+
+  /** 填充色 */
+  _fillColor: SColor = new SColor("#2196f3");
+  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 = 1;
+  get lineWidth(): number {
+    return this._lineWidth;
+  } // Get lineWidth
+  set lineWidth(v: number) {
+    this._lineWidth = v;
+    this.update();
+  } // Set lineWidth
+
+  /** undo/redo 堆栈 */
+  private undoStack: SUndoStack = new SUndoStack();
+
+  /**
+   * 构造函数
+   *
+   * @param parent    指向父对象
+   * @param data      矩形数据
+  */
+  constructor(parent: SGraphItem | null, data: Marker) {
+    super(parent);
+    this.data = data;
+    if (data.style) {
+      // 关于顶点
+      if (data.style.line) {
+        let setPointList: SPoint[];
+        setPointList = data.style.line.map(i => {
+          return new SPoint(i.x, i.y)
+        });
+        this.line = setPointList;
+        this.calRect()
+        console.log('this.line', this.line)
+      }
+    }
+
+    if (data.style && data.style.default) {
+
+      // 颜色
+      if (data.style.default.strokeColor) {
+        this.strokeColor = new SColor(data.style.default.strokeColor)
+      }
+
+      // 线宽
+      if (data.style.default.lineWidth) {
+        this.lineWidth = data.style.default.lineWidth
+      }
+
+      // 线样式
+      if (data.style.default.lineStyle) {
+        this.lineStyle = data.style.default.lineStyle
+      }
+    }
+  } // Constructor
+
+  /**
+   * 大小改变
+   *
+   * @param oldSize  旧数据
+   * @param newSize  新数据
+  */
+  resize(oldSize: SRect, newSize: SRect): void {
+    const xs = newSize.width / oldSize.width;
+    const ys = newSize.height / oldSize.height;
+    this.line = this.line.map(t => {
+      t.x = t.x * xs;
+      t.y = t.y * ys;
+      return t
+    })
+
+    this.calRect()
+    this.update()
+  } // Function resize()
+
+  /**
+   * 鼠标按下事件
+   *
+   * @param event   鼠标事件
+   * @return 是否处理事件
+  */
+  onMouseDown(event: SMouseEvent): boolean {
+    if (event.buttons == SMouseButton.LeftButton) {
+      if (this.status == SItemStatus.Create) {
+        this.addPoint(new SPoint(event.x, event.y));
+        return true;
+      } else {
+        return super.onMouseDown(event);
+      }
+    }
+
+    return true;
+  } // Function onMouseDown()
+
+  /**
+   * 鼠标移动事件
+   *
+   * @param event   鼠标事件
+   * @return 是否处理事件
+  */
+  onMouseMove(event: SMouseEvent): boolean {
+    if (this.status == SItemStatus.Create) {
+      if (this.line[0] instanceof SPoint) {
+        this.line[1] = new SPoint(event.x, event.y);
+        this.calRect()
+      }
+    } else {
+      return super.onMouseMove(event);
+    }
+
+    this.update();
+    return true;
+  } // Function onMouseMove()
+
+  /**
+   * 鼠标抬起事件
+   *
+   * @param	event    事件参数
+   * @return 是否处理该事件
+  */
+  onMouseUp(event: SMouseEvent): boolean {
+    if (this.status != SItemStatus.Create) {
+      super.onMouseUp(event);
+    }
+
+    return true;
+  } // Function onMouseUp()
+
+  /**
+   * 计算矩形的左上角和右下角
+  */
+  private calRect(): void {
+    if (this.line.length > 1) {
+      const fi = this.line[0];
+      const se = this.line[1];
+      let minx, maxx, miny, maxy;
+      if (fi.x < se.x) {
+        minx = fi.x;
+        maxx = se.x;
+      } else {
+        minx = se.x;
+        maxx = fi.x;
+      }
+
+      if (fi.y < se.y) {
+        miny = fi.y;
+        maxy = se.y;
+      } else {
+        miny = se.y;
+        maxy = fi.y;
+      }
+
+      this._leftTop = new SPoint(minx, miny)
+      this._rightBottom = new SPoint(maxx, maxy)
+    }
+  } // Function calRect()
+
+  /**
+   * 添加点至数组中
+   *
+   * @param p   添加的点
+  */
+  private addPoint(p: SPoint): void {
+    if (this.line.length < 2) {
+      this.line.push(p);
+      this.recordAction(SGraphPointListInsert, [this.line, p]);
+    } else {
+      this.line[1] = p;
+      this.recordAction(SGraphPointListInsert, [this.line, p, 1]);
+      this.status = SItemStatus.Normal;
+      this.releaseItem();
+      this.$emit("finishCreated");
+    }
+
+    this.calRect()
+    this.update();
+  } // Function addPoint()
+
+  /**
+   * 记录相关动作并推入栈中
+   *
+   * @param	SGraphCommand   相关命令类
+   * @param	any             对应传入参数
+  */
+  protected recordAction(SGraphCommand: any, any: any[]): void {
+    // 记录相关命令并推入堆栈中
+    const command = new SGraphCommand(this.scene, this, ...any);
+    this.undoStack.push(command);
+  } // Function recordAction()
+
+  /**
+   * Item 对象边界区域
+   *
+   * @return SRect   外接矩阵
+  */
+  boundingRect(): SRect {
+    if (this.line.length > 1) {
+      this.calRect()
+      return new SRect(this._leftTop, this._rightBottom);
+    }
+
+    return new SRect()
+  } // Function boundingRect()
+
+  /**
+   * 撤销操作
+  */
+  undo(): void {
+    if (this._status != SItemStatus.Normal) {
+      this.undoStack.undo();
+    }
+  } // Function undo()
+
+  /**
+   * 重做操作
+  */
+  redo(): void {
+    if (this._status != SItemStatus.Normal) {
+      this.undoStack.redo();
+    }
+  } // Function redo()
+
+  /**
+   * 取消操作执行
+  */
+  cancelOperate(): void {
+    if (this.status == SItemStatus.Create) {
+      this.parent = null;
+      this.releaseItem();
+    } else if (this.status == SItemStatus.Edit) {
+      this.status = SItemStatus.Normal;
+      this.releaseItem();
+    }
+  } // Function cancelOperate()
+
+  /**
+   * 返回对象储存的相关数据
+   *
+   * @return  实体类数据
+  */
+  toData(): any {
+    const Line = [{ x: this.line[0].x, y: this.line[0].y }, { x: this.line[1].x, y: this.line[1].y }];
+    this.data.style.line = Line;
+    this.data.style.default.lineWidth = this.lineWidth;
+    this.data.style.default.lineStyle = this.lineStyle;
+    this.data.style.default.strokeColor = this.strokeColor.value;
+    this.data.style.default.fillColor = this.fillColor.value;
+    return this.data
+  } // Function toData()
+
+  /**
+   * Item 绘制操作
+   *
+   * @param painter    绘制对象
+  */
+  onDraw(painter: SPainter): void {
+    if (this.line.length == 2) {
+      this.calRect()
+      painter.pen.color = this.strokeColor;
+      painter.brush.color = this.fillColor;
+      painter.pen.lineWidth = this.lineWidth;
+      if (this.lineStyle == SLineStyle.Dashed) {
+        painter.pen.lineDash = [
+          painter.toPx(this.lineWidth * 3),
+          painter.toPx(this.lineWidth * 7)
+        ];
+      } else if (this.lineStyle == SLineStyle.Dotted) {
+        painter.pen.lineDash = [
+          painter.toPx(this.lineWidth * 2),
+          painter.toPx(this.lineWidth * 2)
+        ];
+      }
+
+      painter.drawEllipse(
+        (this._leftTop.x + this._rightBottom.x) / 2,
+        (this._leftTop.y + this._rightBottom.y) / 2,
+        (this._rightBottom.x - this._leftTop.x) / 2,
+        (this._rightBottom.y - this._leftTop.y) / 2
+      );
+    }
+  } // Function onDraw()
+} // Class SCircleEdit

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

@@ -0,0 +1,422 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+import {
+    SImageItem,
+    STextItem,
+    SAnchorItem,
+    SGraphItem,
+
+} from "@persagy-web/graph";
+import { SItemStatus, ItemOrder, } from "@persagy-web/big";
+import { SMouseEvent } from "@persagy-web/base";
+import {
+    SSize,
+    SRect,
+    SPainter,
+    SColor,
+    SFont,
+    SPoint
+
+} from "@persagy-web/draw";
+import { SGraphEdit } from "..";
+import { Marker } from "../type/Marker";
+
+/**
+ * 图标
+ *
+ * @author 韩耀龙 <han_yao_long@163.com>
+ */
+
+export class SBaseIconTextEdit extends SGraphEdit {
+    /** item 状态 */
+    _status: SItemStatus = SItemStatus.Normal;
+    get status(): SItemStatus {
+        return this._status;
+    } // 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) {
+            this.moveable = false;
+            this.textItem.moveable = true;
+            this.img.moveable = true;
+        } else if (v == SItemStatus.Create) {
+            this.moveable = true;
+            this.textItem.moveable = false;
+            this.img.moveable = false;
+        }
+
+        this.update();
+    } // Set status
+
+    /** 锚点 list */
+    anchorList: SAnchorItem[] = [];
+    /** 是否显示文字 */
+    _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;
+        } else {
+            this.img.scale = 1;
+            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";
+            this.img.cursor = "pointer";
+        } else {
+            this.cursor = "auto";
+            this.textItem.cursor = "auto";
+            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(
+            this.img.width * 0.5,
+            this.img.height * 0.5
+        );
+        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(
+            this.img.width * 0.5,
+            this.img.height * 0.5
+        );
+        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();
+    } // Set color
+
+    /** 文本字体 */
+    get font(): SFont {
+        return this.textItem.font;
+    } // Get font
+    set font(v: SFont) {
+        this.textItem.font = v;
+        this.update();
+    } // Set font
+    /** 图像 */
+    img: SImageItem = new SImageItem(this);
+    /** 文本 */
+    textItem: STextItem = new STextItem(this);
+
+    /**
+     * 构造体
+     *
+     * @param parent  父节点
+     * @param data    锚点数据
+    */
+    constructor(parent: SGraphItem | null, data: Marker) {
+        super(parent);
+        this.img.width = 32;
+        this.img.height = 32;
+        this.img.origin = new SPoint(
+            this.img.width * 0.5,
+            this.img.height * 0.5
+        );
+        this.img.connect("onMove", this, this.changeAnchorPoint.bind(this));
+        let anchorPoint: any = [];
+        if (data) {
+            anchorPoint = [
+                {
+                    x: data.pos.x,
+                    y: data.pos.y,
+                    id: '123'
+                }
+            ];
+            this.img.url = data.style.default.url
+        }
+
+        this.anchorList = anchorPoint.map(t => {
+            let item = new SAnchorItem(this);
+            if (t.id) {
+                item.id = t.id;
+            }
+
+            item.moveTo(t.x, t.y);
+            return item;
+        });
+
+        this.showAnchor = false;
+        this.textItem.text = "";
+        this.textItem.font.size = 12;
+        // 偏移二分之一文本高度
+        this.textItem.moveTo(
+            this.img.width * 0.5,
+            -(this.font.size * 1.25 * 0.5)
+        );
+
+        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 }
+            ];
+            this.anchorList.forEach((item, index) => {
+                item.moveTo(anchorPoint[index].x, anchorPoint[index].y);
+            });
+        }
+    } // Function changeAnchorPoint()
+
+    /**
+     * 鼠标按下事件
+     *
+     * @param event   事件对象
+     * @return  是否处理事件
+    */
+    onMouseDown(event: SMouseEvent): boolean {
+        if (this.status == SItemStatus.Normal) {
+            return super.onMouseDown(event);
+        } else if (this.status == SItemStatus.Edit) {
+            return super.onMouseDown(event);
+        }
+
+        return true;
+    } // Function onMouseDown()
+
+    /**
+     * 宽高发发生变化
+     *
+     * @param oldSize   改之前的大小
+     * @param newSize   改之后大小
+    */
+    onResize(oldSize: SSize, newSize: SSize) {
+        console.log(arguments);
+    } // Function onResize()
+
+    /**
+     * 鼠标双击事件
+     *
+     * @param event   鼠标事件
+     * @return 是否处理事件
+    */
+    onDoubleClick(event: SMouseEvent): boolean {
+        // 如果位show状态 双击改对象则需改为编辑状态
+        if (SItemStatus.Normal == this.status) {
+            this.status = SItemStatus.Edit;
+            this.grabItem(this);
+        } else if (SItemStatus.Edit == this.status) {
+            this.status = SItemStatus.Normal;
+            this.releaseItem();
+        }
+
+        this.update();
+        return true;
+    } // Function onDoubleClick()
+
+    /**
+     * 宽高发生变化
+     *
+     * @return SRect   所有子对象的并集
+    */
+    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
+                    .boundingRect()
+                    .adjusted(this.textItem.pos.x, this.textItem.pos.y, 0, 0)
+            );
+        }
+
+        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)];
+            painter.pen.color = SColor.Black;
+            painter.brush.color = SColor.Transparent;
+            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;
+                painter.shadow.shadowOffsetX = 5;
+                painter.shadow.shadowOffsetY = 5;
+                painter.drawCircle(
+                    this.img.x,
+                    this.img.y,
+                    (this.sWidth / 2.0 + 3) * 1.25
+                );
+            } else {
+                painter.drawCircle(
+                    this.img.x,
+                    this.img.y,
+                    this.sWidth / 2.0 + 3
+                );
+            }
+        } else {
+            if (this.selected) {
+                painter.pen.color = SColor.Transparent;
+                painter.brush.color = SColor.Transparent;
+                painter.shadow.shadowBlur = 10;
+                painter.shadow.shadowColor = new SColor(`#00000033`);
+                painter.shadow.shadowOffsetX = 5;
+                painter.shadow.shadowOffsetY = 5;
+                painter.drawCircle(this.img.x, this.img.y, this.sWidth / 2.0);
+            }
+        }
+    } // Function onDraw()
+} // Class SIconTextItem

File diff suppressed because it is too large
+ 447 - 0
persagy-web-edit/src/items/SBaseImageEdit.ts


+ 0 - 0
persagy-web-edit/src/items/LineEdit.ts


Some files were not shown because too many files changed in this diff