YaolongHan 4 years ago
parent
commit
d1eb24bd99
86 changed files with 4153 additions and 6254 deletions
  1. 125 0
      persagy-web-big/src/BigEditFactory.ts
  2. 415 0
      persagy-web-big/src/SBaseEditScene.ts
  3. 0 72
      persagy-web-big/src/config/ItemColor.ts
  4. 0 72
      persagy-web-big/src/config/ItemOrder.ts
  5. 0 135
      persagy-web-big/src/config/Transparency.ts
  6. 0 40
      persagy-web-big/src/enums/SItemStatus.ts
  7. 0 42
      persagy-web-big/src/enums/SRelationState.ts
  8. 0 122
      persagy-web-big/src/factories/SItemFactory.ts
  9. 0 32
      persagy-web-big/src/factories/STopoItemFactory.ts
  10. 13 67
      persagy-web-big/src/index.ts
  11. 49 16
      persagy-web-big/src/items/SArrowItem.ts
  12. 20 17
      persagy-web-big/src/parser/SParser.ts
  13. 34 4
      persagy-web-big/src/items/SLayerItem.ts
  14. 34 4
      persagy-web-big/src/items/SArrowPoly.ts
  15. 44 53
      persagy-web-big/src/items/SRectSelectItem.ts
  16. 0 535
      persagy-web-big/src/items/SLineItem.ts
  17. 0 846
      persagy-web-big/src/items/SPolygonItem.ts
  18. 0 643
      persagy-web-big/src/items/SPolylineItem.ts
  19. 0 34
      persagy-web-big/src/items/STooltipItem.ts
  20. 0 104
      persagy-web-big/src/items/floor/SBoardItem.ts
  21. 0 67
      persagy-web-big/src/items/floor/SColumnItem.ts
  22. 0 158
      persagy-web-big/src/items/floor/SDoorItem.ts
  23. 0 100
      persagy-web-big/src/items/floor/SHighlightItem.ts
  24. 0 183
      persagy-web-big/src/items/floor/SSpaceItem.ts
  25. 0 253
      persagy-web-big/src/items/floor/SSpaceItems.ts
  26. 0 118
      persagy-web-big/src/items/floor/SVirtualWallItem.ts
  27. 0 70
      persagy-web-big/src/items/floor/SWallItem.ts
  28. 0 151
      persagy-web-big/src/items/floor/SWallItems.ts
  29. 0 109
      persagy-web-big/src/items/floor/SWindowItem.ts
  30. 0 203
      persagy-web-big/src/items/floor/ZoneItem.ts
  31. 0 163
      persagy-web-big/src/parser/SFloorParser.ts
  32. 0 85
      persagy-web-big/src/parser/STopologyParser.ts
  33. 0 60
      persagy-web-big/src/parser/SZoneParser.ts
  34. 1 0
      persagy-web-big/src/parsers/bigEditParse.ts
  35. 9 9
      persagy-web-big/src/types/topology/Anchor.ts
  36. 0 38
      persagy-web-big/src/types/BigPoint.ts
  37. 11 11
      persagy-web-big/src/enums/SRelationDir.ts
  38. 0 52
      persagy-web-big/src/types/FloorData.ts
  39. 0 47
      persagy-web-big/src/types/ImageData.ts
  40. 39 13
      persagy-web-big/src/enums/SGraphElementType.ts
  41. 24 11
      persagy-web-big/src/types/Marker.ts
  42. 0 39
      persagy-web-big/src/types/MinDis.ts
  43. 0 39
      persagy-web-big/src/types/Outline.ts
  44. 0 39
      persagy-web-big/src/types/Place.ts
  45. 0 41
      persagy-web-big/src/types/PointToLine.ts
  46. 27 24
      persagy-web-big/src/types/floor/Casement.ts
  47. 0 37
      persagy-web-big/src/types/Size.ts
  48. 0 53
      persagy-web-big/src/types/TextData.ts
  49. 0 43
      persagy-web-big/src/types/TopologyData.ts
  50. 0 49
      persagy-web-big/src/types/floor/Column.ts
  51. 0 59
      persagy-web-big/src/types/floor/Door.ts
  52. 0 55
      persagy-web-big/src/types/floor/Space.ts
  53. 0 46
      persagy-web-big/src/types/floor/VirtualWall.ts
  54. 0 52
      persagy-web-big/src/types/floor/Wall.ts
  55. 0 51
      persagy-web-big/src/types/floor/Zone.ts
  56. 19 0
      persagy-web-big/src/until.ts
  57. 0 352
      persagy-web-big/src/utils/SMathUtil.ts
  58. 18 4
      persagy-web-edit/src/SGraphEdit.ts
  59. 467 0
      persagy-web-edit/src/SGraphEditScene.ts
  60. 8 8
      persagy-web-edit/src/commands/SGraphAddCommand.ts
  61. 2 2
      persagy-web-edit/src/commands/SGraphCommand.ts
  62. 12 12
      persagy-web-edit/src/commands/SGraphMoveCommand.ts
  63. 7 8
      persagy-web-edit/src/commands/SGraphPointListDelete.ts
  64. 6 7
      persagy-web-edit/src/commands/SGraphPointListInsert.ts
  65. 7 8
      persagy-web-edit/src/commands/SGraphPointListUpdate.ts
  66. 6 7
      persagy-web-edit/src/commands/SGraphPropertyCommand.ts
  67. 1 1
      persagy-web-edit/src/enums/SGraphLayoutType.ts
  68. 1 1
      persagy-web-edit/src/enums/SOrderSetType.ts
  69. 1 1
      persagy-web-edit/src/enums/STextOrigin.ts
  70. 20 2
      persagy-web-edit/src/index.ts
  71. 0 93
      persagy-web-edit/src/items/ImageEdit.ts
  72. 558 0
      persagy-web-edit/src/items/SBaseArrowEdit.ts
  73. 387 0
      persagy-web-edit/src/items/SBaseCircleEdit.ts
  74. 45 48
      persagy-web-big/src/items/SIconTextItem.ts
  75. 425 0
      persagy-web-edit/src/items/SBaseImageEdit.ts
  76. 113 79
      persagy-web-edit/src/items/LineEdit.ts
  77. 149 74
      persagy-web-edit/src/items/PolygonEdit.ts
  78. 93 60
      persagy-web-edit/src/items/PolylineEdit.ts
  79. 371 0
      persagy-web-edit/src/items/SBaseRectEdit.ts
  80. 143 37
      persagy-web-edit/src/items/TextEdit.ts
  81. 348 0
      persagy-web-edit/src/items/SBaseTriangleEdit.ts
  82. 12 7
      persagy-web-big/src/enums/SLineType.ts
  83. 13 11
      persagy-web-big/src/enums/SMarkerType.ts
  84. 34 28
      persagy-web-big/src/types/topology/Node.ts
  85. 20 18
      persagy-web-big/src/types/topology/MarkerTopo.ts
  86. 22 20
      persagy-web-big/src/types/topology/Relation.ts

+ 125 - 0
persagy-web-big/src/BigEditFactory.ts

@@ -0,0 +1,125 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .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 { SBaseLineEdit, SBaseTextEdit, SBaseImageEdit, SBaseRectEdit, SBasePolygonEdit, SBaseCircleEdit } from "./../edit";
+import { Marker, SBaseExpainEdit, SBaseArrow } from "./"
+import { SItemFactory } from "@persagy-web/big"
+
+/**
+ * item创建工厂
+ *
+ * @author han_yao_long@163.com
+ */
+export class BigEditFactory extends SItemFactory {
+    /**
+     * 构造函数
+     *
+     * */
+    constructor() {
+        super()
+    } // Constructor
+
+    /**
+     * 创建基础直线
+     *
+     * @param   data    Marker数据
+     * @return  线item
+     * */
+    createBaseLineEdit(data: Marker): SBaseLineEdit {
+        return new SBaseLineEdit(null, data);
+    } // Function createBaseLineEdit()
+
+    /**
+     * 创建基础文本
+     *
+     * @param   data    Marker数据
+     * @return  文本item
+     * */
+    createBaseTextEdit(data: Marker): SBaseTextEdit {
+        return new SBaseTextEdit(null, data);
+    } // Function createBaseTextEdit()
+
+    /**
+     * 创建基础图片
+     *
+     * @param   data    Marker数据
+     * @return  图片item
+     * */
+    createBaseImageEdit(data: Marker): SBaseImageEdit {
+        return new SBaseImageEdit(null, data);
+    } // Function createBaseImageEdit()
+
+    /**
+     * 创建基础矩形
+     *
+     * @param   data    Marker数据
+     * @return  矩形item
+     * */
+    createBaseRectEdit(data: Marker): SBaseRectEdit {
+        return new SBaseRectEdit(null, data);
+    } // Function createBaseRectEdit()
+
+    /**
+     * 创建基础圆
+     *
+     * @param   data    Marker数据
+     * @return  圆item
+     * */
+    createBaseCircleEdit(data: Marker): SBaseCircleEdit {
+        return new SBaseCircleEdit(null, data);
+    } // Function createBaseRectEdit()
+
+    /**
+     * 创建基础注释
+     *
+     * @param   data    Marker数据
+     * @return  注释item
+     * */
+    createBaseExpainEdit(data: Marker): SBaseExpainEdit {
+        return new SBaseExpainEdit(null, data);
+    } // Function createBaseExpainEdit()
+
+    /**
+     * 创建基础多边形
+     *
+     * @param   data    Marker数据
+     * @return  注释item
+     * */
+    createBasePolygonEdit(data: Marker): SBasePolygonEdit {
+        return new SBasePolygonEdit(null, data);
+    } // Function createBasePolygonEdit()
+
+    /**
+     * 创建基础基础箭头(折线)
+     *
+     * @param   data    Marker数据
+     * @return  注释item
+     */
+    createBaseArrow(data: Marker): SBaseArrow {
+        return new SBaseArrow(null, data);
+    } // Function createBasePolygonEdit()
+
+} // Class SItemFactory

+ 415 - 0
persagy-web-big/src/SBaseEditScene.ts

@@ -0,0 +1,415 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .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 { SGraphEditScene, SGraphAddCommand } from "../edit"
+import { SMouseEvent } from "@persagy-web/base/lib";
+import { SPoint, SFont, SColor, SRect, SArrowStyleType } from '@persagy-web/draw/lib';
+import { SRectSelectItem, SItemStatus } from '@persagy-web/big/lib';
+import { SGraphItem, SGraphSelectContainer } from "@persagy-web/graph/";
+import { uuid } from "./until";
+import { SBaseExpainEdit, SBaseArrow, SBaseEquipment, SBasePipeUninTool } from "./"
+
+/**
+ * big-edit 场景
+ *
+ * @author 韩耀龙 <han_yao_long@163.com>
+ */
+export class SBaseEditScene extends SGraphEditScene {
+
+    /**图例节点 */
+    Nodes: any = [];  // 图例节点,所有与工程信息化相关的图例(图标类型与区域)
+    /**图例节点 */  // 与工程信息无关的标识对象(增加文本注释,图上的图片说明)
+    Markers: any = [];
+    /**  管线对象 */
+    Relations: any = [];
+
+    copyString: any[] = []
+
+    constructor() {
+        super()
+    }
+
+    /**
+     * 新增基础类注释
+     *
+     * @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);
+    }
+
+    /**
+     * 新增基础箭头(折线)
+     *
+     * @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();
+        }
+    }
+
+    /**
+     * 添加基本设备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();
+        }
+    }
+
+    /**
+     * 添加基本管道联通器
+     *
+     * @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();
+        }
+    }
+
+    /**
+     * 重做
+     *
+     * @return any
+     */
+    redo(): void {
+        if (this.grabItem && this.grabItem.redo) {
+            this.grabItem.redo()
+        } else {
+            this.undoStack.redo();
+        }
+    }
+
+    /**
+     * 撤销
+     *
+     * @return any
+     */
+    undo(): void {
+        if (this.grabItem && this.grabItem.undo) {
+            this.grabItem.undo()
+        } else {
+            this.undoStack.undo();
+        }
+    }
+
+    /**
+     * 删除
+     *
+     * @return item[]
+     */
+    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
+    }
+
+    /**
+     * 框选
+     *
+     */
+    addRectSelect(event: SMouseEvent): void {
+        let point = new SPoint(event.x, event.y);
+        let rect = new SRectSelectItem(null, point);
+        this.addItem(rect);
+        this.grabItem = rect;
+    }
+
+    /**
+     * 计算框选交集
+     */
+    groupSelect(ctrl: boolean) {
+        // if (!ctrl) {
+        //     this.selectContainer.clear()
+        // }
+        if (this.grabItem instanceof SRectSelectItem) {
+            const rect = this.grabItem.boundingRect();
+            this.arrToSelect(this.root.children, rect)
+        }
+    }
+
+    /**
+     * 选中item:框选
+     */
+    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)
+                    }
+                }
+            })
+        }
+    }
+
+    /////////////////////////////////////////////////////////////////////
+    // 鼠标事件
+
+    /**
+     * 鼠标左键按下
+     *
+     * @param   event   鼠标事件参数
+     */
+    onMouseDown(event: SMouseEvent): any {
+        if (!super.onMouseDown(event) && 1 == event.buttons) {
+            this.addRectSelect(event);
+        }
+    }
+
+    /**
+     * 鼠标抬起
+     *
+     * @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)
+    }
+
+    /**
+     * 复制
+     *
+     */
+    copy() {
+        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)
+        }
+    }
+
+    /**
+     * 粘贴
+     *
+     */
+    paste() {
+        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)
+    }
+}

+ 0 - 72
persagy-web-big/src/config/ItemColor.ts

@@ -1,72 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { SColor } from "@persagy-web/draw";
-
-/**
- * 接口item颜色配置
- *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
- * @deprecated
- */
-export class ItemColor {
-    /** 墙颜色 */
-    static wallColor = new SColor("#2b2b2b");
-    /** 柱子颜色 */
-    static columnColor = SColor.Black;
-    /** 虚拟墙颜色 */
-    static virtualWallColor = SColor.Black;
-    /** 空间颜色 */
-    static spaceColor = new SColor("#f1fffd80");
-    /** 门颜色 */
-    static doorColor = new SColor("#f5b36f");
-    /** 窗户颜色 */
-    static windowColor = new SColor("#fcd6ff");
-    /** 蒙版颜色 */
-    static sceneMarkColor = new SColor("#00000080");
-    /** 遮罩颜色 */
-    static shadeColor = new SColor("#00000080");
-    /** 高亮item吸附点颜色 */
-    static highLightPointColor = new SColor("#ff8d00");
-    /** 高亮item吸附线颜色 */
-    static highLightLineColor = new SColor("#409EFF");
-    /** 矩形选择对象边框颜色 */
-    static rectSelectOutColor = new SColor("#3e78f9e8");
-    /** 矩形选择对象填充颜色 */
-    static rectSelectInColor = new SColor("#8cf2fd73");
-    /** 空间边框颜色 */
-    static spaceBorderColor = new SColor("#2b2b2b");
-    /** 空间,业务空间选中颜色 */
-    static selectColor = new SColor("#1abc9c");
-    /** 空间高亮颜色 */
-    static spaceHighColor = new SColor("#fbb029");
-    /** 业务空间不可选中颜色 */
-    static zoneUnselectColor = new SColor("#cecece");
-    /** 受影响业务空间颜色 */
-    static zoneInfectedColor = new SColor("#ff0000");
-    /** 受影响的业务空间边框颜色 */
-    static zoneInfectedBorder = new SColor("#e2675c");
-} // Class ItemColor

+ 0 - 72
persagy-web-big/src/config/ItemOrder.ts

@@ -1,72 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.
- *
- * *********************************************************************************************************************
- */
-
-/**
- * item层级类
- *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
- * @deprecated
- */
-export class ItemOrder {
-    /** 空间层级 */
-    static spaceOrder = 200;
-    /** 业务空间层级 */
-    static zoneOrder = 800;
-    /** 类空间层级 */
-    static likeSpaceOrder = 1000;
-    /** 柱子层级 */
-    static columnOrder = 1200;
-    /** 墙层级 */
-    static wallOrder = 1600;
-    /** 虚拟墙层级 */
-    static virtualWallOrder = 2000;
-    /** 门层级 */
-    static doorOrder = 2400;
-    /** 窗户层级 */
-    static windowOrder = 2800;
-    /** 多边形层级 */
-    static polygonOrder = 4000;
-    /** 直线层级 */
-    static lineOrder = 5000;
-    /** 折线层级 */
-    static polylineOrder = 6000;
-    /** 图片层级 */
-    static imageOrder = 7000;
-    /** 文本层级 */
-    static textOrder = 8000;
-    /** 位置标签对象层级 */
-    static markOrder = 9900;
-    /** 遮罩层级 */
-    static shadeOrder = 12000;
-    /** 框选矩形对象层级 */
-    static rectSelectOrder = 9999900;
-    /** 高亮对象层级 */
-    static highLightOrder = 999900;
-    /** 业务空间关系点位层级 */
-    static RelationOrder = 999900;
-    /** 蒙版层级 */
-    static sceneMarkOrder = 9999900;
-} // Class ItemOrder

+ 0 - 135
persagy-web-big/src/config/Transparency.ts

@@ -1,135 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.
- *
- * *********************************************************************************************************************
- */
-
-/**
- * 透明度索引对应
- *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
- * @deprecated
- */
-export const Transparency = [
-    "00",
-    "03",
-    "05",
-    "08",
-    "0A",
-    "0D",
-    "0F",
-    "12",
-    "14",
-    "17",
-    "1A",
-    "1C",
-    "1F",
-    "21",
-    "24",
-    "26",
-    "29",
-    "2B",
-    "2E",
-    "30",
-    "33",
-    "36",
-    "38",
-    "3B",
-    "3D",
-    "40",
-    "42",
-    "45",
-    "47",
-    "4A",
-    "4D",
-    "4F",
-    "52",
-    "54",
-    "57",
-    "59",
-    "5C",
-    "5E",
-    "61",
-    "63",
-    "66",
-    "69",
-    "6B",
-    "6E",
-    "70",
-    "73",
-    "75",
-    "78",
-    "7A",
-    "7D",
-    "80",
-    "82",
-    "85",
-    "87",
-    "8A",
-    "8C",
-    "8F",
-    "91",
-    "94",
-    "96",
-    "99",
-    "9C",
-    "9E",
-    "A1",
-    "A3",
-    "A6",
-    "A8",
-    "AB",
-    "AD",
-    "B0",
-    "B3",
-    "B5",
-    "B8",
-    "BA",
-    "BD",
-    "BF",
-    "C2",
-    "C4",
-    "C7",
-    "C9",
-    "CC",
-    "CF",
-    "D1",
-    "D4",
-    "D6",
-    "D9",
-    "DB",
-    "DE",
-    "E0",
-    "E3",
-    "E6",
-    "E8",
-    "EB",
-    "ED",
-    "F0",
-    "F2",
-    "F5",
-    "F7",
-    "FA",
-    "FC",
-    "FF"
-]; // Interface Transparency

+ 0 - 40
persagy-web-big/src/enums/SItemStatus.ts

@@ -1,40 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.
- *
- * *********************************************************************************************************************
- */
-
-/**
- * item状态
- *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
- * @deprecated move to edit
- */
-export enum SItemStatus {
-    /** 标准状态 */
-    Normal,
-    /** 编辑状态 */
-    Edit,
-    /** 创建态 */
-    Create
-} // Enum SItemStatus

+ 0 - 42
persagy-web-big/src/enums/SRelationState.ts

@@ -1,42 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.
- *
- * *********************************************************************************************************************
- */
-
-/**
- * 关系状态
- *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
- * @deprecated
- */
-export enum SRelationState {
-    /** 标准状态 */
-    Normal,
-    /** 动画撞他 */
-    Animation,
-    /** 编辑状态 */
-    Edit,
-    /** 创建态 */
-    Create
-} // Enum SRelationState

+ 0 - 122
persagy-web-big/src/factories/SItemFactory.ts

@@ -1,122 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { Column } from "../types/floor/Column";
-import { SColumnItem } from "../items/floor/SColumnItem";
-import { SWallItem } from "../items/floor/SWallItem";
-import { Wall } from "../types/floor/Wall";
-import { SVirtualWallItem } from "../items/floor/SVirtualWallItem";
-import { VirtualWall } from "../types/floor/VirtualWall";
-import { SSpaceItem } from "../items/floor/SSpaceItem";
-import { Space } from "../types/floor/Space";
-import { Door } from "../types/floor/Door";
-import { SDoorItem } from "../items/floor/SDoorItem";
-import { SWindowItem } from "../items/floor/SWindowItem";
-import { Casement } from "../types/floor/Casement";
-import { SZoneItem } from "../items/floor/ZoneItem";
-import { Zone } from "../types/floor/Zone";
-
-/**
- * item创建工厂
- *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
- */
-export class SItemFactory {
-    /**
-     * 构造函数
-     */
-    constructor() {} // Constructor
-
-    /**
-     * 创建柱子item
-     *
-     * @param data    柱子数据
-     * @return 柱子 item
-     */
-    createColumn(data: Column): SColumnItem {
-        return new SColumnItem(null, data);
-    } // Function createColumn()
-
-    /**
-     * 创建墙item
-     *
-     * @param data    墙数据
-     * @return 墙 item
-     */
-    createWall(data: Wall): SWallItem {
-        return new SWallItem(null, data);
-    } // Function createWall()
-
-    /**
-     * 创建虚拟墙item
-     *
-     * @param data    虚拟墙数据
-     * @return 虚拟墙 item
-     */
-    createVirtualWall(data: VirtualWall): SVirtualWallItem {
-        return new SVirtualWallItem(null, data);
-    } // Function createVirtualWall()
-
-    /**
-     * 创建空间item
-     *
-     * @param data    空间数据
-     * @return 空间 item
-     */
-    createSpace(data: Space): SSpaceItem {
-        return new SSpaceItem(null, data);
-    } // Function createSpace()
-
-    /**
-     * 创建门item
-     *
-     * @param data    门数据
-     * @return 门item
-     */
-    createDoor(data: Door): SDoorItem {
-        return new SDoorItem(null, data);
-    } // Function createDoor()
-
-    /**
-     * 创建窗item
-     *
-     * @param data    窗户数据
-     * @return 窗户 item
-     */
-    createWindow(data: Casement): SWindowItem {
-        return new SWindowItem(null, data);
-    } // Function createWindow()
-
-    /**
-     * 创建业务空间item
-     *
-     * @param data    业务空间数据
-     * @return 业务空间 item
-     */
-    createZone(data: Zone): SZoneItem {
-        return new SZoneItem(null, data);
-    } // Function createZone()
-} // Class SItemFactory

+ 0 - 32
persagy-web-big/src/factories/STopoItemFactory.ts

@@ -1,32 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.
- *
- * *********************************************************************************************************************
- */
-
-/**
- * 拓扑图item创建工厂
- *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
- */
-export class STopoItemFactory {} // Class STopoItemFactory

+ 13 - 67
persagy-web-big/src/index.ts

@@ -1,67 +1,13 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { SLayerItem } from "./items/SLayerItem";
-import { STooltipItem } from "./items/STooltipItem";
-import { ItemColor } from "./config/ItemColor";
-import { Transparency } from "./config/Transparency";
-import { ItemOrder } from "./config/ItemOrder";
-import { SItemFactory } from "./factories/SItemFactory";
-import { SZoneParser } from "./parser/SZoneParser";
-import { SFloorParser } from "./parser/SFloorParser";
-import { SParser } from "./parser/SParser";
-import { SIconTextItem } from "./items/SIconTextItem";
-import { SPolylineItem } from "./items/SPolylineItem";
-import { SLineItem } from "./items/SLineItem";
-import { SRelationState } from "./enums/SRelationState";
-import { SItemStatus } from "./enums/SItemStatus";
-import { SPolygonItem } from "./items/SPolygonItem";
-import { SRectSelectItem } from "./items/SRectSelectItem";
-import { SBoardItem } from "./items/floor/SBoardItem";
-import { SArrowItem } from "./items/SArrowItem";
-import { SArrowPoly } from "./items/SArrowPoly";
-
-export {
-    SLayerItem,
-    SLineItem,
-    SPolylineItem,
-    STooltipItem,
-    ItemColor,
-    ItemOrder,
-    Transparency,
-    SItemFactory,
-    SParser,
-    SFloorParser,
-    SZoneParser,
-    SIconTextItem,
-    SRelationState,
-    SItemStatus,
-    SPolygonItem,
-    SRectSelectItem,
-    SBoardItem,
-    SArrowItem,
-    SArrowPoly
-};
+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 }

+ 49 - 16
persagy-web-big/src/items/SArrowItem.ts

@@ -17,48 +17,71 @@
  *          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.  博锐尚格科技股份有限公司
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
  *        ~8888'
  *        .!88~                                                                     All rights reserved.
  *
  * *********************************************************************************************************************
  */
 
-import { SPainter, SArrowStyleType } from "@persagy-web/draw";
-import { SPolylineItem } from "..";
-import { SLineStyle } from "@persagy-web/graph";
+import { SColor, SFont, SPainter, SArrowStyleType } from "@persagy-web/draw/";
+import { SBasePolylineEdit } from './../../edit';
+import { SGraphItem, SLineStyle } from "@persagy-web/graph";
+import { Marker } from "./../types/Marker";
+import { SMouseEvent } from "@persagy-web/base/lib";
+import { ItemOrder } from '@persagy-web/big/lib';
 
 /**
- * 折线箭头 item
+ * 编辑箭头(折线)
  *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
+ * @author  韩耀龙(han_yao_long#163.com)
  */
-export class SArrowItem extends SPolylineItem {
+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
+    }
+    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
+        }
+    }
+    /**
+     * 鼠标按下事件
+     *
+     * @param   event   保存事件参数
+     * @return  boolean
+     */
+    onMouseDown(event: SMouseEvent): boolean {
+        super.onMouseDown(event)
+        return true;
+    } // Function onMouseDown()
 
     /**
      * 绘制基本图形
      *
-     * @param painter   绘制对象
-     */
+     * @param   painter painter对象
+     * */
     drawBaseLine(painter: SPainter): void {
         // 绘制基本图形
         if (this.lineStyle == SLineStyle.Dashed) {
@@ -72,7 +95,6 @@ export class SArrowItem extends SPolylineItem {
                 painter.toPx(this.lineWidth)
             ];
         }
-
         painter.pen.color = this.strokeColor;
         painter.drawArrowLine(this.pointList[0], this.pointList[1], {
             begin: this.begin,
@@ -88,4 +110,15 @@ export class SArrowItem extends SPolylineItem {
         );
         painter.drawPolyline(this.pointList);
     } // Function drawBaseLine()
-} // Class SArrowItem
+
+    /**
+    * 返回对象储存的相关数据
+    *
+    * @return	formData
+    */
+    toData(): any {
+        this.data.style.begin = this.begin;
+        this.data.style.end = this.end;
+        return super.toData()
+    }
+}

+ 20 - 17
persagy-web-big/src/parser/SParser.ts

@@ -17,32 +17,35 @@
  *          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.  博锐尚格科技股份有限公司
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
  *        ~8888'
  *        .!88~                                                                     All rights reserved.
  *
  * *********************************************************************************************************************
  */
 
-import { SItemFactory } from "..";
+import { SColor, SLine, SPainter, SPoint, SRect } from "@persagy-web/draw/";
+import { SGraphItem, SGraphSvg } from "@persagy-web/graph";
+import { SGraphEdit } from '../../edit/';
+import { Marker } from "./../types/Marker";
+import { SBaseImageEdit } from './../../edit';
 
 /**
- * 解析器基类
+ * 编辑基础设备
  *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
+ * @author han_yao_long@163.com
  */
-export abstract class SParser {
-    /** 解析器工厂 */
-    protected factory: SItemFactory = new SItemFactory();
+export class SBaseEquipment extends SBaseImageEdit {
+    constructor(parent: SGraphItem | null, data: Marker) {
+        super(parent, data);
+    }
 
     /**
-     * 构造函数
-     *
-     * @param factory   解析工厂
-     */
-    constructor(factory: SItemFactory | null = null) {
-        if (factory) {
-            this.factory = factory;
-        }
-    } // Constructor
-} // class SParser
+    * 返回对象储存的相关数据
+    *
+    * @return	formData
+    */
+    toData(): any {
+        return super.toData()
+    }
+} // Class SGraphSvgItem

+ 34 - 4
persagy-web-big/src/items/SLayerItem.ts

@@ -17,18 +17,48 @@
  *          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.  博锐尚格科技股份有限公司
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
  *        ~8888'
  *        .!88~                                                                     All rights reserved.
  *
  * *********************************************************************************************************************
  */
 
+import { SColor, SFont } from "@persagy-web/draw/";
+import { SBaseTextEdit } from './../../edit';
 import { SGraphItem } from "@persagy-web/graph";
+import { Marker } from "./../types/Marker";
+import { SMouseEvent } from "@persagy-web/base/lib";
+import { ItemOrder } from '@persagy-web/big/lib';
 
 /**
- *  编辑器图层-图层锁定,业务层组合使用
+ * 编辑基础注释类
  *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
+ * @author  韩耀龙(han_yao_long#163.com)
  */
-export class SLayerItem extends SGraphItem {} // Class SLayerItem
+export class SBaseExpainEdit extends SBaseTextEdit {
+    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    //属性
+    constructor(parent: SGraphItem | null, data: Marker) {
+        super(parent, data);
+    }
+    /**
+     * 鼠标按下事件
+     *
+     * @param   event   保存事件参数
+     * @return  boolean
+     */
+    onMouseDown(event: SMouseEvent): boolean {
+        super.onMouseDown(event)
+        return true;
+    } // Function onMouseDown()
+
+    /**
+    * 返回对象储存的相关数据
+    *
+    * @return	formData
+    */
+    toData(): any {
+        return super.toData()
+    }
+}

+ 34 - 4
persagy-web-big/src/items/SArrowPoly.ts

@@ -17,18 +17,48 @@
  *          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.  博锐尚格科技股份有限公司
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
  *        ~8888'
  *        .!88~                                                                     All rights reserved.
  *
  * *********************************************************************************************************************
  */
 
+import { SColor, SFont } from "@persagy-web/draw/";
+import { SBasePolylineEdit } from './../../edit';
 import { SGraphItem } from "@persagy-web/graph";
+import { Marker } from "./../types/Marker";
+import { SMouseEvent } from "@persagy-web/base/lib";
+import { ItemOrder } from '@persagy-web/big/lib';
 
 /**
- * 箭头多边形类型
+ * 编辑基础管道
  *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
+ * @author  韩耀龙(han_yao_long#163.com)
  */
-export class SArrowPoly extends SGraphItem {} // Class SArrowPoly
+export class SBasePipe extends SBasePolylineEdit {
+    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    //属性
+    constructor(parent: SGraphItem | null, data: Marker) {
+        super(parent,data);
+    }
+    /**
+     * 鼠标按下事件
+     *
+     * @param   event   保存事件参数
+     * @return  boolean
+     */
+    onMouseDown(event: SMouseEvent): boolean {
+        super.onMouseDown(event)
+        return true;
+    } // Function onMouseDown()
+
+    /**
+    * 返回对象储存的相关数据
+    *
+    * @return	formData
+    */
+    toData(): any {
+        return super.toData()
+    }
+}

+ 44 - 53
persagy-web-big/src/items/SRectSelectItem.ts

@@ -17,74 +17,65 @@
  *          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.  博锐尚格科技股份有限公司
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
  *        ~8888'
  *        .!88~                                                                     All rights reserved.
  *
  * *********************************************************************************************************************
  */
 
+import { SColor, SFont } from "@persagy-web/draw/";
+import { SBaseImageEdit } from './../../edit';
 import { SGraphItem } from "@persagy-web/graph";
-import { SPainter, SPoint, SRect } from "@persagy-web/draw";
-import { SMouseEvent } from "@persagy-web/base";
-import { ItemColor, ItemOrder } from "..";
+import { Marker } from "./../types/Marker";
+import { SMouseEvent } from "@persagy-web/base/lib";
+import { ItemOrder } from '@persagy-web/big/lib';
 
 /**
- * 矩形选择 item
+ * 编辑基础管道接头类
  *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
+ * @author  韩耀龙(han_yao_long#163.com)
  */
-export class SRectSelectItem extends SGraphItem {
-    /** 起点 */
-    startPoint: SPoint = new SPoint();
-    /** 终点 */
-    endPoint: SPoint = new SPoint();
 
+export class SBasePipeUninTool extends SBaseImageEdit {
+    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    //属性
+    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
+            }
+        }
+    }
     /**
-     * 构造函数
+     * 鼠标按下事件
      *
-     * @param parent    指向父对象
-     * @param point     起点数据
+     * @param   event   保存事件参数
+     * @return  boolean
      */
-    constructor(parent: SGraphItem | null, point: SPoint) {
-        super(parent);
-        this.startPoint = point;
-        this.endPoint = new SPoint(point.x, point.y);
-        this.update();
-        this.zOrder = ItemOrder.rectSelectOrder;
-    } // Constructor
-
-    /**
-     * Item 对象边界区域
-     *
-     * @return 边界区域
-     */
-    boundingRect(): SRect {
-        return new SRect(this.startPoint, this.endPoint);
-    } // Function boundingRect()
-
-    /**
-     * 鼠标移动事件
-     *
-     * @param event     事件参数
-     * @return 是否处理
-     */
-    onMouseMove(event: SMouseEvent): boolean {
-        this.endPoint.x = event.x;
-        this.endPoint.y = event.y;
-        this.update();
+    onMouseDown(event: SMouseEvent): boolean {
+        super.onMouseDown(event)
         return true;
-    } // Function onMouseMove()
+    } // Function onMouseDown()
 
     /**
-     * Item 绘制操作
-     *
-     * @param painter   绘制对象
-     */
-    onDraw(painter: SPainter): void {
-        painter.pen.lineWidth = painter.toPx(2);
-        painter.pen.color = ItemColor.rectSelectOutColor;
-        painter.brush.color = ItemColor.rectSelectInColor;
-        painter.drawRect(this.startPoint, this.endPoint);
-    } // Function onDraw()
-} // SRectSelectItem
+    * 返回对象储存的相关数据
+    *
+    * @return	formData
+    */
+    toData(): any {
+        return super.toData()
+    }
+}

+ 0 - 535
persagy-web-big/src/items/SLineItem.ts

@@ -1,535 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { SColor, SLine, SPainter, SPoint, SRect } from "@persagy-web/draw";
-import { SMouseButton, SMouseEvent, SUndoStack } from "@persagy-web/base";
-import { SMathUtil } from "../utils/SMathUtil";
-import { SItemStatus } from "..";
-import {
-    SGraphItem,
-    SGraphPointListInsert,
-    SGraphPointListUpdate,
-    SLineStyle
-} from "@persagy-web/graph";
-
-/**
- * 直线 item
- *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
- */
-export class SLineItem extends SGraphItem {
-    /** X 坐标最小值 */
-    private minX = Number.MAX_SAFE_INTEGER;
-    /** X 坐标最大值 */
-    private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y 坐标最小值 */
-    private minY = Number.MAX_SAFE_INTEGER;
-    /** Y 坐标最大值 */
-    private maxY = Number.MIN_SAFE_INTEGER;
-
-    /** 线段 */
-    private _line: SPoint[] = [];
-    get line(): SPoint[] {
-        return this._line;
-    } // Get line
-    set line(arr: SPoint[]) {
-        this._line = arr;
-        this.update();
-    } // Set line
-
-    /** 是否完成绘制 */
-    protected _status: SItemStatus = SItemStatus.Normal;
-    get status(): SItemStatus {
-        return this._status;
-    } // Get status
-    set status(v: SItemStatus) {
-        this._status = v;
-        this.undoStack.clear();
-        this.update();
-    } // Set status
-
-    /** 线条颜色 */
-    private _strokeColor: SColor = SColor.Black;
-    get strokeColor(): SColor {
-        return this._strokeColor;
-    } // Get strokeColor
-    set strokeColor(v: SColor) {
-        this._strokeColor = v;
-        this.update();
-    } // Set strokeColor
-
-    /** 线条样式 */
-    private _lineStyle: SLineStyle = SLineStyle.Solid;
-    get lineStyle(): SLineStyle {
-        return this._lineStyle;
-    } // Get lineStyle
-    set lineStyle(v: SLineStyle) {
-        this._lineStyle = v;
-        this.update();
-    } // Set lineStyle
-
-    /** 端点填充色 */
-    private _fillColor: SColor = SColor.White;
-    get fillColor(): SColor {
-        return this._fillColor;
-    } // Get fillColor
-    set fillColor(v: SColor) {
-        this._fillColor = v;
-        this.update();
-    } // Set fillColor
-
-    /** 选中端点填充色 */
-    private _activeFillColor: SColor = new SColor("#2196f3");
-    get activeFillColor(): SColor {
-        return this._activeFillColor;
-    } // Get activeFillColor
-    set activeFillColor(v: SColor) {
-        this._activeFillColor = v;
-        this.update();
-    } // Set activeFillColor
-
-    /** 线条宽度 */
-    private _lineWidth: number = 1;
-    get lineWidth(): number {
-        return this._lineWidth;
-    } // Get lineWidth
-    set lineWidth(v: number) {
-        this._lineWidth = v;
-        this.update();
-    } // Set lineWidth
-
-    /** 拖动灵敏度 */
-    dis: number = 5;
-
-    /** 拖动灵敏度 */
-    private sceneDis: number = 5;
-
-    /** 当前点索引 */
-    curIndex: number = -1;
-
-    /** 当前点坐标 */
-    private curPoint: SPoint | null = null;
-
-    /** undo/redo 堆栈 */
-    private undoStack: SUndoStack = new SUndoStack();
-
-    /**
-     * 构造函数
-     *
-     * @param parent  父级
-     */
-    constructor(parent: SGraphItem | null);
-
-    /**
-     * 构造函数
-     *
-     * @param parent  父级
-     * @param line    坐标集合
-     */
-    constructor(parent: SGraphItem | null, line: SPoint[]);
-
-    /**
-     * 构造函数
-     *
-     * @param parent  父级
-     * @param point   第一个点坐标
-     */
-    constructor(parent: SGraphItem | null, point: SPoint);
-
-    /**
-     * 构造函数
-     *
-     * @param parent    父级
-     * @param line      坐标集合|第一个点坐标
-     */
-    constructor(parent: SGraphItem | null, line?: SPoint | SPoint[]) {
-        super(parent);
-        if (line) {
-            if (line instanceof SPoint) {
-                this.line.push(line);
-            } else {
-                this.line = line;
-            }
-        } else {
-            this.line = [];
-        }
-    } // Constructor
-
-    /**
-     * 添加点至数组中
-     *
-     * @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.update();
-    } // Function addPoint()
-
-    /**
-     * 鼠标双击事件
-     *
-     * @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) {
-            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()
-
-    /**
-     * 鼠标抬起事件
-     *
-     * @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()
-
-    /**
-     * 鼠标移动事件
-     *
-     * @param event     事件参数
-     * @return 是否处理事件
-     */
-    onMouseMove(event: SMouseEvent): boolean {
-        if (event.shiftKey) {
-            event = this.compare(event);
-        }
-
-        if (this.status == SItemStatus.Create) {
-            if (this.line[0] instanceof SPoint) {
-                this.line[1] = new SPoint(event.x, event.y);
-            }
-        } else if (this.status == SItemStatus.Edit) {
-            if (-1 != this.curIndex) {
-                this.line[this.curIndex].x = event.x;
-                this.line[this.curIndex].y = event.y;
-            }
-        } else {
-            return super.onMouseMove(event);
-        }
-
-        this.update();
-        return true;
-    } // Function onMouseMove()
-
-    /**
-     * 获取点击点与 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 SGraphCommand 相关命令类
-     * @param any           对应传入参数
-     */
-    protected recordAction(SGraphCommand: any, any: any[]): void {
-        // 记录相关命令并推入堆栈中 todo
-        const command = new SGraphCommand(this.scene, this, ...any);
-        this.undoStack.push(command);
-    } // Function recordAction()
-
-    /**
-     * 移动后处理所有坐标,并肩原点置为场景原点
-     *
-     * @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()
-
-    /**
-     * 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()
-
-    /**
-     * 判断点是否在区域内
-     *
-     * @param x     x 坐标
-     * @param y     y 坐标
-     * @return 是否包含
-     */
-    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()
-
-    /**
-     * 撤销操作
-     */
-    undo(): void {
-        if (this.status != SItemStatus.Normal) {
-            this.undoStack.undo();
-        }
-    } // Function undo()
-
-    /**
-     * 重做操作
-     */
-    redo(): void {
-        if (this.status != SItemStatus.Normal) {
-            this.undoStack.redo();
-        }
-    } // Function redo()
-
-    /**
-     * 取消操作 item 事件
-     */
-    cancelOperate(): void {
-        if (this.status == SItemStatus.Create) {
-            this.parent = null;
-            this.releaseItem();
-        } else if (this.status == SItemStatus.Edit) {
-            this.status = SItemStatus.Normal;
-            this.releaseItem();
-        }
-    } // Function cancelOperate()
-
-    /**
-     * Item 对象边界区域
-     *
-     * @return 边界区域
-     */
-    boundingRect(): SRect {
-        if (this.line.length) {
-            this.minX = this.line[0].x;
-            this.maxX = this.line[0].x;
-            this.minY = this.line[0].y;
-            this.maxY = this.line[0].y;
-            this.line.forEach(it => {
-                let x = it.x,
-                    y = it.y;
-                if (x < this.minX) {
-                    this.minX = x;
-                }
-                if (y < this.minY) {
-                    this.minY = y;
-                }
-                if (x > this.maxX) {
-                    this.maxX = x;
-                }
-                if (y > this.maxY) {
-                    this.maxY = y;
-                }
-            });
-        }
-
-        return new SRect(
-            this.minX,
-            this.minY,
-            this.maxX - this.minX,
-            this.maxY - this.minY
-        );
-    } // Function boundingRect()
-
-    /**
-     * Item 绘制操作
-     *
-     * @param painter   绘制对象
-     */
-    onDraw(painter: SPainter): void {
-        this.sceneDis = painter.toPx(this.dis);
-        painter.pen.lineWidth = painter.toPx(this.lineWidth);
-        painter.pen.color = this.strokeColor;
-        if (this.line.length == 2) {
-            // 绘制直线
-            painter.pen.color = new SColor(this.strokeColor);
-            if (this.lineStyle == SLineStyle.Dashed) {
-                painter.pen.lineDash = [
-                    painter.toPx(this.lineWidth * 3),
-                    painter.toPx(this.lineWidth * 7)
-                ];
-            } else if (this.lineStyle == SLineStyle.Dotted) {
-                painter.pen.lineDash = [
-                    painter.toPx(this.lineWidth),
-                    painter.toPx(this.lineWidth)
-                ];
-            }
-
-            if (this.selected && this.status == SItemStatus.Normal) {
-                painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
-                painter.shadow.shadowBlur = 10;
-                painter.shadow.shadowColor = new SColor(`#00000033`);
-                painter.shadow.shadowOffsetX = 5;
-                painter.shadow.shadowOffsetY = 5;
-            }
-
-            painter.drawLine(this.line[0], this.line[1]);
-            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()
-} // Class SLineItem

+ 0 - 846
persagy-web-big/src/items/SPolygonItem.ts

@@ -1,846 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 {
-    SGraphItem,
-    SGraphPointListDelete,
-    SGraphPointListInsert,
-    SGraphPointListUpdate,
-    SLineStyle
-} from "@persagy-web/graph";
-import { SKeyCode, SMouseEvent, SUndoStack } from "@persagy-web/base/";
-import {
-    SColor,
-    SLine,
-    SLineCapStyle,
-    SPainter,
-    SPoint,
-    SPolygonUtil,
-    SRect
-} from "@persagy-web/draw";
-import { SItemStatus } from "..";
-import { SMathUtil } from "../utils/SMathUtil";
-
-/**
- * 编辑多边形
- *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
- */
-export class SPolygonItem extends SGraphItem {
-    /** X 坐标最小值 */
-    private minX = Number.MAX_SAFE_INTEGER;
-    /** X 坐标最大值 */
-    private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y 坐标最小值 */
-    private minY = Number.MAX_SAFE_INTEGER;
-    /** Y 坐标最大值 */
-    private maxY = Number.MIN_SAFE_INTEGER;
-
-    /** 轮廓线坐标 */
-    private pointList: SPoint[] = [];
-    get getPointList(): SPoint[] {
-        return this.pointList;
-    } // Get getPointList
-    set setPointList(arr: SPoint[]) {
-        this.pointList = arr;
-        this.update();
-    } // Set getPointList
-
-    /** 当前状态 */
-    protected _status: number = SItemStatus.Normal;
-    get status(): SItemStatus {
-        return this._status;
-    } // Get status
-    set status(value: SItemStatus) {
-        this._status = value;
-        this.undoStack.clear();
-        this.update();
-    } // Set status
-
-    /** 边框颜色 */
-    _strokeColor: SColor = new SColor("#0091FF");
-    /**  画笔颜色 */
-    get strokeColor(): SColor {
-        return this._strokeColor;
-    } // Get strokeColor
-    set strokeColor(v: SColor) {
-        this._strokeColor = v;
-        this.update();
-    } // Set strokeColor
-
-    /** 填充颜色 */
-    _fillColor: SColor = new SColor("#1EE887");
-    get fillColor(): SColor {
-        return this._fillColor;
-    } // Get fillColor
-    set fillColor(v: SColor) {
-        this._fillColor = v;
-        this.update();
-    } // Set fillColor
-
-    /** 边框样式 */
-    _lineStyle: SLineStyle = SLineStyle.Solid;
-    get lineStyle(): SLineStyle {
-        return this._lineStyle;
-    } // Get lineStyle
-    set lineStyle(v: SLineStyle) {
-        this._lineStyle = v;
-        this.update();
-    } // Set lineStyle
-
-    /** 边框的宽 只可输入像素宽 */
-    _lineWidth: number = 4;
-    get lineWidth(): number {
-        return this._lineWidth;
-    } // Get lineWidth
-    set lineWidth(v: number) {
-        this._lineWidth = v;
-        this.update();
-    } // Set lineWidth
-
-    /** 是否闭合 */
-    closeFlag: boolean = false;
-    /** 鼠标移动点 */
-    private lastPoint: SPoint | null = null;
-    /** 当前鼠标获取顶点对应索引 */
-    private curIndex: number = -1;
-    /** 当前鼠标获取顶点对应坐标 */
-    private curPoint: null | SPoint = null;
-    /** 灵敏像素 */
-    private len: number = 10;
-    /** 场景像素 内部将灵敏像素换算为场景实际距离 */
-    private scenceLen: number = 15;
-    /** 场景像素 */
-    private isAlt: boolean = false;
-    /** undo/redo 堆栈 */
-    protected undoStack: SUndoStack = new SUndoStack();
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     */
-    constructor(parent: SGraphItem | null) {
-        super(parent);
-    } // Constructor
-
-    //////////////////
-    //  以下为对pointList 数组的操作方法
-
-    /**
-     * 储存新的多边形顶点
-     *
-     * @param x   点位得 x 坐标
-     * @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) {
-            this.pointList.push(point);
-        } else {
-            this.pointList.splice(i, 0, point);
-        }
-        this.update();
-        return point;
-    } // Function insertPoint()
-
-    /**
-     * 删除点位
-     *
-     * @param i   删除点所在的索引
-     * @return 索引不在数组范围则返回 null
-     */
-    deletePoint(i: number | null = null): SPoint | null {
-        let point = null;
-        if (i != null) {
-            if (i >= this.pointList.length || i < 0) {
-                point = null;
-            } else {
-                point = new SPoint(this.pointList[i].x, this.pointList[i].y);
-                this.pointList.splice(i, 1);
-            }
-        } else {
-            if (this.pointList.length) {
-                point = this.pointList[this.pointList.length - 1];
-                this.pointList.pop();
-            } else {
-                point = null;
-            }
-        }
-        this.curIndex = -1;
-        this.curPoint = null;
-        this.update();
-        return point;
-    } // Function deletePoint()
-
-    /**
-     * 多边形顶点的移动位置
-     *
-     * @param x   点位得 x 坐标
-     * @param y   点位得 y 坐标
-     * @param i   点位得 i 坐标
-     * @return   移动对应得点。如果索引无法找到移动顶点,则返回 null
-     */
-    movePoint(x: number, y: number, i: number): SPoint | null {
-        let point = null;
-        if (i >= this.pointList.length || i < 0) {
-            return null;
-        }
-
-        if (this.pointList.length) {
-            this.pointList[i].x = x;
-            this.pointList[i].y = y;
-        }
-
-        point = this.pointList[i];
-        return point;
-    } // Function movePoint()
-
-    ////////////
-    //  以下为三种状态下的绘制多边形方法
-
-    /**
-     * 展示状态 --绘制多边形数组
-     *
-     * @param painter      绘制类
-     * @param pointList    绘制多边形数组
-     */
-    protected drawShowPolygon(painter: SPainter, pointList: SPoint[]): void {
-        painter.save();
-        painter.pen.lineCapStyle = SLineCapStyle.Square;
-        painter.pen.color = this.strokeColor;
-        painter.brush.color = this.fillColor;
-        painter.pen.lineWidth = painter.toPx(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),
-                painter.toPx(this.lineWidth)
-            ];
-        }
-
-        if (this.selected) {
-            painter.shadow.shadowBlur = 10;
-            painter.shadow.shadowColor = new SColor(`#00000033`);
-            painter.shadow.shadowOffsetX = 5;
-            painter.shadow.shadowOffsetY = 5;
-        } else {
-            painter.shadow.shadowColor = SColor.Transparent;
-        }
-
-        painter.drawPolygon([...pointList]);
-        painter.restore();
-    } // Function drawShowPolygon()
-
-    /**
-     * 创建状态 --绘制多边形数组
-     *
-     * @param painter      绘制类
-     * @param pointList    绘制多边形数组
-     */
-    protected drawCreatePolygon(painter: SPainter, pointList: SPoint[]): void {
-        painter.pen.lineCapStyle = SLineCapStyle.Square;
-        painter.pen.color = this.strokeColor;
-        painter.pen.lineWidth = painter.toPx(this.lineWidth);
-        if (this.lastPoint && pointList.length) {
-            painter.drawLine(
-                pointList[pointList.length - 1].x,
-                pointList[pointList.length - 1].y,
-                this.lastPoint.x,
-                this.lastPoint.y
-            );
-        }
-
-        painter.drawPolyline(pointList);
-        painter.pen.color = SColor.Transparent;
-        painter.brush.color = new SColor(this.fillColor.value);
-        painter.pen.lineWidth = painter.toPx(this.lineWidth);
-
-        if (this.lastPoint) {
-            painter.drawPolygon([...pointList, this.lastPoint]);
-            // 绘制顶点块
-            painter.pen.color = SColor.Black;
-            painter.brush.color = SColor.White;
-            pointList.forEach(item => {
-                painter.drawCircle(item.x, item.y, painter.toPx(this.len / 2));
-            });
-            // 如果最后一个点在第一个点的灵敏度范围内,第一个点填充变红
-            if (this.pointList.length) {
-                if (
-                    SMathUtil.pointDistance(
-                        this.lastPoint.x,
-                        this.lastPoint.y,
-                        this.pointList[0].x,
-                        this.pointList[0].y
-                    ) < this.scenceLen
-                ) {
-                    // 绘制第一个点的顶点块
-                    painter.pen.color = SColor.Black;
-                    painter.brush.color = SColor.Red;
-                    painter.drawCircle(
-                        this.pointList[0].x,
-                        this.pointList[0].y,
-                        painter.toPx(this.len / 2)
-                    );
-                }
-            }
-        } else {
-            painter.drawPolygon(pointList);
-        }
-    } // Function drawCreatePolygon()
-
-    /**
-     * 编辑状态 --绘制多边形数组
-     *
-     * @param painter       绘制类
-     * @param pointList    绘制多边形数组
-     */
-    protected drawEditPolygon(painter: SPainter, pointList: SPoint[]): void {
-        // 展示多边形
-        painter.pen.lineCapStyle = SLineCapStyle.Square;
-        painter.pen.color = this.strokeColor;
-        painter.pen.lineWidth = painter.toPx(this.lineWidth);
-        painter.brush.color = new SColor(this.fillColor.value);
-        painter.drawPolygon([...pointList]);
-        // 绘制顶点块
-        painter.pen.color = SColor.Black;
-        painter.brush.color = SColor.White;
-        pointList.forEach((item, index) => {
-            painter.brush.color = SColor.White;
-            if (index == this.curIndex) {
-                painter.brush.color = new SColor("#2196f3");
-            }
-
-            painter.drawCircle(item.x, item.y, painter.toPx(this.len / 2));
-        });
-    } // Function drawCreatePolygon()
-
-    /**
-     * 编辑状态操作多边形数组
-     *
-     * @param event    鼠标事件
-     */
-    protected editPolygonPoint(event: SMouseEvent): void {
-        //  判断是否为删除状态 isAlt = true为删除状态
-        if (this.isAlt) {
-            // 1 判断是否点击在多边形顶点
-            let lenIndex = -1; // 当前点击到的点位索引;
-            let curenLen = this.scenceLen; // 当前的灵敏度
-            this.pointList.forEach((item, index) => {
-                let dis = SMathUtil.pointDistance(
-                    event.x,
-                    event.y,
-                    item.x,
-                    item.y
-                );
-                if (dis < curenLen) {
-                    curenLen = dis;
-                    lenIndex = index;
-                }
-            });
-            // 若点击到,对该索引对应的点做删除
-            if (lenIndex != -1) {
-                if (this.pointList.length <= 3) {
-                    return;
-                }
-
-                const delePoint = new SPoint(
-                    this.pointList[lenIndex].x,
-                    this.pointList[lenIndex].y
-                );
-                this.deletePoint(lenIndex);
-                // 记录顶点操作记录压入堆栈
-                this.recordAction(SGraphPointListDelete, [
-                    this.pointList,
-                    delePoint,
-                    lenIndex
-                ]);
-            }
-        } else {
-            // 1 判断是否点击在多边形顶点
-            this.curIndex = -1;
-            this.curPoint = null;
-            let lenIndex = -1; // 当前点击到的点位索引;
-            let curenLen = this.scenceLen; // 当前的灵敏度
-            this.pointList.forEach((item, index) => {
-                let dis = SMathUtil.pointDistance(
-                    event.x,
-                    event.y,
-                    item.x,
-                    item.y
-                );
-                if (dis < curenLen) {
-                    curenLen = dis;
-                    lenIndex = index;
-                }
-            });
-            this.curIndex = lenIndex;
-            // 2判断是否点击在多边形得边上
-            if (-1 == lenIndex) {
-                let len = SMathUtil.pointToLine(
-                        new SPoint(event.x, event.y),
-                        new SLine(this.pointList[0], this.pointList[1])
-                    ),
-                    index = 0;
-                if (this.pointList.length > 2) {
-                    for (let i = 1; i < this.pointList.length; i++) {
-                        let dis = SMathUtil.pointToLine(
-                            new SPoint(event.x, event.y),
-                            new SLine(this.pointList[i], this.pointList[i + 1])
-                        );
-                        if (i + 1 == this.pointList.length) {
-                            dis = SMathUtil.pointToLine(
-                                new SPoint(event.x, event.y),
-                                new SLine(this.pointList[i], this.pointList[0])
-                            );
-                        }
-
-                        if (dis.MinDis < len.MinDis) {
-                            len = dis;
-                            index = i;
-                        }
-                    }
-                }
-
-                // 判断是否有点
-                if (len.Point) {
-                    // 点在了多边形的边上
-                    if (len.MinDis <= this.scenceLen) {
-                        this.pointList.splice(index + 1, 0, len.Point);
-                        // 记录新增顶点操作记录压入堆栈
-                        this.recordAction(SGraphPointListInsert, [
-                            this.pointList,
-                            len.Point,
-                            index + 1
-                        ]);
-                    } else {
-                        //没点在多边形边上也没点在多边形顶点上
-                        super.onMouseDown(event);
-                    }
-                }
-            } else {
-                // 当捕捉到顶点后 ,记录当前点的xy坐标,用于undo、redo操作
-                this.curPoint = new SPoint(
-                    this.pointList[this.curIndex].x,
-                    this.pointList[this.curIndex].y
-                );
-            }
-            // 刷新视图
-            this.update();
-        }
-    } // Function editPolygonPoint()
-
-    /////////////////////
-    // undo、redo相关操作
-
-    /**
-     * 记录相关动作并推入栈中
-     *
-     * @param	SGraphCommand   相关命令类
-     * @param	any             对应传入参数
-     */
-    protected recordAction(SGraphCommand: any, any: any[]): void {
-        // 记录相关命令并推入堆栈中
-        const sgraphcommand = new SGraphCommand(this.scene, this, ...any);
-        this.undoStack.push(sgraphcommand);
-    } // Function recordAction()
-
-    /**
-     * 执行取消操作执行
-     */
-    undo(): void {
-        if (this.status == SItemStatus.Normal) {
-            return;
-        }
-        this.undoStack.undo();
-    } // Function undo()
-
-    /**
-     * 执行重做操作执行
-     */
-    redo(): void {
-        if (this.status == SItemStatus.Normal) {
-            return;
-        }
-        this.undoStack.redo();
-    } // Function redo()
-
-    ///////////////////////////////
-    // 以下为鼠标事件
-
-    /**
-     * 鼠标双击事件
-     *
-     * @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()
-
-    /**
-     * 键盘事件
-     *
-     * @param event     事件参数
-     * @return 是否处理
-     */
-
-    onKeyDown(event: KeyboardEvent): boolean {
-        if (this.status == SItemStatus.Normal) {
-            return false;
-        } else if (this.status == SItemStatus.Create) {
-            if (event.code == "Enter") {
-                // 当顶点大于二个时才又条件执行闭合操作并清空堆栈
-                if (this.pointList.length > 2) {
-                    this.status = SItemStatus.Normal;
-                    //3 传递完成事件状态
-                    this.$emit("finishCreated");
-                    //1 grabItem 置为null
-                    this.releaseItem();
-                }
-            }
-        } else if (this.status == SItemStatus.Edit) {
-            if (event.key == "Alt") {
-                this.isAlt = true;
-            }
-        }
-
-        this.update();
-        return true;
-    } // Function onKeyDown()
-
-    /**
-     * 键盘键抬起事件
-     *
-     * @param event     事件参数
-     * @return 是否处理
-     */
-    onKeyUp(event: KeyboardEvent): void {
-        if (this.status == SItemStatus.Edit) {
-            if (event.key == "Alt") {
-                this.isAlt = false;
-            } else if (event.keyCode == SKeyCode.Delete) {
-                // 当多边形的顶点大于三个允许删除点
-                if (this.pointList.length > 3) {
-                    this.deletePoint(this.curIndex);
-                }
-            }
-        }
-
-        this.update();
-    } // Function onKeyUp()
-
-    /**
-     * 鼠标按下事件
-     *
-     * @param event     事件参数
-     * @return 是否处理
-     */
-    onMouseDown(event: SMouseEvent): boolean {
-        if (event.shiftKey) {
-            event = this.compare(event);
-        }
-
-        // 如果状态为编辑状态则添加点
-        if (this.status == SItemStatus.Create) {
-            // 新增顶点
-            let len = -1;
-            if (this.pointList.length) {
-                len = SMathUtil.pointDistance(
-                    event.x,
-                    event.y,
-                    this.pointList[0].x,
-                    this.pointList[0].y
-                );
-            }
-
-            if (this.pointList.length > 2 && len > 0 && len < this.scenceLen) {
-                this.status = SItemStatus.Normal;
-                //3 传递完成事件状态
-                this.$emit("finishCreated");
-                //1 grabItem 置为null
-                this.releaseItem();
-            } else {
-                this.insertPoint(event.x, event.y);
-                // 记录新增顶点操作记录压入堆栈
-                let pos = new SPoint(event.x, event.y);
-                this.recordAction(SGraphPointListInsert, [this.pointList, pos]);
-            }
-        } else if (this.status == SItemStatus.Edit) {
-            // 对多边形数组做编辑操作
-            this.editPolygonPoint(event);
-        } else {
-            return super.onMouseDown(event);
-        }
-
-        return true;
-    } // Function onMouseDown()
-
-    /**
-     * 鼠标移入事件
-     *
-     * @param event     事件参数
-     * @return 是否处理
-     */
-    onMouseEnter(event: SMouseEvent): boolean {
-        return true;
-    } // Function onMouseEnter()
-
-    /**
-     * 鼠标移出事件
-     *
-     * @param event     事件参数
-     * @return 是否处理
-     */
-    onMouseLeave(event: SMouseEvent): boolean {
-        return true;
-    } // Function onMouseLeave()
-
-    /**
-     * 鼠标移动事件
-     *
-     * @param event     事件参数
-     * @return 是否处理
-     */
-    onMouseMove(event: SMouseEvent): boolean {
-        if (event.shiftKey) {
-            event = this.compare(event);
-        }
-
-        if (this.status == SItemStatus.Create) {
-            this.lastPoint = new SPoint();
-            this.lastPoint.x = event.x;
-            this.lastPoint.y = event.y;
-            this.update();
-        } else if (this.status == SItemStatus.Edit) {
-            if (event.buttons == 1) {
-                if (-1 != this.curIndex) {
-                    this.pointList[this.curIndex].x = event.x;
-                    this.pointList[this.curIndex].y = event.y;
-                }
-            }
-
-            this.update();
-        } else {
-            return super.onMouseMove(event);
-        }
-
-        return true;
-    } // Function onMouseMove()
-
-    /**
-     * shift 垂直水平创建或编辑
-     *
-     * @param event     事件
-     * @return 处理后的事件
-     */
-    compare(event: SMouseEvent): SMouseEvent {
-        if (this.pointList.length) {
-            let last = new SPoint(event.x, event.y);
-            if (this.status == SItemStatus.Create) {
-                last = this.pointList[this.pointList.length - 1];
-            } else if (this.status == SItemStatus.Edit) {
-                if (this.curIndex > 0) {
-                    last = this.pointList[this.curIndex - 1];
-                }
-            }
-
-            const dx = Math.abs(event.x - last.x);
-            const dy = Math.abs(event.y - last.y);
-            if (dy > dx) {
-                event.x = last.x;
-            } else {
-                event.y = last.y;
-            }
-        }
-
-        return event;
-    } // Function compare()
-
-    /**
-     * 鼠标抬起事件
-     *
-     * @param event     事件参数
-     * @return 是否处理
-     */
-    onMouseUp(event: SMouseEvent): boolean {
-        if (this.status == SItemStatus.Edit) {
-            if (-1 != this.curIndex) {
-                const pos = new SPoint(
-                    this.pointList[this.curIndex].x,
-                    this.pointList[this.curIndex].y
-                );
-                this.recordAction(SGraphPointListUpdate, [
-                    this.pointList,
-                    this.curPoint,
-                    pos,
-                    this.curIndex
-                ]);
-            }
-        } else if (this.status == SItemStatus.Normal) {
-            this.moveToOrigin(this.x, this.y);
-            return super.onMouseUp(event);
-        }
-
-        return true;
-    } // Function onMouseUp()
-
-    /**
-     * 移动后处理所有坐标,并肩原点置为场景原点
-     *
-     * @param x   x 坐标
-     * @param y   y 坐标
-     */
-    moveToOrigin(x: number, y: number): void {
-        super.moveToOrigin(x, y);
-        this.pointList = this.pointList.map(t => {
-            t.x = t.x + x;
-            t.y = t.y + y;
-            return t;
-        });
-        this.x = 0;
-        this.y = 0;
-    } // Function moveToOrigin()
-
-    /**
-     * 适配事件
-     *
-     * @param event     事件参数
-     * @return 是否处理
-     */
-    onResize(event: SMouseEvent): boolean {
-        return true;
-    } // Function onResize()
-
-    /**
-     * 取消操作
-     */
-    cancelOperate(): void {
-        // 当状态为展示状态
-        if (this.status == SItemStatus.Create) {
-            // 闭合多边形
-            this.parent = null;
-        } else if (this.status == SItemStatus.Edit) {
-            // 编辑状态
-            this.status = SItemStatus.Normal;
-        }
-
-        this.update();
-    } // Function cancelOperate()
-
-    /**
-     * Item 对象边界区域
-     *
-     * @return 边界区域
-     */
-    boundingRect(): SRect {
-        if (this.pointList.length) {
-            this.minX = this.pointList[0].x;
-            this.maxX = this.pointList[0].x;
-            this.minY = this.pointList[0].y;
-            this.maxY = this.pointList[0].y;
-            this.pointList.forEach(it => {
-                let x = it.x,
-                    y = it.y;
-                if (x < this.minX) {
-                    this.minX = x;
-                }
-
-                if (y < this.minY) {
-                    this.minY = y;
-                }
-
-                if (x > this.maxX) {
-                    this.maxX = x;
-                }
-
-                if (y > this.maxY) {
-                    this.maxY = y;
-                }
-
-            });
-        }
-
-        return new SRect(
-            this.minX,
-            this.minY,
-            this.maxX - this.minX,
-            this.maxY - this.minY
-        );
-    } // Function boundingRect()
-
-    /**
-     * 判断点是否在区域内
-     *
-     * @param x     x 坐标
-     * @param y     y 坐标
-     * @return 是否在区域内
-     */
-    contains(x: number, y: number): boolean {
-        let arr = this.pointList;
-        if (arr.length < 3 || !SPolygonUtil.pointIn(x, y, arr)) {
-            return false;
-        }
-
-        return true;
-    } // Function contains()
-
-    /**
-     * Item 绘制操作
-     *
-     * @param painter   绘制对象
-     */
-    onDraw(painter: SPainter): void {
-        this.scenceLen = painter.toPx(this.len);
-        // 当状态为展示状态
-        if (this.status == SItemStatus.Normal) {
-            // 闭合多边形
-            this.drawShowPolygon(painter, this.pointList);
-        } else if (this.status == SItemStatus.Create) {
-            // 创建状态
-            this.drawCreatePolygon(painter, this.pointList);
-        } else {
-            // 编辑状态
-            this.drawEditPolygon(painter, this.pointList);
-        }
-    } // Function onDraw()
-} // Class SPolygonItem

+ 0 - 643
persagy-web-big/src/items/SPolylineItem.ts

@@ -1,643 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { SColor, SLine, SPainter, SPoint, SRect } from "@persagy-web/draw";
-import { SKeyCode, SMouseEvent, SUndoStack } from "@persagy-web/base";
-import { SItemStatus } from "..";
-import { SMathUtil } from "../utils/SMathUtil";
-import {
-    SGraphItem,
-    SGraphPointListDelete,
-    SGraphPointListInsert,
-    SGraphPointListUpdate,
-    SLineStyle
-} from "@persagy-web/graph";
-
-/**
- * 折线 item
- *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
- */
-export class SPolylineItem extends SGraphItem {
-    /** X 坐标最小值 */
-    private minX = Number.MAX_SAFE_INTEGER;
-    /** X 坐标最大值 */
-    private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y 坐标最小值 */
-    private minY = Number.MAX_SAFE_INTEGER;
-    /** Y 坐标最大值 */
-    private maxY = Number.MIN_SAFE_INTEGER;
-    /** 折点信息 */
-    pointList: SPoint[] = [];
-    /** 是否绘制完成 */
-    _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
-
-    /** 鼠标移动时的点 */
-    protected lastPoint: 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
-
-    /** 线条宽度 */
-    _lineWidth: number = 1;
-    get lineWidth(): number {
-        return this._lineWidth;
-    } // Get lineWidth
-    set lineWidth(v: number) {
-        this._lineWidth = v;
-        this.update();
-    } // Set lineWidth
-
-    /** 边框样式 */
-    _lineStyle: SLineStyle = SLineStyle.Solid;
-    get lineStyle(): SLineStyle {
-        return this._lineStyle;
-    } // Get lineStyle
-    set lineStyle(v: SLineStyle) {
-        this._lineStyle = v;
-        this.update();
-    } // Set lineStyle
-
-    /** 全局灵敏度 */
-    dis: number = 10;
-    /** 灵敏度转换为场景长度 */
-    protected sceneDis: number = 10;
-    /** 当前点索引 */
-    protected curIndex: number = -1;
-    /** 当前点 */
-    private curPoint: SPoint | null = null;
-    /** undo/redo 堆栈 */
-    private undoStack: SUndoStack = new SUndoStack();
-
-    /**
-     * 构造函数
-     *
-     * @param parent    父级
-     * @param list      坐标集合
-     */
-    constructor(parent: null | SGraphItem, list: SPoint[]);
-
-    /**
-     * 构造函数
-     *
-     * @param parent    父级
-     * @param list      第一个坐标
-     */
-    constructor(parent: null | SGraphItem, list: SPoint);
-
-    /**
-     * 构造函数
-     *
-     * @param parent    父级
-     * @param list      第一个坐标|坐标集合
-     */
-    constructor(parent: null | SGraphItem, list: SPoint | SPoint[]) {
-        super(parent);
-        if (list instanceof SPoint) {
-            this.pointList.push(list);
-        } else {
-            this.pointList = list;
-        }
-    } // Constructor
-
-    /**
-     * 添加点至数组中
-     *
-     * @param p         添加的点
-     * @param index     添加到的索引
-     */
-    private addPoint(p: SPoint, index?: number): void {
-        if (index && this.canHandle(index)) {
-            this.pointList.splice(index, 0, p);
-            this.recordAction(SGraphPointListInsert, [
-                this.pointList,
-                p,
-                index
-            ]);
-        } else {
-            this.pointList.push(p);
-            this.recordAction(SGraphPointListInsert, [this.pointList, p]);
-        }
-
-        this.update();
-    } // Function addPoint()
-
-    /**
-     * 是否可以添加点到数组中
-     *
-     * @param index     要添加到的索引
-     * @return 是否可添加
-     */
-    private canHandle(index: number): boolean {
-        return index >= 0 && index <= this.pointList.length;
-    } // Function canHandle()
-
-    /**
-     * 根据索引删除点
-     *
-     * @param index     删除点
-     */
-    deletePoint(index: number): void {
-        if (this.canHandle(index) && this.pointList.length > 2) {
-            const p = new SPoint(
-                this.pointList[this.curIndex].x,
-                this.pointList[this.curIndex].y
-            );
-            this.pointList.splice(index, 1);
-            this.recordAction(SGraphPointListDelete, [
-                this.pointList,
-                p,
-                index
-            ]);
-            this.curIndex = -1;
-            this.curPoint = null;
-            this.update();
-        }
-    } // Function deletePoint
-
-    /**
-     * 鼠标按下事件
-     *
-     * @param event     鼠标事件
-     * @return 是否处理事件
-     */
-    onMouseDown(event: SMouseEvent): boolean {
-        this.curIndex = -1;
-        this.curPoint = null;
-        if (event.shiftKey) {
-            event = this.compare(event);
-        }
-
-        if (event.buttons == 1) {
-            if (this.status == SItemStatus.Create) {
-                this.addPoint(new SPoint(event.x, event.y));
-                return true;
-            } else if (this.status == SItemStatus.Edit) {
-                // 查询鼠标最近的索引
-                this.findNearestPoint(new SPoint(event.x, event.y));
-                // 增加点
-                if (this.curIndex < 0) {
-                    this.findAddPos(new SPoint(event.x, event.y));
-                }
-
-                // 删除点
-                if (event.altKey && this.canHandle(this.curIndex)) {
-                    this.deletePoint(this.curIndex);
-                }
-
-                this.update();
-                return true;
-            } else {
-                return super.onMouseDown(event);
-            }
-        }
-
-        return super.onMouseDown(event);
-    } // Function onMouseDown()
-
-    /**
-     * 鼠标移动事件
-     *
-     * @param event     鼠标事件
-     * @return 是否处理事件
-     */
-    onMouseMove(event: SMouseEvent): boolean {
-        if (event.shiftKey) {
-            event = this.compare(event);
-        }
-
-        if (this.status == SItemStatus.Create) {
-            if (this.lastPoint) {
-                this.lastPoint.x = event.x;
-                this.lastPoint.y = event.y;
-            } else {
-                this.lastPoint = new SPoint(event.x, event.y);
-            }
-
-            this.update();
-            return true;
-        } else if (this.status == SItemStatus.Edit) {
-            if (event.buttons == 1) {
-                if (this.canHandle(this.curIndex)) {
-                    this.pointList[this.curIndex].x = event.x;
-                    this.pointList[this.curIndex].y = event.y;
-                }
-            }
-
-            this.update();
-            return true;
-        } else {
-            return super.onMouseMove(event);
-        }
-    } // Function onMouseMove()
-
-    /**
-     * 鼠标移动事件
-     *
-     * @param event     鼠标事件
-     * @return 是否处理事件
-     */
-    onMouseUp(event: SMouseEvent): boolean {
-        if (this.status == SItemStatus.Edit) {
-            if (this.curIndex > -1) {
-                const p = new SPoint(
-                    this.pointList[this.curIndex].x,
-                    this.pointList[this.curIndex].y
-                );
-                this.recordAction(SGraphPointListUpdate, [
-                    this.pointList,
-                    this.curPoint,
-                    p,
-                    this.curIndex
-                ]);
-            }
-        } else if (this.status == SItemStatus.Normal) {
-            this.moveToOrigin(this.x, this.y);
-            return super.onMouseUp(event);
-        }
-
-        return true;
-    } // Function onMouseUp()
-
-    /**
-     * 鼠标双击事件
-     *
-     * @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();
-        } else if (this.status == SItemStatus.Create) {
-            if (this.pointList.length > 1) {
-                this.status = SItemStatus.Normal;
-                this.releaseItem();
-                this.$emit("finishCreated");
-            }
-        }
-
-        this.$emit("onDoubleClick", event);
-        return true;
-    } // Function onDoubleClick()
-
-    /***
-     * 键盘按键弹起事件
-     *
-     * @param event     事件参数
-     */
-    onKeyUp(event: KeyboardEvent): void {
-        if (event.keyCode == SKeyCode.Enter) {
-            if (this.pointList.length > 1) {
-                if (this.status == SItemStatus.Create) {
-                    this.$emit("finishCreated");
-                }
-
-                this.status = SItemStatus.Normal;
-                this.releaseItem();
-            }
-        }
-
-        // delete删除点
-        if (
-            event.keyCode == SKeyCode.Delete &&
-            this.status == SItemStatus.Edit
-        ) {
-            this.deletePoint(this.curIndex);
-        }
-    } // Function onKeyUp()
-
-    /**
-     * 移动后处理所有坐标,并肩原点置为场景原点
-     *
-     * @param x     x 坐标
-     * @param y     y 坐标
-     */
-    moveToOrigin(x: number, y: number): void {
-        super.moveToOrigin(x, y);
-        this.pointList = this.pointList.map(t => {
-            t.x = t.x + x;
-            t.y = t.y + y;
-            return t;
-        });
-        this.x = 0;
-        this.y = 0;
-    } // Function moveToOrigin()
-
-    /**
-     * 获取点击点与点集中距离最近点
-     *
-     * @param p     鼠标点击点
-     */
-    findNearestPoint(p: SPoint): void {
-        let len = this.sceneDis;
-        for (let i = 0; i < this.pointList.length; i++) {
-            let dis = SMathUtil.pointDistance(
-                p.x,
-                p.y,
-                this.pointList[i].x,
-                this.pointList[i].y
-            );
-            if (dis < len) {
-                len = dis;
-                this.curIndex = i;
-                this.curPoint = new SPoint(
-                    this.pointList[this.curIndex].x,
-                    this.pointList[this.curIndex].y
-                );
-            }
-        }
-    } // Function findNearestPoint()
-
-    /**
-     * 计算增加点的位置
-     *
-     * @param p     鼠标点击点
-     */
-    findAddPos(p: SPoint): void {
-        let len = SMathUtil.pointToLine(
-                p,
-                new SLine(this.pointList[0], this.pointList[1])
-            ),
-            index = 0;
-        if (this.pointList.length > 2) {
-            for (let i = 1; i < this.pointList.length - 1; i++) {
-                let dis = SMathUtil.pointToLine(
-                    p,
-                    new SLine(this.pointList[i], this.pointList[i + 1])
-                );
-                if (dis.MinDis < len.MinDis) {
-                    len = dis;
-                    index = i;
-                }
-            }
-        }
-
-        if (len.MinDis < this.sceneDis && len.Point) {
-            this.addPoint(len.Point, index + 1);
-        }
-    } // Function findAddPos()
-
-    /**
-     * shift 垂直水平创建或编辑
-     *
-     * @param event     事件
-     * @return 事件对象
-     */
-    compare(event: SMouseEvent): SMouseEvent {
-        if (this.pointList.length) {
-            let last = new SPoint(event.x, event.y);
-            if (this.status == SItemStatus.Create) {
-                last = this.pointList[this.pointList.length - 1];
-            } else if (this.status == SItemStatus.Edit) {
-                if (this.curIndex > 1) {
-                    last = this.pointList[this.curIndex - 1];
-                }
-            }
-
-            const dx = Math.abs(event.x - last.x);
-            const dy = Math.abs(event.y - last.y);
-            if (dy > dx) {
-                event.x = last.x;
-            } else {
-                event.y = last.y;
-            }
-        }
-
-        return event;
-    } // Function compare()
-
-    /**
-     * 记录相关动作并推入栈中
-     *
-     * @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 外接矩阵
-     */
-    boundingRect(): SRect {
-        if (this.pointList.length) {
-            this.minX = this.pointList[0].x;
-            this.maxX = this.pointList[0].x;
-            this.minY = this.pointList[0].y;
-            this.maxY = this.pointList[0].y;
-            this.pointList.forEach(it => {
-                let x = it.x,
-                    y = it.y;
-                if (x < this.minX) {
-                    this.minX = x;
-                }
-
-                if (y < this.minY) {
-                    this.minY = y;
-                }
-
-                if (x > this.maxX) {
-                    this.maxX = x;
-                }
-
-                if (y > this.maxY) {
-                    this.maxY = y;
-                }
-            });
-        }
-
-        return new SRect(
-            this.minX,
-            this.minY,
-            this.maxX - this.minX,
-            this.maxY - this.minY
-        );
-    } // Function boundingRect()
-
-    /**
-     * 判断点是否在区域内
-     *
-     * @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++) {
-            let PTL = SMathUtil.pointToLine(
-                p,
-                new SLine(
-                    this.pointList[i - 1].x,
-                    this.pointList[i - 1].y,
-                    this.pointList[i].x,
-                    this.pointList[i].y
-                )
-            );
-            if (PTL.MinDis < this.sceneDis) {
-                return true;
-            }
-        }
-        return false;
-    } // Function contains()
-
-    /**
-     * 撤销操作
-     */
-    undo(): void {
-        if (this._status != SItemStatus.Normal) {
-            this.undoStack.undo();
-        }
-    } // Function undo()
-
-    /**
-     * 重做操作
-     */
-    redo(): void {
-        if (this._status != SItemStatus.Normal) {
-            this.undoStack.redo();
-        }
-    } // Function redo()
-
-    /**
-     * 取消操作执行
-     */
-    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()
-
-    /**
-     * 绘制基本图形
-     *
-     * @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.drawPolyline(this.pointList);
-    } // Function drawBaseLine()
-
-    /**
-     * Item 绘制操作
-     *
-     * @param painter   绘制对象
-     */
-    onDraw(painter: SPainter): void {
-        // 缓存场景长度
-        this.sceneDis = painter.toPx(this.dis);
-        // 创建状态
-        painter.pen.lineWidth = painter.toPx(this.lineWidth);
-        if (this.status == SItemStatus.Create && this.lastPoint) {
-            // 绘制基本图形
-            this.drawBaseLine(painter);
-            painter.drawLine(
-                this.pointList[this.pointList.length - 1],
-                this.lastPoint
-            );
-            this.pointList.forEach((t, i): void => {
-                painter.brush.color = SColor.White;
-                if (i == this.curIndex) {
-                    painter.brush.color = this.fillColor;
-                }
-
-                painter.drawCircle(t.x, t.y, painter.toPx(5));
-            });
-        } else if (this.status == SItemStatus.Edit) {
-            // 绘制基本图形
-            this.drawBaseLine(painter);
-            // 编辑状态
-            this.pointList.forEach((t, i): void => {
-                painter.brush.color = SColor.White;
-                if (i == this.curIndex) {
-                    painter.brush.color = this.fillColor;
-                }
-
-                painter.drawCircle(t.x, t.y, painter.toPx(5));
-            });
-        } else {
-            // 查看状态
-            if (this.selected) {
-                painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
-                painter.shadow.shadowBlur = 10;
-                painter.shadow.shadowColor = new SColor(`#00000033`);
-                painter.shadow.shadowOffsetX = 5;
-                painter.shadow.shadowOffsetY = 5;
-            }
-
-            // 绘制基本图形
-            this.drawBaseLine(painter);
-        }
-    } // Function onDraw()
-} // Class SPolylineItem

+ 0 - 34
persagy-web-big/src/items/STooltipItem.ts

@@ -1,34 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { STextItem } from "@persagy-web/graph";
-
-/**
- * 提示框 item
- *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
- */
-export class STooltipItem extends STextItem {} // Class STooltipItem

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

@@ -1,104 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { SPainter, SPath, SPoint } from "@persagy-web/draw";
-import { Zone } from "../../types/floor/Zone";
-import { ItemColor } from "../..";
-import { SGraphItem } from "@persagy-web/graph";
-
-/**
- * 建筑轮廓 item
- *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
- */
-export class SBoardItem extends SGraphItem {
-    /** 空间所有数据 */
-    data: Zone;
-    /** 空间轮廓线坐标 list */
-    readonly pointArr: SPoint[][][] = [];
-    /** path 数组 */
-    private pathList: SPath[] = [];
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      建筑轮廓数据
-     */
-    constructor(parent: SGraphItem | null, data: Zone) {
-        super(parent);
-        this.data = data;
-        this.zOrder = 0;
-        if (
-            this.data.OutLine.length &&
-            this.data.OutLine[0] &&
-            this.data.OutLine[0].length
-        ) {
-            let tempArr = this.data.OutLine;
-            this.pointArr = tempArr.map((t): SPoint[][] => {
-                let sPath = new SPath();
-                let tempArr = t.map((it): SPoint[] => {
-                    let array = it.map(
-                        (item): SPoint => {
-                            let x = item.X,
-                                y = -item.Y;
-                            return new SPoint(x, y);
-                        }
-                    );
-                    sPath.polygon(array);
-                    return array;
-                });
-                this.pathList.push(sPath);
-                return tempArr;
-            });
-        }
-    } // Constructor
-
-    /**
-     * 判断点是否在区域内
-     *
-     * @param x     x 坐标
-     * @param y     y 坐标
-     * @return 是否在区域内
-     */
-    contains(x: number, y: number): boolean {
-        return false;
-    } // Function contains()
-
-    /**
-     * Item 绘制操作
-     *
-     * @param painter   painter 对象
-     */
-    onDraw(painter: SPainter): void {
-        painter.pen.lineWidth = painter.toPx(1);
-        painter.brush.color = ItemColor.spaceColor;
-        painter.pen.color = ItemColor.spaceBorderColor;
-        this.pathList.forEach((t): void => {
-            painter.drawPath(t);
-        });
-    } // Function onDraw()
-} // Class SBoardItem

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

@@ -1,67 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { Column } from "../../types/floor/Column";
-import { ItemOrder } from "../..";
-import { SGraphPolyGroupItem, SGraphItem, Point } from "@persagy-web/graph";
-
-/**
- * 柱子 item
- *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
- */
-export class SColumnItem extends SGraphPolyGroupItem {
-    /** 柱子数据 */
-    data: Column;
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      柱子数据
-     */
-    constructor(parent: SGraphItem | null, data: Column) {
-        const style = {
-            default: {
-                stroke: "#000000",
-                fill: "#000000",
-                lineWidth: 0,
-                effect: {}
-            }
-        };
-        let tempArr = data.OutLine;
-        let outline: Point[][] = [];
-        if (tempArr && tempArr.length) {
-            outline = tempArr.map(t => {
-                return t.map(it => ({x: it.X, y: -it.Y}));
-            });
-        }
-
-        super(parent, { outline: outline, style: style });
-        this.data = data;
-        this.zOrder = ItemOrder.columnOrder;
-    } // Constructor
-} // Class SColumnItem

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

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

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

@@ -1,100 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { SColor, SLine, SPainter, SPoint, SRect } from "@persagy-web/draw";
-import { ItemOrder, ItemColor } from "../..";
-import { SGraphItem } from "@persagy-web/graph";
-
-/**
- * 吸附时高亮对象
- *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
- */
-export class SHighlightItem extends SGraphItem {
-    /** 对象与鼠标位置距离 */
-    distance: number = 0;
-    /** 对象类型 */
-    private type: number = 1;
-
-    /** 点对象数据-当吸附的为线时,此点为垂线与线段的交点 */
-    _point: SPoint = new SPoint();
-    get point(): SPoint {
-        return this._point;
-    } // Get point
-    set point(v: SPoint) {
-        this._point = v;
-        this.type = 1;
-        this.update();
-    } // Set point
-
-    /** 点对象数据 */
-    _line: SLine = new SLine();
-    get line(): SLine {
-        return this._line;
-    } // Get line
-    set line(v: SLine) {
-        this._line = v;
-        this.type = 2;
-        this.update();
-    } // Set line
-
-    /**
-     * 构造函数
-     *
-     * @param parent  指向父对象
-     */
-    constructor(parent: SGraphItem | null) {
-        super(parent);
-        this.visible = false;
-        this.zOrder = ItemOrder.highLightOrder;
-    } // Constructor
-
-    /**
-     * Item 对象边界区域
-     *
-     * @return	边界矩形
-     */
-    boundingRect(): SRect {
-        return new SRect(this.point.x, this.point.y, 10, 10);
-    } // Function boundingRect()
-
-    /**
-     * Item绘制操作
-     *
-     * @param painter   绘制对象
-     */
-    onDraw(painter: SPainter): void {
-        if (this.type == 2) {
-            painter.pen.color = ItemColor.highLightLineColor;
-            painter.pen.lineWidth = painter.toPx(6);
-            painter.drawLine(this.line);
-        }
-
-        painter.pen.color = SColor.Transparent;
-        painter.brush.color = ItemColor.highLightPointColor;
-        painter.drawCircle(this.point.x, this.point.y, painter.toPx(5));
-    } // Function onDraw()
-} // Class SHighlightItem

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

@@ -1,183 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 {
-    SColor,
-    SPainter,
-    STextAlign
-} from "@persagy-web/draw";
-import { Space } from "../../types/floor/Space";
-import { ItemOrder, ItemColor } from "../..";
-import { SGraphItem, SGraphAreaGroupItem } from "@persagy-web/graph";
-
-/**
- * 模型空间 item
- *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
- */
-export class SSpaceItem extends SGraphAreaGroupItem {
-    /** 空间所有数据 */
-    data: Space;
-    /** 高亮状态 */
-    private _highLightFlag: boolean = false;
-    get highLightFlag(): boolean {
-        return this._highLightFlag;
-    } // Get highLightFlag
-    set highLightFlag(value: boolean) {
-        this._highLightFlag = value;
-        this.update();
-    } // Set highLightFlag
-
-    /** 是否显示名字 */
-    private _showBaseName: boolean = false;
-    get showBaseName(): boolean {
-        return this._showBaseName;
-    } // Get showBaseName
-    set showBaseName(value: boolean) {
-        this._showBaseName = value;
-        this.update();
-    } // Set showBaseName
-
-    /** 是否名字大小 */
-    private _nameSize: number = 10;
-    get nameSize(): number {
-        return this._nameSize;
-    } // Get nameSize
-    set nameSize(value: number) {
-        this._nameSize = value;
-        this.update();
-    } // Set nameSize
-
-    /** 名字是否缩放 */
-    private _nameTransform: boolean = false;
-    get nameTransform(): boolean {
-        return this._nameTransform;
-    } // Get nameTransform
-    set nameTransform(value: boolean) {
-        this._nameTransform = value;
-        this.update();
-    } // Set nameTransform
-
-    /** 名字颜色 */
-    private _nameColor: string = "#000000";
-    get nameColor(): string {
-        return this._nameColor;
-    } // Get nameColor
-    set nameColor(value: string) {
-        this._nameColor = value;
-        this.update();
-    } // Set nameColor
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      空间数据
-     */
-    constructor(parent: SGraphItem | null, data: Space) {
-        super(parent, {
-            outline: [
-                data.OutLine.map(t => t.map(it => ({ x: it.X, y: -it.Y })))
-            ],
-            style: {
-                default: {
-                    stroke: "#2b2b2b",
-                    fill: "#f1fffd80",
-                    lineWidth: 1,
-                    effect: {}
-                },
-                selected: {
-                    stroke: "#2b2b2b",
-                    fill: "#1abc9c",
-                    lineWidth: 1,
-                    effect: {}
-                },
-                disabled: {
-                    stroke: "#2b2b2b",
-                    fill: "#afafaf",
-                    lineWidth: 1,
-                    effect: {}
-                },
-                highlight: {
-                    stroke: "#2b2b2b",
-                    fill: "#fbb029",
-                    lineWidth: 1,
-                    effect: {}
-                }
-            }
-        });
-
-        this.data = data;
-        this.zOrder = ItemOrder.spaceOrder;
-        this.name = data.Name || "";
-    } // Constructor
-
-    /**
-     * 绘制前设置绘制样式
-     *
-     * @return 当前状态
-     */
-    setStyle(): string {
-        let status = "default";
-        if (this.style) {
-            if (this.highLightFlag) {
-                status = "highlight";
-            } else if (this.enabled) {
-                if (this.selected) {
-                    status = "selected";
-                }
-            } else {
-                status = "disabled";
-            }
-        }
-        return status;
-    } // Function setStyle()
-
-    /**
-     * Item 绘制操作
-     *
-     * @param painter   绘制对象
-     */
-    onDraw(painter: SPainter): void {
-        super.onDraw(painter);
-        if (this.showBaseName) {
-            if (this.name && this.name != "null") {
-                painter.brush.color = new SColor(this.nameColor);
-                if (this.nameTransform) {
-                    painter.font.size = this.nameSize;
-                } else {
-                    painter.font.size = painter.toPx(this.nameSize);
-                }
-                painter.font.textAlign = STextAlign.Center;
-                painter.drawText(
-                    this.name,
-                    this.data.Location.Points[0].X,
-                    -this.data.Location.Points[0].Y
-                );
-            }
-        }
-    } // Function onDraw()
-} // Class SSpaceItem

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

@@ -1,253 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 {
-    SColor,
-    SPainter,
-    SPoint,
-    SPolygonUtil,
-    SRect,
-    STextAlign
-} from "@persagy-web/draw";
-import { Space } from "../../types/floor/Space";
-import { ItemOrder, ItemColor } from "../..";
-import { SGraphItem } from "@persagy-web/graph";
-
-/**
- * 模型空间 item
- *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
- * @deprecated 万达
- */
-export class SSpaceItems extends SGraphItem {
-    /** 空间所有数据  */
-    data: Space;
-    /** 空间轮廓线坐标list  */
-    readonly pointArr: SPoint[][] = [];
-    /** X坐标最小值  */
-    minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值  */
-    maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值  */
-    minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值  */
-    maxY = Number.MIN_SAFE_INTEGER;
-    /** path对象      */
-    // private path = new SPath2D();
-    /** 高亮状态    */
-    private _highLightFlag: boolean = false;
-    get highLightFlag(): boolean {
-        return this._highLightFlag;
-    } // Get highLightFlag
-    set highLightFlag(value: boolean) {
-        this._highLightFlag = value;
-        this.update();
-    } // Set highLightFlag
-    /** 是否显示名字  */
-    private _showBaseName: boolean = false;
-    get showBaseName(): boolean {
-        return this._showBaseName;
-    } // Get showBaseName
-    set showBaseName(value: boolean) {
-        this._showBaseName = value;
-        this.update();
-    } // Set showBaseName
-    /** 是否名字大小  */
-    private _nameSize: number = 10;
-    get nameSize(): number {
-        return this._nameSize;
-    } // Get nameSize
-    set nameSize(value: number) {
-        this._nameSize = value;
-        this.update();
-    } // Set nameSize
-    /** 名字是否缩放  */
-    private _nameTransform: boolean = false;
-    get nameTransform(): boolean {
-        return this._nameTransform;
-    } // Get nameTransform
-    set nameTransform(value: boolean) {
-        this._nameTransform = value;
-        this.update();
-    } // Set nameTransform
-    /** 名字颜色    */
-    private _nameColor: string = "#000000";
-    get nameColor(): string {
-        return this._nameColor;
-    } // Get nameColor
-    set nameColor(value: string) {
-        this._nameColor = value;
-        this.update();
-    } // Set nameColor
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      空间数据
-     */
-    constructor(parent: SGraphItem | null, data: Space) {
-        super(parent);
-        this.data = data;
-        this.zOrder = ItemOrder.spaceOrder;
-        let tempArr = this.data.OutLine;
-        this.name = data.Name || "";
-        if (tempArr && tempArr.length) {
-            this.minX = tempArr[0][0].X;
-            this.maxX = this.minX;
-            this.minY = -tempArr[0][0].Y;
-            this.maxY = this.minY;
-            this.pointArr = tempArr.map((t): SPoint[] => {
-                let temp = t.map(
-                    (it): SPoint => {
-                        let x = it.X,
-                            y = -it.Y;
-                        if (x < this.minX) {
-                            this.minX = x;
-                        }
-                        if (y < this.minY) {
-                            this.minY = y;
-                        }
-                        if (x > this.maxX) {
-                            this.maxX = x;
-                        }
-                        if (y > this.maxY) {
-                            this.maxY = y;
-                        }
-                        return new SPoint(x, y);
-                    }
-                );
-                // this.path.polygon(temp);
-                return temp;
-            });
-        }
-    } // Constructor
-
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    boundingRect(): SRect {
-        return new SRect(
-            this.minX,
-            this.minY,
-            this.maxX - this.minX,
-            this.maxY - this.minY
-        );
-    } // Function boundingRect()
-
-    // /**
-    //  * 鼠标单击事件
-    //  *
-    //  * @param	event         事件参数
-    //  * @return	boolean
-    //  */
-    // onMouseDown(event: SMouseEvent): boolean {
-    //     console.log("spaceDown");
-    //     this.$emit("click", event);
-    //     return true;
-    // } // Function onMouseDown()
-
-    // /**
-    //  * 鼠标移动事件
-    //  *
-    //  * @param event 事件参数
-    //  */
-    // onMouseMove(event: SMouseEvent): boolean {
-    //     return false;
-    // } // Function onMouseMove()
-
-    // /**
-    //  * 鼠标抬起事件
-    //  *
-    //  * @param	event         事件参数
-    //  * @return	boolean
-    //  */
-    // onMouseUp(event: SMouseEvent): boolean {
-    //     console.log("spaceUp");
-    //     return false;
-    // } // Function onClick()
-
-    /**
-     * 判断点是否在区域内
-     *
-     * @param x
-     * @param y
-     */
-    contains(x: number, y: number): boolean {
-        let arr = this.pointArr;
-        if (arr.length < 1 || !SPolygonUtil.pointIn(x, y, arr[0])) {
-            return false;
-        }
-
-        for (let i = 1; i < arr.length; i++) {
-            if (SPolygonUtil.pointIn(x, y, arr[i])) {
-                return false;
-            }
-        }
-        return true;
-    } // Function contains()
-
-    /**
-     * Item绘制操作
-     *
-     * @param painter    绘制对象
-     */
-    onDraw(painter: SPainter): void {
-        painter.pen.color = ItemColor.spaceBorderColor;
-        if (this.selected) {
-            painter.brush.color = ItemColor.selectColor;
-        } else if (this.highLightFlag) {
-            painter.brush.color = ItemColor.spaceHighColor;
-        } else {
-            painter.brush.color = ItemColor.spaceColor;
-        }
-        painter.pen.lineWidth = painter.toPx(1);
-        // painter.drawPath(this.path);
-        if (this.pointArr.length) {
-            painter.drawPolygon(this.pointArr[0]);
-        }
-
-        if (this.showBaseName) {
-            if (this.name && this.name != "null") {
-                painter.brush.color = new SColor(this.nameColor);
-                if (this.nameTransform) {
-                    painter.font.size = this.nameSize;
-                } else {
-                    painter.font.size = painter.toPx(this.nameSize);
-                }
-                // painter.font.size = 500;
-                painter.font.textAlign = STextAlign.Center;
-                painter.drawText(
-                    this.name,
-                    this.data.Location.Points[0].X,
-                    -this.data.Location.Points[0].Y
-                );
-            }
-        }
-    } // Function onDraw()
-} // Class SSpaceItem

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

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

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

@@ -1,70 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { Wall } from "../../types/floor/Wall";
-import { ItemOrder, ItemColor } from "../..";
-import { SGraphItem } from "@persagy-web/graph";
-import { Point, SGraphAreaGroupItem } from "@persagy-web/graph";
-
-/**
- * 墙 item
- *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
- */
-export class SWallItem extends SGraphAreaGroupItem {
-    /** 墙数据 */
-    data: Wall;
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      墙数据
-     */
-    constructor(parent: SGraphItem | null, data: Wall) {
-        const style = {
-            default: {
-                stroke: "#000000",
-                fill: "#000000",
-                lineWidth: 0,
-                effect: {}
-            }
-        };
-        let tempArr = data.OutLine;
-        let outline: Point[][] = [];
-        if (tempArr && tempArr.length) {
-            outline = tempArr.map(t => t.map(it => ({ x: it.X, y: -it.Y })));
-        }
-
-        super(parent, {
-            outline: outline.length ? [outline] : [],
-            style: style
-        });
-
-        this.data = data;
-        this.zOrder = ItemOrder.wallOrder;
-    } // Constructor
-} // Class SWallItem

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

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

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

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

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

@@ -1,203 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { SColor, SPainter, SPoint, SRect } from "@persagy-web/draw";
-import { SMouseEvent } from "@persagy-web/base";
-import { Zone } from "../../types/floor/Zone";
-import { ItemColor, ItemOrder, Transparency } from "../..";
-import { Point, SGraphAreaGroupItem, SGraphItem } from "@persagy-web/graph";
-
-/**
- * 业务空间 item
- *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
- */
-export class SZoneItem extends SGraphAreaGroupItem {
-    /** 空间所有数据 */
-    data: Zone;
-    /** 点击位置坐标 */
-    private clickPoint: SPoint | undefined;
-    /** 高亮状态 */
-    private _highLightFlag: boolean = false;
-    get highLightFlag(): boolean {
-        return this._highLightFlag;
-    } // Get highLightFlag
-    set highLightFlag(value: boolean) {
-        this._highLightFlag = value;
-        this.update();
-    } // Set highLightFlag
-
-    /** 透明度 */
-    _transparency: number = 20;
-    get transparency(): number {
-        return this._transparency;
-    } // Get transparency
-    set transparency(value: number) {
-        this._transparency = value;
-        this.update();
-    } // Set transparency
-
-    /** 受影响状态 */
-    _isInfected: boolean = false;
-    get isInfected(): boolean {
-        return this._isInfected;
-    } // Get isInfected
-    set isInfected(value: boolean) {
-        this._isInfected = value;
-        this.update();
-    } // Set isInfected
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      空间数据
-     */
-    constructor(parent: SGraphItem | null, data: Zone) {
-        super(parent, {
-            outline: data.OutLine.map((t): Point[][] => {
-                return t.map((it): Point[] => {
-                    return it.map(
-                        (item): Point => {
-                            return { x: item.X, y: -item.Y };
-                        }
-                    );
-                });
-            }),
-            style: {
-                default: {
-                    stroke: "#00000000",
-                    fill: "#ffee2280",
-                    lineWidth: 1,
-                    effect: {}
-                },
-                selected: {
-                    stroke: "#00000000",
-                    fill: "#1abc9c",
-                    lineWidth: 1,
-                    effect: {}
-                },
-                highlight: {
-                    stroke: "#00000000",
-                    fill: data.Color || "#fbb029",
-                    lineWidth: 1,
-                    effect: {}
-                },
-                unselect: {
-                    stroke: "#00000000",
-                    fill: "#cecece",
-                    lineWidth: 1,
-                    effect: {}
-                },
-                infected: {
-                    stroke: "#00000000",
-                    fill: "#ff0000",
-                    lineWidth: 1,
-                    effect: {}
-                }
-            }
-        });
-
-        this.data = data;
-        this.zOrder = ItemOrder.zoneOrder;
-        this.highLightFlag = data.HighLightFlag || false;
-        this.transparency = data.Transparency || 20;
-        this.isInfected = data.Infected || false;
-    } // Constructor
-
-    /**
-     * 鼠标单击事件
-     *
-     * @param event     事件参数
-     * @return 是否处理事件
-     */
-    onMouseDown(event: SMouseEvent): boolean {
-        if (this.selectable) {
-            this.selected = !this.selected;
-            this.clickPoint = new SPoint(event.x, event.y);
-        }
-        this.$emit("click", event);
-        return true;
-    } // Function onMouseDown()
-
-    /**
-     * 鼠标抬起事件
-     *
-     * @param event     事件参数
-     * @return 是否处理事件
-     */
-    onMouseUp(event: SMouseEvent): boolean {
-        return false;
-    } // Function onMouseUp()
-
-    /**
-     * 绘制前设置绘制样式
-     *
-     * @return 当前状态
-     */
-    setStyle(): string {
-        let status = "default";
-        if (this.style) {
-            if (!this.selectable) {
-                status = "unselect";
-            } else {
-                if (this.selected) {
-                    status = "selected";
-                } else if (this.highLightFlag) {
-                    status = "highlight";
-                } else if (this.isInfected) {
-                    status = "infected";
-                } else {
-                    status = "default";
-                    if (this.data.Color) {
-                        this.style.default.fill = `${this.data.Color}${
-                            Transparency[this.transparency]
-                        }`;
-                    }
-                }
-            }
-        }
-        return status;
-    } // Function setStyle()
-
-    /**
-     * Item 绘制操作
-     *
-     * @param painter   绘制对象
-     */
-    onDraw(painter: SPainter): void {
-        super.onDraw(painter);
-        painter.brush.color = SColor.Black;
-        painter.font.size = painter.toPx(10);
-        if (this.clickPoint) {
-            painter.drawText(
-                this.data.RoomLocalName,
-                this.clickPoint.x,
-                this.clickPoint.y
-            );
-        }
-    } // Function onDraw()
-} // Class ZoneItem

+ 0 - 163
persagy-web-big/src/parser/SFloorParser.ts

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

+ 0 - 85
persagy-web-big/src/parser/STopologyParser.ts

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

+ 0 - 60
persagy-web-big/src/parser/SZoneParser.ts

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

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

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

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

@@ -17,23 +17,23 @@
  *          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.  博锐尚格科技股份有限公司
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
  *        ~8888'
  *        .!88~                                                                     All rights reserved.
  *
  * *********************************************************************************************************************
  */
 
-import { Point } from "@persagy-web/graph/lib";
+import { Point } from "@persagy-web/big/lib/types/Point";
 
 /**
- * 锚点
+ * 锚点item接口
  *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
+ * @author  张宇
  */
 export interface Anchor {
-    /** ID */
-    id: string;
-    /** 位置 */
-    pos: Point;
-} // interface Anchor
+    /** 锚点ID */
+    ID: string;
+    /** 锚点的坐标  */
+    Pos: Point;
+} // Interface Anchor

+ 0 - 38
persagy-web-big/src/types/BigPoint.ts

@@ -1,38 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.
- *
- * *********************************************************************************************************************
- */
-/**
- * 轮廓坐标接口
- *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
- */
-export interface BigPoint {
-    /** x 坐标 */
-    X: number;
-    /** y 坐标 */
-    Y: number;
-    /** z 坐标 */
-    Z?: number;
-} // Interface BigPoint

+ 11 - 11
persagy-web-big/src/enums/SRelationDir.ts

@@ -17,24 +17,24 @@
  *          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.  博锐尚格科技股份有限公司
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
  *        ~8888'
  *        .!88~                                                                     All rights reserved.
  *
  * *********************************************************************************************************************
  */
 
+import { Legend } from "./Legend";
+import { Marker } from "./Marker";
+import { Relation } from "./Relation";
+
 /**
- * 关系方向
+ * 系统图数据接口
  *
  * @author  张宇
- * @deprecated 万达
  */
-export enum SRelationDir {
-    /** 无向 */
-    Undirected,
-    /** 正向(节点1到节点2) */
-    Forward,
-    /** 逆向(节点2到节点1) */
-    Reverse
-} // Enum SRelationDir
+export interface ElementData {
+    nodes: Legend[];
+    markers: Marker[];
+    relations: Relation[];
+} // Interface ElementData

+ 0 - 52
persagy-web-big/src/types/FloorData.ts

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

+ 0 - 47
persagy-web-big/src/types/ImageData.ts

@@ -1,47 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.
- *
- * *********************************************************************************************************************
- */
-
-/**
- * 图片 item 数据接口
- *
- * @author 郝建龙  <haojianlong@sagacloud.cn>
- */
-export interface ImageData {
-    /** 图片的 id */
-    id?: string;
-    /** 图片的名称 */
-    name?: string;
-    /** X 坐标 */
-    x: number;
-    /** Y 坐标 */
-    y: number;
-    /** 图片 url */
-    url: string;
-    /** 绘制图片的宽 */
-    width: number;
-    /** 绘制图片的高 */
-    height: number;
-} // Interface ImageData

+ 39 - 13
persagy-web-big/src/enums/SGraphElementType.ts

@@ -17,26 +17,52 @@
  *          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.  博锐尚格科技股份有限公司
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
  *        ~8888'
  *        .!88~                                                                     All rights reserved.
  *
  * *********************************************************************************************************************
  */
 
+import { Anchor } from "./Anchor";
+import { Point } from "@persagy-web/big/lib/types/Point";
+import { Size } from "@persagy-web/big/lib/types/Size";
+import { SPoint } from '@persagy-web/draw/lib';
+
 /**
- * 图标,区域类型
+ * 图例节点接口
  *
  * @author  张宇
- * @deprecated 万达
  */
-export enum SGraphElementType {
-    /** 非图例 */
-    None,
-    /** 线类型 */
-    Line,
-    /** 区域类型 */
-    Zone,
-    /** 图类型 */
-    Image
-} // Enum SGraphElementType
+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

+ 24 - 11
persagy-web-big/src/types/Marker.ts

@@ -17,25 +17,38 @@
  *          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.  博锐尚格科技股份有限公司
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
  *        ~8888'
  *        .!88~                                                                     All rights reserved.
  *
  * *********************************************************************************************************************
  */
 
+import { Point } from "@persagy-web/graph/lib/types/Point";
+import { Size } from "@persagy-web/big/lib/types/Size";
+
 /**
- * 标记 item 接口
+ * 标识对象接口
  *
- * @author 郝建龙  <haojianlong@sagacloud.cn>
+ * @author  张宇
  */
 export interface Marker {
-    /** 标记的 id */
-    id?: string;
-    /** 标记的名称 */
-    name?: string;
-    /** X 坐标 */
-    x: number;
-    /** Y 坐标 */
-    y: number;
+    /** ID */
+    iD?: string;
+    /** 名称  */
+    name: string;
+    /** 图标(Image),线类型(Line) */
+    type: string;
+    /** 位置  */
+    pos: Point;
+    /** 缩放  */
+    scale?: Point;
+    /** 旋转  */
+    rolate?: Point;
+    /** 大小  */
+    size?: Size;
+    /** 绘制时得数据以及样式 */
+    style: any;
+    /** 由应用自己定义  */
+    properties?: any;
 } // Interface Marker

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

@@ -1,39 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { Point } from "@persagy-web/graph";
-
-/**
- * 距离最短点接口
- *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
- */
-export interface MinDis {
-    /** 最短距离 */
-    MinDis: number;
-    /** 最短距离的点 */
-    Point: Point | undefined;
-} // Interface Space

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

@@ -1,39 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { SPoint } from "@persagy-web/draw";
-
-/**
- * 轮廓线接口
- *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
- */
-export interface Outline {
-    /** 外轮廓 */
-    Outer: SPoint[];
-    /** 内轮廓 */
-    Inner: SPoint[][];
-} // Interface Outline

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

@@ -1,39 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { BigPoint } from "./BigPoint";
-
-/**
- * 位置接口
- *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
- */
-export interface Place {
-    /** 定位 */
-    Points: BigPoint[];
-    /** 类型 */
-    Type: string;
-} // Interface Place

+ 0 - 41
persagy-web-big/src/types/PointToLine.ts

@@ -1,41 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { SLine, SPoint } from "@persagy-web/draw";
-
-/**
- * 距离最短线接口
- *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
- */
-export interface PointToLine {
-    /** 最短距离 */
-    MinDis: number;
-    /** 最短距离的线 */
-    Line: SLine | undefined;
-    /** 最短距离的点 */
-    Point: SPoint | undefined;
-} // Interface Space

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

@@ -17,39 +17,42 @@
  *          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.  博锐尚格科技股份有限公司
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
  *        ~8888'
  *        .!88~                                                                     All rights reserved.
  *
  * *********************************************************************************************************************
  */
 
-import { Place } from "../Place";
-import { Point } from "@persagy-web/graph";
-import { BigPoint } from "../BigPoint";
+import { SRelationDir } from "@persagy-web/big/lib/enums/SRelationDir";
+import { Point } from "@persagy-web/big/lib/types/Point";
 
 /**
- * 窗户 item 接口
+ * 管线对象关系接口
  *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
+ * @author  张宇
  */
-export interface Casement {
-    /** 位置 */
-    Location: Place;
-    /** 模型 id (外键) */
-    ModelId: string;
+export interface Relation {
+    /** ID */
+    ID: string;
     /** 名称 */
     Name: string;
-    /** 轮廓线 */
-    OutLine: BigPoint[][];
-    /** 拥有者的 RevitId */
-    Owner: string;
-    /** 对应 Revit 模型 id */
-    SourceId: string;
-    /** 厚度 */
-    Thick: number;
-    /** 所属墙 */
-    WallId: string;
-    /** 宽度 */
-    Width: string;
-} // interface Casement
+    /** 对应的图例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

+ 0 - 37
persagy-web-big/src/types/Size.ts

@@ -1,37 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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.
- *
- * *********************************************************************************************************************
- */
-
-/**
- * 大小接口
- *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
- */
-export interface Size {
-    /** 宽 */
-    width: number;
-    /** 高 */
-    height: number;
-} // Interface Size

+ 0 - 53
persagy-web-big/src/types/TextData.ts

@@ -1,53 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { STextAlign, STextBaseLine, STextDirection } from "@persagy-web/draw";
-
-/**
- * 文本 item 数据接口
- *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
- */
-export interface TextData {
-    /** 文本的 id */
-    id?: string;
-    /** 文本内容 */
-    text: string;
-    /** X 坐标 */
-    x: number;
-    /** Y 坐标 */
-    y: number;
-    /** 文本最大宽 */
-    width?: number;
-    /** 文本对齐方向 */
-    textAlign?: STextAlign;
-    /** 文本基线对齐 */
-    baseLine?: STextBaseLine;
-    /** 文本方向 */
-    textDirection?: STextDirection;
-    /** 文本大小 */
-    size?: number;
-} // Interface TextData

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

@@ -1,43 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { Node } from "./topology/Node";
-import { MarkerTopo } from "./topology/MarkerTopo";
-import { Relation } from "./topology/Relation";
-
-/**
- * 对象关系
- *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
- */
-export interface TopologyData {
-    /** 图例节点 */
-    Nodes: Node[];
-    /** 标识对象 */
-    Marks: MarkerTopo[];
-    /** 对象关系 */
-    Relations: Relation[];
-} // interface TopologyData

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

@@ -1,49 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { Point } from "@persagy-web/graph";
-import { Place } from "../Place";
-import { BigPoint } from "../BigPoint";
-
-/**
- * 柱子 item 接口
- *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
- */
-export interface Column {
-    /** 名称 */
-    Name?: string;
-    /** 轮廓线 */
-    OutLine: BigPoint[][];
-    /** 房间边界 */
-    RoomBoundary?: boolean;
-    /** 位置 */
-    Location?: Place;
-    /** 模型 id (外键) */
-    ModelId?: string;
-    /** 对应 Revit 模型 id */
-    SourceId?: string;
-} // Interface Column

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

@@ -1,59 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { Point } from "@persagy-web/graph";
-import { Place } from "../Place";
-import { BigPoint } from "../BigPoint";
-
-/**
- * 门 item 接口
- *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
- */
-export interface Door {
-    /** 面朝方向 */
-    FaceDirection: BigPoint;
-    /** 把手方向 */
-    HandDirection: BigPoint;
-    /** 位置 */
-    Location: Place;
-    /** 模型 id (外键) */
-    ModelId: string;
-    /** 名称 */
-    Name: string;
-    /** 轮廓线 */
-    OutLine: BigPoint[][];
-    /** 拥有者的 RevitId */
-    Owner: string;
-    /** 对应 Revit 模型 id */
-    SourceId: string;
-    /** 厚度 */
-    Thick: number;
-    /** 所属墙 */
-    WallId: string;
-    /** 宽度 */
-    Width: string;
-} // Interface Door

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

@@ -1,55 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { Point } from "@persagy-web/graph";
-import { Place } from "../Place";
-import { BigPoint } from "../BigPoint";
-
-/**
- * 空间 item 接口
- *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
- */
-export interface Space {
-    /** 轮廓线段 */
-    BoundarySegments?: string[];
-    /** 位置 */
-    Location: Place;
-    /** 高度 */
-    Height?: number;
-    /** 模型 id (外键) */
-    ModelId?: string;
-    /** 名称 */
-    Name?: string;
-    /** 轮廓线 */
-    OutLine: BigPoint[][];
-    /** 对应 Revit 模型 id */
-    SourceId?: string;
-    /** 补充信息 */
-    Tag?: string;
-    /** 类型 */
-    TypeId?: string;
-} // Interface Space

+ 0 - 46
persagy-web-big/src/types/floor/VirtualWall.ts

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

+ 0 - 52
persagy-web-big/src/types/floor/Wall.ts

@@ -1,52 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { Place } from "../Place";
-import { BigPoint } from "../BigPoint";
-
-/**
- * 墙 item 接口
- *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
- */
-export interface Wall {
-    /** 层 id */
-    LevelId?: string;
-    /** 位置 */
-    Location?: Place;
-    /** 模型 id (外键) */
-    ModelId?: string;
-    /** 名称 */
-    Name?: string;
-    /** 轮廓线 */
-    OutLine: BigPoint[][];
-    /** 轮廓线 */
-    Holes?: BigPoint[][];
-    /** 对应 Revit 模型 id */
-    SourceId?: string;
-    /** 厚度 */
-    Width?: number;
-} // Interface Wall

+ 0 - 51
persagy-web-big/src/types/floor/Zone.ts

@@ -1,51 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { BigPoint } from "../BigPoint";
-
-/**
- * 业务空间 item 接口
- *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
- */
-export interface Zone {
-    /** 名称 */
-    RoomLocalName: string;
-    /** 轮廓线 */
-    OutLine: BigPoint[][][];
-    /** 业务空间 id */
-    RoomID: string;
-    /** 颜色 */
-    Color: string;
-    /** 高度 */
-    Height?: number;
-    /** 是否高亮 */
-    HighLightFlag?: boolean;
-    /** 透明度 */
-    Transparency?: number;
-    /** 是否受影响 */
-    Infected?: boolean;
-} // Interface Zone

+ 19 - 0
persagy-web-big/src/until.ts

@@ -0,0 +1,19 @@
+//  生成uuid
+export function uuid() {
+    const s = [];
+    const hexDigits = "0123456789abcdef";
+    for (let i = 0; i < 36; i++) {
+        s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
+    }
+    s[14] = "4";
+    s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);
+    s[8] = s[13] = s[18] = s[23] = "-";
+
+    const uuid = s.join("");
+    return `${uuid}-${new Date().getTime()}`;
+}
+
+export function rgbaNum(rgba: string) {
+    let val = rgba.match(/(\d(\.\d+)?)+/g);
+    return val;
+}

+ 0 - 352
persagy-web-big/src/utils/SMathUtil.ts

@@ -1,352 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { SLine, SPoint, SRect } from "@persagy-web/draw";
-import { MinDis } from "../types/MinDis";
-import { Point } from "@persagy-web/graph";
-import { PointToLine } from "../types/PointToLine";
-import { Outline } from "../types/Outline";
-// @ts-ignore
-import { intersect } from "polybooljs";
-
-/**
- * 数学工具类
- *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
- */
-export class SMathUtil {
-    /**
-     * 计算点到点距离
-     *
-     * @param x1    点 1 的 x 坐标
-     * @param y1    点 1 的 y 坐标
-     * @param x2    点 2 的 x 坐标
-     * @param y2    点 2 的 y 坐标
-     * @return 距离
-     */
-    static pointDistance(
-        x1: number,
-        y1: number,
-        x2: number,
-        y2: number
-    ): number {
-        return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
-    } // Function pointDistance()
-
-    /**
-     * 计算点到点集中点最小距离,返回该点和该距离
-     *
-     * @param p     第一个点
-     * @param arr   点集
-     * @return 距离,点坐标
-     */
-    static getMinDisPoint(p: SPoint, arr: Point[]): MinDis | null {
-        if (!arr.length) {
-            return null;
-        }
-
-        let minDis = {
-            // @ts-ignore
-            MinDis: SMathUtil.pointDistance(
-                p.x,
-                p.y,
-                // @ts-ignore
-                arr[0].X || arr[0].x,
-                // @ts-ignore
-                -arr[0].Y || -arr[0].y
-            ),
-            Point: arr[0]
-        };
-        for (let i = 1; i < arr.length; i++) {
-            let ds = SMathUtil.pointDistance(
-                p.x,
-                p.y,
-                // @ts-ignore
-                arr[i].X || arr[i].x,
-                // @ts-ignore
-                -arr[i].Y || -arr[i].y
-            );
-            if (ds < minDis.MinDis) {
-                minDis.MinDis = ds;
-                minDis.Point = arr[i];
-            }
-        }
-        return minDis;
-    } // Function getMinDisPoint()
-
-    /**
-     * 计算点到线段垂线与线段的交点
-     *
-     * @param p     点
-     * @param l     线段
-     * @return 距离
-     */
-    static pointToLine(p: SPoint, l: SLine): PointToLine {
-        let d = {
-            MinDis: Number.MAX_SAFE_INTEGER,
-            Line: new SLine(),
-            Point: new SPoint()
-        };
-        let bgX = Math.max(l.x1, l.x2);
-        let smX = Math.min(l.x1, l.x2);
-        if (l.dx == 0) {
-            // l.dx为0 说明线段是垂直于x轴的
-            let bgY = Math.max(l.y1, l.y2);
-            let smY = Math.min(l.y1, l.y2);
-            if (p.y > smY && p.y < bgY) {
-                d.MinDis = Math.abs(p.x - l.x1);
-                d.Line = l;
-                d.Point = new SPoint(l.x1, p.y);
-            }
-        } else if (l.dy == 0) {
-            // l.dy为0 说明线段是平行于x轴的
-            if (p.x > smX && p.x < bgX) {
-                d.MinDis = Math.abs(p.y - l.y1);
-                d.Line = l;
-                d.Point = new SPoint(p.x, l.y1);
-            }
-        } else {
-            // 直线1
-            let k1 = (l.y1 - l.y2) / (l.x1 - l.x2);
-            let b1 = l.y1 - k1 * l.x1;
-            // 直线2
-            let k2 = -1 / k1;
-            let b2 = p.y - k2 * p.x;
-            // 交点
-            let x = (b1 - b2) / (k2 - k1);
-            let y = k1 * x + b1;
-            if (x > smX && x < bgX) {
-                d.MinDis = SMathUtil.pointDistance(p.x, p.y, x, y);
-                d.Line = l;
-                d.Point = new SPoint(x, y);
-            }
-        }
-
-        return d;
-    } // Function pointDistance()
-
-    /**
-     * 计算点到点集中线段最小距离,返回该点和该距离
-     *
-     * @param p     第一个点
-     * @param arr   点集
-     * @return 距离,点坐标
-     */
-    static getMinDisLine(p: SPoint, arr: Point[]): PointToLine | null {
-        if (arr.length < 2) {
-            return null;
-        }
-
-        let PTL = SMathUtil.pointToLine(
-            p,
-            new SLine(
-                // @ts-ignore
-                arr[arr.length - 1].X || arr[arr.length - 1].x,
-                // @ts-ignore
-                -arr[arr.length - 1].Y || -arr[arr.length - 1].y,
-                // @ts-ignore
-                arr[0].X || arr[0].x,
-                // @ts-ignore
-                -arr[0].Y || -arr[0].y
-            )
-        );
-        for (let i = 0; i < arr.length - 1; i++) {
-            let temp = SMathUtil.pointToLine(
-                p,
-                new SLine(
-                    // @ts-ignore
-                    arr[i].X || arr[i].x,
-                    // @ts-ignore
-                    -arr[i].Y || -arr[i].y,
-                    // @ts-ignore
-                    arr[i + 1].X || arr[i + 1].x,
-                    // @ts-ignore
-                    -arr[i + 1].Y || -arr[i + 1].y
-                )
-            );
-            if (temp.MinDis < PTL.MinDis) {
-                PTL = temp;
-            }
-        }
-        return PTL;
-    } // Function getMinDisPoint()
-
-    /**
-     * 计算矩形是否有交集(外包矩形算法)
-     *
-     * @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;
-        let maxX = rect1.right > rect2.right ? rect1.right : rect2.right;
-        let maxY = rect1.bottom > rect2.bottom ? rect2.bottom : rect2.bottom;
-        return (
-            rect1.width + rect2.width > maxX - minX &&
-            rect1.height + rect2.height > maxY - minY
-        );
-    } // Function rectIntersection()
-
-    /**
-     * 计算线段交点
-     *
-     * @param line1     线段1
-     * @param line2     线段2
-     * @return 交点 null 平行但不重合 'repeat' 重合
-     */
-    static lineIntersection(
-        line1: SLine,
-        line2: SLine
-    ): SPoint | null | string {
-        let k1 = line1.dy / line1.dx;
-        let b1 = line1.y1 - k1 * line1.x1;
-        let k2 = line2.dy / line2.dx;
-        let b2 = line2.y1 - k2 * line2.x1;
-        if (k1 == k2) {
-            if (b1 == b2) {
-                return "repeat";
-            }
-
-            return null;
-        }
-
-        let intersectionX = (b2 - b1) / (k1 - k2);
-        let intersectionY = k1 * intersectionX + b1;
-        let minX = Math.min(line1.x1, line1.x2);
-        let maxX = Math.min(line2.x1, line2.x2);
-        if (intersectionX >= minX && intersectionX <= maxX) {
-            return new SPoint(intersectionX, intersectionY);
-        }
-
-        return null;
-    } // Function lineIntersection()
-
-    /**
-     * 转化数据格式为[][]
-     *
-     * @param SP    点数组
-     * @return 点二维数组
-     */
-    static transferToArray(SP: SPoint[]): number[][] {
-        return SP.map((t): number[] =>([t.x, t.y]));
-    } // Function transferToArray()
-
-    /**
-     * 转化数据格式为 SPoint[]
-     *
-     * @param arr 点二维数组
-     * @return 点数组
-     */
-    static transferToSPoint(arr: number[][]): SPoint[] {
-        return arr.map((t): SPoint => new SPoint(t[0], t[1]));
-    } // Function transferToSPoint()
-
-    /**
-     * 计算数组中每一项的交集,并返回外轮廓与内轮廓
-     *
-     * @param array     三维数组描述轮廓
-     * @return outline 列表
-     */
-    static getIntersectInArray(array: number[][][]): Outline[] {
-        let outlineList: Outline[] = [];
-        if (!array.length) {
-            // 无数据不做处理
-        } else if (array.length == 1) {
-            // 只有一条则为外轮廓
-            let outline: Outline = {
-                Outer: [],
-                Inner: []
-            };
-            outline.Outer = array[0].map(
-                (t): SPoint => {
-                    return new SPoint(t[0], t[1]);
-                }
-            );
-            outlineList.push(outline);
-        } else {
-            // 多条的时候,最后一条未外轮廓,倒序遍历与之相交的为内轮廓,不相交为另外的外轮廓
-            let poly2 = {
-                regions: [],
-                inverted: false
-            };
-            // @ts-ignore
-            poly2.regions.push(array[array.length - 1]);
-            let indexArr: number[] = [array.length - 1];
-            for (let i = array.length - 2; i > 0; i--) {
-                let poly1 = {
-                    regions: [],
-                    inverted: false
-                };
-                // @ts-ignore
-                poly1.regions.push(array[i]);
-                let intersectObj = intersect(poly1, poly2);
-                if (!intersectObj.regions.length) {
-                    indexArr.unshift(i);
-                    poly2.regions = [];
-                    // @ts-ignore
-                    poly2.regions.push(array[i]);
-                }
-            }
-            indexArr.unshift(0);
-            for (let i = 0; i < indexArr.length - 1; i++) {
-                let axArr = array.slice(
-                    i == 0 ? 0 : indexArr[i] + 1,
-                    indexArr[i + 1]
-                );
-                let outline: Outline = {
-                    Outer: [],
-                    Inner: []
-                };
-                outline.Outer = array[indexArr[i + 1]].map(
-                    (t): SPoint =>  new SPoint(t[0], t[1]));
-                outline.Inner = axArr.map((t): SPoint[] =>
-                    t.map((item): SPoint =>  new SPoint(item[0], item[1]))
-                );
-                outlineList.push(outline);
-            }
-        }
-        return outlineList;
-    } // Function getIntersectInArray()
-
-    /**
-     * 计算轮廓线面积
-     *
-     * @param arr   轮廓线
-     * @return 面积(毫米)
-     */
-    static calculateArea(arr: SPoint[]): number {
-        let sum = 0;
-        let n = arr.length;
-        arr[n] = arr[0];
-        for (let i = 1; i <= n; i++) {
-            sum += arr[i].x * arr[i - 1].y - arr[i - 1].x * arr[i].y;
-        }
-
-        return sum / 2;
-    } // Function calculateArea()
-} // Class SMathUtil

+ 18 - 4
persagy-web-edit/src/SGraphEdit.ts

@@ -26,6 +26,7 @@
 
 import { SGraphItem } from "@persagy-web/graph/";
 import { SItemStatus } from "@persagy-web/big";
+import { SMouseEvent } from "@persagy-web/base/";
 
 /**
  * 编辑基类
@@ -45,12 +46,25 @@ export class SGraphEdit extends SGraphItem {
         const newStatus = value;
         this._status = value;
         //状态变更触发事件
-        this.$emit('StatusChange', oldStatus, newStatus)
+        this.$emit('statusChange', oldStatus, newStatus)
         this.update();
     }
 
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //函数
+    /*
+     * 构造函数
+     *
+     * @param   parent      指向父对象
+     */
+    constructor(parent: SGraphItem | null) {
+        super();
+        if (parent) {
+            this.parent = parent;
+        }
+        this.selectable = true
+    }
+
     /**
      * 将类中得数据转换为方便存储格式的方法
      *
@@ -59,8 +73,8 @@ export class SGraphEdit extends SGraphItem {
     toData(): any {
 
     }
-
-    constructor(parent: SGraphItem | null, ) {
-        super(parent)
+    onContextMenu(event: SMouseEvent): boolean {
+        this.$emit('onContextMenu', event)
+        return true
     }
 }

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

@@ -0,0 +1,467 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .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 './'
+
+/**
+ * Graphy图形引擎编辑场景类
+ *
+ * @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
+    }
+    set editCmd(val: string) {
+        this._editCmd = val;
+    }
+    /**是否可编辑 */
+    _isEditStatus: Boolean = true; // 是否可编辑
+    set isEditStatus(bol: Boolean) {
+        this._isEditStatus = bol;
+    }
+    get isEditStatus(): Boolean {
+        return this._isEditStatus
+    }
+    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    //函数
+    constructor() {
+        super()
+        // // 选择绑定选额item事件
+        this.selectContainer.connect("selectChange", this, this.selectChange);
+    }
+
+    /**
+     * 选中item触发方法
+     *
+     * @param obj 变化后的对象
+     */
+    selectChange(obj: any) { }
+
+    /**
+    * 新增基础类直线
+    *
+    * @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();
+        }
+    }
+
+    /**
+     * 新增折线
+     *
+     * @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();
+        }
+    }
+
+    /**
+   * 新增基础类图片
+   *
+   * @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);
+    }
+
+    /**
+     * 新增基础类文本
+     *
+     * @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);
+    }
+    /**
+     * 添加基本矩形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();
+        }
+    }
+
+    /**
+     * 添加基本三角形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();
+        }
+    }
+
+    /**
+     * 添加基本圆
+     *
+     * @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();
+        }
+    }
+
+    /**
+    * 添加基本多边形
+    *
+    * @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();
+        }
+    }
+
+    /**
+     * 添加基本箭头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();
+        }
+    }
+
+    /**
+     * 对齐指定item
+     * @param v
+     */
+    changeAlignItem(v: any): void {
+        this.selectContainer.layout(v);
+    }
+
+    /**
+     * 保存数据
+     *
+     * @return any 返回需要保存的数据
+     */
+    saveMsgItem(): any {
+    }
+
+    /**
+     * 重做
+     *
+     * @return any
+     */
+    redo(): void {
+    }
+
+    /**
+     * 撤销
+     *
+     * @return any
+     */
+    undo(): void {
+    }
+
+    /**
+     * 完成创建的回调函数
+     *
+     * @param item 完成创建的item
+     */
+    finishCreated(item: SGraphItem) {
+    }
+
+    /**
+    * 复制
+    *
+    */
+    copy() { }
+
+    /**
+     * 粘贴
+     *
+     */
+    paste() { }
+
+    /**
+     *  选中状态方法
+     *
+     *  @param  item SGraphItem
+     */
+    toggleItem(item: SGraphItem): void {
+        this.selectContainer.clear()
+        this.selectContainer.toggleItem(item)
+    }
+
+    /**
+     * 框选
+     */
+    addRectSelect(event: SMouseEvent) {
+        let point = new SPoint(event.x, event.y);
+        let rect = new SRectSelectItem(null, point);
+        this.addItem(rect);
+        this.grabItem = rect;
+    }
+
+    /**
+    * 获取item (常用与场景外的调用F)
+    * @param  event SMouseEvent 鼠标事件
+    * @param  item SGraphEdit|null 返回item
+    *
+    */
+    getItem(item: SGraphEdit | null, event: SMouseEvent[]) {
+    }
+
+}// Class GraphEditScene

+ 8 - 8
persagy-web-edit/src/commands/SGraphAddCommand.ts

@@ -33,7 +33,7 @@ import { SUndoCommand } from "@persagy-web/base";
  * 添加item命令
  *
  * @author  panglixiang
- */
+ * */
 export class SGraphAddCommand extends SGraphCommand {
     /** 命令名称    */
     readonly command: string;
@@ -45,9 +45,9 @@ export class SGraphAddCommand extends SGraphCommand {
     /**
      * 构造函数
      *
-     * @param scene   item所在场景
-     * @param item    命令item对象
-     */
+     * @param   scene   item所在场景
+     * @param   item    命令item对象
+     * */
     constructor(scene: SGraphScene, item: SGraphItem) {
         super(scene);
         this.item = item;
@@ -59,8 +59,8 @@ export class SGraphAddCommand extends SGraphCommand {
     /**
      * 合并命令
      *
-     * @return boolean 是否已执行合并
-     */
+     * @return  boolean 是否已执行合并
+     * */
     mergeWith(command: SUndoCommand): boolean {
         return false;
     } // Function mergeWith()
@@ -68,7 +68,7 @@ export class SGraphAddCommand extends SGraphCommand {
     /**
      * 重做
      *
-     */
+     * */
     redo(): void {
         this.item.parent = this.parent;
         // @ts-ignore
@@ -78,7 +78,7 @@ export class SGraphAddCommand extends SGraphCommand {
     /**
      * 撤销
      *
-     */
+     * */
     undo(): void {
         this.item.parent = null;
         // @ts-ignore

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

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

+ 12 - 12
persagy-web-edit/src/commands/SGraphMoveCommand.ts

@@ -35,7 +35,7 @@ import { SGraphScene } from "@persagy-web/graph/";
  *
  * @author  panglixiang
  *
- */
+ * */
 export class SGraphMoveCommand extends SGraphCommand {
     /** 命令名称    */
     readonly command: string;
@@ -49,11 +49,11 @@ export class SGraphMoveCommand extends SGraphCommand {
     /**
      * 构造函数
      *
-     * @param scene   当前场景
-     * @param item    item对象
-     * @param old     移动前位置
-     * @param pos     移动后位置
-     */
+     * @param   scene   当前场景
+     * @param   item    item对象
+     * @param   old     移动前位置
+     * @param   pos     移动后位置
+     * */
     constructor(
         scene: SGraphScene,
         item: SGraphItem,
@@ -71,9 +71,9 @@ export class SGraphMoveCommand extends SGraphCommand {
     /**
      * 合并命令
      *
-     * @param command 命令
-     * @return boolean 是否已执行合并命令
-     */
+     * @param   command 命令
+     * @return  boolean 是否已执行合并命令
+     * */
     mergeWith(command: SUndoCommand): boolean {
         if (command instanceof SGraphMoveCommand && command.item == this.item) {
             command.pos = this.pos;
@@ -85,7 +85,7 @@ export class SGraphMoveCommand extends SGraphCommand {
     /**
      * 重做
      *
-     */
+     * */
     redo(): void {
         this.item.pos = new SPoint(this.pos.x, this.pos.y);
         this.item.update();
@@ -94,7 +94,7 @@ export class SGraphMoveCommand extends SGraphCommand {
     /**
      * 撤销
      *
-     */
+     * */
     undo(): void {
         this.item.pos = new SPoint(this.old.x, this.old.y);
         this.item.update();
@@ -103,7 +103,7 @@ export class SGraphMoveCommand extends SGraphCommand {
     /**
      * 命令细节描述
      *
-     */
+     * */
     toString(): string {
         return `oldPos=${JSON.stringify(this.old)};\nnewPos=${JSON.stringify(
             this.pos

+ 7 - 8
persagy-web-edit/src/commands/SGraphPointListDelete.ts

@@ -30,9 +30,8 @@ import { SGraphCommand, SGraphItem, SGraphScene } from "@persagy-web/graph/";
 /**
  * 多边形、折线等相关顶点的位置删除命令
  *
- * @author  韩耀龙
+ * @author  韩耀龙(han_yao_long@163.com)
  */
-
 export class SGraphPointListDelete extends SGraphCommand {
     /** 命令名称    */
     readonly command: string;
@@ -47,11 +46,11 @@ export class SGraphPointListDelete extends SGraphCommand {
 
     /**
      * 构造函数
-     * @param scene       item所在场景
-     * @param item        指向item对象
-     * @param pointList   顶点数组
-     * @param pos         删除的点
-     * @param index       索引
+     * @param   scene       item所在场景
+     * @param   item        指向item对象
+     * @param   pointList   顶点数组
+     * @param   pos         删除的点
+     * @param   index       索引
      */
     constructor(
         scene: SGraphScene,
@@ -97,7 +96,7 @@ export class SGraphPointListDelete extends SGraphCommand {
     /**
      * 命令细节描述
      *
-     */
+     * */
     toString(): string {
         const pointList = `pointList=${JSON.stringify(this.pointList)}`;
         const pos = `pos=${JSON.stringify(this.pos)}`;

+ 6 - 7
persagy-web-edit/src/commands/SGraphPointListInsert.ts

@@ -32,7 +32,6 @@ import { SGraphCommand, SGraphItem, SGraphScene } from "@persagy-web/graph/";
  *
  * @author  韩耀龙
  */
-
 export class SGraphPointListInsert extends SGraphCommand {
     /** 命令名称    */
     readonly command: string;
@@ -47,11 +46,11 @@ export class SGraphPointListInsert extends SGraphCommand {
 
     /**
      * 构造函数
-     * @param scene       item所在场景
-     * @param item        指向item对象
-     * @param pointList   顶点数组
-     * @param pos         当前位置
-     * @param index       索引
+     * @param   scene       item所在场景
+     * @param   item        指向item对象
+     * @param   pointList   顶点数组
+     * @param   pos         当前位置
+     * @param   index       索引
      */
     constructor(
         scene: SGraphScene,
@@ -97,7 +96,7 @@ export class SGraphPointListInsert extends SGraphCommand {
     /**
      * 命令细节描述
      *
-     */
+     * */
     toString(): string {
         const pointList = `pointList=${JSON.stringify(this.pointList)}`;
         const pos = `pos=${JSON.stringify(this.pos)}`;

+ 7 - 8
persagy-web-edit/src/commands/SGraphPointListUpdate.ts

@@ -32,7 +32,6 @@ import { SGraphCommand, SGraphItem, SGraphScene } from "@persagy-web/graph/";
  *
  * @author  韩耀龙
  */
-
 export class SGraphPointListUpdate extends SGraphCommand {
     /** 命令名称    */
     readonly command: string;
@@ -49,12 +48,12 @@ export class SGraphPointListUpdate extends SGraphCommand {
 
     /**
      * 构造函数
-     * @param scene       item所在场景
-     * @param item        指向item对象
-     * @param pointList   顶点数组
-     * @param old         原位置
-     * @param pos         当前位置
-     * @param index       索引
+     * @param   scene       item所在场景
+     * @param   item        指向item对象
+     * @param   pointList   顶点数组
+     * @param   old         原位置
+     * @param   pos         当前位置
+     * @param   index       索引
      */
     constructor(
         scene: SGraphScene,
@@ -95,7 +94,7 @@ export class SGraphPointListUpdate extends SGraphCommand {
     /**
      * 命令细节描述
      *
-     */
+     * */
     toString(): string {
         const pointList = `pointList=${JSON.stringify(this.pointList)}`;
         const old = `old=${JSON.stringify(this.old)}`;

+ 6 - 7
persagy-web-edit/src/commands/SGraphPropertyCommand.ts

@@ -33,7 +33,6 @@ import { SGraphScene } from "@persagy-web/graph/";
  *
  * @author  张宇(taohuzy@163.com)
  */
-
 export class SGraphPropertyCommand<T> extends SGraphCommand {
     /** 命令名称    */
     readonly command: string;
@@ -49,11 +48,11 @@ export class SGraphPropertyCommand<T> extends SGraphCommand {
     /**
      * 构造函数
      *
-     * @param scene       命令所属的场景类
-     * @param item        命令所属的item类
-     * @param propName    修改的属性名称
-     * @param oldProp     修改前的属性值
-     * @param newProp     修改后的属性值
+     * @param   scene       命令所属的场景类
+     * @param   item        命令所属的item类
+     * @param   propName    修改的属性名称
+     * @param   oldProp     修改前的属性值
+     * @param   newProp     修改后的属性值
      */
     constructor(
         scene: SGraphScene,
@@ -92,7 +91,7 @@ export class SGraphPropertyCommand<T> extends SGraphCommand {
     /**
      * 命令细节描述
      *
-     */
+     * */
     toString(): string {
         const propName = `propName=${this.propName}`;
         const oldProp = `oldProp=${JSON.stringify(this.oldProp)}`;

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

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

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

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

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

@@ -33,5 +33,5 @@ export enum STextOrigin {
   /** 左上点    */
   LeftTop,
   /** 中心点    */
-  Center,
+  Centrum,
 } // Enum STextOrigin

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

@@ -23,5 +23,23 @@
  *
  * *********************************************************************************************************************
  */
-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 }

+ 0 - 93
persagy-web-edit/src/items/ImageEdit.ts

@@ -1,93 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .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 { 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";
-
-/**
- * 图片编辑类
- *
- * @author  韩耀龙(han_yao_long@163.com)
- */
-export class ImageEdit extends SImageItem {
-    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    //属性
-    /**编辑状态 */
-    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      指向父对象
-     */
-    constructor(parent: SGraphItem | null, url: string) {
-        super(parent);
-        this.url = url;
-        // this.initItem();
-        this.origin = new SPoint(this.width / 2, this.height / 2);
-    }
-
-    /**
-     * 将类中得数据转换为方便存储格式的方法
-     *
-     * return   any         针对item类型保持相应的格式
-     */
-    toData(): any {
-
-    }
-    // 初始化item
-    // initItem() {
-    //     if (!this.url) {
-    //         this.strokeColor = SColor.Black;
-    //         this.width = 100;
-    //         this.height = 100
-    //     }
-    // }
-
-    /**
-     * 根据显示模式计算图片的宽高
-     */
-    computeImgSize(): void {
-        super.computeImgSize();
-        this.origin = new SPoint(this.width / 2, this.height / 2);
-        this.update();
-    } // Function computeImgSize()
-} // Class SImageItem

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

@@ -0,0 +1,558 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .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

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

@@ -0,0 +1,387 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .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();
+  } // Get 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
+
+  /**
+   * 大小改变
+   */
+  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	boolean
+   */
+  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
+  }
+
+  /**
+   * Item绘制操作
+   *
+   * @param   painter 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

+ 45 - 48
persagy-web-big/src/items/SIconTextItem.ts

@@ -29,9 +29,11 @@ import {
     SImageItem,
     STextItem,
     SAnchorItem,
-    SGraphItem
+    SGraphItem,
+
 } from "@persagy-web/graph";
-import { SItemStatus, ItemOrder } from "..";
+import { SItemStatus, ItemOrder, } from "@persagy-web/big";
+import { Anchor } from "@persagy-web/big/lib/types/topology/Anchor";
 import { SMouseEvent } from "@persagy-web/base";
 import {
     SSize,
@@ -40,16 +42,19 @@ import {
     SColor,
     SFont,
     SPoint
+
 } from "@persagy-web/draw";
-import { Anchor } from "../types/topology/Anchor";
+import { SGraphEdit } from "..";
+import { Marker } from "../type/Marker";
 
 /**
- * 图例 item
+ * 图例item  icon
  *
- * @author  郝建龙 <haojianlong@sagacloud.cn>
+ * @author 韩耀龙 <han_yao_long@163.com>
  */
-export class SIconTextItem extends SObjectItem {
-    /** item 状态 */
+
+export class SBaseIconTextEdit extends SGraphEdit {
+    /** item状态 */
     _status: SItemStatus = SItemStatus.Normal;
     get status(): SItemStatus {
         return this._status;
@@ -72,6 +77,8 @@ export class SIconTextItem extends SObjectItem {
         this.update();
     } // Set status
 
+    /** 锚点list */
+    anchorList: SAnchorItem[] = [];
     /** 是否显示文字 */
     _showText: boolean = true;
     get showText(): boolean {
@@ -81,6 +88,7 @@ export class SIconTextItem extends SObjectItem {
         if (v === this._showText) {
             return;
         }
+
         this._showText = v;
         if (v) {
             this.textItem.show();
@@ -138,7 +146,7 @@ export class SIconTextItem extends SObjectItem {
         this.update();
     } // Set activeColor
 
-    /** X 轴坐标 */
+    /** X轴坐标 */
     get x(): number {
         return this.pos.x;
     } // Get x
@@ -148,7 +156,7 @@ export class SIconTextItem extends SObjectItem {
         this.update();
     } // Set x
 
-    /** Y 轴坐标 */
+    /** Y轴坐标 */
     get y(): number {
         return this.pos.y;
     } // Get y
@@ -214,7 +222,7 @@ export class SIconTextItem extends SObjectItem {
     set color(v: SColor) {
         this.textItem.color = v;
         this.update();
-    } // Get color
+    } // Set color
 
     /** 文本字体 */
     get font(): SFont {
@@ -224,20 +232,17 @@ export class SIconTextItem extends SObjectItem {
         this.textItem.font = v;
         this.update();
     } // Set font
-
     /** img Item */
     img: SImageItem = new SImageItem(this);
-
-    /** text Item */
+    /** text item */
     textItem: STextItem = new STextItem(this);
-
     /**
      * 构造体
      *
-     * @param parent  父类
-     * @param data    锚点数据
+     * @param   parent  父类
+     * @param   data    锚点数据
      */
-    constructor(parent: SGraphItem | null, data?: Anchor[]) {
+    constructor(parent: SGraphItem | null, data: Marker) {
         super(parent);
         this.img.width = 32;
         this.img.height = 32;
@@ -246,35 +251,28 @@ export class SIconTextItem extends SObjectItem {
             this.img.height * 0.5
         );
         this.img.connect("onMove", this, this.changeAnchorPoint.bind(this));
-        let anchorPoint;
-        if (data && data.length) {
-            anchorPoint = data.map(t => {
-                return {
-                    x: t.pos.x,
-                    y: t.pos.y,
-                    id: t.id
-                };
-            });
-        } else {
+        let anchorPoint: any = [];
+        if (data) {
             anchorPoint = [
-                { x: this.img.x, y: this.img.y, id: "" },
-                { x: this.img.x, y: this.img.y, id: "" },
-                { x: this.img.x, y: this.img.y, id: "" },
-                { x: this.img.x, y: this.img.y, id: "" }
-                // { x: this.img.x, y: this.img.y + this.img.height / 2, id: "" },
-                // { x: this.img.x, y: this.img.y - this.img.height / 2, id: "" },
-                // { x: this.img.x - this.img.width / 2, y: this.img.y, id: "" },
-                // { x: this.img.x + this.img.width / 2, y: this.img.y, id: "" }
+                {
+                    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;
@@ -312,8 +310,8 @@ export class SIconTextItem extends SObjectItem {
     /**
      * 鼠标按下事件
      *
-     * @param event   事件对象
-     * @return 是否处理事件
+     * @param   event   事件对象
+     * @return  是否处理事件
      */
     onMouseDown(event: SMouseEvent): boolean {
         if (this.status == SItemStatus.Normal) {
@@ -327,18 +325,18 @@ export class SIconTextItem extends SObjectItem {
     /**
      * 宽高发发生变化
      *
-     * @param oldSize 改之前的大小
-     * @param newSize 改之后大小
-     */
-    onResize(oldSize: SSize, newSize: SSize): void {
+     * @param   oldSize 改之前的大小
+     * @param   newSize 改之后大小
+     * */
+    onResize(oldSize: SSize, newSize: SSize) {
         console.log(arguments);
     } // Function onResize()
 
     /**
      * 鼠标双击事件
      *
-     * @param event   鼠标事件
-     * @return 是否处理事件
+     * @param   event   鼠标事件
+     * @return  是否处理事件
      */
     onDoubleClick(event: SMouseEvent): boolean {
         // 如果位show状态 双击改对象则需改为编辑状态
@@ -354,9 +352,9 @@ export class SIconTextItem extends SObjectItem {
     } // Function onDoubleClick()
 
     /**
-     * Item 对象边界区域
+     * 宽高发生变化
      *
-     * @return 边界矩阵
+     * @return  SRect   所有子对象的并集
      */
     boundingRect(): SRect {
         let rect = this.img
@@ -369,14 +367,13 @@ export class SIconTextItem extends SObjectItem {
                     .adjusted(this.textItem.pos.x, this.textItem.pos.y, 0, 0)
             );
         }
-
         return rect.adjusted(-5, -5, 10, 10);
     } // Function boundingRect()
 
     /**
-     * Item 绘制操作
+     * Item绘制操作
      *
-     * @param painter   绘制对象
+     * @param   painter painter对象
      */
     onDraw(painter: SPainter): void {
         if (this.status == SItemStatus.Edit) {

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


+ 113 - 79
persagy-web-edit/src/items/LineEdit.ts

@@ -24,7 +24,6 @@
  * *********************************************************************************************************************
  */
 
-
 import { SColor, SLine, SPainter, SPoint, SRect } from "@persagy-web/draw/";
 import { SMouseButton, SMouseEvent, SUndoStack } from "@persagy-web/base";
 import { SMathUtil } from "@persagy-web/big/lib/utils/SMathUtil";
@@ -35,16 +34,24 @@ import {
     SLineStyle,
     SGraphItem
 } from "@persagy-web/graph/";
-import { SGraphEdit } from "./../"
+import { SGraphEdit } from ".."
+import { Marker } from "../type/Marker";
 
 /**
  * 直线编辑类
  *
  * @author  韩耀龙(han_yao_long@163.com)
  */
-export class LineEdit extends SGraphEdit {
+export class SBaseLineEdit extends SGraphEdit {
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //属性
+
+    /**编辑相关操作的数据 */
+    data: Marker
+    /** 起始锚点  */
+    startItem: SGraphItem | null = null;
+    /** 结束锚点  */
+    endItem: SGraphItem | null = null;
     /** X坐标最小值  */
     private minX = Number.MAX_SAFE_INTEGER;
     /** X坐标最大值  */
@@ -53,87 +60,85 @@ export class LineEdit extends SGraphEdit {
     private minY = Number.MAX_SAFE_INTEGER;
     /** Y坐标最大值  */
     private maxY = Number.MIN_SAFE_INTEGER;
-
     /** 线段   */
     private _line: SPoint[] = [];
     get line(): SPoint[] {
         return this._line;
-    }
+    } // Get line
     set line(arr: SPoint[]) {
         this._line = arr;
         this.update();
-    }
-
+    } // Set line
     /** 是否垂直水平绘制   */
     private _verAndLeve: Boolean = false;
     get verAndLeve(): Boolean {
         return this._verAndLeve;
-    }
+    } // Get verAndLeve
     set verAndLeve(bool: Boolean) {
         this._verAndLeve = bool;
         this.update();
-    }
+    } // Set verAndLeve
 
     /** 是否完成绘制  */
     protected _status: SItemStatus = SItemStatus.Normal;
     get status(): SItemStatus {
         return this._status;
-    }
+    } // Get status
     set status(v: SItemStatus) {
         this._status = v;
         this.undoStack.clear();
         this.update();
-    }
+    } // Set status
 
     /** 线条颜色    */
     private _strokeColor: SColor = SColor.Black;
     get strokeColor(): SColor {
         return this._strokeColor;
-    }
+    } // Get strokeColor
     set strokeColor(v: SColor) {
         this._strokeColor = v;
         this.update();
-    }
+    }// Get strokeColor
 
     /** 线条样式    */
     private _lineStyle: SLineStyle = SLineStyle.Solid;
     get lineStyle(): SLineStyle {
         return this._lineStyle;
-    }
+    } // Get lineStyle
     set lineStyle(v: SLineStyle) {
         this._lineStyle = v;
         this.update();
-    }
+    } // Set lineStyle
 
     /** 端点填充色 */
     private _fillColor: SColor = SColor.White;
     get fillColor(): SColor {
         return this._fillColor;
-    }
+    } // Get fillColor
     set fillColor(v: SColor) {
         this._fillColor = v;
         this.update();
-    }
+    } //Set fillColor
 
     /** 选中端点填充色 */
     private _activeFillColor: SColor = new SColor("#2196f3");
     get activeFillColor(): SColor {
         return this._activeFillColor;
-    }
+    } //Get activeFillColor
     set activeFillColor(v: SColor) {
         this._activeFillColor = v;
         this.update();
-    }
+    } //Set activeFillColor
 
     /** 线条宽度    */
     private _lineWidth: number = 1;
     get lineWidth(): number {
         return this._lineWidth;
-    }
+    } //Get lineWidth
     set lineWidth(v: number) {
         this._lineWidth = v;
         this.update();
-    }
+    } //Set lineWidth
 
     /** 拖动灵敏度   */
     dis: number = 5;
@@ -153,50 +158,45 @@ export class LineEdit extends SGraphEdit {
     /**
      * 构造函数
      *
-     * @param parent  父级
-     */
-    constructor(parent: SGraphItem | null);
-
-    /**
-     * 构造函数
-     *
-     * @param parent  父级
-     * @param line    坐标集合
-     */
-    constructor(parent: SGraphItem | null, line: SPoint[]);
-
-    /**
-     * 构造函数
-     *
-     * @param parent  父级
-     * @param point   第一个点坐标
-     */
-    constructor(parent: SGraphItem | null, point: SPoint);
-
-    /**
-     * 构造函数
-     *
-     * @param parent  父级
-     * @param l       坐标集合|第一个点坐标
-     */
-    constructor(parent: SGraphItem | null, l?: SPoint | SPoint[]) {
+     * @param   parent  父级
+     * @param   l       坐标集合|第一个点坐标
+     * */
+    constructor(parent: SGraphItem | null, data: Marker) {
         super(parent);
-        if (l) {
-            if (l instanceof SPoint) {
-                this.line.push(l);
-            } else {
-                this.line = l;
+        this.showSelect = false;
+        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;
+            }
+        }
+        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
             }
-        } else {
-            this.line = [];
         }
     }
 
     /**
      * 添加点至数组中
      *
-     * @param p       添加的点
-     */
+     * @param   p       添加的点
+     * */
     private addPoint(p: SPoint): void {
         if (this.line.length < 2) {
             this.line.push(p);
@@ -232,9 +232,9 @@ export class LineEdit extends SGraphEdit {
     /**
      * 鼠标按下事件
      *
-     * @param event   鼠标事件
-     * @return 是否处理事件
-     */
+     * @param   event   鼠标事件
+     * @return  是否处理事件
+     * */
     onMouseDown(event: SMouseEvent): boolean {
         this.curIndex = -1;
         this.curPoint = null;
@@ -285,11 +285,31 @@ export class LineEdit extends SGraphEdit {
     } // Function onMouseUp()
 
     /**
+      * 鼠标抬起事件
+      *
+      * @param	event         事件参数
+      * @return	boolean
+      */
+    onKeyUp(event: KeyboardEvent): void {
+        // 当 ESC 时
+        if (27 == event.keyCode) {
+            if (this.status == SItemStatus.Edit) {
+                this.status = SItemStatus.Normal;
+                this.releaseItem();
+            } else if (this.status == SItemStatus.Create) {
+                this.update()
+                this.releaseItem();
+                this.parent = null;
+            }
+        }
+    } // Function onKeyUp()
+
+    /**
      * 鼠标移动事件
      *
-     * @param event   鼠标事件
-     * @return 是否处理事件
-     */
+     * @param   event   鼠标事件
+     * @return  是否处理事件
+     * */
     onMouseMove(event: SMouseEvent): boolean {
         if (event.shiftKey || this._verAndLeve) {
             event = this.compare(event);
@@ -313,8 +333,8 @@ export class LineEdit extends SGraphEdit {
     /**
      * 获取点击点与Point[]中的点距离最近点
      *
-     * @param p   鼠标点击点
-     */
+     * @param   p   鼠标点击点
+     * */
     findNearestPoint(p: SPoint): void {
         let len = this.sceneDis;
         for (let i = 0; i < this.line.length; i++) {
@@ -347,9 +367,9 @@ export class LineEdit extends SGraphEdit {
     /**
      * 移动后处理所有坐标,并肩原点置为场景原点
      *
-     * @param x   x坐标
-     * @param y   y坐标
-     */
+     * @param   x   x坐标
+     * @param   y   y坐标
+     * */
     moveToOrigin(x: number, y: number): void {
         super.moveToOrigin(x, y);
         this.line = this.line.map(t => {
@@ -364,8 +384,8 @@ export class LineEdit extends SGraphEdit {
     /**
      * shift垂直水平创建或编辑
      *
-     * @param event   事件
-     */
+     * @param   event   事件
+     * */
     compare(event: SMouseEvent): SMouseEvent {
         if (this.line.length) {
             let last = new SPoint(event.x, event.y);
@@ -392,9 +412,9 @@ export class LineEdit extends SGraphEdit {
     /**
      * 判断点是否在区域内
      *
-     * @param x
-     * @param y
-     * @return true-是
+     * @param   x
+     * @param   y
+     * @return  true-是
      */
     contains(x: number, y: number): boolean {
         if (this.line.length == 2) {
@@ -432,7 +452,7 @@ export class LineEdit extends SGraphEdit {
     /**
      * 取消操作item事件
      *
-     */
+     * */
     cancelOperate(): void {
         if (this.status == SItemStatus.Create) {
             this.parent = null;
@@ -480,9 +500,23 @@ export class LineEdit extends SGraphEdit {
     } // Function boundingRect()
 
     /**
+     * 返回对象储存的相关数据
+     *
+     * @return	formData
+     */
+    toData() {
+        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.value;
+        return this.data
+    } // Function toData()
+
+    /**
      * Item绘制操作
      *
-     * @param painter painter对象
+     * @param   painter painter对象
      */
     onDraw(painter: SPainter): void {
         this.sceneDis = painter.toPx(this.dis);
@@ -490,7 +524,7 @@ export class LineEdit extends SGraphEdit {
         painter.pen.color = this.strokeColor;
         if (this.line.length == 2) {
             // 绘制直线
-            painter.pen.color = new SColor(this.strokeColor);
+            painter.pen.color = this.strokeColor;
             if (this.lineStyle == SLineStyle.Dashed) {
                 painter.pen.lineDash = [
                     painter.toPx(this.lineWidth * 3),
@@ -498,8 +532,8 @@ export class LineEdit extends SGraphEdit {
                 ];
             } else if (this.lineStyle == SLineStyle.Dotted) {
                 painter.pen.lineDash = [
-                    painter.toPx(this.lineWidth),
-                    painter.toPx(this.lineWidth)
+                    painter.toPx(2 * this.lineWidth),
+                    painter.toPx(2 * this.lineWidth)
                 ];
             }
             if (this.selected && this.status == SItemStatus.Normal) {
@@ -538,4 +572,4 @@ export class LineEdit extends SGraphEdit {
             }
         }
     } // Function onDraw()
-} // Class SLineItem
+} // Class SLineItem

+ 149 - 74
persagy-web-edit/src/items/PolygonEdit.ts

@@ -17,7 +17,7 @@
  *          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.  博锐尚格科技股份有限公司
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
  *        ~8888'
  *        .!88~                                                                     All rights reserved.
  *
@@ -25,11 +25,11 @@
  */
 
 import {
+    SGraphItem,
     SGraphPointListDelete,
     SGraphPointListInsert,
     SGraphPointListUpdate,
-    SLineStyle,
-    SGraphItem
+    SLineStyle
 } from "@persagy-web/graph";
 import { SKeyCode, SMouseEvent, SUndoStack } from "@persagy-web/base/";
 import {
@@ -41,26 +41,29 @@ import {
     SPolygonUtil,
     SRect
 } from "@persagy-web/draw";
-import { SItemStatus } from "@persagy-web/big";
+import { SItemStatus, ItemOrder } from "@persagy-web/big";
+import { Marker } from "../type/Marker";
 import { SMathUtil } from "@persagy-web/big/lib/utils/SMathUtil";
-import {SGraphEdit} from "./../"
+import { SGraphEdit } from ".."
 
 /**
- * 多边形编辑类
+ * 编辑多边形
  *
- * @author  韩耀龙(han_yao_long@163.com)
+ * @author  韩耀龙
  */
-export class PolygonEdit extends SGraphEdit {
-    /** X坐标最小值  */
+export class SBasePolygonEdit extends SGraphEdit {
+    /** X坐标最小值 */
     private minX = Number.MAX_SAFE_INTEGER;
-    /** X坐标最大值  */
+    /** X坐标最大值 */
     private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y坐标最小值  */
+    /** Y坐标最小值 */
     private minY = Number.MAX_SAFE_INTEGER;
-    /** Y坐标最大值  */
+    /** Y坐标最大值 */
     private maxY = Number.MIN_SAFE_INTEGER;
 
-    /** 轮廓线坐标  */
+    /** 图例节点对象数据 */
+    data: Marker;
+    /** 轮廓线坐标 */
     private pointList: SPoint[] = [];
     // 获取当前状态
     get getPointList(): SPoint[] {
@@ -71,22 +74,12 @@ export class PolygonEdit extends SGraphEdit {
         this.pointList = arr;
         this.update();
     }
-    /** 是否垂直水平绘制   */
-    private _verAndLeve: Boolean = false;
-    get verAndLeve(): Boolean {
-        return this._verAndLeve;
-    }
-    set verAndLeve(bool: Boolean) {
-        this._verAndLeve = bool;
-        this.update();
-    }
-    // 当前状态
+
+    /** 当前状态 */
     protected _status: number = SItemStatus.Normal;
-    // 获取当前状态
     get status(): SItemStatus {
         return this._status;
     }
-    // 编辑当前状态
     set status(value: SItemStatus) {
         this._status = value;
         this.undoStack.clear();
@@ -94,49 +87,49 @@ export class PolygonEdit extends SGraphEdit {
     }
 
     /** 边框颜色 */
-    _strokeColor: SColor = new SColor("#0091FF");
+    _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("#1EE887");
+    _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 = 4;
+    /** 边框的宽 只可输入像素宽 */
+    _lineWidth: number = 1;
     get lineWidth(): number {
         return this._lineWidth;
-    }
+    } // Get lineWidth
     set lineWidth(v: number) {
         this._lineWidth = v;
         this.update();
-    }
+    } // Set lineWidth
 
-    /** 是否闭合    */
+    /** 是否闭合 */
     closeFlag: boolean = false;
-    /** 鼠标移动点  */
+    /** 鼠标移动点 */
     private lastPoint: SPoint | null = null;
     /** 当前鼠标获取顶点对应索引 */
     private curIndex: number = -1;
@@ -144,20 +137,91 @@ export class PolygonEdit extends SGraphEdit {
     private curPoint: null | SPoint = null;
     /** 灵敏像素 */
     private len: number = 10;
-    /** 场景像素 内部将灵敏像素换算为场景实际距离  */
+    /** 场景像素 内部将灵敏像素换算为场景实际距离 */
     private scenceLen: number = 15;
-    /** 场景像素  */
+    /** 场景像素 */
     private isAlt: boolean = false;
-    /** undoredo堆栈 */
+    /** undo/redo堆栈 */
     protected undoStack: SUndoStack = new SUndoStack();
 
     /**
      * 构造函数
      *
      * @param parent    指向父对象
+     * @param data      图例节点对象数据
      */
-    constructor(parent: SGraphItem | null) {
+    constructor(parent: SGraphItem | null, data: Marker) {
         super(parent);
+        // this.textItem.originPosition = STextOrigin.Centrum;
+        // this.textItem.isTransform = false;
+        this.zOrder = ItemOrder.polygonOrder;
+        this.data = data;
+        this.name = data.name;
+        // this.text = data.Name;
+        if (data.style) {
+            this.setPointList = [];
+            let setPointList: SPoint[];
+            if (data.style.outLine) {
+                if (data.style.outLine[0] instanceof SPoint) {
+                    // @ts-ignore
+                    this.setPointList = data.style.outLine;
+                } else {
+                    setPointList = data.style.outLine.map(i => {
+                        return (new SPoint(i.x, i.y))
+                    })
+                    this.setPointList = setPointList;
+                }
+            }
+            // 样式相关
+            if (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
+                }
+                // 填充色
+                if (data.style.default.fillColor) {
+                    this.fillColor = new SColor(data.style.default.fillColor)
+                }
+            }
+        }
+        // if (data) {
+        //     if (data.Properties.Zorder) {
+        //         this.zOrder = data.Properties.Zorder;
+        //     }
+        //     // 设置线宽
+
+        //     if (data.Properties.TextPos) {
+        //         this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
+        //     }
+        //     if (data.Properties.color) {
+        //         this.color = new SColor(data.Properties.color);
+        //     }
+        //     if (data.Properties.font) {
+        //         this.font = new SFont("sans-serif", data.Properties.font);
+        //     }
+        //     if (data.Properties && data.Properties.IsActive) {
+        //         this.isActive = data.Properties.IsActive;
+        //     }
+        // }
+        // 监听多边形创建完成事件,并动态计算文本位置
+        // this.connect("finishCreated", this, () => {
+        //     // 计算文本位置
+        //     let x: number = this.getPointList.reduce((pre, cur, index, arr) => {
+        //         return pre + (cur.x / arr.length)
+        //     }, 0),
+        //         y: number = this.getPointList.reduce((pre, cur, index, arr) => {
+        //             return pre + (cur.y / arr.length)
+        //         }, 0);
+        //     this.textItem.moveTo(x, y);
+        // })
     }
 
     //////////////////
@@ -180,13 +244,13 @@ export class PolygonEdit extends SGraphEdit {
         }
         this.update();
         return point;
-    }
+    } // Function insertPoint()
 
     /**
      * 删除点位
      *
      * @param i   删除点所在的索引
-     * @return   SPoint|null。索引不在数组范围则返回null
+     * @return    SPoint|null。索引不在数组范围则返回null
      */
     deletePoint(i: number | null = null): SPoint | null {
         let point = null;
@@ -209,7 +273,7 @@ export class PolygonEdit extends SGraphEdit {
         this.curPoint = null;
         this.update();
         return point;
-    }
+    } // Function deletePoint()
 
     /**
      * 多边形顶点的移动位置
@@ -217,7 +281,7 @@ export class PolygonEdit extends SGraphEdit {
      * @param x   点位得x坐标
      * @param y   点位得y坐标
      * @param i   点位得i坐标
-     * @return   移动对应得点。如果索引无法找到移动顶点,则返回null
+     * @return    移动对应得点。如果索引无法找到移动顶点,则返回null
      */
     movePoint(x: number, y: number, i: number): SPoint | null {
         let point = null;
@@ -230,16 +294,7 @@ export class PolygonEdit extends SGraphEdit {
         }
         point = this.pointList[i];
         return point;
-    }
-
-    /**
-     * 打印出多边形数组
-     *
-     * @return 顶点数组
-     */
-    PrintPointList(): SPoint[] {
-        return this.pointList;
-    }
+    } // Function movePoint()
 
     ////////////
     //  以下为三种状态下的绘制多边形方法
@@ -277,7 +332,7 @@ export class PolygonEdit extends SGraphEdit {
         }
         painter.drawPolygon([...pointList]);
         painter.restore();
-    }
+    } // Function drawShowPolygon()
 
     /**
      * 创建状态 --绘制多边形数组
@@ -333,7 +388,7 @@ export class PolygonEdit extends SGraphEdit {
         } else {
             painter.drawPolygon(pointList);
         }
-    }
+    } // Function drawCreatePolygon()
 
     /**
      *
@@ -359,7 +414,7 @@ export class PolygonEdit extends SGraphEdit {
             }
             painter.drawCircle(item.x, item.y, painter.toPx(this.len / 2));
         });
-    }
+    } // Function drawCreatePolygon()
 
     /**
      * 编辑状态操作多边形数组
@@ -473,7 +528,7 @@ export class PolygonEdit extends SGraphEdit {
             // 刷新视图
             this.update();
         }
-    }
+    } // Function editPolygonPoint()
 
     /////////////////////
     // undo、redo相关操作
@@ -487,7 +542,7 @@ export class PolygonEdit extends SGraphEdit {
         // 记录相关命令并推入堆栈中
         const sgraphcommand = new SGraphCommand(this.scene, this, ...any);
         this.undoStack.push(sgraphcommand);
-    }
+    } // Function recordAction()
 
     /**
      * 执行取消操作执行
@@ -497,7 +552,7 @@ export class PolygonEdit extends SGraphEdit {
             return;
         }
         this.undoStack.undo();
-    }
+    } // Function undo()
 
     /**
      * 执行重做操作执行
@@ -507,7 +562,7 @@ export class PolygonEdit extends SGraphEdit {
             return;
         }
         this.undoStack.redo();
-    }
+    } // Function redo()
 
     ///////////////////////////////
     // 以下为鼠标事件
@@ -588,7 +643,7 @@ export class PolygonEdit extends SGraphEdit {
      * @return	boolean
      */
     onMouseDown(event: SMouseEvent): boolean {
-        if (event.shiftKey || this.verAndLeve) {
+        if (event.shiftKey) {
             event = this.compare(event);
         }
         // 如果状态为编辑状态则添加点
@@ -653,7 +708,7 @@ export class PolygonEdit extends SGraphEdit {
      */
 
     onMouseMove(event: SMouseEvent): boolean {
-        if (event.shiftKey || this.verAndLeve) {
+        if (event.shiftKey) {
             event = this.compare(event);
         }
         if (this.status == SItemStatus.Create) {
@@ -678,15 +733,15 @@ export class PolygonEdit extends SGraphEdit {
     /**
      * shift垂直水平创建或编辑
      *
-     * @param event   事件
-     */
+     * @param   event   事件
+     * */
     compare(event: SMouseEvent): SMouseEvent {
         if (this.pointList.length) {
             let last = new SPoint(event.x, event.y);
             if (this.status == SItemStatus.Create) {
                 last = this.pointList[this.pointList.length - 1];
             } else if (this.status == SItemStatus.Edit) {
-                if (this.curIndex > 1) {
+                if (this.curIndex > 0) {
                     last = this.pointList[this.curIndex - 1];
                 }
             }
@@ -731,9 +786,9 @@ export class PolygonEdit extends SGraphEdit {
     /**
      * 移动后处理所有坐标,并肩原点置为场景原点
      *
-     * @param x   x坐标
-     * @param y   y坐标
-     */
+     * @param   x   x坐标
+     * @param   y   y坐标
+     * */
     moveToOrigin(x: number, y: number): void {
         super.moveToOrigin(x, y);
         this.pointList = this.pointList.map(t => {
@@ -822,9 +877,29 @@ export class PolygonEdit extends SGraphEdit {
     } // Function contains()
 
     /**
+     * 返回对象储存的相关数据
+     *
+     * @return	formData
+     */
+    toData() {
+        const Line = this.pointList.map(pos => {
+            return {
+                x: pos.x,
+                y: pos.y
+            }
+        });
+        this.data.style.outLine = 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    绘制对象
+     * @param   painter       painter对象
      */
     onDraw(painter: SPainter): void {
         this.scenceLen = painter.toPx(this.len);
@@ -840,4 +915,4 @@ export class PolygonEdit extends SGraphEdit {
             this.drawEditPolygon(painter, this.pointList);
         }
     } // Function onDraw()
-}
+} // Class SPolygonItem

+ 93 - 60
persagy-web-edit/src/items/PolylineEdit.ts

@@ -36,14 +36,17 @@ import {
     SLineStyle,
     SGraphItem
 } from "@persagy-web/graph/";
-import {SGraphEdit} from "./../"
+import { SGraphEdit } from ".."
+import { Marker } from "../type/Marker";
 
 /**
  * 折线编辑类
  *
  * @author  韩耀龙(han_yao_long@163.com)
  */
-export class PolylineEdit extends SGraphEdit {
+export class SBasePolylineEdit extends SGraphEdit {
+    /** 传入数据 */
+    data: Marker
     /** X坐标最小值  */
     private minX = Number.MAX_SAFE_INTEGER;
     /** X坐标最大值  */
@@ -125,40 +128,52 @@ export class PolylineEdit extends SGraphEdit {
     /**
      * 构造函数
      *
-     * @param parent  父级
-     * @param list    坐标集合
-     */
-    constructor(parent: null | SGraphItem, list: SPoint[]);
+     * @param   parent  父级
+     * @param   list    第一个坐标|坐标集合
+     * */
+    constructor(parent: null | SGraphItem, data: Marker) {
+        super(parent);
+        this.data = data;
+        this.name = data.name;
+        this.moveTo(data.pos.x, data.pos.y);
+        this.showSelect = false;
+        if (data && data.style) {
+            if (data.style.outLine) {
+                let setPointList: SPoint[];
+                setPointList = data.style.outLine.map(i => {
+                    return new SPoint(i.x, i.y)
+                })
+                this.pointList = setPointList;
+            }
 
-    /**
-     * 构造函数
-     *
-     * @param parent  父级
-     * @param list    第一个坐标
-     */
-    constructor(parent: null | SGraphItem, list: SPoint);
+            this.moveable = data.style.isMove ? data.style.isMove : false;
+            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
+                }
+
+            }
 
-    /**
-     * 构造函数
-     *
-     * @param parent  父级
-     * @param list    第一个坐标|坐标集合
-     */
-    constructor(parent: null | SGraphItem, list: SPoint | SPoint[]) {
-        super(parent);
-        if (list instanceof SPoint) {
-            this.pointList.push(list);
-        } else {
-            this.pointList = list;
         }
     } // Constructor
 
     /**
      * 添加点至数组中
      *
-     * @param p       添加的点
-     * @param index   添加到的索引
-     */
+     * @param   p       添加的点
+     * @param   index   添加到的索引
+     * */
     private addPoint(p: SPoint, index?: number): void {
         if (index && this.canHandle(index)) {
             this.pointList.splice(index, 0, p);
@@ -177,9 +192,9 @@ export class PolylineEdit extends SGraphEdit {
     /**
      * 是否可以添加点到数组中
      *
-     * @param index   要添加到的索引
-     * @return boolean 是否可添加
-     */
+     * @param   index   要添加到的索引
+     * @return  boolean 是否可添加
+     * */
     private canHandle(index: number): boolean {
         return index >= 0 && index <= this.pointList.length;
     } // Function canHandle()
@@ -187,8 +202,8 @@ export class PolylineEdit extends SGraphEdit {
     /**
      * 根据索引删除点
      *
-     * @param index   删除点
-     */
+     * @param   index   删除点
+     * */
     deletePoint(index: number): void {
         if (this.canHandle(index) && this.pointList.length > 2) {
             const p = new SPoint(
@@ -210,9 +225,9 @@ export class PolylineEdit extends SGraphEdit {
     /**
      * 鼠标按下事件
      *
-     * @param event   鼠标事件
-     * @return boolean 是否处理事件
-     */
+     * @param   event   鼠标事件
+     * @return  boolean 是否处理事件
+     * */
     onMouseDown(event: SMouseEvent): boolean {
         this.curIndex = -1;
         this.curPoint = null;
@@ -246,9 +261,9 @@ export class PolylineEdit extends SGraphEdit {
     /**
      * 鼠标移动事件
      *
-     * @param event   鼠标事件
-     * @return boolean 是否处理事件
-     */
+     * @param   event   鼠标事件
+     * @return  boolean 是否处理事件
+     * */
     onMouseMove(event: SMouseEvent): boolean {
         if (event.shiftKey || this.verAndLeve) {
             event = this.compare(event);
@@ -279,9 +294,9 @@ export class PolylineEdit extends SGraphEdit {
     /**
      * 鼠标移动事件
      *
-     * @param event   鼠标事件
-     * @return boolean 是否处理事件
-     */
+     * @param   event   鼠标事件
+     * @return  boolean 是否处理事件
+     * */
     onMouseUp(event: SMouseEvent): boolean {
         if (this.status == SItemStatus.Edit) {
             if (this.curIndex > -1) {
@@ -354,9 +369,9 @@ export class PolylineEdit extends SGraphEdit {
     /**
      * 移动后处理所有坐标,并肩原点置为场景原点
      *
-     * @param x   x坐标
-     * @param y   y坐标
-     */
+     * @param   x   x坐标
+     * @param   y   y坐标
+     * */
     moveToOrigin(x: number, y: number): void {
         super.moveToOrigin(x, y);
         this.pointList = this.pointList.map(t => {
@@ -371,8 +386,8 @@ export class PolylineEdit extends SGraphEdit {
     /**
      * 获取点击点与点集中距离最近点
      *
-     * @param p   鼠标点击点
-     */
+     * @param   p   鼠标点击点
+     * */
     findNearestPoint(p: SPoint): void {
         let len = this.sceneDis;
         for (let i = 0; i < this.pointList.length; i++) {
@@ -396,8 +411,8 @@ export class PolylineEdit extends SGraphEdit {
     /**
      * 计算增加点的位置
      *
-     * @param p   鼠标点击点
-     */
+     * @param   p   鼠标点击点
+     * */
     findAddPos(p: SPoint): void {
         let len = SMathUtil.pointToLine(
             p,
@@ -426,8 +441,8 @@ export class PolylineEdit extends SGraphEdit {
     /**
      * shift垂直水平创建或编辑
      *
-     * @param event   事件
-     */
+     * @param   event   事件
+     * */
     compare(event: SMouseEvent): SMouseEvent {
         if (this.pointList.length) {
             let last = new SPoint(event.x, event.y);
@@ -464,8 +479,8 @@ export class PolylineEdit extends SGraphEdit {
     /**
      * Item对象边界区域
      *
-     * @return SRect   外接矩阵
-     */
+     * @return  SRect   外接矩阵
+     * */
     boundingRect(): SRect {
         if (this.pointList.length) {
             this.minX = this.pointList[0].x;
@@ -500,9 +515,9 @@ export class PolylineEdit extends SGraphEdit {
     /**
      * 判断点是否在区域内
      *
-     * @param x
-     * @param y
-     * @return true-是
+     * @param   x
+     * @param   y
+     * @return  true-是
      */
     contains(x: number, y: number): boolean {
         let p = new SPoint(x, y);
@@ -546,7 +561,7 @@ export class PolylineEdit extends SGraphEdit {
     /**
      * 取消操作执行
      *
-     */
+     * */
     cancelOperate(): void {
         if (this.status == SItemStatus.Create) {
             this.parent = null;
@@ -559,7 +574,7 @@ export class PolylineEdit extends SGraphEdit {
 
     /**
      * 绘制基本图形
-     */
+     * */
     drawBaseLine(painter: SPainter): void {
         // 绘制基本图形
         painter.pen.color = this.strokeColor;
@@ -578,9 +593,27 @@ export class PolylineEdit extends SGraphEdit {
     } // Function drawBaseLine()
 
     /**
+     * 返回对象储存的相关数据
+     *
+     * @return	formData
+     */
+    toData() {
+        const Line = this.pointList.map(pos => {
+            return {
+                x: pos.x,
+                y: pos.y
+            }
+        });
+        this.data.style.outLine = Line;
+        this.data.style.default.lineWidth = this.lineWidth;
+        this.data.style.default.lineStyle = this.lineStyle;
+        this.data.style.default.strokeColor = this.strokeColor.value;
+        return this.data
+    } // Function toData()
+    /**
      * Item绘制操作
      *
-     * @param painter painter对象
+     * @param   painter painter对象
      */
     onDraw(painter: SPainter): void {
         // 缓存场景长度
@@ -626,4 +659,4 @@ export class PolylineEdit extends SGraphEdit {
             this.drawBaseLine(painter);
         }
     } // Function onDraw()
-} // Class SPolylineItem
+} // Class SPolylineItem

+ 371 - 0
persagy-web-edit/src/items/SBaseRectEdit.ts

@@ -0,0 +1,371 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .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 SBaseRectEdit extends SGraphEdit {
+  /** 是否绘制完成  */
+  _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
+  width: number = 0;
+  height: number = 0;
+  /** 矩形两个对角 */
+  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();
+  /** 绘制矩形的圆角半径 */
+  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();
+  /** 传入数据 */
+  data: Marker
+
+  /**
+   * 构造函数
+   *
+   * @param parent    指向父对象
+   * @param data      矩形数据
+   */
+  constructor(parent: SGraphItem | null, data: Marker) {
+    super(parent);
+    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.fillColor) {
+        this.fillColor = new SColor(data.style.default.fillColor)
+      }
+      // 线宽
+      if (data.style.default.lineWidth) {
+        this.lineWidth = data.style.default.lineWidth
+      }
+      // 线样式
+      if (data.style.default.lineStyle) {
+        this.lineStyle = data.style.default.lineStyle
+      }
+    }
+  } // Constructor
+
+  /**
+   * 大小改变
+  */
+  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()
+  }
+
+  /**
+   * 鼠标按下事件
+   *
+   * @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	boolean
+     */
+  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.width = this.boundingRect().width;
+      this.height = this.boundingRect().height;
+    }
+    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()
+
+  toData() {
+    const Line: any = [];
+    this.line.forEach(item => {
+      Line.push({ x: item.x, y: item.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.value;
+    this.data.style.default.fillColor = this.fillColor.value;
+    return this.data
+  }
+
+  /**
+   * Item绘制操作
+   *
+   * @param   painter 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)
+        ];
+      }
+      if (this.radius != 0) {
+        painter.drawRoundRect(this._leftTop, this._rightBottom, this.radius);
+      } else {
+        painter.drawRect(this._leftTop, this._rightBottom);
+      }
+    }
+  } // Function onDraw()
+} // Class SRectEdit

+ 143 - 37
persagy-web-edit/src/items/TextEdit.ts

@@ -23,25 +23,32 @@
  *
  * *********************************************************************************************************************
  */
-
-import { SObjectItem } from "@persagy-web/graph/";
-import { SPainter, SRect, SColor, SFont, SPoint } from "@persagy-web/draw";
-import { SGraphItem, STextOrigin, SLineStyle } from "@persagy-web/graph/";
+import { SPainter, SRect, SColor, SFont, SPoint, SSize } from "@persagy-web/draw";
+import { SGraphItem, STextOrigin, SLineStyle, SAnchorItem } from "@persagy-web/graph/";
 import { SItemStatus } from "@persagy-web/big";
+import { SGraphEdit } from ".."
+import { Marker } from "../type/Marker";
+import { ItemOrder } from '@persagy-web/big/lib';
 
 /**
  * 文本编辑类
  *
  * @author  韩耀龙(han_yao_long@163.com)
  */
-export class TextEdit extends SObjectItem {
+export class SBaseTextEdit extends SGraphEdit {
     /////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //属性
+    /**编辑相关操作的数据 */
+    data: Marker
+    /** 起始锚点  */
+    startItem: SGraphItem | null = null;
+    /** 结束锚点  */
+    endItem: SGraphItem | null = null;
     /**编辑状态 */
     protected _status: SItemStatus = SItemStatus.Normal;
     get status(): SItemStatus {
         return this._status;
-    }
+    } //Get status
     set status(value: SItemStatus) {
         const oldStatus = this._status;
         const newStatus = value;
@@ -49,7 +56,7 @@ export class TextEdit extends SObjectItem {
         //状态变更触发事件
         this.$emit('StatusChange', oldStatus, newStatus)
         this.update();
-    }
+    } //Set status
     /** 记录painter */
     private _painter: SPainter | null = null;
 
@@ -57,87 +64,136 @@ export class TextEdit extends SObjectItem {
     private _text: string = "";
     get text(): string {
         return this._text;
-    }
+    } //Get text
     set text(v: string) {
         this._text = v;
         this._textArr = this.text.split(/\n/g);
         this.drawFormatText();
         this.update();
-    }
+    } //Set text
 
     /** 切割后的文本数组 */
     private _textArr: string[] = [];
+    /** 锚点list  */
+    anchorList: SAnchorItem[] = [];
+    /** 宽度  */
+    private _width: number = 64;
+    get width(): number {
+        return this._width;
+    } //Get width
+    set width(v: number) {
+        if (v > 0) {
+            if (v != this._width) {
+                let w = this._width;
+                this._width = v;
+                this.onResize(
+                    new SSize(w, this._height),
+                    new SSize(this._width, this._height)
+                );
+            }
+        }
+    } //Set width
+
+    /** 高度  */
+    private _height: number = 64;
+    get height(): number {
+        return this._height;
+    } //Get height
+    set height(v: number) {
+        if (v > 0) {
+            if (v != this._height) {
+                let h = this._height;
+                this._height = v;
+                this.onResize(
+                    new SSize(this._width, h),
+                    new SSize(this._width, this._height)
+                );
+            }
+        }
+    } //Set height
+
+    /** 原点  */
+    origin = new SPoint();
+
+    /**
+     * 宽高发发生变化
+     *
+     * @param   oldSize 改之前的大小
+     * @param   newSize 改之后大小
+     * */
+    protected onResize(oldSize: SSize, newSize: SSize) { } // Function onResize()
 
     /** 文本颜色 */
     private _color: SColor = new SColor("#333333");
     get color(): SColor {
         return this._color;
-    }
+    } //Get color
     set color(v: SColor) {
         this._color = v;
         this.update();
-    }
+    } //Set color
 
     /** 字体 */
-    private _font: SFont;
+    private _font: SFont = new SFont("sans-serif", 12);
     get font(): SFont {
         return this._font;
-    }
+    } //Get font
     set font(v: SFont) {
         this._font = v;
         this.drawFormatText();
         this.update();
-    }
+    } //Set font
 
     /** 背景色 */
     private _backgroundColor: SColor = SColor.Transparent;
     get backgroundColor(): SColor {
         return this._backgroundColor;
-    }
+    } //Get backgroundColor
     set backgroundColor(v: SColor) {
         this._backgroundColor = v;
         this.update();
-    }
+    } //Set backgroundColor
 
     /** 边框色 */
     private _strokeColor: SColor = SColor.Transparent;
     get strokeColor(): SColor {
         return this._strokeColor;
-    }
+    } //Get strokeColor
     set strokeColor(v: SColor) {
         this._strokeColor = v;
+        console.log(this._strokeColor)
         this.update();
-    }
+    } //Set strokeColor
 
     /** 边框宽度 */
     private _lineWidth: number = 1;
     get lineWidth(): number {
         return this._lineWidth;
-    }
+    } //Get lineWidth
     set lineWidth(v: number) {
         this._lineWidth = v;
         this.update();
-    }
+    } //Set lineWidth
 
     /** 边框样式    */
     private _borderStyle: SLineStyle = SLineStyle.None;
     get borderStyle(): SLineStyle {
         return this._borderStyle;
-    }
+    } //Get borderStyle
     set borderStyle(v: SLineStyle) {
         this._borderStyle = v;
         this.update();
-    }
+    } //Set borderStyle
 
     /** 原点位置    */
     private _originPosition: STextOrigin = STextOrigin.LeftTop;
     get originPosition(): STextOrigin {
         return this._originPosition;
-    }
+    } //Get originPosition
     set originPosition(v: STextOrigin) {
         this._originPosition = v;
         this.update();
-    }
+    } //Set originPosition
 
     /** 文本绘制最大宽 */
     maxWidth: number | undefined = undefined;
@@ -145,20 +201,49 @@ export class TextEdit extends SObjectItem {
     /**
      * 构造函数
      *
-     * @param parent      指向父Item
-     * @param str         文本内容
+     * @param   parent      指向父Item
+     * @param   str         文本内容
      */
-    constructor(parent: SGraphItem | null, str: string = "") {
+    constructor(parent: SGraphItem | null, data: Marker) {
         super(parent);
-        this._text = str;
-        this._font = new SFont("sans-serif", 12);
-        this.height = 12;
+        this.showSelect = false;
+        this.zOrder = ItemOrder.textOrder;
+        this.isTransform = false;
+        this.data = data;
+        this.name = data.name;
+        this.moveTo(data.pos.x, data.pos.y);
+        if (data.size) {
+            this.width = data.size.width;
+            this.height = data.size.height;
+        }
+        if (data.style && data.style.default) {
+            // 高度
+            if (data.style.default.zorder) {
+                this.zOrder = data.style.default.zorder;
+            }
+            // 文本
+            if (data.style.default.text) {
+                this.text = data.style.default.text;
+            }
+            // 文本颜色
+            if (data.style.default.strokeColor) {
+                this.strokeColor = new SColor(data.style.default.strokeColor);
+            }
+            // 字体大小
+            if (data.style.default.font) {
+                this.font = new SFont("sans-serif", data.style.default.font);
+            }
+            // 背景色
+            if (data.style.default.backgroundColor) {
+                this.backgroundColor = new SColor(data.style.default.backgroundColor);
+            }
+        }
     } // Constructor
 
     /**
      * 对象边界区域
      *
-     * @return 边界区域
+     * @return  边界区域
      */
     boundingRect(): SRect {
         return new SRect(
@@ -172,9 +257,9 @@ export class TextEdit extends SObjectItem {
     /**
      * 移动后处理所有坐标,并肩原点置为场景原点
      *
-     * @param x   x坐标
-     * @param y   y坐标
-     */
+     * @param   x   x坐标
+     * @param   y   y坐标
+     * */
     moveToOrigin(x: number, y: number): void {
         this.moveTo(this.x + x, this.y + y);
     } // Function moveToOrigin()
@@ -236,7 +321,7 @@ export class TextEdit extends SObjectItem {
             this.width = textMaxWidth;
             this.height = fontSize * 1.25 * this._textArr.length + fontSize / 8;
             // 设置原点位置(默认左上角)
-            if (this.originPosition == STextOrigin.Center) {
+            if (this.originPosition == STextOrigin.entrum) {
                 this.origin = new SPoint(this.width / 2, this.height / 2);
             }
             this._painter.restore();
@@ -244,9 +329,30 @@ export class TextEdit extends SObjectItem {
     } // Function drawFormatText()
 
     /**
+     * 返回对象储存的相关数据
+     *
+     * @return	formData
+     */
+    toData(): any {
+        if (this.data.size) {
+            this.data.size.width = this.width
+            this.data.size.height = this.height;
+        }
+
+        this.data.pos.x = this.pos.x;
+        this.data.pos.y = this.pos.y;
+        this.data.style.default.zorder = this.zOrder;
+        this.data.style.default.text = this.text;
+        this.data.style.default.strokeColor = this.strokeColor.value;
+        this.data.style.default.font = this.font.size;
+        this.data.style.default.backgroundColor = this.backgroundColor.value;
+        return this.data
+    } // Function toData()
+
+    /**
      * Item绘制操作
      *
-     * @param painter      绘画类
+     * @param   painter      绘画类
      */
     onDraw(painter: SPainter): void {
         if (!(this._painter instanceof SPainter)) {
@@ -255,4 +361,4 @@ export class TextEdit extends SObjectItem {
         }
         this.drawShowText(painter);
     } // Function onDraw()
-} // Class STextItem
+} // Class STextItem

+ 348 - 0
persagy-web-edit/src/items/SBaseTriangleEdit.ts

@@ -0,0 +1,348 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .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 SBaseTriangleEdit extends SGraphEdit {
+  /** 是否绘制完成  */
+  _status: SItemStatus = SItemStatus.Normal;
+  get status(): SItemStatus {
+    return this._status;
+  }
+  set status(v: SItemStatus) {
+    this._status = v;
+    this.undoStack.clear();
+    this.update();
+  }
+  /**编辑相关操作的数据 */
+  data: Marker
+  /** 矩形两个对角 */
+  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();
+  // 绘制三角形的点数组
+  private pointList: SPoint[] = [];
+  /** 线条颜色    */
+  _strokeColor: SColor = SColor.Black;
+  get strokeColor(): SColor {
+    return this._strokeColor;
+  }
+  set strokeColor(v: SColor) {
+    this._strokeColor = v;
+    this.update();
+  }
+  /** 填充色 */
+  _fillColor: SColor = new SColor("#2196f3");
+  get fillColor(): SColor {
+    return this._fillColor;
+  }
+  set fillColor(v: SColor) {
+    this._fillColor = v;
+    this.update();
+  }
+  /** 边框样式 */
+  _lineStyle: SLineStyle = SLineStyle.Solid;
+  get lineStyle(): SLineStyle {
+    return this._lineStyle;
+  }
+  set lineStyle(v: SLineStyle) {
+    this._lineStyle = v;
+    this.update();
+  }
+  /** 线条宽度    */
+  _lineWidth: number = 1;
+  get lineWidth(): number {
+    return this._lineWidth;
+  }
+  set lineWidth(v: number) {
+    this._lineWidth = v;
+    this.update();
+  }
+  /** 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 && 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
+
+  /**
+   * 大小改变
+  */
+  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()
+  }
+
+  /**
+     * 鼠标按下事件
+     *
+     * @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	boolean
+     */
+  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)
+      this.calTriangel()
+    }
+  } // Function calRect
+
+  /**
+   * 计算绘制图形的3个点
+  */
+  private calTriangel(): void {
+    this.pointList = [];
+    this.pointList.push(new SPoint(this._leftTop.x, this._rightBottom.y))
+    this.pointList.push(new SPoint((this._leftTop.x + this._rightBottom.x) / 2, this._leftTop.y))
+    this.pointList.push(new SPoint(this._rightBottom.x, this._rightBottom.y))
+  } // 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()
+
+  /**
+   * Item绘制操作
+   *
+   * @param   painter painter对象
+   */
+  onDraw(painter: SPainter): void {
+    if (this.line.length == 2) {
+      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.drawPolygon(this.pointList);
+    }
+  } // Function onDraw()
+} // Class STriangleEdit

+ 12 - 7
persagy-web-big/src/enums/SLineType.ts

@@ -17,20 +17,25 @@
  *          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.  博锐尚格科技股份有限公司
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
  *        ~8888'
  *        .!88~                                                                     All rights reserved.
  *
  * *********************************************************************************************************************
  */
 
+
+
+import { Point } from "@persagy-web/big/lib/types/Point";
+
 /**
- * 线类型
+ * 锚点item接口
  *
  * @author  张宇
- * @deprecated 万达
  */
-export enum SLineType {
-    /** 直线 */
-    Line
-} // Enum SLineType
+export interface Anchor {
+    /** 锚点ID */
+    ID: string;
+    /** 锚点的坐标  */
+    Pos: Point;
+} // Interface Anchor

+ 13 - 11
persagy-web-big/src/enums/SMarkerType.ts

@@ -17,24 +17,26 @@
  *          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.  博锐尚格科技股份有限公司
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
  *        ~8888'
  *        .!88~                                                                     All rights reserved.
  *
  * *********************************************************************************************************************
  */
 
+
+
+import { Legend } from "./Legend";
+import { Marker } from "./Marker";
+import { Relation } from "./Relation";
+
 /**
- * 标识对象类型
+ * 系统图数据接口
  *
  * @author  张宇
- * @deprecated 万达
  */
-export enum SMarkerType {
-    /** 图标 */
-    Image,
-    /** 线类型 */
-    Line,
-    /** 文本类型 */
-    Text
-} // Enum SMarkerType
+export interface ElementData {
+    Nodes: Legend[];
+    Markers: Marker[];
+    Relations: Relation[];
+} // Interface ElementData

+ 34 - 28
persagy-web-big/src/types/topology/Node.ts

@@ -17,47 +17,53 @@
  *          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.  博锐尚格科技股份有限公司
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
  *        ~8888'
  *        .!88~                                                                     All rights reserved.
  *
  * *********************************************************************************************************************
  */
 
-import { Point } from "@persagy-web/graph/lib";
-import { Size } from "../Size";
+
 import { Anchor } from "./Anchor";
+import { Point } from "@persagy-web/big/lib/types/Point";
+import { Size } from "@persagy-web/big/lib/types/Size";
+import { SPoint } from '@persagy-web/draw/lib';
 
 /**
- * 图例节点
+ * 图例节点接口
  *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
+ * @author  张宇
  */
-export interface Node {
+export interface Legend {
     /** ID */
-    id: string;
-    /** 名称 */
+    iD: string;
+    /** 名称  */
     name: string;
-    /** 图例类型 */
+    /** 返回工程信息化对象 ID 列表 */
+    attachObjectIds?: any[];
+    /** 图标,区域类型  */
     graphElementType: string;
-    /** 对应的图元 ID */
+    /** 对应的图例ID  */
     graphElementId: string;
-    /** 图例数量 */
-    num: number;
-    /** 节点类型 */
-    type: string;
-    /** 位置 */
+    /** 图例数量  */
+    num?: number;
+    /** 位置  */
     pos: Point;
-    /** 缩放 */
-    scale: Point;
-    /** 旋转 */
-    rotate: Point;
-    /** 大小 */
-    size: Size;
-    /** 锚点 */
-    anchorList: Anchor[];
-    /** 轮廓线 */
-    outLine: Point[][];
-    /** 由应用自己定义 */
-    properties: any;
-} // interface Node
+    /** item类型 */
+    type: string
+    /** 缩放  */
+    scale?: Point;
+    /** 旋转  */
+    rolate?: Point;
+    /** 大小  */
+    size?: Size;
+    /** 锚点List  */
+    anchorList?: Anchor[];
+    /** 轮廓线  */
+    outLine?: Point[] | SPoint[];
+    /** 由应用自己定义  */
+    properties?: any;
+     /** zone 区分防火分区和石材铺装  */
+    subType?:string
+} // Interface Legend

+ 20 - 18
persagy-web-big/src/types/topology/MarkerTopo.ts

@@ -17,36 +17,38 @@
  *          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.  博锐尚格科技股份有限公司
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
  *        ~8888'
  *        .!88~                                                                     All rights reserved.
  *
  * *********************************************************************************************************************
  */
 
-import { Point } from "@persagy-web/graph";
-import { Size } from "../Size";
+import { Point } from "@persagy-web/graph/lib/types/Point";
+import { Size } from "@persagy-web/big/lib/types/Size";
 
 /**
  * 标识对象接口
  *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
+ * @author  张宇
  */
-export interface MarkerTopo {
+export interface Marker {
     /** ID */
-    id: string;
-    /** 名称 */
+    iD?: string;
+    /** 名称  */
     name: string;
-    /** 类型 */
+    /** 图标(Image),线类型(Line) */
     type: string;
-    /** 位置 */
+    /** 位置  */
     pos: Point;
-    /** 缩放 */
-    scale: Point;
-    /** 旋转 */
-    rotate: Point;
-    /** 大小 */
-    size: Size;
-    /** 由应用自己定义 */
-    properties: any;
-} // interface MarkerTo
+    /** 缩放  */
+    scale?: Point;
+    /** 旋转  */
+    rolate?: Point;
+    /** 大小  */
+    size?: Size;
+    /** 绘制时得数据以及样式 */
+    style:any;
+    /** 由应用自己定义  */
+    properties?: any;
+} // Interface Marker

+ 22 - 20
persagy-web-big/src/types/topology/Relation.ts

@@ -17,42 +17,44 @@
  *          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.  博锐尚格科技股份有限公司
+ *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
  *        ~8888'
  *        .!88~                                                                     All rights reserved.
  *
  * *********************************************************************************************************************
  */
 
-import { SRelationDir } from "../../enums/SRelationDir";
-import { Point } from "@persagy-web/graph/lib";
+
+
+import { SRelationDir } from "@persagy-web/big/lib/enums/SRelationDir";
+import { Point } from "@persagy-web/big/lib/types/Point";
 
 /**
- * 对象关系
+ * 管线对象关系接口
  *
- * @author 郝建龙 <haojianlong@sagacloud.cn>
+ * @author  张宇
  */
 export interface Relation {
     /** ID */
-    id: string;
+    iD: string;
     /** 名称 */
     name: string;
-    /** 对应的图ID */
+    /** 对应的图ID */
     graphElementId: string;
-    /** 关联节点 1_id */
-    node1Id: string;
-    /** 关联节点 2_id */
-    node2Id: string;
-    /** 关联锚点 1_id */
-    anchor1Id: string;
-    /** 关联锚点 2_id */
-    anchor2ID: string;
-    /** 方向 */
-    dir: SRelationDir;
-    /** 直线(Line),水平垂直 */
+    /** 关联节点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[];
     /** 线的绘图样式 */
-    style: any;
-} // interface Relation
+    properties?: any;
+} // Interface Relation