Bladeren bron

修改引用等问题

haojianlong 4 jaren geleden
bovenliggende
commit
2c0dd3aa3f
55 gewijzigde bestanden met toevoegingen van 453 en 1962 verwijderingen
  1. 2 2
      persagy-web-big-edit/package.json
  2. 16 11
      persagy-web-big-edit/src/BigEditFactory.ts
  3. 88 80
      persagy-web-big-edit/src/SBaseEditScene.ts
  4. 2 2
      persagy-web-big-edit/src/index.ts
  5. 7 5
      persagy-web-big-edit/src/items/SBaseArrow.ts
  6. 114 115
      persagy-web-big-edit/src/items/SBaseArrowPolyEdit.ts
  7. 66 58
      persagy-web-big-edit/src/items/SBaseEquipment.ts
  8. 0 68
      persagy-web-big-edit/src/items/SBaseExpainEdit.ts
  9. 31 12
      persagy-web-edit/src/commands/SGraphCommand.ts
  10. 58 59
      persagy-web-big-edit/src/items/SBaseObjectRelation.ts
  11. 1 2
      persagy-web-big-edit/src/items/SBasePipe.ts
  12. 0 1
      persagy-web-big-edit/src/parsers/bigEditParse.ts
  13. 0 39
      persagy-web-big-edit/src/types/Anchor.ts
  14. 0 43
      persagy-web-big-edit/src/types/ElementData.ts
  15. 0 68
      persagy-web-big-edit/src/types/Legend.ts
  16. 0 58
      persagy-web-big-edit/src/types/Marker.ts
  17. 0 64
      persagy-web-big-edit/src/types/Relation.ts
  18. 12 66
      persagy-web-big-edit/src/until.ts
  19. 1 1
      persagy-web-big/package.json
  20. 6 0
      persagy-web-big/src/index.ts
  21. 0 39
      persagy-web-big/src/types/Anchor.ts
  22. 2 2
      persagy-web-big/src/types/Legend.ts
  23. 8 5
      persagy-web-big/src/utils/svgTobase64.ts
  24. 13 10
      persagy-web-edit/src/type/Anchor.ts
  25. 2 2
      persagy-web-edit/package.json
  26. 0 2
      persagy-web-edit/src/SGraphEdit.ts
  27. 0 85
      persagy-web-edit/src/commands/SGraphAddCommand.ts
  28. 0 112
      persagy-web-edit/src/commands/SGraphMoveCommand.ts
  29. 0 116
      persagy-web-edit/src/commands/SGraphPointListDelete.ts
  30. 0 114
      persagy-web-edit/src/commands/SGraphPointListInsert.ts
  31. 0 107
      persagy-web-edit/src/commands/SGraphPointListUpdate.ts
  32. 0 102
      persagy-web-edit/src/commands/SGraphPropertyCommand.ts
  33. 0 49
      persagy-web-edit/src/enums/SGraphLayoutType.ts
  34. 0 39
      persagy-web-edit/src/enums/SImageShowType.ts
  35. 0 41
      persagy-web-edit/src/enums/SLineStyle.ts
  36. 0 41
      persagy-web-edit/src/enums/SOrderSetType.ts
  37. 0 37
      persagy-web-edit/src/enums/STextOrigin.ts
  38. 2 14
      persagy-web-edit/src/index.ts
  39. 1 2
      persagy-web-edit/src/items/SBaseArrowEdit.ts
  40. 1 1
      persagy-web-edit/src/items/SBaseCircleEdit.ts
  41. 2 2
      persagy-web-edit/src/items/SBaseCirclePolylineEdit.ts
  42. 1 1
      persagy-web-edit/src/items/SBaseIconTextEdit.ts
  43. 10 6
      persagy-web-edit/src/items/SBaseImageEdit.ts
  44. 1 1
      persagy-web-edit/src/items/SBaseLineEdit.ts
  45. 1 1
      persagy-web-edit/src/items/SBaseMaskEdit.ts
  46. 1 1
      persagy-web-edit/src/items/SBasePolygonEdit.ts
  47. 1 1
      persagy-web-edit/src/items/SBasePolylineEdit.ts
  48. 1 1
      persagy-web-edit/src/items/SBaseRectEdit.ts
  49. 1 1
      persagy-web-edit/src/items/SBaseTextEdit.ts
  50. 1 1
      persagy-web-edit/src/items/SBaseTriangleEdit.ts
  51. 0 43
      persagy-web-edit/src/type/ElementData.ts
  52. 0 72
      persagy-web-edit/src/type/Legend.ts
  53. 0 58
      persagy-web-edit/src/type/Marker.ts
  54. 0 37
      persagy-web-edit/src/type/Point.ts
  55. 0 62
      persagy-web-edit/src/type/Relation.ts

+ 2 - 2
persagy-web-big-edit/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@persagy-web/big-edit",
-    "version": "2.2.25",
+    "version": "2.2.26",
     "description": "博锐尚格二维图形编辑器。",
     "main": "lib/index.js",
     "types": "lib/index.d.js",
@@ -40,7 +40,7 @@
         "typescript": "^3.5.3"
     },
     "dependencies": {
-        "@persagy-web/edit": "2.2.24",
+        "@persagy-web/edit": "2.2.25",
         "@types/uuid": "^8.0.0",
         "crypto-js": "^4.0.0",
         "axios": "^0.20.0"

+ 16 - 11
persagy-web-big-edit/src/BigEditFactory.ts

@@ -32,8 +32,13 @@ import {
     SBaseRectEdit,
     SBaseTextEdit
 } from "@persagy-web/edit";
-import { Marker, SBaseArrow, SBaseExpainEdit, SBaseArrowPolyEdit, SBaseEquipment, SBasePipe, Legend, Relation } from "./"
-import { SItemFactory } from "@persagy-web/big"
+import { SItemFactory } from "@persagy-web/big";
+import { SBaseExplainEdit } from "./items/SBaseExplainEdit";
+import { SBaseArrow } from "./items/SBaseArrow";
+import { SBaseArrowPolyEdit } from "./items/SBaseArrowPolyEdit";
+import { SBaseEquipment } from "./items/SBaseEquipment";
+import { SBasePipe } from "./items/SBasePipe";
+import { Relation, Marker, Legend } from "@persagy-web/big/lib";
 
 /**
  * item 创建工厂
@@ -45,7 +50,7 @@ export class BigEditFactory extends SItemFactory {
      * 构造函数
      */
     constructor() {
-        super()
+        super();
     }
 
     /**
@@ -104,8 +109,8 @@ export class BigEditFactory extends SItemFactory {
      * @param data     数据
      * @return 注释实例
      */
-    createBaseExpainEdit(data: Marker): SBaseExpainEdit {
-        return new SBaseExpainEdit(null, data);
+    createBaseExpainEdit(data: Marker): SBaseExplainEdit {
+        return new SBaseExplainEdit(null, data);
     }
 
     /**
@@ -149,12 +154,12 @@ export class BigEditFactory extends SItemFactory {
     }
 
     /**
-      * 创建基础管道
-      *
-      * @param data     数据
-      * @return 基础管道实例
-      */
+     * 创建基础管道
+     *
+     * @param data     数据
+     * @return 基础管道实例
+     */
     createBasePipe(data: Relation): SBasePipe {
         return new SBasePipe(null, data);
     }
-}
+}

+ 88 - 80
persagy-web-big-edit/src/SBaseEditScene.ts

@@ -24,15 +24,22 @@
  * *********************************************************************************************************************
  */
 
-import { SGraphDeleteListCommand, SGraphEditScene, SGraphEdit } from "@persagy-web/edit"
+import {
+    SGraphDeleteListCommand,
+    SGraphEditScene,
+    SGraphEdit
+} from "@persagy-web/edit";
 import { SMouseEvent } from "@persagy-web/base/lib";
-import { SArrowStyleType, SPoint, SRect } from '@persagy-web/draw';
-import { SItemStatus, SRectSelectItem } from '@persagy-web/big/lib';
-import { SGraphItem, SGraphSelectContainer, SOrderSetType } from "@persagy-web/graph/lib/";
-import { uuid } from "./until";
-import { SBaseArrow, SBaseEquipment, SBaseExpainEdit, SBasePipe } from "./"
-import { SBaseArrowPolyEdit } from './items/SBaseArrowPolyEdit';
-import { SGraphAddListCommand } from '@persagy-web/edit/lib/commands/SGraphAddListCommand';
+import { SArrowStyleType, SPoint, SRect } from "@persagy-web/draw";
+import { SItemStatus, SRectSelectItem } from "@persagy-web/big/lib";
+import {
+    SGraphItem,
+    SGraphSelectContainer,
+    SOrderSetType
+} from "@persagy-web/graph/lib/";
+import { SBaseArrow, SBaseExplainEdit, SBasePipe } from "./";
+import { SBaseArrowPolyEdit } from "./items/SBaseArrowPolyEdit";
+import { SGraphAddListCommand } from "@persagy-web/edit/lib/commands/SGraphAddListCommand";
 
 /**
  * big-edit 场景
@@ -41,9 +48,8 @@ import { SGraphAddListCommand } from '@persagy-web/edit/lib/commands/SGraphAddLi
  */
 export class SBaseEditScene extends SGraphEditScene {
     /** 图例节点 */
-    Nodes: any = [];  // 图例节点,所有与工程信息化相关的图例(图标类型与区域)
-    /** 图例节点 */  // 与工程信息无关的标识对象(增加文本注释,图上的图片说明)
-    Markers: any = [];
+    Nodes: any = []; // 图例节点,所有与工程信息化相关的图例(图标类型与区域) // 与工程信息无关的标识对象(增加文本注释,图上的图片说明)
+    /** 图例节点 */ Markers: any = [];
     /** 管线对象 */
     Relations: any = [];
     /** 复制的对象 */
@@ -56,7 +62,7 @@ export class SBaseEditScene extends SGraphEditScene {
      *
      */
     constructor() {
-        super()
+        super();
     }
 
     /**
@@ -65,29 +71,29 @@ export class SBaseEditScene extends SGraphEditScene {
      * @param event   鼠标事件参数
      * @return 新增的基础类注释
      */
-    addExplainItem(event: SMouseEvent): SBaseExpainEdit {
+    addExplainItem(event: SMouseEvent): SBaseExplainEdit {
         const data = {
             /** 名称 */
-            name: '基础注释文本',
+            name: "基础注释文本",
             /** 图标 */
             type: "Text",
             /** 位置 */
             pos: { x: event.x, y: event.y },
             /** 由应用自己定义 */
             properties: {
-                type: "BaseExplain",
+                type: "BaseExplain"
             },
             style: {
                 default: {
-                    text: '请在右侧属性栏输入文字!',
+                    text: "请在右侧属性栏输入文字!",
                     color: "#646c73",
                     font: 14,
-                    backgroundcolor: "#f7f9facc",
+                    backgroundcolor: "#f7f9facc"
                 }
             }
         };
 
-        const item = new SBaseExpainEdit(null, data);
+        const item = new SBaseExplainEdit(null, data);
         item.moveTo(event.x, event.y);
         item.selectable = true;
         item.moveable = true;
@@ -106,17 +112,17 @@ export class SBaseEditScene extends SGraphEditScene {
      */
     addPolyLineArrow(event: SMouseEvent): SBaseArrow {
         const data = {
-            name: '基础箭头',
+            name: "基础箭头",
             type: "Arrow",
             pos: { x: 0, y: 0 },
             properties: {
-                type: "BaseArrow",
+                type: "BaseArrow"
             },
             style: {
                 outLine: [{ x: event.x, y: event.y }],
-                begin: SArrowStyleType.None,  //开端箭头样式
-                end: SArrowStyleType.None,    //结尾箭头样式
-                isMove: true,                 //是否可以移动
+                begin: SArrowStyleType.None, //开端箭头样式
+                end: SArrowStyleType.None, //结尾箭头样式
+                isMove: true, //是否可以移动
                 default: {}
             }
         };
@@ -144,7 +150,7 @@ export class SBaseEditScene extends SGraphEditScene {
     addPolygonArrow(event: SMouseEvent): SBaseArrowPolyEdit {
         const data = {
             /** 名称 */
-            name: '多边形箭头',
+            name: "多边形箭头",
             /** 图标(Image),线类型(Line) */
             type: "ArrowPolygon",
             /** 缩放比例(Image),线类型(Line) */
@@ -155,12 +161,11 @@ export class SBaseEditScene extends SGraphEditScene {
             pos: { x: 0, y: 0 },
             /** 由应用自己定义 */
             properties: {
-                type: "BaseArrowPolygon"           // 自定义类型用于区分mark与node
+                type: "BaseArrowPolygon" // 自定义类型用于区分mark与node
             },
             style: {
                 line: [{ x: event.x, y: event.y }],
-                default: {
-                }
+                default: {}
             }
         };
         const item = new SBaseArrowPolyEdit(null, data);
@@ -239,23 +244,23 @@ export class SBaseEditScene extends SGraphEditScene {
 
         // 锚点时否存在
         if (anc) {
-            const p = anc.mapToScene(0, 0)
+            const p = anc.mapToScene(0, 0);
             anc.isConnected = true;
             event.x = p.x;
             event.y = p.y;
-        };
+        }
 
         const data = {
             name: legendObj.name,
             graphElementId: legendObj.id,
-            lineType: '',
-            node1Id: '',
-            node2Id: '',
-            anchor1Id: '',
-            anchor2Id: '',
+            lineType: "",
+            node1Id: "",
+            node2Id: "",
+            anchor1Id: "",
+            anchor2Id: "",
             pointList: [{ x: event.x, y: event.y }],
             properties: {
-                type: "BasePipe",
+                type: "BasePipe"
             },
             style: {
                 default: {
@@ -274,9 +279,9 @@ export class SBaseEditScene extends SGraphEditScene {
 
         // 锚点事件绑定
         if (anc) {
-            anc.parent?.connect('changePos', item, item.changePos)
+            anc.parent?.connect("changePos", item, item.changePos);
             item.anchor1Id = anc.id;
-            item.node1Id = anc.parent ? anc.parent.nodeId : '';
+            item.node1Id = anc.parent ? anc.parent.nodeId : "";
         }
 
         item.connect("finishCreated", this, this.finishCreated);
@@ -292,7 +297,7 @@ export class SBaseEditScene extends SGraphEditScene {
      */
     redo(): void {
         if (this.grabItem && this.grabItem instanceof SGraphEdit) {
-            this.grabItem.redo()
+            this.grabItem.redo();
         } else {
             this.undoStack.redo();
         }
@@ -303,7 +308,7 @@ export class SBaseEditScene extends SGraphEditScene {
      */
     undo(): void {
         if (this.grabItem && this.grabItem instanceof SGraphEdit) {
-            this.grabItem.undo()
+            this.grabItem.undo();
         } else {
             this.undoStack.undo();
         }
@@ -315,26 +320,28 @@ export class SBaseEditScene extends SGraphEditScene {
      * @return 删除的图例
      */
     deleteItem(itemArr: SGraphItem[] = []): any {
-        let itemList = null;
+        let itemList: SGraphItem[] = [];
         if (itemArr && itemArr.length && itemArr[0]) {
-            itemList = [...itemArr]
+            itemList = [...itemArr];
         } else {
             if (this.selectContainer.count == 0) {
-                return []
+                return [];
             }
             itemList = this.selectContainer.itemList;
-            this.undoStack.push(new SGraphDeleteListCommand(this, [...itemList]))
+            this.undoStack.push(
+                new SGraphDeleteListCommand(this, [...itemList])
+            );
         }
         // 推入 undo/redo 栈
         itemList.forEach((element: any) => {
-            this.removeItem(element)
+            this.removeItem(element);
         });
 
         // view 必须存在
         if (this.view) {
-            this.view.update()
+            this.view.update();
         }
-        return itemList
+        return itemList;
     }
 
     /**
@@ -353,11 +360,10 @@ export class SBaseEditScene extends SGraphEditScene {
      * @param ctrl  是否点击ctrl
      */
     groupSelect(ctrl: boolean) {
-
         // 判断当前图例是否为选中框
         if (this.grabItem instanceof SRectSelectItem) {
             const rect = this.grabItem.boundingRect();
-            this.arrToSelect(this.root.children, rect)
+            this.arrToSelect(this.root.children, rect);
         }
     }
 
@@ -375,15 +381,15 @@ export class SBaseEditScene extends SGraphEditScene {
                 if (!(t instanceof SGraphSelectContainer) && t.parent) {
                     if (t.visible) {
                         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)
+                        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)
+                            this.selectContainer.toggleItem(t);
                         }
                     }
                 }
-            })
+            });
         }
     }
 
@@ -415,7 +421,7 @@ export class SBaseEditScene extends SGraphEditScene {
                 this.grabItem = null;
                 // view 不为空
                 if (this.view) {
-                    this.view.update()
+                    this.view.update();
                 }
 
                 return true;
@@ -424,7 +430,7 @@ export class SBaseEditScene extends SGraphEditScene {
             return this.grabItem.onMouseUp(event);
         }
 
-        return super.onMouseUp(event)
+        return super.onMouseUp(event);
     }
 
     /**
@@ -440,7 +446,7 @@ export class SBaseEditScene extends SGraphEditScene {
                 delete item.id;
                 delete item.graphId;
                 delete item.markerId;
-                return item
+                return item;
             });
 
             // 删除对应得id
@@ -448,7 +454,7 @@ export class SBaseEditScene extends SGraphEditScene {
                 delete item.id;
                 delete item.graphId;
                 delete item.markerId;
-                return item
+                return item;
             });
 
             // 删除对应得id
@@ -456,26 +462,24 @@ export class SBaseEditScene extends SGraphEditScene {
                 delete item.id;
                 delete item.graphId;
                 delete item.markerId;
-                return item
+                return item;
             });
 
-            this.copyString = itemList
+            this.copyString = itemList;
             // 获取input dom
-            const input = document.createElement('input');
-            input.setAttribute('id', 'COPYINPUT')
-            input.value = JSON.stringify(this.copyString)
+            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';
+            input.select();
+            document.execCommand("copy");
+            input.style.display = "none";
             console.log(input.value, Date.now());
-            document.body.removeChild(input)
+            document.body.removeChild(input);
         }
     }
 
-
-
     /**
      * 添加多个item命令
      *
@@ -491,7 +495,7 @@ export class SBaseEditScene extends SGraphEditScene {
      * @param type   设置类型
      */
     setOrder(type: string) {
-        this.selectContainer.setOrder(SOrderSetType[type])
+        this.selectContainer.setOrder(SOrderSetType[type]);
     }
 
     /**
@@ -501,7 +505,7 @@ export class SBaseEditScene extends SGraphEditScene {
         if (this.grabItem instanceof SBasePipe) {
             const anc = this.clickIsAnchor(event);
             if (anc) {
-                const p = anc.mapToScene(0, 0)
+                const p = anc.mapToScene(0, 0);
                 anc.isConnected = true;
                 event.x = p.x;
                 event.y = p.y;
@@ -511,19 +515,24 @@ export class SBaseEditScene extends SGraphEditScene {
                     // pointList 长度不能为空
                     if (this.grabItem.pointList.length) {
                         this.grabItem.endAnchor = anc;
-                        anc.parent?.connect('changePos', this.grabItem, this.grabItem.changePos)
+                        anc.parent?.connect(
+                            "changePos",
+                            this.grabItem,
+                            this.grabItem.changePos
+                        );
                     }
 
-                    this.grabItem.anchor2Id = anc.id
-                    this.grabItem.node2Id = anc.parent.nodeId
-                    this.grabItem.onMouseDown(event)
+                    this.grabItem.anchor2Id = anc.id;
+                    this.grabItem.node2Id = anc.parent.nodeId;
+                    this.grabItem.onMouseDown(event);
                     this.grabItem.status = SItemStatus.Normal;
-                    this.finishCreated(this.grabItem)
-                    return
+                    this.finishCreated(this.grabItem);
+                    return;
                 }
+
             }
 
-            this.grabItem.onMouseDown(event)
+            this.grabItem.onMouseDown(event);
         }
     }
 
@@ -533,6 +542,5 @@ export class SBaseEditScene extends SGraphEditScene {
      * @param isAll    是否为全部item数据
      * @returns   返回保存的数据接口
      */
-    save(isAll: boolean = true): any {
-    }
-}
+    save(isAll: boolean = true): any {}
+}

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

@@ -25,7 +25,7 @@
  */
 
 import { SBaseEditScene } from "./SBaseEditScene"
-import { SBaseExpainEdit } from "./items/SBaseExpainEdit"
+import { SBaseExplainEdit } from "./items/SBaseExplainEdit"
 import { SBasePipe } from "./items/SBasePipe"
 import { SBaseArrow } from "./items/SBaseArrow"
 import { Anchor } from "./types/Anchor"
@@ -36,4 +36,4 @@ import { Relation } from "./types/Relation"
 import { BigEditFactory } from "./BigEditFactory"
 import { SBaseEquipment } from "./items/SBaseEquipment"
 import { SBaseArrowPolyEdit } from './items/SBaseArrowPolyEdit'
-export { SBaseArrow, SBasePipe, SBaseEquipment, BigEditFactory, Anchor, Legend, Marker, Relation, ElementData, SBaseEditScene, SBaseExpainEdit, SBaseArrowPolyEdit }
+export { SBaseArrow, SBasePipe, SBaseEquipment, BigEditFactory, Anchor, Legend, Marker, Relation, ElementData, SBaseEditScene, SBaseExplainEdit, SBaseArrowPolyEdit }

+ 7 - 5
persagy-web-big-edit/src/items/SBaseArrow.ts

@@ -27,8 +27,8 @@
 import { SPainter, SArrowStyleType } from "@persagy-web/draw/";
 import { SBasePolylineEdit } from "@persagy-web/edit";
 import { SGraphItem, SLineStyle } from "@persagy-web/graph/lib";
-import { Marker } from "./../types/Marker";
 import { SMouseEvent } from "@persagy-web/base/lib";
+import { Marker } from "@persagy-web/big";
 
 /**
  * 编辑箭头(折线)
@@ -67,8 +67,10 @@ export class SBaseArrow extends SBasePolylineEdit {
         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
+            this.begin = data.style.begin
+                ? data.style.begin
+                : SArrowStyleType.None;
+            this.end = data.style.end ? data.style.end : SArrowStyleType.None;
         }
     }
 
@@ -79,7 +81,7 @@ export class SBaseArrow extends SBasePolylineEdit {
      * @return 事件是否处理
      */
     onMouseDown(event: SMouseEvent): boolean {
-        super.onMouseDown(event)
+        super.onMouseDown(event);
         return true;
     }
 
@@ -132,4 +134,4 @@ export class SBaseArrow extends SBasePolylineEdit {
         this.data.style.end = this.end;
         return super.toData();
     }
-}
+}

+ 114 - 115
persagy-web-big-edit/src/items/SBaseArrowPolyEdit.ts

@@ -25,11 +25,10 @@
  */
 
 import { SMathUtil } from "@persagy-web/graph/lib/utils/SMathUtil";
-import { SColor, SLine, SPainter, SPoint } from '@persagy-web/draw/lib';
+import { SColor, SLine, SPainter, SPoint } from "@persagy-web/draw/lib";
 import { SBaseLineEdit } from "@persagy-web/edit";
-import { SItemStatus } from '@persagy-web/big/lib';
-import { Marker } from '..';
-import { SGraphItem } from '@persagy-web/graph/lib';
+import { SItemStatus, Marker } from "@persagy-web/big/lib";
+import { SGraphItem } from "@persagy-web/graph/lib";
 
 /**
  * 箭头编辑(多边形)
@@ -37,87 +36,87 @@ import { SGraphItem } from '@persagy-web/graph/lib';
  * @author  韩耀龙 <han_yao_long@163.com>
  */
 export class SBaseArrowPolyEdit extends SBaseLineEdit {
-	/** 多边形数组 */
-	pointList: SPoint[] = [];
-	/** 绘制时需要旋转的角度 */
-	private _ang: number = 0;
-	/** 箭头中间粗细 */
-	arrowWidth: number = 8;
+    /** 多边形数组 */
+    pointList: SPoint[] = [];
+    /** 绘制时需要旋转的角度 */
+    private _ang: number = 0;
+    /** 箭头中间粗细 */
+    arrowWidth: number = 8;
 
-	/** 是否为单向箭头 是-只绘制末端箭头 */
-	_isSingle: boolean = true;
-	get isSingle(): boolean {
-		return this._isSingle;
-	}
-	set isSingle(v: boolean) {
-		this._isSingle = v;
-		this.update();
-	}
+    /** 是否为单向箭头 是-只绘制末端箭头 */
+    _isSingle: boolean = true;
+    get isSingle(): boolean {
+        return this._isSingle;
+    }
+    set isSingle(v: boolean) {
+        this._isSingle = v;
+        this.update();
+    }
 
-	/**
-	 * 构造函数
-	 *
-	 * @param parent    指向父 Item
-	 * @param data      坐标集合|第一个点坐标
-	 */
-	constructor(parent: SGraphItem | null, data: Marker): void {
+    /**
+     * 构造函数
+     *
+     * @param parent    指向父 Item
+     * @param data      坐标集合|第一个点坐标
+     */
+    constructor(parent: SGraphItem | null, data: Marker) {
         super(parent, data);
         // 箭头宽度
         if (data?.style?.default?.arrowWidth) {
             this.arrowWidth = data.style.default.arrowWidth;
-		}
+        }
 
-		// 设置罗阔
-		this.pointChange();
-	}
+        // 设置罗阔
+        this.pointChange();
+    }
 
-	/**
-	 * 根据两个顶点生成多边形数组
-	 */
-	pointChange(): void {
-		// 轮廓箭头数组数量必须大于两位
-		if (this.line.length > 1) {
-			const line = new SLine(this.line[0], this.line[1]);
-			// 获取两点之间的距离
-			const dis = SMathUtil.pointDistance(
-				this.line[0].x,
-				this.line[0].y,
-				this.line[1].x,
-				this.line[1].y
-			);
+    /**
+     * 根据两个顶点生成多边形数组
+     */
+    pointChange(): void {
+        // 轮廓箭头数组数量必须大于两位
+        if (this.line.length > 1) {
+            const line = new SLine(this.line[0], this.line[1]);
+            // 获取两点之间的距离
+            const dis = SMathUtil.pointDistance(
+                this.line[0].x,
+                this.line[0].y,
+                this.line[1].x,
+                this.line[1].y
+            );
             // 根据dx dy 获取对应直线的角度
-			if (line.dx != 0) {
-				const tempFo = Math.atan(line.dy / line.dx);
-				this._ang = line.dx > 0 ? tempFo : tempFo + Math.PI;
-			} else {
-				this._ang = line.dy > 0 ? Math.PI / 2 : (3 * Math.PI) / 2;
-			}
+            if (line.dx != 0) {
+                const tempFo = Math.atan(line.dy / line.dx);
+                this._ang = line.dx > 0 ? tempFo : tempFo + Math.PI;
+            } else {
+                this._ang = line.dy > 0 ? Math.PI / 2 : (3 * Math.PI) / 2;
+            }
             // 根据是否是单箭头设置对应的轮廓
-			if (this.isSingle) {
-				this.pointList = [
-					new SPoint(0, this.arrowWidth / 2),
-					new SPoint(dis - this.arrowWidth, this.arrowWidth / 2),
-					new SPoint(dis - this.arrowWidth, this.arrowWidth),
-					new SPoint(dis, 0),
-					new SPoint(dis - this.arrowWidth, -this.arrowWidth),
-					new SPoint(dis - this.arrowWidth, -this.arrowWidth / 2),
-					new SPoint(0, -this.arrowWidth / 2)
-				];
-			} else {
-				this.pointList = [
-					new SPoint(0, 0),
-					new SPoint(this.arrowWidth, this.arrowWidth),
-					new SPoint(this.arrowWidth, this.arrowWidth / 2),
-					new SPoint(dis - this.arrowWidth, this.arrowWidth / 2),
-					new SPoint(dis - this.arrowWidth, this.arrowWidth),
-					new SPoint(dis, 0),
-					new SPoint(dis - this.arrowWidth, -this.arrowWidth),
-					new SPoint(dis - this.arrowWidth, -this.arrowWidth / 2),
-					new SPoint(this.arrowWidth, -this.arrowWidth / 2),
-					new SPoint(this.arrowWidth, -this.arrowWidth)
-				];
-			}
-		}
+            if (this.isSingle) {
+                this.pointList = [
+                    new SPoint(0, this.arrowWidth / 2),
+                    new SPoint(dis - this.arrowWidth, this.arrowWidth / 2),
+                    new SPoint(dis - this.arrowWidth, this.arrowWidth),
+                    new SPoint(dis, 0),
+                    new SPoint(dis - this.arrowWidth, -this.arrowWidth),
+                    new SPoint(dis - this.arrowWidth, -this.arrowWidth / 2),
+                    new SPoint(0, -this.arrowWidth / 2)
+                ];
+            } else {
+                this.pointList = [
+                    new SPoint(0, 0),
+                    new SPoint(this.arrowWidth, this.arrowWidth),
+                    new SPoint(this.arrowWidth, this.arrowWidth / 2),
+                    new SPoint(dis - this.arrowWidth, this.arrowWidth / 2),
+                    new SPoint(dis - this.arrowWidth, this.arrowWidth),
+                    new SPoint(dis, 0),
+                    new SPoint(dis - this.arrowWidth, -this.arrowWidth),
+                    new SPoint(dis - this.arrowWidth, -this.arrowWidth / 2),
+                    new SPoint(this.arrowWidth, -this.arrowWidth / 2),
+                    new SPoint(this.arrowWidth, -this.arrowWidth)
+                ];
+            }
+        }
     }
 
     /**
@@ -128,53 +127,53 @@ export class SBaseArrowPolyEdit extends SBaseLineEdit {
     toData() {
         const data = super.toData();
         data.style.default.arrowWidth = this.arrowWidth;
-        return data
+        return data;
     }
 
-	/**
-	 * 绘制
-	 *
-	 * @param painter   绘制对象
-	 */
-	onDraw(painter: SPainter): void {
-		// line数量不能为0
-		if (this.line.length) {
-			painter.save();
+    /**
+     * 绘制
+     *
+     * @param painter   绘制对象
+     */
+    onDraw(painter: SPainter): void {
+        // line数量不能为0
+        if (this.line.length) {
+            painter.save();
 
-			const lw = painter.toPx(this.lineWidth);
-			painter.pen.lineWidth = lw;
-			this.sceneDis = painter.toPx(this.dis);
+            const lw = painter.toPx(this.lineWidth);
+            painter.pen.lineWidth = lw;
+            this.sceneDis = painter.toPx(this.dis);
 
-			painter.translate(this.line[0].x, this.line[0].y);
-			painter.rotate((this._ang * 180) / Math.PI);
-			painter.pen.color = this.strokeColor;
-			painter.brush.color = this.fillColor;
+            painter.translate(this.line[0].x, this.line[0].y);
+            painter.rotate((this._ang * 180) / Math.PI);
+            painter.pen.color = this.strokeColor;
+            painter.brush.color = this.fillColor;
             // 如果为选中状态且编辑状态为正常则设置阴影
-			if (this.selected && this.status == SItemStatus.Normal) {
-				painter.pen.lineWidth = 2 * lw;
-				painter.shadow.shadowBlur = 10;
-				painter.shadow.shadowColor = new SColor(`#00000033`);
-				painter.shadow.shadowOffsetX = 5;
-				painter.shadow.shadowOffsetY = 5;
-			}
+            if (this.selected && this.status == SItemStatus.Normal) {
+                painter.pen.lineWidth = 2 * lw;
+                painter.shadow.shadowBlur = 10;
+                painter.shadow.shadowColor = new SColor(`#00000033`);
+                painter.shadow.shadowOffsetX = 5;
+                painter.shadow.shadowOffsetY = 5;
+            }
 
             // 绘制多边形
-			painter.drawPolygon(this.pointList);
-			painter.restore();
+            painter.drawPolygon(this.pointList);
+            painter.restore();
 
-			// 如果状态为编辑态则设置对应节点效果
-			if (this.status == SItemStatus.Edit) {
+            // 如果状态为编辑态则设置对应节点效果
+            if (this.status == SItemStatus.Edit) {
                 painter.pen.lineWidth = lw;
-				this.line.forEach((p, i) => {
-					painter.brush.color = SColor.White;
-					// 如果选中节点则高亮
-					if (i == this.curIndex) {
-						painter.brush.color = this.activeFillColor;
-					}
+                this.line.forEach((p, i) => {
+                    painter.brush.color = SColor.White;
+                    // 如果选中节点则高亮
+                    if (i == this.curIndex) {
+                        painter.brush.color = this.activeFillColor;
+                    }
 
-					painter.drawCircle(p.x, p.y, painter.toPx(5));
-				});
-			}
-		}
-	}
-}
+                    painter.drawCircle(p.x, p.y, painter.toPx(5));
+                });
+            }
+        }
+    }
+}

+ 66 - 58
persagy-web-big-edit/src/items/SBaseEquipment.ts

@@ -25,10 +25,10 @@
  */
 
 import { SGraphItem, SAnchorItem } from "@persagy-web/graph/lib";
-import { Legend } from "./../types/Legend";
 import { SBaseIconTextEdit, SBaseTextEdit } from "@persagy-web/edit";
-import { SColor } from '@persagy-web/draw/lib';
-import { svgTobase64, uuid } from "./../until"
+import { SColor } from "@persagy-web/draw/lib";
+import { uuid } from "./../until";
+import { Legend, svgTobase64 } from "@persagy-web/big/lib";
 
 /**
  * 编辑基础设备类
@@ -37,40 +37,40 @@ import { svgTobase64, uuid } from "./../until"
  */
 export class SBaseEquipment extends SBaseIconTextEdit {
     /** 图例节点 id */
-    nodeId: string | null = null;
+    nodeId: string | undefined = undefined;
 
     /** 设备图例 */
     _legendData: Legend | null = null;
     set legendData(val) {
         this._legendData = val;
-        this.initData()
+        this.initData();
     }
     get legendData(): Legend | null {
-        return this._legendData
+        return this._legendData;
     }
 
     /** 信息点存储 */
-    _infoPointList: any[] = []
+    _infoPointList: any[] = [];
     set infoPointList(val) {
         this._infoPointList = val;
     }
     get infoPointList(): any[] {
-        return this._infoPointList
+        return this._infoPointList;
     }
 
-    defaultUrl: string = '';
+    defaultUrl: string = "";
     /** 图得url */
-    _url: string = '';
+    _url: string = "";
     set url(val) {
         this._url = val;
-        this.initUrl()
+        this.initUrl();
     }
     get url(): string {
-        return this._url
+        return this._url;
     }
 
     /** 设备附加数据 */
-    anotherMsg: string = ''
+    anotherMsg: string = "";
 
     /**
      * 构造函数
@@ -106,17 +106,16 @@ export class SBaseEquipment extends SBaseIconTextEdit {
                 let item = new SAnchorItem(this);
 
                 // 是否存在 anchorId
-                if (t.anchorId) {
-                    item.id = t.anchorId;
+                if (t.id) {
+                    item.id = t.id;
                 }
 
                 item.moveTo(t.pos.x, t.pos.y);
                 return item;
             });
-
         } else {
             const anchorPoint = [
-                { x: this.img.x, y: this.img.y, anchorId: uuid() },
+                { x: this.img.x, y: this.img.y, anchorId: uuid() }
             ];
 
             // 没锚点则默认中心点为锚点
@@ -133,25 +132,30 @@ export class SBaseEquipment extends SBaseIconTextEdit {
         }
 
         // 该设备是否有信息点
-        if (this.legendData.properties && this.legendData.properties.infoPointList) {
+        if (
+            this.legendData.properties &&
+            this.legendData.properties.infoPointList
+        ) {
             const infoPointList = this.legendData.properties.infoPointList;
             // 将信息点数据转换为实例
             if (infoPointList.length) {
                 this.infoPointList = infoPointList;
                 this.infoPointList.forEach((obj, i) => {
-                    this.setTextItem(obj, i)
-                })
+                    this.setTextItem(obj, i);
+                });
             } else {
-                this.infoPointList = []
+                this.infoPointList = [];
             }
-
         } else {
-            this.infoPointList = []
+            this.infoPointList = [];
         }
 
         this.showAnchor = false;
+        // eslint-disable-next-line max-len
         // this.url = this.legendData.style.default.base64Url ? this.legendData.style.default.base64Url : this.legendData.style.default.url
-        this.anotherMsg = this.legendData.properties.anotherMsg ? this.legendData.properties.anotherMsg : '';
+        this.anotherMsg = this.legendData.properties.anotherMsg
+            ? this.legendData.properties.anotherMsg
+            : "";
         this.x = this.legendData.pos.x;
         this.y = this.legendData.pos.y;
         this.moveable = true;
@@ -163,11 +167,14 @@ export class SBaseEquipment extends SBaseIconTextEdit {
      */
     initUrl() {
         // 获取图数据转换为 base64
-        svgTobase64(this.url).then((res) => {
-            this.img.url = res ? res : '';
-        }).catch((res) => {
-            this.img.url = res;
-        })
+        svgTobase64(this.url)
+            .then(res => {
+                // @ts-ignore
+                this.img.url = res ? res : "";
+            })
+            .catch(res => {
+                this.img.url = res;
+            });
     }
 
     /**
@@ -179,21 +186,19 @@ export class SBaseEquipment extends SBaseIconTextEdit {
         // 根据是否勾选来判断是够增加或删除
         if (val.checked) {
             this._infoPointList.push(val);
-            this.setTextItem(val, (this._infoPointList.length - 1))
+            this.setTextItem(val, this._infoPointList.length - 1);
         } else {
-            let deleteItemIndex: number = -1;
+            let deleteItemIndex = -1;
 
             // 遍历信息点数组删除 checked 为 false 的信息点
             this._infoPointList.forEach((item, index) => {
-
                 // 通过 id 对比定位对象
                 if (val.id == item.id) {
                     deleteItemIndex = index;
                 }
-
             });
             this._infoPointList.splice(deleteItemIndex, 1);
-            this.setTextItem(val, deleteItemIndex)
+            this.setTextItem(val, deleteItemIndex);
         }
     }
 
@@ -212,28 +217,33 @@ export class SBaseEquipment extends SBaseIconTextEdit {
 
             // 是否存在pos
             if (val.pos) {
-                item.moveTo(val.pos.x, val.pos.y)
+                item.moveTo(val.pos.x, val.pos.y);
             } else {
                 item.moveTo(
                     this.img.width * 0.5,
-                    -(this.font.size * 1.25 * 0.5) + (index) * 10
+                    -(this.font.size * 1.25 * 0.5) + index * 10
                 );
             }
 
             item.font.size = val.font ? val.font : 12;
             item.isTransform = false;
             item.showSelect = false;
-            item.color = val.color ? new SColor(val.color) : new SColor('#000000');
-            item.backgroundColor = val.backgroundColor ?  new SColor(val.backgroundColor) : SColor.Transparent;
-            item.strokeColor = val.strokeColor ?  new SColor(val.strokeColor) : SColor.Transparent;
-            item.connect('textSelect', this, this.textSelectChange)
-            this.textItemList.push(item)
+            item.color = val.color
+                ? new SColor(val.color)
+                : new SColor("#000000");
+            item.backgroundColor = val.backgroundColor
+                ? new SColor(val.backgroundColor)
+                : SColor.Transparent;
+            item.strokeColor = val.strokeColor
+                ? new SColor(val.strokeColor)
+                : SColor.Transparent;
+            item.connect("textSelect", this, this.textSelectChange);
+            this.textItemList.push(item);
         } else {
             this.scene?.removeItem(this.textItemList[index]);
-            this.textItemList.splice(index, 1)
-            this.update()
+            this.textItemList.splice(index, 1);
+            this.update();
         }
-
     }
 
     /**
@@ -242,30 +252,29 @@ export class SBaseEquipment extends SBaseIconTextEdit {
      * @return	对象储存的相关数据
      */
     toData(): any {
-
         // this.legendData 必须存在
         if (this.legendData) {
             // 遍历锚点获取需要存储的数据格式
-            const list = this.anchorList.map((item) => {
+            const list = this.anchorList.map(item => {
                 return {
-                    anchorId: item.id,
+                    id: item.id,
                     pos: {
                         x: item.x,
                         y: item.y
                     }
-                }
-            })
+                };
+            });
 
             this.legendData.anchorList = list;
             // 反馈大小
             if (this.legendData.size) {
                 this.legendData.size.width = this.sWidth;
-                this.legendData.size.height = this.sHeight
+                this.legendData.size.height = this.sHeight;
             } else {
                 this.legendData.size = {
                     width: this.sWidth,
                     height: this.sHeight
-                }
+                };
             }
 
             // 位置
@@ -275,18 +284,18 @@ export class SBaseEquipment extends SBaseIconTextEdit {
             };
 
             // 存储信息点
-            const infoPoinList: any[] = []
+            const infoPoinList: any[] = [];
             // 获取信息点对应参数
             this.textItemList.forEach(item => {
                 let obj = Object.assign(item.propertyData, {
                     pos: { x: item.x, y: item.y },
                     font: item.font.size,
                     color: item.color.value,
-                    backgroundColor:item.backgroundColor.value,
+                    backgroundColor: item.backgroundColor.value,
                     strokeColor: item.strokeColor.value
-                })
-                delete obj.currentEquipMsg
-                infoPoinList.push(obj)
+                });
+                delete obj.currentEquipMsg;
+                infoPoinList.push(obj);
             });
 
             this.legendData.properties.infoPointList = infoPoinList;
@@ -297,8 +306,7 @@ export class SBaseEquipment extends SBaseIconTextEdit {
             if (this.defaultUrl) {
                 this.legendData.style.default.url = this.defaultUrl;
             }
-            return this.legendData
+            return this.legendData;
         }
     }
-
 }

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

@@ -1,68 +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 {SBaseTextEdit} from "@persagy-web/edit";
-import {SGraphItem} from "@persagy-web/graph/lib";
-import {Marker} from "./../types/Marker";
-import {SMouseEvent} from "@persagy-web/base/lib";
-
- /**
-  * 编辑基础注释类
-  *
-  * @author 韩耀龙 <han_yao_long@163.com>
-  */
- export class SBaseExpainEdit extends SBaseTextEdit {
-
-     /**
-      * 构造函数
-      *
-      * @param parent    指向父对象 Item
-      * @param data      数据
-      */
-     constructor(parent: SGraphItem | null, data: Marker) {
-         super(parent, data);
-     }
-
-     /**
-      * 鼠标按下事件
-      *
-      * @param event   保存事件参数
-      * @return 是否处理该事件
-      */
-     onMouseDown(event: SMouseEvent): boolean {
-         super.onMouseDown(event);
-         return true;
-     }
-
-     /**
-      * 返回对象储存的相关数据
-      *
-      * @return 相关数据
-      */
-     toData(): any {
-         return super.toData()
-     }
- }

+ 31 - 12
persagy-web-edit/src/commands/SGraphCommand.ts

@@ -24,25 +24,44 @@
  * *********************************************************************************************************************
  */
 
-import { SUndoCommand } from "@persagy-web/base";
-import { SGraphScene } from "@persagy-web/graph/";
+import { SBaseTextEdit } from "@persagy-web/edit";
+import { SGraphItem } from "@persagy-web/graph/lib";
+import { SMouseEvent } from "@persagy-web/base/lib";
+import { Marker } from "@persagy-web/big";
 
 /**
- * Graph 命令基
+ * 编辑基础注释
  *
- * @author 庞利祥 <sybotan@126.com>
+ * @author 韩耀龙 <han_yao_long@163.com>
  */
-export abstract class SGraphCommand extends SUndoCommand {
-    /** 命令所属的场景类 */
-    scene: SGraphScene | null = null;
-
+export class SBaseExplainEdit extends SBaseTextEdit {
     /**
      * 构造函数
      *
-     * @param scene   命令所属的场景类
+     * @param parent    指向父对象 Item
+     * @param data      数据
+     */
+    constructor(parent: SGraphItem | null, data: Marker) {
+        super(parent, data);
+    }
+
+    /**
+     * 鼠标按下事件
+     *
+     * @param event   保存事件参数
+     * @return 是否处理该事件
+     */
+    onMouseDown(event: SMouseEvent): boolean {
+        super.onMouseDown(event);
+        return true;
+    }
+
+    /**
+     * 返回对象储存的相关数据
+     *
+     * @return 相关数据
      */
-    protected constructor(scene: SGraphScene | null) {
-        super();
-        this.scene = scene;
+    toData(): any {
+        return super.toData();
     }
 }

+ 58 - 59
persagy-web-big-edit/src/items/SBaseObjectRelation.ts

@@ -24,9 +24,8 @@
  * *********************************************************************************************************************
  */
 
-import { SColor, SPainter, SPoint } from '@persagy-web/draw/lib';
-import { SGraphItem } from '@persagy-web/graph/lib';
-import { SLineStyle } from '@persagy-web/edit/lib/enums/SLineStyle';
+import { SColor, SPainter, SPoint } from "@persagy-web/draw/lib";
+import { SGraphItem, SLineStyle } from "@persagy-web/graph/lib";
 
 /**
  * 对象关系 虚线 item
@@ -34,66 +33,66 @@ import { SLineStyle } from '@persagy-web/edit/lib/enums/SLineStyle';
  * @author  韩耀龙 <han_yao_long@163.com>
  */
 export class SBaseObjectRelation extends SGraphItem {
-  /** 线起始点 */
-  startPoint: SPoint | null = null;
-  /** 结束始点 */
-  endPoint: SPoint | null = null;
+    /** 线起始点 */
+    startPoint: SPoint | null = null;
+    /** 结束始点 */
+    endPoint: SPoint | null = null;
 
-  /** 线条颜色 */
-  private _strokeColor: SColor = SColor.Black;
-  get strokeColor(): SColor {
-    return this._strokeColor;
-  }
-  set strokeColor(v: SColor) {
-    this._strokeColor = v;
-    this.update();
-  }
+    /** 线条颜色 */
+    private _strokeColor: SColor = SColor.Black;
+    get strokeColor(): SColor {
+        return this._strokeColor;
+    }
+    set strokeColor(v: SColor) {
+        this._strokeColor = v;
+        this.update();
+    }
 
-  /** 线条样式 */
-  private _lineStyle: SLineStyle = SLineStyle.Solid;
-  get lineStyle(): SLineStyle {
-    return this._lineStyle;
-  }
-  set lineStyle(v: SLineStyle) {
-    this._lineStyle = v;
-    this.update();
-  }
+    /** 线条样式 */
+    private _lineStyle: SLineStyle = SLineStyle.Solid;
+    get lineStyle(): SLineStyle {
+        return this._lineStyle;
+    }
+    set lineStyle(v: SLineStyle) {
+        this._lineStyle = v;
+        this.update();
+    }
 
-  /** 线条宽度 */
-  private _lineWidth: number = 1;
-  get lineWidth(): number {
-    return this._lineWidth;
-  }
-  set lineWidth(v: number) {
-    this._lineWidth = v;
-    this.update();
-  }
+    /** 线条宽度 */
+    private _lineWidth: number = 1;
+    get lineWidth(): number {
+        return this._lineWidth;
+    }
+    set lineWidth(v: number) {
+        this._lineWidth = v;
+        this.update();
+    }
 
-  /**
-   * 绘制
-   *
-   * @param painter   绘制对象
-   */
-  onDraw(painter: SPainter): void {
-    // 判断时否存在开头结尾
-    if (this.startPoint && this.endPoint) {
-      painter.pen.lineWidth = painter.toPx(this.lineWidth);
-      painter.pen.color = this.strokeColor;
+    /**
+     * 绘制
+     *
+     * @param painter   绘制对象
+     */
+    onDraw(painter: SPainter): void {
+        // 判断时否存在开头结尾
+        if (this.startPoint && this.endPoint) {
+            painter.pen.lineWidth = painter.toPx(this.lineWidth);
+            painter.pen.color = 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(2 * this.lineWidth),
-          painter.toPx(2 * 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(2 * this.lineWidth),
+                    painter.toPx(2 * this.lineWidth)
+                ];
+            }
 
-      painter.drawLine(this.startPoint, this.endPoint);
+            painter.drawLine(this.startPoint, this.endPoint);
+        }
     }
-  }
-}
+}

+ 1 - 2
persagy-web-big-edit/src/items/SBasePipe.ts

@@ -24,13 +24,12 @@
  * *********************************************************************************************************************
  */
 
-import { SBasePolylineEdit } from "@persagy-web/edit";
 import { SGraphItem, SAnchorItem } from "@persagy-web/graph/lib/";
-import { Relation } from "./../types/Relation";
 import { SMouseEvent } from "@persagy-web/base/lib";
 import { SPoint, SColor } from "@persagy-web/draw";
 import { SLineStyle } from "@persagy-web/graph/";
 import { SBaseCirclePolylineEdit } from "@persagy-web/edit/lib";
+import { Relation } from "@persagy-web/big/lib";
 
 /**
  * 编辑基础管道

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

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

+ 0 - 39
persagy-web-big-edit/src/types/Anchor.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) 2016-2020.  博锐尚格科技股份有限公司
- *        ~8888'
- *        .!88~                                                                     All rights reserved.
- *
- * *********************************************************************************************************************
- */
-
-import { Point } from "@persagy-web/edit/lib/type/Point";
-
-/**
- * 锚点 item 接口
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export interface Anchor {
-    /** 锚点 ID */
-    anchorId: string;
-    /** 锚点的坐标 */
-    pos: Point;
-}

+ 0 - 43
persagy-web-big-edit/src/types/ElementData.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) 2016-2020.  博锐尚格科技股份有限公司
- *        ~8888'
- *        .!88~                                                                     All rights reserved.
- *
- * *********************************************************************************************************************
- */
-
-import { Legend } from "./Legend";
-import { Marker } from "./Marker";
-import { Relation } from "./Relation";
-
-/**
- * 系统图数据接口
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export interface ElementData {
-    /** 在数据中台有数据的节点 */
-    nodes: Legend[];
-    /** 说明型节点 */
-    markers: Marker[];
-    /** 关系类节点 */
-    relations: Relation[];
-}

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

@@ -1,68 +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 { Anchor } from "./Anchor";
-import { Point } from "@persagy-web/edit/lib/type/Point";
-import { Size } from "@persagy-web/big/lib/types/Size";
-import { SPoint } from '@persagy-web/draw/';
-
-/**
- * 图例节点接口
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export interface Legend {
-    /** ID */
-    id?: string;
-    /** 图 id */
-    graphId?: string;
-    /** 图例实例 id */
-    nodeId?: string;
-    /** 名称 */
-    name: string;
-    /** 返回物理世界对象 ID 列表 */
-    attachObjectIds?: any[];
-    /** 对应的图元 ID */
-    graphElementId?: string;
-    /** 位置 */
-    pos: Point;
-    /** item 类型 */
-    type: string
-    /** 缩放 */
-    scale?: Point;
-    /** 旋转 */
-    rolate?: Point;
-    /** 大小 */
-    size?: Size;
-    /** 锚点 List */
-    anchorList?: Anchor[];
-    /** 轮廓线 */
-    outLine?: Point[] | SPoint[];
-    /** 由应用自己定义 */
-    properties?: any;
-    /** 样式 */
-    style?: any
-}

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

@@ -1,58 +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 { Point } from "@persagy-web/edit/lib/type/Point";
-import { Size } from "@persagy-web/big/lib/types/Size";
-
-/**
- * 标识对象接口
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export interface Marker {
-    /** ID */
-    id?: string;
-    /** 图 id */
-    graphId?: string;
-    /** 图例实例 id */
-    markerId?: string;
-    /** 名称 */
-    name: string;
-    /** 图标 (Image),线类型 (Line) */
-    type: string;
-    /** 位置 */
-    pos: Point;
-    /** 缩放 */
-    scale?: Point;
-    /** 旋转 */
-    rolate?: Point;
-    /** 大小 */
-    size?: Size;
-    /** 绘制时得数据以及样式 */
-    style: any;
-    /** 由应用自己定义 */
-    properties?: any;
-}

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

@@ -1,64 +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 { SRelationDir } from "@persagy-web/big/lib/enums/SRelationDir";
-import { Point } from "@persagy-web/edit/lib/type/Point";
-
-/**
- * 管线对象关系接口
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export interface Relation {
-    /** 图 id */
-    id?: string;
-    /** 图 id */
-    graphId?: string;
-    /** 图例实例 id */
-    relationId?: string;
-    /** 名称 */
-    name: string;
-    /** 对应的图例 ID */
-    GraphElementId?: string;
-    /** 关联节点 1_id */
-    node1Id?: string;
-    /** 关联节点 2_id */
-    node2Id?: string;
-    /** 关联锚点 1_id */
-    anchor1Id?: string;
-    /** 关联锚点 2_id */
-    anchor2Id?: string;
-    /** 方向(0:无向,1:节点 1 到节点2,2:节点 2 到节点 1) */
-    dir?: SRelationDir;
-    /** 线类型(0:直线,1:水平/垂直线,2:曲线) */
-    lineType: string;
-    /** 线的顶点坐标 */
-    pointList: Point[];
-    /** 线的绘图样式 */
-    properties: any;
-    /** 线性样式 */
-    style: any
-}

+ 12 - 66
persagy-web-big-edit/src/until.ts

@@ -1,4 +1,3 @@
-
 import axios from "axios";
 import crypto from "crypto-js";
 
@@ -6,17 +5,17 @@ import crypto from "crypto-js";
  *  生成 uuid 字符串
  */
 export function uuid() {
-  var s: any[] = [];
-  var hexDigits = "0123456789abcdef";
-  for (var 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] = "-";
+    var s: any[] = [];
+    var hexDigits = "0123456789abcdef";
+    for (var 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] = "-";
 
-  var uuid = s.join("");
-  return `${uuid}-${new Date().getTime()}`;
+    var uuid = s.join("");
+    return `${uuid}-${new Date().getTime()}`;
 }
 
 /**
@@ -24,59 +23,6 @@ export function uuid() {
  * @param rgba rgba 字符串
  */
 export function rgbaNum(rgba: string) {
-  let val = rgba.match(/(\d(\.\d+)?)+/g);
-  return val;
+    let val = rgba.match(/(\d(\.\d+)?)+/g);
+    return val;
 }
-
-/**
- * svg流转换为base64字符串
- *
- * @param url 获取base的路径
- */
-export function svgTobase64(url: string) {
-  let baseUrl: string = ''
-  // 请求svg图
-  return new Promise((relve, res) => {
-    if (url.includes(".svg")) {
-      axios.get(url).then((res) => {
-        let svgUrl = ''
-        if (res.data) {
-          const regexp = /\<\?xml .*\?\>/i,
-            newXml = '<?xml version="1.0" encoding="UTF-8"?>';
-          res.data = res.data.replace(regexp, newXml);
-          if ("<?xml".indexOf(res.data) === -1) {
-            res.data = '<?xml version="1.0" encoding="UTF-8"?>' + res.data;
-          }
-          const index = res.data.indexOf('"UTF-8"?>');
-          // const str = res.data.substr(index + 9);
-          // const a = crypto.enc.Utf8.parse(str);
-          svgUrl = res.data.substr(index + 9);
-          const a = crypto.default.enc.Utf8.parse(svgUrl);
-          baseUrl =
-            "data:image/svg+xml;base64," + crypto.enc.Base64.stringify(a);
-        }
-        relve([baseUrl, svgUrl])
-      }).catch((err) => {
-        res(err)
-      });
-    } else {
-      baseUrl = url;
-      relve(baseUrl)
-    }
-  })
-
-}
-
-/**
- * svg格式转换为 base64
- *
- * @param str svg数据
- */
-export function svgUrlTobase64(str) {
-  var div = document.createElement("div");
-  div.appendChild(str);
-  const svgUrl = crypto.default.enc.Utf8.parse(div.innerHTML);
-  const baseUrl =
-    "data:image/svg+xml;base64," + crypto.default.enc.Base64.stringify(svgUrl);
-  return baseUrl
-}

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

@@ -1,6 +1,6 @@
 {
     "name": "@persagy-web/big",
-    "version": "2.2.52",
+    "version": "2.2.54",
     "description": "博锐尚格建筑信息化库",
     "main": "lib/index.js",
     "types": "lib/index.d.js",

+ 6 - 0
persagy-web-big/src/index.ts

@@ -63,6 +63,9 @@ import { SWallItem } from "./items/floor/SWallItem";
 import { SWindowItem } from "./items/floor/SWindowItem";
 import { SZoneItem } from "./items/floor/SZoneItem";
 import { SHighlightItem } from "./items/SHighlightItem";
+import { SMathUtil } from "./utils/SMathUtil";
+import { svgUrlTobase64 } from "./utils/svgUrlTobase64";
+import { svgTobase64 } from "./utils/svgTobase64";
 
 export {
     ElementData,
@@ -104,4 +107,7 @@ export {
     SWindowItem,
     SZoneItem,
     SHighlightItem,
+    SMathUtil,
+    svgTobase64,
+    svgUrlTobase64
 };

+ 0 - 39
persagy-web-big/src/types/Anchor.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) 2016-2020.  博锐尚格科技股份有限公司
- *        ~8888'
- *        .!88~                                                                     All rights reserved.
- *
- * *********************************************************************************************************************
- */
-
-import { Point } from "@persagy-web/graph/lib";
-
-/**
- * 锚点 item 接口
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export interface Anchor {
-    /** 锚点 ID */
-    anchorId: string;
-    /** 锚点的坐标 */
-    pos: Point;
-}

+ 2 - 2
persagy-web-big/src/types/Legend.ts

@@ -24,10 +24,10 @@
  * *********************************************************************************************************************
  */
 
-import { Anchor } from "./Anchor";
 import { SPoint } from "@persagy-web/draw/";
 import { Point } from "@persagy-web/graph/lib";
 import { Size } from "./Size";
+import { Anchor } from "./topology/Anchor";
 
 /**
  * 图例节点接口
@@ -54,7 +54,7 @@ export interface Legend {
     /** 缩放 */
     scale?: Point;
     /** 旋转 */
-    rolate?: Point;
+    rotate?: Point;
     /** 大小 */
     size?: Size;
     /** 锚点 List */

+ 8 - 5
persagy-web-big/src/utils/svgTobase64.ts

@@ -15,18 +15,21 @@ export function svgTobase64(url: string) {
                 .then(res => {
                     if (res.data) {
                         const regexp = /\<\?xml .*\?\>/i,
-                          newXml = '<?xml version="1.0" encoding="UTF-8"?>';
+                            newXml = '<?xml version="1.0" encoding="UTF-8"?>';
                         res.data = res.data.replace(regexp, newXml);
                         if ("<?xml".indexOf(res.data) === -1) {
-                          res.data = '<?xml version="1.0" encoding="UTF-8"?>' + res.data;
+                            res.data =
+                                '<?xml version="1.0" encoding="UTF-8"?>' +
+                                res.data;
                         }
                         const index = res.data.indexOf('"UTF-8"?>');
                         const str = res.data.substr(index + 9);
                         const a = crypto.enc.Utf8.parse(str);
                         baseUrl =
-                          "data:image/svg+xml;base64," + crypto.enc.Base64.stringify(a);
-                      }
-                      relve(baseUrl)
+                            "data:image/svg+xml;base64," +
+                            crypto.enc.Base64.stringify(a);
+                    }
+                    relve(baseUrl);
                 })
                 .catch(err => {
                     res(err);

+ 13 - 10
persagy-web-edit/src/type/Anchor.ts

@@ -17,23 +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) 2016-2020.  博锐尚格科技股份有限公司
+ *      .&888888I                                          Copyright (c) 2009-2021.  博锐尚格科技股份有限公司
  *        ~8888'
  *        .!88~                                                                     All rights reserved.
  *
  * *********************************************************************************************************************
  */
-
-import { Point } from "./Point";
+// @ts-ignore
+import crypto from "crypto-js";
 
 /**
- * 锚点 item 接口
+ * svg格式转换为 base64
  *
- * @author 韩耀龙 <han_yao_long@163.com>
+ * @param str svg数据
  */
-export interface Anchor {
-    /** 锚点 ID */
-    anchorId: string;
-    /** 锚点的坐标 */
-    Pos: Point;
+export function svgUrlTobase64(str: Node) {
+    const div = document.createElement("div");
+    div.appendChild(str);
+    const svgUrl = crypto.default.enc.Utf8.parse(div.innerHTML);
+    const baseUrl =
+        "data:image/svg+xml;base64," +
+        crypto.default.enc.Base64.stringify(svgUrl);
+    return baseUrl;
 }

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

@@ -1,6 +1,6 @@
 {
     "name": "@persagy-web/edit",
-    "version": "2.2.24",
+    "version": "2.2.25",
     "description": "博锐尚格二维图形编辑器。",
     "main": "lib/index.js",
     "types": "lib/index.d.js",
@@ -40,7 +40,7 @@
         "typescript": "^3.5.3"
     },
     "dependencies": {
-        "@persagy-web/big": "2.2.52",
+        "@persagy-web/big": "2.2.54",
         "@types/uuid": "^8.0.0"
     }
 }

+ 0 - 2
persagy-web-edit/src/SGraphEdit.ts

@@ -54,8 +54,6 @@ export class SGraphEdit extends SGraphItem {
         this.update();
     }
 
-    /** 存储数据 Mark */
-    data: any;
     /** 存储数据 legend */
     legendData: any;
     /** 存储数据 Relation */

+ 0 - 85
persagy-web-edit/src/commands/SGraphAddCommand.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) 2016-2020.  博锐尚格科技股份有限公司
- *        ~8888'
- *        .!88~                                                                     All rights reserved.
- *
- * *********************************************************************************************************************
- */
-
-import { SGraphCommand } from "./SGraphCommand";
-import { SGraphItem, SGraphScene } from "@persagy-web/graph/";
-import { SUndoCommand } from "@persagy-web/base";
-
-/**
- * 添加 item 命令
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export class SGraphAddCommand extends SGraphCommand {
-    /** 命令名称 */
-    readonly command: string;
-    /** 命令 item 对象 */
-    item: SGraphItem;
-    /** 命令 item 的父类 */
-    parent: SGraphItem | null;
-
-    /**
-     * 构造函数
-     *
-     * @param scene   item 所在场景
-     * @param item    命令 item 对象
-     */
-    constructor(scene: SGraphScene, item: SGraphItem) {
-        super(scene);
-        this.item = item;
-        this.parent = item.parent;
-        this.command = "SGraphAddCommand";
-        this.desc = `添加对象=${item.id}`;
-    }
-
-    /**
-     * 合并命令
-     *
-     * @param command   命令对象
-     * @return 是否已执行合并
-     */
-    mergeWith(command: SUndoCommand): boolean {
-        return false;
-    }
-
-    /**
-     * 重做
-     */
-    redo(): void {
-        this.item.parent = this.parent;
-        // @ts-ignore
-        this.parent.update();
-    }
-
-    /**
-     * 撤销
-     */
-    undo(): void {
-        this.item.parent = null;
-        // @ts-ignore
-        this.parent.update();
-    }
-}

+ 0 - 112
persagy-web-edit/src/commands/SGraphMoveCommand.ts

@@ -1,112 +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 { SGraphCommand } from "./SGraphCommand";
-import { SGraphItem } from "@persagy-web/graph/";
-import { SPoint } from "@persagy-web/draw";
-import { SUndoCommand } from "@persagy-web/base";
-import { SGraphScene } from "@persagy-web/graph/";
-
-/**
- * item 移动命令
- *
- * @author 庞利祥 <sybotan@126.com>
- */
-export class SGraphMoveCommand extends SGraphCommand {
-    /** 命令名称 */
-    readonly command: string;
-    /** 执行命令的 item */
-    item: SGraphItem;
-    /** 移动前位置 */
-    old: SPoint;
-    /** 移动后位置 */
-    pos: SPoint;
-
-    /**
-     * 构造函数
-     *
-     * @param scene    当前场景
-     * @param item     item 对象
-     * @param old      移动前位置
-     * @param pos      移动后位置
-     */
-    constructor(
-        scene: SGraphScene,
-        item: SGraphItem,
-        old: SPoint,
-        pos: SPoint
-    ) {
-        super(scene);
-        this.item = item;
-        this.old = old;
-        this.pos = pos;
-        this.command = "SGraphMoveCommand";
-        this.desc = `移动对象=${item.id}`;
-    }
-
-    /**
-     * 合并命令
-     *
-     * @param command      命令
-     * @return 是否已执行合并命令
-     */
-    mergeWith(command: SUndoCommand): boolean {
-        // 合并的命令与当前的命令是一种,而且执行命令的对象与当前对象是一个
-        if (command instanceof SGraphMoveCommand && command.item == this.item) {
-            command.pos = this.pos;
-            return true;
-        }
-
-        return false;
-    }
-
-    /**
-     * 重做
-     */
-    redo(): void {
-        this.item.pos = new SPoint(this.pos.x, this.pos.y);
-        this.item.update();
-    }
-
-    /**
-     * 撤销
-     */
-    undo(): void {
-        this.item.pos = new SPoint(this.old.x, this.old.y);
-        this.item.update();
-    }
-
-    /**
-     * 命令细节描述
-     *
-     * @return 字符串类型的数据
-     */
-    toString(): string {
-        return `oldPos=${JSON.stringify(this.old)};\nnewPos=${JSON.stringify(
-            this.pos
-        )}`;
-    }
-}

+ 0 - 116
persagy-web-edit/src/commands/SGraphPointListDelete.ts

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

+ 0 - 114
persagy-web-edit/src/commands/SGraphPointListInsert.ts

@@ -1,114 +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 { SPoint } from "@persagy-web/draw";
-import { SGraphCommand, SGraphItem, SGraphScene } from "@persagy-web/graph/";
-
-/**
- * 多边形、折线等相关顶点的位置插入命令
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export class SGraphPointListInsert extends SGraphCommand {
-    /** 命令名称 */
-    readonly command: string;
-    /** 指向 item 对象 */
-    item: SGraphItem;
-    /** 当前位置 */
-    pos: SPoint;
-    /** 索引 */
-    index: number | null;
-    /** 顶点数组 */
-    pointList: SPoint[];
-
-    /**
-     * 构造函数
-     *
-     * @param scene       item 所在场景
-     * @param item        指向 item 对象
-     * @param pointList   顶点数组
-     * @param pos         当前位置
-     * @param index       索引
-     */
-    constructor(
-        scene: SGraphScene,
-        item: SGraphItem,
-        pointList: SPoint[],
-        pos: SPoint,
-        index: number | null = null
-    ) {
-        super(scene);
-        this.item = item;
-        this.pos = pos;
-        this.index = index;
-        this.pointList = pointList;
-        this.command = "SGraphPointListInsert";
-        this.desc = `添加折点=${item.id}`;
-    }
-
-    /**
-     * 执行重做操作执行
-     */
-    redo(): void {
-        const point = new SPoint(this.pos.x, this.pos.y);
-        // 不传索引则执行命令的索引指向最后一个
-        if (this.index == null) {
-            this.pointList.push(point);
-        } else {
-            // 否则
-            this.pointList.splice(this.index, 0, point);
-        }
-
-        this.item.update();
-    }
-
-    /**
-     * 执行取消操作执行
-     */
-    undo(): void {
-        // 不传索引则执行命令的索引指向最后一个
-        if (this.index == null) {
-            this.pointList.pop();
-        } else {
-            // 否则
-            this.pointList.splice(this.index, 1);
-        }
-
-        this.item.update();
-    }
-
-    /**
-     * 命令细节描述
-     *
-     * @return 字符串类型数据
-     */
-    toString(): string {
-        const pointList = `pointList=${JSON.stringify(this.pointList)}`;
-        const pos = `pos=${JSON.stringify(this.pos)}`;
-        const index = `index=${this.index}`;
-        return `${index};\n${pos};\n${pointList}`;
-    }
-}

+ 0 - 107
persagy-web-edit/src/commands/SGraphPointListUpdate.ts

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

+ 0 - 102
persagy-web-edit/src/commands/SGraphPropertyCommand.ts

@@ -1,102 +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 { SGraphCommand } from "./SGraphCommand";
-import { SGraphItem } from "@persagy-web/graph/";
-import { SGraphScene } from "@persagy-web/graph/";
-
-/**
- * 属性修改命令类
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export class SGraphPropertyCommand<T> extends SGraphCommand {
-    /** 命令名称 */
-    readonly command: string;
-    /**	指向 item 对象 */
-    item: SGraphItem;
-    /** 属性名称 */
-    propName: string;
-    /** 属性旧值 */
-    oldProp: T;
-    /** 属性新值 */
-    newProp: T;
-
-    /**
-     * 构造函数
-     *
-     * @param scene       命令所属的场景类
-     * @param item        命令所属的 item 类
-     * @param propName    修改的属性名称
-     * @param oldProp     修改前的属性值
-     * @param newProp     修改后的属性值
-     */
-    constructor(
-        scene: SGraphScene,
-        item: SGraphItem,
-        propName: string,
-        oldProp: T,
-        newProp: T
-    ) {
-        super(scene);
-        this.item = item;
-        this.propName = propName;
-        this.oldProp = oldProp;
-        this.newProp = newProp;
-        this.command = "SGraphPropertyCommand";
-        this.command = `更新属性=${item.id}`;
-    }
-
-    /**
-     * redo 操作
-     */
-    redo(): void {
-        // @ts-ignore
-        this.item[this.propName] = this.newProp;
-        this.item.update();
-    }
-
-    /**
-     * undo 操作
-     */
-    undo(): void {
-        // @ts-ignore
-        this.item[this.propName] = this.oldProp;
-        this.item.update();
-    }
-
-    /**
-     * 命令细节描述
-     *
-     * @return 字符串型数据
-     */
-    toString(): string {
-        const propName = `propName=${this.propName}`;
-        const oldProp = `oldProp=${JSON.stringify(this.oldProp)}`;
-        const newProp = `newProp=${JSON.stringify(this.newProp)}`;
-        return `${propName};\n${oldProp};\n${newProp}`;
-    }
-}

+ 0 - 49
persagy-web-edit/src/enums/SGraphLayoutType.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) 2016-2020.  博锐尚格科技股份有限公司
- *        ~8888'
- *        .!88~                                                                     All rights reserved.
- *
- * *********************************************************************************************************************
- */
-
-/**
- * 布局对齐方式
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export enum SGraphLayoutType {
-    /** 垂直分布 */
-    Vertical,
-    /** 垂直分布 */
-    Horizontal,
-    /** 左对齐 */
-    Left,
-    /** 右对齐 */
-    Right,
-    /** 顶对齐 */
-    Top,
-    /** 底对齐 */
-    Bottom,
-    /** 水平居中 */
-    Center,
-    /** 垂直居中 */
-    Middle
-}

+ 0 - 39
persagy-web-edit/src/enums/SImageShowType.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) 2016-2020.  博锐尚格科技股份有限公司
- *        ~8888'
- *        .!88~                                                                     All rights reserved.
- *
- * *********************************************************************************************************************
- */
-
-/**
- * 图片 item 展示方式
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export enum SImageShowType {
-    /** 铺满 */
-    Full,
-    /** 自适应 */
-    AutoFit,
-    /** 等比缩放 */
-    Equivalency
-}

+ 0 - 41
persagy-web-edit/src/enums/SLineStyle.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) 2016-2020.  博锐尚格科技股份有限公司
- *        ~8888'
- *        .!88~                                                                     All rights reserved.
- *
- * *********************************************************************************************************************
- */
-
-/**
- * 线样式
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export enum SLineStyle {
-    /** 实线 */
-    Solid,
-    /** 虚线 */
-    Dashed,
-    /** 点线 */
-    Dotted,
-    /** 无 */
-    None
-}

+ 0 - 41
persagy-web-edit/src/enums/SOrderSetType.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) 2016-2020.  博锐尚格科技股份有限公司
- *        ~8888'
- *        .!88~                                                                     All rights reserved.
- *
- * *********************************************************************************************************************
- */
-
-/**
- * 图层操作
- *
- * @author  韩耀龙 <han_yao_long@163.com>
- */
-export enum SOrderSetType {
-    /** 置顶 */
-    Top,
-    /** 置底 */
-    Bottom,
-    /** 上移一层 */
-    After,
-    /** 下移一层 */
-    Before
-}

+ 0 - 37
persagy-web-edit/src/enums/STextOrigin.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) 2016-2020.  博锐尚格科技股份有限公司
- *        ~8888'
- *        .!88~                                                                     All rights reserved.
- *
- * *********************************************************************************************************************
- */
-
-/**
- * 文本原点位置
- *
- * @author  韩耀龙 <han_yao_long@163.com>
- */
-export enum STextOrigin {
-  /** 左上点 */
-  LeftTop,
-  /** 中心点 */
-  Center,
-}

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

@@ -36,16 +36,10 @@ 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 { SGraphDeleteListCommand } from "./commands/SGraphDeleteListCommand";
-import { SGraphPointListDelete } from "./commands/SGraphPointListDelete";
-import { SGraphPointListInsert } from "./commands/SGraphPointListInsert";
-import { SGraphPointListUpdate } from "./commands/SGraphPointListUpdate";
-import { SGraphPropertyCommand } from "./commands/SGraphPropertyCommand";
 import SBaseCirclePolylineEdit from "./items/SBaseCirclePolylineEdit";
 import SBaseMaskEdit from "./items/SBaseMaskEdit";
+import { SGraphAddListCommand } from "./commands/SGraphAddListCommand";
 
 export {
     SGraphDeleteListCommand,
@@ -61,13 +55,7 @@ export {
     SBaseArrowEdit,
     SGraphEditScene,
     SGraphEdit,
-    SGraphCommand,
-    SGraphAddCommand,
-    SGraphMoveCommand,
-    SGraphPointListDelete,
-    SGraphPointListInsert,
-    SGraphPointListUpdate,
-    SGraphPropertyCommand,
+    SGraphAddListCommand,
     SBaseCirclePolylineEdit,
     SBaseMaskEdit
 };

+ 1 - 2
persagy-web-edit/src/items/SBaseArrowEdit.ts

@@ -42,8 +42,7 @@ import {
     SGraphPointListUpdate
 } from "@persagy-web/graph/";
 import { SGraphEdit } from "..";
-import { SMathUtil } from "@persagy-web/big/lib/utils/SMathUtil";
-import { Marker } from "./../type/Marker";
+import { Marker, SMathUtil } from "@persagy-web/big/lib";
 
 /**
  * 折线编辑类

+ 1 - 1
persagy-web-edit/src/items/SBaseCircleEdit.ts

@@ -33,7 +33,7 @@ import {
     SGraphPointListInsert
 } from "@persagy-web/graph/";
 import { SGraphEdit } from "..";
-import { Marker } from "../type/Marker";
+import { Marker } from "@persagy-web/big/lib";
 
 /**
  * 折线编辑类

+ 2 - 2
persagy-web-edit/src/items/SBaseCirclePolylineEdit.ts

@@ -43,7 +43,7 @@ import {
     SGraphItem
 } from "@persagy-web/graph/";
 import { SGraphEdit } from "..";
-import { Marker } from "../type/Marker";
+import { Marker } from "@persagy-web/big/lib";
 
 /**
  * 折线编辑类
@@ -52,7 +52,7 @@ import { Marker } from "../type/Marker";
  */
 export default class SBaseCirclePolylineEdit extends SGraphEdit {
     /** 传入数据 */
-    _data: Marker | null = null;
+    private _data: Marker | null = null;
     get data(): Marker | null {
         return this._data;
     } // Get data

+ 1 - 1
persagy-web-edit/src/items/SBaseIconTextEdit.ts

@@ -36,7 +36,7 @@ import {
     SPoint
 } from "@persagy-web/draw";
 import { SGraphEdit, SBaseTextEdit, SBaseImageEdit } from "..";
-import { Marker } from "../type/Marker";
+import { Marker } from "@persagy-web/big/lib";
 
 /**
  * 图标

+ 10 - 6
persagy-web-edit/src/items/SBaseImageEdit.ts

@@ -29,10 +29,13 @@ import { SImageShowType, STextOrigin } from "@persagy-web/graph";
 import { SGraphItem, SAnchorItem, SLineStyle } 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";
+import {
+    ItemOrder,
+    Marker,
+    svgTobase64,
+    svgUrlTobase64
+} from "@persagy-web/big/lib";
 import { SMouseEvent } from "@persagy-web/base/lib";
-import { svgTobase64, svgUrlTobase64 } from "@persagy-web/big-edit/lib/until";
 
 /**
  * 图片编辑类
@@ -43,7 +46,7 @@ export class SBaseImageEdit extends SGraphEdit {
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //属性
     /** item 数据*/
-    _data: Marker | null = null;
+    private _data: Marker | null = null;
     get data(): Marker | null {
         return this._data;
     } // Get data
@@ -294,9 +297,10 @@ export class SBaseImageEdit extends SGraphEdit {
      * @param {*} val 修改svg图对应的色值(矩阵)
      */
     changeSvgColor(val) {
-        var parser = new DOMParser();
-        var doc = parser.parseFromString(this.svgUrl, "text/xml");
+        const parser = new DOMParser();
+        const doc = parser.parseFromString(this.svgUrl, "text/xml");
         const svgDom = doc.children[0];
+        // @ts-ignore
         svgDom.style.filter = "url('#lighten')";
         const colorDefs = parser.parseFromString(
             `<defs>

+ 1 - 1
persagy-web-edit/src/items/SBaseLineEdit.ts

@@ -35,7 +35,7 @@ import {
     SGraphItem
 } from "@persagy-web/graph/";
 import { SGraphEdit } from "..";
-import { Marker } from "../type/Marker";
+import { Marker } from "@persagy-web/big/lib";
 
 /**
  * 直线编辑类

+ 1 - 1
persagy-web-edit/src/items/SBaseMaskEdit.ts

@@ -26,7 +26,7 @@
 import { SPainter, SPoint, SPath } from "@persagy-web/draw";
 import { SLineStyle, SGraphItem } from "@persagy-web/graph/";
 import { SBaseRectEdit } from "..";
-import { Marker } from "../type/Marker";
+import { Marker } from "@persagy-web/big/lib";
 import { SItemStatus } from "@persagy-web/big/lib";
 import { SMouseEvent } from "@persagy-web/base";
 

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

@@ -43,7 +43,7 @@ import {
     SSize
 } from "@persagy-web/draw";
 import { SItemStatus, ItemOrder } from "@persagy-web/big";
-import { Marker } from "../type/Marker";
+import { Marker } from "@persagy-web/big/lib";
 import { SMathUtil } from "@persagy-web/big/lib/utils/SMathUtil";
 import { SGraphEdit } from "..";
 

+ 1 - 1
persagy-web-edit/src/items/SBasePolylineEdit.ts

@@ -36,7 +36,7 @@ import {
     SGraphItem
 } from "@persagy-web/graph/";
 import { SGraphEdit } from "..";
-import { Marker } from "../type/Marker";
+import { Marker } from "@persagy-web/big/lib";
 
 /**
  * 折线编辑类

+ 1 - 1
persagy-web-edit/src/items/SBaseRectEdit.ts

@@ -32,7 +32,7 @@ import {
     SGraphPointListInsert
 } from "@persagy-web/graph/";
 import { SGraphEdit } from "..";
-import { Marker } from "../type/Marker";
+import { Marker } from "@persagy-web/big/lib";
 
 /**
  * 矩形编辑类

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

@@ -39,7 +39,7 @@ import {
 } from "@persagy-web/graph/";
 import { SItemStatus } from "@persagy-web/big";
 import { SGraphEdit } from "..";
-import { Marker } from "../type/Marker";
+import { Marker } from "@persagy-web/big/lib";
 import { ItemOrder } from "@persagy-web/big/lib";
 import { SMouseEvent } from "@persagy-web/base/lib";
 

+ 1 - 1
persagy-web-edit/src/items/SBaseTriangleEdit.ts

@@ -33,7 +33,7 @@ import {
     SGraphPointListInsert
 } from "@persagy-web/graph/";
 import { SGraphEdit } from "..";
-import { Marker } from "../type/Marker";
+import { Marker } from "@persagy-web/big/lib";
 
 /**
  * 折线编辑类

+ 0 - 43
persagy-web-edit/src/type/ElementData.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) 2016-2020.  博锐尚格科技股份有限公司
- *        ~8888'
- *        .!88~                                                                     All rights reserved.
- *
- * *********************************************************************************************************************
- */
-
-import { Legend } from "./Legend";
-import { Marker } from "./Marker";
-import { Relation } from "./Relation";
-
-/**
- * 系统图数据接口
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export interface ElementData {
-    /** 在数据中台有数据的节点 */
-    nodes: Legend[];
-    /** 说明型节点 */
-    markers: Marker[];
-    /** 关系类节点 */
-    relations: Relation[];
-} // Interface ElementData

+ 0 - 72
persagy-web-edit/src/type/Legend.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) 2016-2020.  博锐尚格科技股份有限公司
- *        ~8888'
- *        .!88~                                                                     All rights reserved.
- *
- * *********************************************************************************************************************
- */
-
-import { Anchor } from "./Anchor";
-import { Point } from "@persagy-web/graph";
-import { Size } from "@persagy-web/big/lib/types/Size";
-import { SPoint } from '@persagy-web/draw/lib';
-
-/**
- * 图例节点接口
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export interface Legend {
-    /** ID */
-    id?: string;
-    /** 图 id */
-    graphId?: string;
-    /** 图例实例 id */
-    nodeId?: 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

+ 0 - 58
persagy-web-edit/src/type/Marker.ts

@@ -1,58 +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 { Point } from "@persagy-web/graph/lib/types/Point";
-import { Size } from "@persagy-web/big/lib/types/Size";
-
-/**
- * 标识对象接口
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export interface Marker {
-    /** ID */
-    id?: string;
-    /** 图 id */
-    graphId?: string;
-    /** 图例实例 id */
-    markerId?: string;
-    /** 名称 */
-    name: string;
-    /** 图标(Image),线类型 (Line) */
-    type: string;
-    /** 位置 */
-    pos: Point;
-    /** 缩放 */
-    scale?: Point;
-    /** 旋转 */
-    rolate?: Point;
-    /** 大小 */
-    size?: Size;
-    /** 绘制时得数据以及样式 */
-    style: any;
-    /** 由应用自己定义 */
-    properties?: any;
-}

+ 0 - 37
persagy-web-edit/src/type/Point.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) 2016-2020.  博锐尚格科技股份有限公司
- *        ~8888'
- *        .!88~                                                                     All rights reserved.
- *
- * *********************************************************************************************************************
- */
-
-/**
- * 坐标接口
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export interface Point {
-    /** x 坐标 */
-    x: number;
-    /** y 坐标 */
-    y: number;
-}

+ 0 - 62
persagy-web-edit/src/type/Relation.ts

@@ -1,62 +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 { SRelationDir } from "@persagy-web/big/lib/enums/SRelationDir";
-import { Point } from "./Point";
-
-/**
- * 管线对象关系接口
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export interface Relation {
-    /** 图 id */
-    id?: string;
-    /** 图 id */
-    graphId?: string;
-    /** 图例实例 id */
-    relationId?: string;
-    /** 名称 */
-    name: string;
-    /** 对应的图例 ID */
-    graphElementId: string;
-    /** 关联节点 1_id */
-    node1ID?: string;
-    /** 关联节点 2_id */
-    node2ID?: string;
-    /** 关联锚点 1_id */
-    anchor1ID?: string;
-    /** 关联锚点 2_id */
-    anchor2ID?: string;
-    /** 方向(0:无向,1:节点1到节点2,2:节点2到节点1) */
-    dir?: SRelationDir;
-    /** 线类型(0:直线,1:水平/垂直线,2:曲线) */
-    lineType: string;
-    /** 线的顶点坐标 */
-    pointList: Point[];
-    /** 线的绘图样式 */
-    properties?: any;
-}