68 Commits 329cf1081a ... 192f9fb0b5

Author SHA1 Message Date
  YaolongHan 192f9fb0b5 debug 3 years ago
  YaolongHan 91b8a91b9e 调试设备 3 years ago
  YaolongHan cc6494c1e6 拓扑图第五次提测 3 years ago
  haojianlong 93fb42c006 限制半径最大值 3 years ago
  haojianlong bb5e365969 删除zip 3 years ago
  haojianlong 90e794c855 Merge branch 'develop' of http://39.106.8.246:3003/web/persagy_topo_editer into develop 3 years ago
  haojianlong f29e745cf4 左侧删除无法撤销问题吸怪 3 years ago
  YaolongHan 29a30a67b6 debug 3 years ago
  YaolongHan 7aa46f2430 Merge branch 'test' into develop 3 years ago
  YaolongHan b012096f95 debug 3 years ago
  YaolongHan eefd484bdc Merge branch 'develop' of http://39.106.8.246:3003/web/persagy_topo_editer into develop 3 years ago
  YaolongHan 9b4843bb0a debug 3 years ago
  haojianlong 7c8b81bd70 修改某些情况设备删除不了问题 3 years ago
  haojianlong 0dbb9a9eea 修改报错问题 3 years ago
  haojianlong a28cda13e7 移动命令 撤销重做 3 years ago
  haojianlong 1927aa0978 修改问题8605 3 years ago
  haojianlong 974cb44412 设置默认可移动 3 years ago
  YaolongHan 8c75e34112 -m“debug 3 years ago
  haojianlong e6275e958e Merge branch 'develop' of http://39.106.8.246:3003/web/persagy_topo_editer into develop 3 years ago
  haojianlong e02e0554b0 删除压缩包 修改传参 3 years ago
  YaolongHan 49304cb2bb Merge branch 'develop' of http://39.106.8.246:3003/web/persagy_topo_editer into develop 3 years ago
  YaolongHan f2c2b2b92a debug 3 years ago
  haojianlong 758c9a0fc1 删除log 3 years ago
  haojianlong 1491133756 Merge branch 'develop' of http://39.106.8.246:3003/web/persagy_topo_editer into develop 3 years ago
  haojianlong 41bfe6136f 名称倒叙 3 years ago
  YaolongHan 0a1c4ababf debug 3 years ago
  YaolongHan f1c94d757c debug 3 years ago
  YaolongHan 487cae7592 Merge branch 'develop' of http://39.106.8.246:3003/web/persagy_topo_editer into develop 3 years ago
  YaolongHan ba2bba8d70 debug 3 years ago
  haojianlong 8403517591 重名问题 3 years ago
  haojianlong e3a5e314bc 取色器边框 3 years ago
  haojianlong 6f6c9d27c4 移动时所属分类一致不可移动 3 years ago
  haojianlong bea7dec791 Merge branch 'develop' of http://39.106.8.246:3003/web/persagy_topo_editer into develop 3 years ago
  haojianlong cb6481cc1a 关闭弹窗8457 3 years ago
  YaolongHan 7aabbe607b debug 3 years ago
  YaolongHan 5b665faa86 debug 3 years ago
  haojianlong 9af73d6ad0 删除以后刷新问题 3 years ago
  haojianlong 70abbfe8b1 文本item 修改 3 years ago
  haojianlong 53cb3cdc32 调整在主页面获取所有分类 增加恢复时恢复的位置 3 years ago
  haojianlong b0c75016a9 移动命令 可撤销重做 3 years ago
  haojianlong 6d3a87348d 支持未发布修改标签 3 years ago
  haojianlong ff90d19c44 文本颜色修改 3 years ago
  haojianlong ded146d068 设置矩形 多边形圆 箭头层级一致 3 years ago
  haojianlong 954a6bc63c bug8337 删除取色器清空按钮 3 years ago
  haojianlong 3a62946870 解决bug 8333 3 years ago
  haojianlong 4e9849c51e bug 8332禁用右侧事件 3 years ago
  haojianlong 1d6fe1bd1b 解决bug 8331 3 years ago
  haojianlong 868b7bc1b7 修改引用 3 years ago
  YaolongHan bbf7290eff Merge branch 'develop' of http://39.106.8.246:3003/web/persagy_topo_editer into develop 3 years ago
  YaolongHan c3b35e0ee3 debug 3 years ago
  haojianlong 67da733614 圆角设置 3 years ago
  haojianlong 5883aedda5 Merge branch 'develop' of http://39.106.8.246:3003/web/persagy_topo_editer into develop 3 years ago
  haojianlong 9e2cba8c98 旋转 3 years ago
  YaolongHan 1b7fafa383 去掉通用信息点提示问题 3 years ago
  YaolongHan d4b62305cb Merge branch 'develop' of http://39.106.8.246:3003/web/persagy_topo_editer into develop 3 years ago
  haojianlong b0e8e43e46 旋转功能添加 3 years ago
  YaolongHan b84604993c Merge branch 'develop' of http://39.106.8.246:3003/web/persagy_topo_editer into develop 3 years ago
  YaolongHan 9d2b2aedac debug 3 years ago
  haojianlong 9407a5ab81 样式调整 3 years ago
  haojianlong adf75d4f99 bug 5756 修复 3 years ago
  YaolongHan 634bcb00c4 debug 3 years ago
  haojianlong b8c8b6de80 修改样式问题 3 years ago
  YaolongHan 8126bacd4e Merge branch 'develop' of http://39.106.8.246:3003/web/persagy_topo_editer into develop 3 years ago
  YaolongHan 444364030d 提测 3 years ago
  haojianlong eeff66e9f9 关系按钮层级调整 3 years ago
  haojianlong 269be065e2 bug5681修复 3 years ago
  haojianlong 7f91bf7776 bug5683修复 3 years ago
  haojianlong 8eef6c5893 问题7429 3 years ago
93 changed files with 1288 additions and 9187 deletions
  1. 7 6
      package.json
  2. 3 2
      public/systemConf.js
  3. 8 0
      src/App.vue
  4. 0 160
      src/components/editClass/big-edit/BigEditFactory.ts
  5. 2 3
      src/components/editClass/big-edit/SBaseEditScene.ts
  6. 0 13
      src/components/editClass/big-edit/index.ts
  7. 0 135
      src/components/editClass/big-edit/items/SBaseArrow.ts
  8. 0 158
      src/components/editClass/big-edit/items/SBaseArrowPolyEdit.ts
  9. 0 258
      src/components/editClass/big-edit/items/SBaseEquipment.ts
  10. 0 69
      src/components/editClass/big-edit/items/SBaseExpainEdit.ts
  11. 0 96
      src/components/editClass/big-edit/items/SBaseObjectRelation.ts
  12. 0 225
      src/components/editClass/big-edit/items/SBasePipe.ts
  13. 0 1
      src/components/editClass/big-edit/parsers/bigEditParse.ts
  14. 0 39
      src/components/editClass/big-edit/types/Anchor.ts
  15. 0 43
      src/components/editClass/big-edit/types/ElementData.ts
  16. 0 68
      src/components/editClass/big-edit/types/Legend.ts
  17. 0 58
      src/components/editClass/big-edit/types/Marker.ts
  18. 0 64
      src/components/editClass/big-edit/types/Relation.ts
  19. 0 58
      src/components/editClass/big-edit/until.ts
  20. 0 108
      src/components/editClass/edit/SGraphEdit.ts
  21. 0 551
      src/components/editClass/edit/SGraphEditScene.ts
  22. 0 85
      src/components/editClass/edit/commands/SGraphAddCommand.ts
  23. 0 81
      src/components/editClass/edit/commands/SGraphAddListCommand.ts
  24. 0 48
      src/components/editClass/edit/commands/SGraphCommand.ts
  25. 0 82
      src/components/editClass/edit/commands/SGraphDeleteListCommand.ts
  26. 0 111
      src/components/editClass/edit/commands/SGraphMoveCommand.ts
  27. 0 111
      src/components/editClass/edit/commands/SGraphPointListDelete.ts
  28. 0 110
      src/components/editClass/edit/commands/SGraphPointListInsert.ts
  29. 0 107
      src/components/editClass/edit/commands/SGraphPointListUpdate.ts
  30. 0 102
      src/components/editClass/edit/commands/SGraphPropertyCommand.ts
  31. 0 49
      src/components/editClass/edit/enums/SGraphLayoutType.ts
  32. 0 39
      src/components/editClass/edit/enums/SImageShowType.ts
  33. 0 41
      src/components/editClass/edit/enums/SLineStyle.ts
  34. 0 41
      src/components/editClass/edit/enums/SOrderSetType.ts
  35. 0 37
      src/components/editClass/edit/enums/STextOrigin.ts
  36. 0 48
      src/components/editClass/edit/index.ts
  37. 0 558
      src/components/editClass/edit/items/SBaseArrowEdit.ts
  38. 0 409
      src/components/editClass/edit/items/SBaseCircleEdit.ts
  39. 0 558
      src/components/editClass/edit/items/SBaseIconTextEdit.ts
  40. 0 497
      src/components/editClass/edit/items/SBaseImageEdit.ts
  41. 0 602
      src/components/editClass/edit/items/SBaseLineEdit.ts
  42. 0 956
      src/components/editClass/edit/items/SBasePolygonEdit.ts
  43. 0 705
      src/components/editClass/edit/items/SBasePolylineEdit.ts
  44. 0 410
      src/components/editClass/edit/items/SBaseRectEdit.ts
  45. 0 410
      src/components/editClass/edit/items/SBaseTextEdit.ts
  46. 0 365
      src/components/editClass/edit/items/SBaseTriangleEdit.ts
  47. 0 39
      src/components/editClass/edit/type/Anchor.ts
  48. 0 43
      src/components/editClass/edit/type/ElementData.ts
  49. 0 72
      src/components/editClass/edit/type/Legend.ts
  50. 0 58
      src/components/editClass/edit/type/Marker.ts
  51. 0 37
      src/components/editClass/edit/type/Point.ts
  52. 0 62
      src/components/editClass/edit/type/Relation.ts
  53. 16 5
      src/components/editClass/persagy-edit/PTopoFactory.ts
  54. 4 2
      src/components/editClass/persagy-edit/PTopoParser.ts
  55. 90 35
      src/components/editClass/persagy-edit/PTopoScene.ts
  56. 1 1
      src/components/editClass/persagy-edit/item/SPersagyImageEdit.ts
  57. 1 1
      src/components/editClass/persagy-edit/items/SBaseArrow.ts
  58. 4 5
      src/components/editClass/persagy-edit/items/SBaseBtns.ts
  59. 1 1
      src/components/editClass/persagy-edit/items/SBaseCursor.ts
  60. 2 4
      src/components/editClass/persagy-edit/items/SBaseEquation.ts
  61. 2 4
      src/components/editClass/persagy-edit/items/SBaseInfoPoint.ts
  62. 238 7
      src/components/editClass/persagy-edit/items/SBasePipeUninTool.ts
  63. 59 8
      src/components/editview/baseTopoEditer.vue
  64. 42 0
      src/components/editview/equipAnchor.js
  65. 5 5
      src/components/editview/leftToolBar.vue
  66. 1 1
      src/components/editview/leftToolBar/addBaseItem.vue
  67. 4 5
      src/components/editview/leftToolBar/addItemModel.vue
  68. 6 6
      src/components/editview/leftToolBar/data.js
  69. 7 1
      src/components/editview/leftToolBar/equipmentList.vue
  70. 74 1
      src/components/editview/rightPropertyBar/BaseEquipment.vue
  71. 2 1
      src/components/editview/rightPropertyBar/BaseGraphy.vue
  72. 43 3
      src/components/editview/rightPropertyBar/BaseImagePro.vue
  73. 40 29
      src/components/editview/rightPropertyBar/BasePipe.vue
  74. 285 0
      src/components/editview/rightPropertyBar/BaseUnitPro.vue
  75. 17 5
      src/components/editview/rightPropertyBar/InfoPoint.vue
  76. 31 9
      src/components/editview/rightPropertyBar/baseTextPro.vue
  77. 38 13
      src/components/editview/rightPropertyBar/property.vue
  78. 1 1
      src/components/editview/topToolBar.vue
  79. 16 5
      src/components/editview/topoTooltip.vue
  80. 42 3
      src/components/editview/zoom.vue
  81. 17 6
      src/components/homeView/createGraphDialog.vue
  82. 17 5
      src/components/homeView/graphTypeDialog.vue
  83. 2 0
      src/components/homeView/leftAsideTree.vue
  84. 23 5
      src/components/homeView/move.vue
  85. 6 2
      src/components/homeView/recycle.vue
  86. 35 2
      src/components/homeView/recycleDialog.vue
  87. 3 2
      src/components/homeView/rename.vue
  88. 7 2
      src/components/homeView/tagDialog.vue
  89. 8 3
      src/components/homeView/topoImageCard.vue
  90. 19 2
      src/store/index.ts
  91. 1 1
      src/views/editer.vue
  92. 32 8
      src/views/home.vue
  93. 26 0
      vue.config.js

+ 7 - 6
package.json

@@ -15,12 +15,12 @@
     "publish": "node publish.js"
     "publish": "node publish.js"
   },
   },
   "dependencies": {
   "dependencies": {
-    "@persagy-web/base": "2.2.1",
-    "@persagy-web/big": "2.2.55",
-    "@persagy-web/draw": "2.2.14",
-    "@persagy-web/graph": "2.2.46",
-    "@persagy-web/big-edit": "2.2.29",
-    "@persagy-web/edit": "2.2.26",
+    "@persagy-web/base": "2.2.2",
+    "@persagy-web/big": "2.2.61",
+    "@persagy-web/draw": "2.2.17",
+    "@persagy-web/graph": "2.2.52",
+    "@persagy-web/big-edit": "2.2.42",
+    "@persagy-web/edit": "2.2.34",
     "@types/uuid": "^8.0.0",
     "@types/uuid": "^8.0.0",
     "ant-design-vue": "^1.6.5",
     "ant-design-vue": "^1.6.5",
     "axios": "^0.20.0",
     "axios": "^0.20.0",
@@ -47,6 +47,7 @@
     "@vue/eslint-config-typescript": "^5.0.2",
     "@vue/eslint-config-typescript": "^5.0.2",
     "babel-plugin-component": "^1.1.1",
     "babel-plugin-component": "^1.1.1",
     "babel-plugin-import": "^1.12.0",
     "babel-plugin-import": "^1.12.0",
+    "compression-webpack-plugin": "^3.1.0",
     "eslint": "^6.7.2",
     "eslint": "^6.7.2",
     "eslint-plugin-vue": "^6.2.2",
     "eslint-plugin-vue": "^6.2.2",
     "less": "^3.0.4",
     "less": "^3.0.4",

+ 3 - 2
public/systemConf.js

@@ -25,7 +25,7 @@ var __systemConf = {
         { id: "Pj5001120003", name: "香港置地" },
         { id: "Pj5001120003", name: "香港置地" },
         { id: "Pj4403050019", name: "招商IOC" },
         { id: "Pj4403050019", name: "招商IOC" },
         // 美凯龙
         // 美凯龙
-        { id: "Pj0001110001", name: "飞龙商场" },
+        { id: "Pj0000000001", name: "飞龙商场" },
         { id: "Pj0001110002", name: "常州常武" },
         { id: "Pj0001110002", name: "常州常武" },
 
 
         { id: "Pj0002220001", name: "数字化交付01" },
         { id: "Pj0002220001", name: "数字化交付01" },
@@ -39,7 +39,8 @@ var __systemConf = {
         { id: "Pj0002220008", name: "数字化交付08" },
         { id: "Pj0002220008", name: "数字化交付08" },
         { id: "Pj0002220009", name: "数字化交付09" },
         { id: "Pj0002220009", name: "数字化交付09" },
         { id: "Pj00022200010", name: "数字化交付10" },
         { id: "Pj00022200010", name: "数字化交付10" },
-
+        // 资产管理
+        { id: "Pj3702020002", name: "青岛海天中心" }
 
 
 
 
     ] // 项目列表
     ] // 项目列表

+ 8 - 0
src/App.vue

@@ -30,4 +30,12 @@ html {
   height: 100%;
   height: 100%;
 
 
 }
 }
+.el-color-dropdown__btns{
+  .el-color-dropdown__link-btn{
+    display: none;
+  }
+}
+.cololorSelect {
+  border: 1px solid #e6e6e6;
+}
 </style>
 </style>

+ 0 - 160
src/components/editClass/big-edit/BigEditFactory.ts

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

+ 2 - 3
src/components/editClass/big-edit/SBaseEditScene.ts

@@ -29,10 +29,9 @@ import { SMouseEvent } from "@persagy-web/base/lib";
 import { SArrowStyleType, SPoint, SRect } from '@persagy-web/draw';
 import { SArrowStyleType, SPoint, SRect } from '@persagy-web/draw';
 import { SItemStatus, SRectSelectItem } from '@persagy-web/big/lib';
 import { SItemStatus, SRectSelectItem } from '@persagy-web/big/lib';
 import { SGraphItem, SGraphSelectContainer, SOrderSetType } from "@persagy-web/graph/lib/";
 import { SGraphItem, SGraphSelectContainer, SOrderSetType } from "@persagy-web/graph/lib/";
-import { uuid } from "./until";
-import { SBaseArrow, SBaseEquipment, SBaseExpainEdit, SBasePipe } from "./"
+import { SBaseArrow, SBaseExpainEdit, SBasePipe } from "./"
 import { SBaseArrowPolyEdit } from './items/SBaseArrowPolyEdit';
 import { SBaseArrowPolyEdit } from './items/SBaseArrowPolyEdit';
-import { SGraphAddListCommand } from '@persagy-web/edit/lib/commands/SGraphAddListCommand';
+import { SGraphAddListCommand } from '@persagy-web/edit/lib/';
 
 
 /**
 /**
  * big-edit 场景
  * big-edit 场景

+ 0 - 13
src/components/editClass/big-edit/index.ts

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

+ 0 - 135
src/components/editClass/big-edit/items/SBaseArrow.ts

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

+ 0 - 158
src/components/editClass/big-edit/items/SBaseArrowPolyEdit.ts

@@ -1,158 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .F88X
- *        X8888Y
- *      .}888888N;
- *        i888888N;        .:!              .I$WI:
- *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
- *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
- *            +888888N;  .8888888Y                                  "&&8Y.}8,
- *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
- *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
- *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
- *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
- *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
- *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
- *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
- *      .:R888888I
- *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
- *        ~8888'
- *        .!88~                                                                     All rights reserved.
- *
- * *********************************************************************************************************************
- */
-
-import { SMathUtil } from "@persagy-web/graph/lib/utils/SMathUtil";
-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';
-
-/**
- * 箭头编辑(多边形)
- *
- * @author  韩耀龙 <han_yao_long@163.com>
- */
-export class SBaseArrowPolyEdit extends SBaseLineEdit {
-	/** 多边形数组 */
-	pointList: SPoint[] = [];
-	/** 绘制时需要旋转的角度 */
-	private _ang: number = 0;
-	/** 箭头中间粗细 */
-	arrowWidth: number = 8;
-
-	/** 是否为单向箭头 是-只绘制末端箭头 */
-	_isSingle: boolean = true;
-	get isSingle(): boolean {
-		return this._isSingle;
-	} // Get isSingle
-	set isSingle(v: boolean) {
-		this._isSingle = v;
-		this.update();
-	} // Set isSingle
-
-	/**
-	 * 构造函数
-	 *
-	 * @param parent    父级
-	 * @param data      坐标集合|第一个点坐标
-	 */
-	constructor(parent: SGraphItem | null, data: Marker): void {
-		super(parent, data);
-		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
-			);
-			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)
-				];
-			}
-		}
-	}
-
-	/**
-	 * 绘制
-	 *
-	 * @param painter   绘制对象
-	 */
-	onDraw(painter: SPainter): void {
-		if (this.line.length) {
-			painter.save();
-
-			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;
-
-			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();
-
-			if (
-				this.status == SItemStatus.Edit ||
-				this.status == SItemStatus.Create
-			) {
-				this.line.forEach((p, i) => {
-					painter.brush.color = this.fillColor;
-					if (i == this.curIndex) {
-						painter.brush.color = this.activeFillColor;
-					}
-
-					painter.drawCircle(p.x, p.y, painter.toPx(5));
-				});
-			}
-		}
-	}
-}

+ 0 - 258
src/components/editClass/big-edit/items/SBaseEquipment.ts

@@ -1,258 +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 { 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"
-/**
- * 编辑基础设备类
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export class SBaseEquipment extends SBaseIconTextEdit {
-    /** 图例节点 id */
-    nodeId: string | null = null;
-    /** 设备图例 */
-    _legendData: Legend | null = null;
-    set legendData(val) {
-        this._legendData = val;
-        this.initData()
-    } // set legendData()
-    get legendData(): Legend | null {
-        return this._legendData
-    } // get legendData()
-
-    /** 信息点存储 */
-    _infoPointList: any[] = []
-    set infoPointList(val) {
-        this._infoPointList = val;
-    } // set infoPointList()
-    get infoPointList(): any[] {
-        return this._infoPointList
-    } // get infoPointList()
-
-    /** 图得url */
-    _url: string = '';
-    set url(val) {
-        this._url = val;
-        this.initUrl()
-    } // set infoPointList()
-    get url(): string {
-        return this._url
-    } // get infoPointList()
-
-    //  设备附加数据
-    anotherMsg: string = ''
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      数据
-     */
-    constructor(parent: SGraphItem | null, data: Legend) {
-        super(parent);
-        this.legendData = data;
-    } // Constructor
-
-    /**
-     * 设置 legendData 时对 item 做设置
-     */
-    initData() {
-        if (!this.legendData) return;
-
-        this.nodeId = this.legendData?.nodeId
-        if (this.legendData.size) {
-            this.sWidth = this.legendData.size.width;
-            this.sHeight = this.legendData.size.height;
-        }
-
-        this.img.connect("onMove", this, this.changeAnchorPoint.bind(this));
-        if (this.legendData.anchorList && this.legendData.anchorList.length) {
-            this.anchorList = this.legendData.anchorList.map(t => {
-                let item = new SAnchorItem(this);
-                if (t.anchorId) {
-                    item.id = t.anchorId;
-                }
-                item.moveTo(t.pos.x, t.pos.y);
-                return item;
-            });
-        } else {
-            const anchorPoint = [
-                { x: this.img.x, y: this.img.y, anchorId: uuid() },
-            ];
-            this.anchorList = anchorPoint.map(t => {
-                let item = new SAnchorItem(this);
-                if (t.anchorId) {
-                    item.id = t.anchorId;
-                }
-                item.moveTo(t.x, t.y);
-                return item;
-            });
-        }
-
-        // 存储信息点
-        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)
-                })
-            } else {
-                this.infoPointList = []
-            }
-        } else {
-            this.infoPointList = []
-        }
-
-        this.showAnchor = false;
-        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.x = this.legendData.pos.x;
-        this.y = this.legendData.pos.y;
-        this.moveable = true;
-        this.selectable = true;
-    }
-
-    initUrl() {
-        svgTobase64(this.url).then((res) => {
-            this.img.url = res ? res : '';
-        }).catch((res) => {
-            this.img.url = res;
-        })
-    }
-
-    /**
-     * 设置信息点
-     *
-     * @params	obj 设置的信息点
-     */
-    setMsgPoint(val: any) {
-        // 根据是否勾选来判断是够增加或删除
-        if (val.checked) {
-            this._infoPointList.push(val);
-            this.setTextItem(val, (this._infoPointList.length - 1))
-        } else {
-            let deleteItemIndex: number = -1;
-            this._infoPointList.forEach((item, index) => {
-                if (val.id == item.id) {
-                    deleteItemIndex = index;
-                }
-            });
-            this._infoPointList.splice(deleteItemIndex, 1);
-            this.setTextItem(val, deleteItemIndex)
-        }
-    }
-
-    /**
-     * 根据选中状态增加 textItem
-     *
-     * @params obj	textItem 文本信息
-     * @params index 文本索引
-     */
-    setTextItem(val: any, index: number): void {
-        if (val.checked) {
-            let item = new SBaseTextEdit(this, null);
-            item.propertyData = val;
-            item.text = val.name;
-            if (val.pos) {
-                item.moveTo(val.pos.x, val.pos.x)
-            } else {
-                item.moveTo(
-                    this.img.width * 0.5,
-                    -(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.connect('textSelect', this, this.textSelectChange)
-            this.textItemList.push(item)
-        } else {
-            this.textItemList.splice(index, 1)
-            this.scene?.removeItem(this.textItemList[index]);
-        }
-    }
-
-    /**
-     * 返回对象储存的相关数据
-     *
-     * @return	对象储存的相关数据
-     */
-    toData(): any {
-        if (this.legendData) {
-            const list = this.anchorList.map((item) => {
-                return {
-                    anchorId: 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
-            } else {
-                this.legendData.size = {
-                    width: this.sWidth,
-                    height: this.sHeight
-                }
-            }
-
-            // 位置
-            this.legendData.pos = {
-                x: this.x,
-                y: this.y
-            };
-            // 存储信息点
-            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,
-                })
-                delete obj.currentEquipMsg
-                infoPoinList.push(obj)
-            });
-
-            this.legendData.properties.infoPointList = infoPoinList;
-            this.legendData.properties.anotherMsg = this.anotherMsg;
-            this.legendData.style.default.base64Url = "";
-            this.legendData.style.default.url = this.url;
-            return this.legendData
-        }
-    }
-
-}

+ 0 - 69
src/components/editClass/big-edit/items/SBaseExpainEdit.ts

@@ -1,69 +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    指向父对象
-      * @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()
-     }
- }

+ 0 - 96
src/components/editClass/big-edit/items/SBaseObjectRelation.ts

@@ -1,96 +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 { SColor, SPainter, SPoint } from '@persagy-web/draw/lib';
-import { SGraphItem } from '@persagy-web/graph/lib';
-import { SLineStyle } from '@persagy-web/edit/lib/enums/SLineStyle';
-
-/**
- * 对象关系 虚线 item
- *
- * @author  韩耀龙 <han_yao_long@163.com>
- */
-export class SBaseObjectRelation extends SGraphItem {
-  /** 线起始点 */
-  startPoint: SPoint | null = null;
-  /** 结束始点 */
-  endPoint: SPoint | null = null;
-
-  /** 线条颜色 */
-  private _strokeColor: SColor = SColor.Black;
-  get strokeColor(): SColor {
-    return this._strokeColor;
-  } // Get strokeColor
-  set strokeColor(v: SColor) {
-    this._strokeColor = v;
-    this.update();
-  }// Get strokeColor
-
-  /** 线条样式 */
-  private _lineStyle: SLineStyle = SLineStyle.Solid;
-  get lineStyle(): SLineStyle {
-    return this._lineStyle;
-  } // Get lineStyle
-  set lineStyle(v: SLineStyle) {
-    this._lineStyle = v;
-    this.update();
-  } // Set lineStyle
-
-  /** 线条宽度 */
-  private _lineWidth: number = 1;
-  get lineWidth(): number {
-    return this._lineWidth;
-  } //Get lineWidth
-  set lineWidth(v: number) {
-    this._lineWidth = v;
-    this.update();
-  } //Set lineWidth
-
-  /**
-    * 绘制
-    *
-    * @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)
-        ];
-      }
-
-      painter.drawLine(this.startPoint, this.endPoint);
-    }
-  }
-}

+ 0 - 225
src/components/editClass/big-edit/items/SBasePipe.ts

@@ -1,225 +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 { 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/";
-
-/**
- * 编辑基础管道
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export class SBasePipe extends SBasePolylineEdit {
-    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    //属性
-    /** 关系型数据 */
-    _relationData: Relation | null = null;
-    set relationData(val) {
-        this._relationData = val;
-        this.initData()
-    } // set legendData()
-    get relationData(): Relation | null {
-        return this._relationData
-    } // get legendData()
-
-    /** 起始锚点  */
-    startAnchor: SAnchorItem | null = null;
-    /** 结束锚点  */
-    endAnchor: SAnchorItem | null = null;
-    /** 关联锚点1ID  */
-    _anchor1Id: string = "";
-    get anchor1Id(): string {
-        return this._anchor1Id;
-    }// get anchor1Id()
-    set anchor1Id(v: string) {
-        this._anchor1Id = v;
-        if (this.relationData) {
-            this.relationData.anchor1Id = this._anchor1Id;
-        }
-    }// set anchor1Id()
-
-    /** 关联锚点2ID  */
-    _anchor2Id: string = "";
-    get anchor2Id(): string {
-        return this._anchor2Id;
-    }// get anchor2Id()
-    set anchor2Id(v: string) {
-        this._anchor2Id = v;
-        if (this.relationData) {
-            this.relationData.anchor2Id = this._anchor2Id;
-        }
-    }// set anchor2Id()
-
-    /** 关联节点1ID */
-    _node1Id: string = "";
-    get node1Id(): string {
-        return this._node1Id;
-    }// get node1Id()
-    set node1Id(v: string) {
-        this._node1Id = v;
-        if (this.relationData) {
-            this.relationData.node1Id = this._node1Id;
-        }
-    }// set node1Id()
-
-    /** 关联节点2ID */
-    _node2Id: string = "";
-    get node2Id(): string {
-        return this._node2Id;
-    }// get node2Id()
-    set node2Id(v: string) {
-        this._node2Id = v;
-        if (this.relationData) {
-            this.relationData.node2Id = this._node2Id;
-        }
-    }// set node2Id()
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      数据
-     */
-    constructor(parent: SGraphItem | null, data: Relation) {
-        super(parent);
-        this.relationData = data;
-    }
-
-    /**
-     * 设置relationData 时 对 item 做设置
-     */
-    initData() {
-        const data = this.relationData;
-        if (!data) return;
-        // 名称
-        this.name = data.name;
-        // 线样式
-        this.lineStyle = SLineStyle[data.lineType] ? SLineStyle[data.lineType] : SLineStyle.Solid;
-        // 折线点
-        if (data.pointList) {
-            let setPointList: SPoint[];
-            setPointList = data.pointList.map(i => {
-                return new SPoint(i.x, i.y)
-            });
-            this.pointList = setPointList;
-        }
-
-        //锚点
-        if (data.node1Id) {
-            this._node1Id = data.node1Id
-        }
-
-        if (data.node2Id) {
-            this._node2Id = data.node2Id
-        }
-
-        if (data.anchor1Id) {
-            this._anchor1Id = data.anchor1Id
-        }
-
-        if (data.anchor2Id) {
-            this._anchor2Id = data.anchor2Id
-        }
-
-        // 样式
-        if (data.style && data.style.default) {
-            // 颜色
-            if (data.style.default.strokeColor) {
-                this.strokeColor = new SColor(data.style.default.strokeColor)
-            }
-
-            // 线宽
-            if (data.style.default.lineWidth) {
-                this.lineWidth = data.style.default.lineWidth
-            }
-        };
-
-    }
-
-
-    /**
-     * 鼠标按下事件
-     *
-     * @param event   保存事件参数
-     * @return 是否处理该事件
-     */
-    onMouseDown(event: SMouseEvent): boolean {
-        super.onMouseDown(event);
-        return true;
-    }
-
-    /**
-     * 接收事件作出修改
-     */
-    changePos() {
-        if (this.startAnchor) {
-            // 判断删除equip后,不移动
-            if (this.startAnchor.parent && this.startAnchor.parent.parent) {
-                let p = this.startAnchor.mapToScene(0, 0);
-                this.pointList[0] = new SPoint(p.x - this.x, p.y - this.y)
-            }
-        }
-
-        if (this.endAnchor) {
-            // 删除equip后
-            if (this.endAnchor.parent && this.endAnchor.parent.parent) {
-                let p = this.endAnchor.mapToScene(0, 0);
-                this.pointList[
-                    this.pointList.length - 1
-                ] = new SPoint(p.x - this.x, p.y - this.y)
-            }
-        }
-    }
-
-    /**
-     * 返回对象储存的相关数据
-     *
-     * @return 相关数据
-     */
-    toData(): any {
-        this.moveToOrigin();
-        const data = this.relationData;
-        if (!data) return;
-
-        if (this.pointList.length) {
-            const Line = this.pointList.map(pos => {
-                return {
-                    x: pos.x,
-                    y: pos.y
-                }
-            });
-            data.pointList = Line;
-        }
-
-        data.style.default.strokeColor = this.strokeColor.value;
-        data.style.default.lineWidth = this.lineWidth;
-        return data
-    }
-}

+ 0 - 1
src/components/editClass/big-edit/parsers/bigEditParse.ts

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

+ 0 - 39
src/components/editClass/big-edit/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
src/components/editClass/big-edit/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
src/components/editClass/big-edit/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
src/components/editClass/big-edit/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
src/components/editClass/big-edit/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
-}

+ 0 - 58
src/components/editClass/big-edit/until.ts

@@ -1,58 +0,0 @@
-
-import axios from "axios";
-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 uuid = s.join("");
-  return `${uuid}-${new Date().getTime()}`;
-}
-
-/**
- * 生成 rgba 数字
- * @param rgba rgba 字符串
- */
-export function rgbaNum(rgba: string) {
-  let val = rgba.match(/(\d(\.\d+)?)+/g);
-  return val;
-}
-
-/**
- * svg流转换为base64字符串
- *
- * @param url 获取base的路径
- */
-export function svgTobase64(url: string) {
-  let baseUrl: string = ''
-  return new Promise((relve, res) => {
-    if (url.includes(".svg")) {
-      axios.get(url).then((res) => {
-        if (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)
-      }).catch((err) => {
-        res(err)
-      });
-    } else {
-      baseUrl = url;
-      relve(baseUrl)
-    }
-  })
-
-}

+ 0 - 108
src/components/editClass/edit/SGraphEdit.ts

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

File diff suppressed because it is too large
+ 0 - 551
src/components/editClass/edit/SGraphEditScene.ts


+ 0 - 85
src/components/editClass/edit/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 - 81
src/components/editClass/edit/commands/SGraphAddListCommand.ts

@@ -1,81 +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 { SUndoCommand } from '@persagy-web/base/lib';
-import { SGraphCommand, SGraphItem, SGraphScene } from '@persagy-web/graph/lib';
-
-/**
- * 批量添加 item 命令
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export class SGraphAddListCommand extends SGraphCommand {
-    /** 命令item对象    */
-    itemList: SGraphItem[];
-    /** 命令名称    */
-    readonly command: string = "AddListCommand"
-    /** 命令item的父类   */
-    parent: SGraphItem | null;
-    constructor(scene: SGraphScene, itemList: SGraphItem[]) {
-        super(scene);
-        this.itemList = itemList;
-        this.parent = itemList[0].parent;
-    }
-
-    /**
-     * 合并命令
-     *
-     * @param command   命令对象
-     * @return 是否已执行合并
-     */
-    mergeWith(command: SUndoCommand): boolean {
-        return false;
-    }
-
-    /**
-     * 重做
-     *
-     */
-    redo(): void {
-        this.itemList.map((item) => {
-            item.parent = this.parent;
-        })
-        // @ts-ignore
-        this.parent.update();
-    }
-
-    /**
-     * 撤销
-     *
-     */
-    undo(): void {
-        this.itemList.map((item) => {
-            item.parent = null;
-        })
-        // @ts-ignore
-        this.parent.update();
-    }
-}

+ 0 - 48
src/components/editClass/edit/commands/SGraphCommand.ts

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

+ 0 - 82
src/components/editClass/edit/commands/SGraphDeleteListCommand.ts

@@ -1,82 +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 "@persagy-web/graph/lib/commands/SGraphCommand";
-import { SGraphItem } from "@persagy-web/graph/lib/SGraphItem";
-import { SUndoCommand } from "@persagy-web/base";
-import { SGraphScene } from "@persagy-web/graph/";
-
-/**
- * 删除多个 item 命令
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-
-export class SGraphDeleteListCommand extends SGraphCommand {
-    /** 命令item对象    */
-    itemList: SGraphItem[];
-    desc: string = 'DeleteCommandList'
-    /** 命令名称    */
-    readonly command: string = "DeleteCommandList"
-    /** 命令item的父类   */
-    parent: SGraphItem | null;
-    constructor(scene: SGraphScene, itemList: SGraphItem[]) {
-        super(scene);
-        this.itemList = itemList;
-        this.parent = itemList[0].parent;
-    }
-
-    /**
-     * 合并命令
-     * @param command 合并对象
-     * @return 是否已执行合并
-     */
-    mergeWith(command: SUndoCommand): boolean {
-        return false;
-    }
-
-    /**
-     * 重做
-     */
-    undo(): void {
-        this.itemList.map((item) => {
-            item.parent = this.parent;
-        })
-        // @ts-ignore
-        this.parent.update();
-    }
-
-    /**
-     * 撤销
-     */
-    redo(): void {
-        this.itemList.map((item) => {
-            item.parent = null;
-        })
-        // @ts-ignore
-        this.parent.update();
-    }
-}

+ 0 - 111
src/components/editClass/edit/commands/SGraphMoveCommand.ts

@@ -1,111 +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 - 111
src/components/editClass/edit/commands/SGraphPointListDelete.ts

@@ -1,111 +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 - 110
src/components/editClass/edit/commands/SGraphPointListInsert.ts

@@ -1,110 +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
src/components/editClass/edit/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
src/components/editClass/edit/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
src/components/editClass/edit/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
src/components/editClass/edit/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
src/components/editClass/edit/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
src/components/editClass/edit/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
src/components/editClass/edit/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,
-}

+ 0 - 48
src/components/editClass/edit/index.ts

@@ -1,48 +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 { SGraphEdit } from "./SGraphEdit";
-import { SGraphEditScene } from "./SGraphEditScene";
-import { SBaseArrowEdit } from "./items/SBaseArrowEdit";
-import { SBaseLineEdit } from "./items/SBaseLineEdit";
-import { SBaseImageEdit } from "./items/SBaseImageEdit";
-import { SBasePolygonEdit } from "./items/SBasePolygonEdit";
-import { SBaseRectEdit } from "./items/SBaseRectEdit";
-import { SBaseCircleEdit } from "./items/SBaseCircleEdit";
-import { SBaseTriangleEdit } from "./items/SBaseTriangleEdit";
-import { SBasePolylineEdit } from "./items/SBasePolylineEdit";
-import { SBaseIconTextEdit } from "./items/SBaseIconTextEdit";
-import { SBaseTextEdit } from "./items/SBaseTextEdit" ;
-import { SGraphCommand } from "./commands/SGraphCommand";
-import { SGraphAddCommand } from "./commands/SGraphAddCommand";
-import { SGraphMoveCommand } from "./commands/SGraphMoveCommand";
-import { SGraphDeleteListCommand } from "./commands/SGraphDeleteListCommand";
-import { SGraphPointListDelete } from "./commands/SGraphPointListDelete";
-import { SGraphPointListInsert } from "./commands/SGraphPointListInsert";
-import { SGraphPointListUpdate } from "./commands/SGraphPointListUpdate";
-import { SGraphPropertyCommand } from "./commands/SGraphPropertyCommand";
-
-export {SGraphDeleteListCommand,SBasePolylineEdit, SBaseIconTextEdit, SBasePolygonEdit, SBaseTextEdit, SBaseImageEdit, SBaseLineEdit, SBaseCircleEdit, SBaseTriangleEdit, SBaseRectEdit, SBaseArrowEdit, SGraphEditScene, SGraphEdit, SGraphCommand, SGraphAddCommand, SGraphMoveCommand, SGraphPointListDelete, SGraphPointListInsert, SGraphPointListUpdate, SGraphPropertyCommand }

+ 0 - 558
src/components/editClass/edit/items/SBaseArrowEdit.ts

@@ -1,558 +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 { SArrowStyleType, SColor, SLine, SPainter, SPoint, SRect } from "@persagy-web/draw";
-import { SMouseButton, SMouseEvent, SUndoStack } from "@persagy-web/base";
-import { SItemStatus } from "@persagy-web/big";;
-import {
-  SLineStyle,
-  SGraphItem, SGraphPointListInsert, SGraphPointListUpdate
-} from "@persagy-web/graph/";
-import { SGraphEdit } from "..";
-import { SMathUtil } from '@persagy-web/big/lib/utils/SMathUtil';
-import { Marker } from "./../type/Marker";
-
-/**
- * 折线编辑类
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export class SBaseArrowEdit extends SGraphEdit {
-  /** 编辑相关操作的数据 */
-  data: Marker;
-  /** undo/redo 堆栈 */
-  private undoStack: SUndoStack = new SUndoStack();
-  /** 是否绘制完成 */
-  _status: SItemStatus = SItemStatus.Normal;
-  get status(): SItemStatus {
-    return this._status;
-  } // Get status
-  set status(v: SItemStatus) {
-    this._status = v;
-    if (this.undoStack) {
-      this.undoStack.clear();
-    }
-
-    this.update();
-  } // Set status
-
-  /** 矩形两个对角 */
-  private _line: SPoint[] = [];
-  get line(): SPoint[] {
-    return this._line;
-  } // Get line
-  set line(arr: SPoint[]) {
-    this._line = arr;
-    this.update();
-  } // Get line
-
-  /** 矩形左上角 */
-  private _leftTop: SPoint = new SPoint();
-  /** 矩形右下角 */
-  private _rightBottom: SPoint = new SPoint();
-  /** 拖动灵敏度 */
-  dis: number = 5;
-  /** 拖动灵敏度 */
-  private sceneDis: number = 5;
-  /** 是否垂直水平绘制  */
-  private _verAndLeve: Boolean = false;
-  get verAndLeve(): Boolean {
-    return this._verAndLeve;
-  } // Get verAndLeve
-  set verAndLeve(bool: Boolean) {
-    this._verAndLeve = bool;
-    this.update();
-  } // Set verAndLeve
-
-  /** 当前点索引 */
-  curIndex: number = -1;
-  /** 当前点坐标 */
-  private curPoint: SPoint | null = null;
-  /** 线条颜色 */
-  _strokeColor: SColor = SColor.Black;
-  get strokeColor(): SColor {
-    return this._strokeColor;
-  } // Get strokeColor
-  set strokeColor(v: SColor) {
-    this._strokeColor = v;
-    this.update();
-  } // Set strokeColor
-
-  /** 填充色 */
-  _fillColor: SColor = new SColor("#2196f3");
-  get fillColor(): SColor {
-    return this._fillColor;
-  } // Get fillColor
-  set fillColor(v: SColor) {
-    this._fillColor = v;
-    this.update();
-  } // Set fillColor
-
-  /** 选中端点填充色 */
-  private _activeFillColor: SColor = new SColor("#2196f3");
-  get activeFillColor(): SColor {
-    return this._activeFillColor;
-  } // Get activeFillColor
-  set activeFillColor(v: SColor) {
-    this._activeFillColor = v;
-    this.update();
-  } // Set activeFillColor
-
-  /** 边框样式 */
-  _lineStyle: SLineStyle = SLineStyle.Solid;
-  get lineStyle(): SLineStyle {
-    return this._lineStyle;
-  } // Get lineStyle
-  set lineStyle(v: SLineStyle) {
-    this._lineStyle = v;
-    this.update();
-  } // Set lineStyle
-
-  /** 线条宽度 */
-  _lineWidth: number = 1;
-  get lineWidth(): number {
-    return this._lineWidth;
-  } // Get lineWidth
-  set lineWidth(v: number) {
-    this._lineWidth = v;
-    this.update();
-  } // Set lineWidth
-
-  /**
-   * 构造函数
-   *
-   * @param parent    指向父对象
-   * @param data      数据
-   */
-  constructor(parent: SGraphItem | null, data: Marker) {
-    super(parent);
-    this.showSelect = false;
-    this.data = data;
-    if (data.style && data.style.default) {
-      // 关于顶点
-      if (data.style.default.line) {
-        let setPointList: SPoint[];
-        setPointList = data.style.default.line.map(i => {
-          return new SPoint(i.x, i.y)
-        });
-        this.line = setPointList;
-      }
-
-      // 颜色
-      if (data.style.default.strokeColor) {
-        this.strokeColor = new SColor(data.style.default.strokeColor)
-      }
-
-      // 线宽
-      if (data.style.default.LineWidth) {
-        this.lineWidth = data.style.default.lineWidth
-      }
-
-      // 线样式
-      if (data.style.default.LineStyle) {
-        this.lineStyle = data.style.default.lineStyle
-      }
-    }
-  } // Constructor
-
-  /**
-   * 鼠标双击事件
-   *
-   * @param	event   事件参数
-   * @return 是否处理该事件
-  */
-  onDoubleClick(event: SMouseEvent): boolean {
-    if (this.status == SItemStatus.Normal) {
-      this.status = SItemStatus.Edit;
-      this.grabItem(this);
-    } else if (this.status == SItemStatus.Edit) {
-      this.status = SItemStatus.Normal;
-      this.releaseItem();
-    }
-
-    this.update();
-    return true;
-  } // Function onDoubleClick()
-
-  /**
-   * 鼠标按下事件
-   *
-   * @param event   鼠标事件
-   * @return  是否处理该事件
-  */
-  onMouseDown(event: SMouseEvent): boolean {
-    this.curIndex = -1;
-    this.curPoint = null;
-    if (event.shiftKey || this._verAndLeve) {
-      event = this.compare(event);
-    }
-
-    if (event.buttons == SMouseButton.LeftButton) {
-      if (this.status == SItemStatus.Normal) {
-        return super.onMouseDown(event);
-      } else if (this.status == SItemStatus.Edit) {
-        // 判断是否点击到端点上(获取端点索引值)
-        this.findNearestPoint(new SPoint(event.x, event.y));
-      } else if (this.status == SItemStatus.Create) {
-        this.addPoint(new SPoint(event.x, event.y));
-        return true;
-      }
-    }
-
-    return true;
-  } // Function onMouseDown()
-
-  /**
-   * shift 垂直水平创建或编辑
-   *
-   * @param event   事件
-   * @return  返回鼠标事件
-  */
-  compare(event: SMouseEvent): SMouseEvent {
-    if (this.line.length) {
-      let last = new SPoint(event.x, event.y);
-      if (this.status == SItemStatus.Create) {
-        last = this.line[0];
-      } else if (this.status == SItemStatus.Edit) {
-        if (this.curIndex == 1) {
-          last = this.line[0];
-        } else if (this.curIndex == 0) {
-          last = this.line[1];
-        }
-      }
-
-      const dx = Math.abs(event.x - last.x);
-      const dy = Math.abs(event.y - last.y);
-      if (dy > dx) {
-        event.x = last.x;
-      } else {
-        event.y = last.y;
-      }
-    }
-
-    return event;
-  } // Function compare()
-
-  /**
-   * 获取点击点与 Point[] 中的点距离最近点
-   *
-   * @param p   鼠标点击点
-  */
-  findNearestPoint(p: SPoint): void {
-    let len = this.sceneDis;
-    for (let i = 0; i < this.line.length; i++) {
-      let dis = SMathUtil.pointDistance(
-        p.x,
-        p.y,
-        this.line[i].x,
-        this.line[i].y
-      );
-      if (dis < len) {
-        len = dis;
-        this.curIndex = i;
-        this.curPoint = new SPoint(this.line[this.curIndex]);
-      }
-    }
-  } // Function findNearestPoint()
-
-  /**
-   * 鼠标移动事件
-   *
-   * @param event   鼠标事件
-   * @return  是否处理事件
-  */
-  onMouseMove(event: SMouseEvent): boolean {
-    if (event.shiftKey || this._verAndLeve) {
-      event = this.compare(event);
-    }
-
-    if (this.status == SItemStatus.Create) {
-      if (this.line[0] instanceof SPoint) {
-        this.line[1] = new SPoint(event.x, event.y);
-        this.calRect()
-      }
-    } else if (this.status == SItemStatus.Edit) {
-      if (-1 != this.curIndex) {
-        this.line[this.curIndex].x = event.x;
-        this.line[this.curIndex].y = event.y;
-        this.calRect()
-      }
-    } else {
-      return super.onMouseMove(event);
-    }
-
-    this.update();
-    return true;
-  } // Function onMouseMove()
-
-  /**
-   * 鼠标抬起事件
-   *
-   * @param	event   事件参数
-   * @return 是否处理该事件
-  */
-  onMouseUp(event: SMouseEvent): boolean {
-    if (this.status == SItemStatus.Edit) {
-      if (this.curIndex > -1) {
-        const p = new SPoint(
-          this.line[this.curIndex].x,
-          this.line[this.curIndex].y
-        );
-        this.recordAction(SGraphPointListUpdate, [
-          this.line,
-          this.curPoint,
-          p,
-          this.curIndex
-        ]);
-      }
-    } else if (this.status == SItemStatus.Normal) {
-      super.onMouseUp(event)
-      return true;
-    }
-
-    this.curIndex = -1;
-    this.curPoint = null;
-    return true;
-  } // Function onMouseUp()
-
-  /**
-   * 计算矩形的左上角和右下角
-  */
-  private calRect(): void {
-    if (this.line.length > 1) {
-      const fi = this.line[0];
-      const se = this.line[1];
-      let minx, maxx, miny, maxy;
-      if (fi.x < se.x) {
-        minx = fi.x;
-        maxx = se.x;
-      } else {
-        minx = se.x;
-        maxx = fi.x;
-      }
-
-      if (fi.y < se.y) {
-        miny = fi.y;
-        maxy = se.y;
-      } else {
-        miny = se.y;
-        maxy = fi.y;
-      }
-
-      this._leftTop = new SPoint(minx, miny)
-      this._rightBottom = new SPoint(maxx, maxy)
-    }
-  } // Function calRect
-
-  /**
-   * 添加点至数组中
-   *
-   * @param p   添加的点
-  */
-  private addPoint(p: SPoint): void {
-    if (this.line.length < 2) {
-      this.line.push(p);
-      this.recordAction(SGraphPointListInsert, [this.line, p]);
-    } else {
-      this.line[1] = p;
-      this.recordAction(SGraphPointListInsert, [this.line, p, 1]);
-      this.status = SItemStatus.Normal;
-      this.releaseItem();
-      this.$emit("finishCreated");
-    }
-
-    this.calRect()
-    this.update();
-  } // Function addPoint()
-
-  /**
-   * 移动后处理所有坐标,并肩原点置为场景原点
-  */
-  moveToOrigin(): void {
-    this.line = this.line.map(t => {
-      t.x = t.x + this.x;
-      t.y = t.y + this.y;
-      return t;
-    });
-
-    this.x = 0;
-    this.y = 0;
-  } // Function moveToOrigin()
-
-  /**
-   * 记录相关动作并推入栈中
-   *
-   * @param	SGraphCommand   相关命令类
-   * @param	any             对应传入参数
-  */
-  protected recordAction(SGraphCommand: any, any: any[]): void {
-    // 记录相关命令并推入堆栈中
-    const command = new SGraphCommand(this.scene, this, ...any);
-    this.undoStack.push(command);
-  } // Function recordAction()
-
-  /**
-   * 判断点是否在区域内
-   *
-   * @param x   x 横向坐标
-   * @param y   y 纵向坐标
-   * @return  在区域内返回 true, 否则 false
-  */
-  contains(x: number, y: number): boolean {
-    if (this.line.length == 2) {
-      let p = new SPoint(x, y);
-      if (
-        SMathUtil.pointToLine(p, new SLine(this.line[0], this.line[1]))
-          .MinDis < this.dis
-      ) {
-        return true;
-      }
-    }
-
-    return false;
-  } // Function contains()
-
-  /**
-   * Item 对象边界区域
-   *
-   * @return 外接矩阵
-  */
-  boundingRect(): SRect {
-    if (this.line.length > 1) {
-      this.calRect()
-      return new SRect(this._leftTop, this._rightBottom);
-    }
-
-    return new SRect()
-  } // Function boundingRect()
-
-  /**
-   * 撤销操作
-  */
-  undo(): void {
-    if (this._status != SItemStatus.Normal) {
-      this.undoStack.undo();
-    }
-  } // Function undo()
-
-  /**
-   * 重做操作
-  */
-  redo(): void {
-    if (this._status != SItemStatus.Normal) {
-      this.undoStack.redo();
-    }
-  } // Function redo()
-
-  /**
-   * 取消操作执行
-  */
-  cancelOperate(): void {
-    if (this.status == SItemStatus.Create) {
-      this.parent = null;
-      this.releaseItem();
-    } else if (this.status == SItemStatus.Edit) {
-      this.status = SItemStatus.Normal;
-      this.releaseItem();
-    }
-  } // Function cancelOperate()
-
-  /**
-   * Item绘制操作
-   *
-   * @param painter   绘制对象
-  */
-  onDraw(painter: SPainter): void {
-    painter.pen.color = this.strokeColor;
-    if (this.line.length == 2) {
-      painter.brush.color = this.fillColor;
-      painter.pen.lineWidth = this.lineWidth
-      if (this.lineStyle == SLineStyle.Dashed) {
-        painter.pen.lineDash = [
-          painter.toPx(this.lineWidth * 3),
-          painter.toPx(this.lineWidth * 7)
-        ];
-      } else if (this.lineStyle == SLineStyle.Dotted) {
-        painter.pen.lineDash = [
-          painter.toPx(this.lineWidth * 2),
-          painter.toPx(this.lineWidth * 2)
-        ];
-      }
-
-      if (this.selected && this.status == SItemStatus.Normal) {
-        painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
-        painter.shadow.shadowBlur = 10;
-        painter.shadow.shadowColor = new SColor(`#00000033`);
-        painter.shadow.shadowOffsetX = 5;
-        painter.shadow.shadowOffsetY = 5;
-      }
-
-      painter.drawArrowLine(this.line[0], this.line[1], { begin: SArrowStyleType.None, end: SArrowStyleType.Basic });
-      if (
-        this.status == SItemStatus.Edit ||
-        this.status == SItemStatus.Create
-      ) {
-        // 绘制端点
-        this.line.forEach((p, i): void => {
-          painter.brush.color = this.fillColor;
-          if (i == this.curIndex) {
-            painter.brush.color = this.activeFillColor;
-          }
-          painter.drawCircle(p.x, p.y, painter.toPx(5));
-        });
-      }
-
-    } else if (this.line.length == 1) {
-      if (
-        this.status == SItemStatus.Edit ||
-        this.status == SItemStatus.Create
-      ) {
-        // 绘制端点
-        painter.brush.color = this.fillColor;
-        painter.drawCircle(
-          this.line[0].x,
-          this.line[0].y,
-          painter.toPx(5)
-        );
-      }
-    }
-  } // Function onDraw()
-
-  /**
-   * 返回对象储存的相关数据
-   *
-   * @return	实体类保存得数据
-  */
-  toData(): any {
-    this.moveToOrigin()
-    const Line = [{ x: this.line[0].x, y: this.line[0].y }, { x: this.line[1].x, y: this.line[1].y }];
-    this.data.style.default.line = Line;
-    this.data.style.default.lineWidth = this.lineWidth;
-    this.data.style.default.lineStyle = this.lineStyle;
-    this.data.style.default.strokeColor = this.strokeColor;
-    return this.data
-  } // Function toData()
-} // Class SArrowEdit

+ 0 - 409
src/components/editClass/edit/items/SBaseCircleEdit.ts

@@ -1,409 +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 { SColor, SPainter, SPoint, SRect } from "@persagy-web/draw";
-import { SMouseButton, SMouseEvent, SUndoStack } from "@persagy-web/base";
-import { SItemStatus } from "@persagy-web/big";;
-import {
-  SLineStyle,
-  SGraphItem, SGraphPointListInsert
-} from "@persagy-web/graph/";
-import { SGraphEdit } from "..";
-import { Marker } from "../type/Marker";
-
-/**
- * 折线编辑类
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export class SBaseCircleEdit extends SGraphEdit {
-  /** 编辑相关操作的数据 */
-  data: Marker
-  _status: SItemStatus = SItemStatus.Normal;
-  get status(): SItemStatus {
-    return this._status;
-  } // Get status
-  set status(v: SItemStatus) {
-    this._status = v;
-    this.undoStack.clear();
-    this.update();
-  } // Set status
-
-  /** 矩形两个对角 */
-  private _line: SPoint[] = [];
-  get line(): SPoint[] {
-    return this._line;
-  } // Get line
-  set line(arr: SPoint[]) {
-    this._line = arr;
-    this.update();
-  } // Set line
-
-  /** 矩形左上角 */
-  private _leftTop: SPoint = new SPoint();
-  /** 矩形右下角 */
-  private _rightBottom: SPoint = new SPoint();
-  /** 绘制矩形的圆角半径 */
-  private _radius: number = 0;
-  get radius(): number {
-    return this._radius;
-  } // Get radius
-  set radius(v: number) {
-    if (v == this._radius) {
-      return;
-    }
-
-    this._radius = v;
-    this.update();
-  } // Set radius
-
-  /** 线条颜色 */
-  _strokeColor: SColor = SColor.Black;
-  get strokeColor(): SColor {
-    return this._strokeColor;
-  } // Get strokeColor
-  set strokeColor(v: SColor) {
-    this._strokeColor = v;
-    this.update();
-  } // Set strokeColor
-
-  /** 填充色 */
-  _fillColor: SColor = new SColor("#2196f3");
-  get fillColor(): SColor {
-    return this._fillColor;
-  } // Get fillColor
-  set fillColor(v: SColor) {
-    this._fillColor = v;
-    this.update();
-  } // Set fillColor
-
-  /** 边框样式 */
-  _lineStyle: SLineStyle = SLineStyle.Solid;
-  get lineStyle(): SLineStyle {
-    return this._lineStyle;
-  } // Get lineStyle
-  set lineStyle(v: SLineStyle) {
-    this._lineStyle = v;
-    this.update();
-  } // Set lineStyle
-
-  /** 线条宽度 */
-  _lineWidth: number = 1;
-  get lineWidth(): number {
-    return this._lineWidth;
-  } // Get lineWidth
-  set lineWidth(v: number) {
-    this._lineWidth = v;
-    this.update();
-  } // Set lineWidth
-
-  /** undo/redo 堆栈 */
-  private undoStack: SUndoStack = new SUndoStack();
-
-  /**
-   * 构造函数
-   *
-   * @param parent    指向父对象
-   * @param data      矩形数据
-  */
-  constructor(parent: SGraphItem | null, data: Marker) {
-    super(parent);
-    this.data = data;
-    if (data.style) {
-      // 关于顶点
-      if (data.style.line) {
-        let setPointList: SPoint[];
-        setPointList = data.style.line.map(i => {
-          return new SPoint(i.x, i.y)
-        });
-        this.line = setPointList;
-        this.calRect()
-      }
-    }
-
-    if (data.style && data.style.default) {
-
-      // 颜色
-      if (data.style.default.strokeColor) {
-        this.strokeColor = new SColor(data.style.default.strokeColor)
-      }
-
-      // 线宽
-      if (data.style.default.lineWidth) {
-        this.lineWidth = data.style.default.lineWidth
-      }
-
-      // 线样式
-      if (data.style.default.lineStyle) {
-        this.lineStyle = data.style.default.lineStyle
-      }
-    }
-  } // Constructor
-
-  /**
-   * 大小改变
-   *
-   * @param oldSize  旧数据
-   * @param newSize  新数据
-  */
-  resize(oldSize: SRect, newSize: SRect): void {
-    const xs = newSize.width / oldSize.width;
-    const ys = newSize.height / oldSize.height;
-    this.line = this.line.map(t => {
-      t.x = t.x * xs;
-      t.y = t.y * ys;
-      return t
-    })
-
-    this.calRect()
-    this.update()
-  } // Function resize()
-
-  /**
-   * 鼠标按下事件
-   *
-   * @param event   鼠标事件
-   * @return 是否处理事件
-  */
-  onMouseDown(event: SMouseEvent): boolean {
-    if (event.buttons == SMouseButton.LeftButton) {
-      if (this.status == SItemStatus.Create) {
-        this.addPoint(new SPoint(event.x, event.y));
-        return true;
-      } else {
-        // return super.onMouseDown(event);
-        super.onMouseDown(event);
-        return true;
-      }
-    }
-
-    return true;
-  } // Function onMouseDown()
-
-  /**
-   * 鼠标移动事件
-   *
-   * @param event   鼠标事件
-   * @return 是否处理事件
-  */
-  onMouseMove(event: SMouseEvent): boolean {
-    if (this.status == SItemStatus.Create) {
-      if (this.line[0] instanceof SPoint) {
-        this.line[1] = new SPoint(event.x, event.y);
-        this.calRect()
-      }
-    } else {
-      return super.onMouseMove(event);
-    }
-
-    this.update();
-    return true;
-  } // Function onMouseMove()
-
-  /**
-   * 鼠标抬起事件
-   *
-   * @param	event    事件参数
-   * @return 是否处理该事件
-  */
-  onMouseUp(event: SMouseEvent): boolean {
-    if (this.status != SItemStatus.Create) {
-      super.onMouseUp(event);
-    }
-
-    return true;
-  } // Function onMouseUp()
-
-  /**
-   * 计算矩形的左上角和右下角
-  */
-  private calRect(): void {
-    if (this.line.length > 1) {
-      const fi = this.line[0];
-      const se = this.line[1];
-      let minx, maxx, miny, maxy;
-      if (fi.x < se.x) {
-        minx = fi.x;
-        maxx = se.x;
-      } else {
-        minx = se.x;
-        maxx = fi.x;
-      }
-
-      if (fi.y < se.y) {
-        miny = fi.y;
-        maxy = se.y;
-      } else {
-        miny = se.y;
-        maxy = fi.y;
-      }
-
-      this._leftTop = new SPoint(minx, miny)
-      this._rightBottom = new SPoint(maxx, maxy)
-    }
-  } // Function calRect()
-
-  /**
-   * 添加点至数组中
-   *
-   * @param p   添加的点
-  */
-  private addPoint(p: SPoint): void {
-    if (this.line.length < 2) {
-      this.line.push(p);
-      this.recordAction(SGraphPointListInsert, [this.line, p]);
-    } else {
-      this.line[1] = p;
-      this.recordAction(SGraphPointListInsert, [this.line, p, 1]);
-      this.status = SItemStatus.Normal;
-      this.releaseItem();
-      this.$emit("finishCreated");
-    }
-
-    this.calRect()
-    this.update();
-  } // Function addPoint()
-
-  /**
-   * 记录相关动作并推入栈中
-   *
-   * @param	SGraphCommand   相关命令类
-   * @param	any             对应传入参数
-  */
-  protected recordAction(SGraphCommand: any, any: any[]): void {
-    // 记录相关命令并推入堆栈中
-    const command = new SGraphCommand(this.scene, this, ...any);
-    this.undoStack.push(command);
-  } // Function recordAction()
-
-  /**
-   * Item 对象边界区域
-   *
-   * @return SRect   外接矩阵
-  */
-  boundingRect(): SRect {
-    if (this.line.length > 1) {
-      this.calRect()
-      return new SRect(this._leftTop, this._rightBottom);
-    }
-
-    return new SRect()
-  } // Function boundingRect()
-
-  /**
-   * 撤销操作
-  */
-  undo(): void {
-    if (this._status != SItemStatus.Normal) {
-      this.undoStack.undo();
-    }
-  } // Function undo()
-
-  /**
-   * 重做操作
-  */
-  redo(): void {
-    if (this._status != SItemStatus.Normal) {
-      this.undoStack.redo();
-    }
-  } // Function redo()
-
-  /**
-   * 取消操作执行
-  */
-  cancelOperate(): void {
-    if (this.status == SItemStatus.Create) {
-      this.parent = null;
-      this.releaseItem();
-    } else if (this.status == SItemStatus.Edit) {
-      this.status = SItemStatus.Normal;
-      this.releaseItem();
-    }
-  } // Function cancelOperate()
-
-   /**
-     * 移动后处理所有坐标,并肩原点置为场景原点
-     */
-    moveToOrigin(): void {
-      this.line = this.line.map(t => {
-          t.x = t.x + this.x;
-          t.y = t.y + this.y;
-          return t;
-      });
-
-      this.x = 0;
-      this.y = 0;
-    } // Function moveToOrigin()
-  
-  /**
-   * 返回对象储存的相关数据
-   *
-   * @return  实体类数据
-  */
-  toData(): any {
-    // 将原点移动到场景原点
-    this.moveToOrigin();
-    const Line = [{ x: this.line[0].x, y: this.line[0].y }, { x: this.line[1].x, y: this.line[1].y }];
-    this.data.style.line = Line;
-    this.data.style.default.lineWidth = this.lineWidth;
-    this.data.style.default.lineStyle = this.lineStyle;
-    this.data.style.default.strokeColor = this.strokeColor.value;
-    this.data.style.default.fillColor = this.fillColor.value;
-    return this.data
-  } // Function toData()
-
-  /**
-   * Item 绘制操作
-   *
-   * @param painter    绘制对象
-  */
-  onDraw(painter: SPainter): void {
-    if (this.line.length == 2) {
-      this.calRect()
-      painter.pen.color = this.strokeColor;
-      painter.brush.color = this.fillColor;
-      painter.pen.lineWidth = this.lineWidth;
-      if (this.lineStyle == SLineStyle.Dashed) {
-        painter.pen.lineDash = [
-          painter.toPx(this.lineWidth * 3),
-          painter.toPx(this.lineWidth * 7)
-        ];
-      } else if (this.lineStyle == SLineStyle.Dotted) {
-        painter.pen.lineDash = [
-          painter.toPx(this.lineWidth * 2),
-          painter.toPx(this.lineWidth * 2)
-        ];
-      }
-
-      painter.drawEllipse(
-        (this._leftTop.x + this._rightBottom.x) / 2,
-        (this._leftTop.y + this._rightBottom.y) / 2,
-        (this._rightBottom.x - this._leftTop.x) / 2,
-        (this._rightBottom.y - this._leftTop.y) / 2
-      );
-    }
-  } // Function onDraw()
-} // Class SCircleEdit

+ 0 - 558
src/components/editClass/edit/items/SBaseIconTextEdit.ts

@@ -1,558 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .F88X
- *        X8888Y
- *      .}888888N;
- *        i888888N;        .:!              .I$WI:
- *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
- *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
- *            +888888N;  .8888888Y                                  "&&8Y.}8,
- *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
- *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
- *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
- *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
- *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
- *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
- *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
- *      .:R888888I
- *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
- *        ~8888'
- *        .!88~                                                                     All rights reserved.
- *
- * *********************************************************************************************************************
- */
-
-import {
-    SImageItem,
-    STextItem,
-    SAnchorItem,
-    SGraphItem,
-} from "@persagy-web/graph";
-import { SItemStatus, ItemOrder } from "@persagy-web/big";
-import { Anchor } from "@persagy-web/big/lib/types/topology/Anchor"
-import { SMouseEvent } from "@persagy-web/base";
-import {
-    SSize,
-    SRect,
-    SPainter,
-    SColor,
-    SFont,
-    SPoint
-} from "@persagy-web/draw";
-import { SGraphEdit, SBaseTextEdit, SBaseImageEdit } from "..";
-import { Marker } from "../type/Marker";
-
-/**
- * 图标
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-
-export class SBaseIconTextEdit extends SGraphEdit {
-    /** item 数据*/
-    _data: Marker | null = null;
-    get data(): Marker | null {
-        return this._data;
-    } // Get data
-    set data(v: Marker | null) {
-        this._data = v;
-        this.initData()
-        this.update();
-    } // Set data
-
-    /** item 状态 */
-    _status: SItemStatus = SItemStatus.Normal;
-    get status(): SItemStatus {
-        return this._status;
-    } // Get status
-    set status(v: SItemStatus) {
-        this._status = v;
-        if (v == SItemStatus.Normal) {
-            this.moveable = true;
-            this.textItemList.map(item => {
-                item.moveable = false
-            });
-            this.img.moveable = false;
-        } else if (v == SItemStatus.Edit) {
-            this.moveable = false;
-            this.textItemList.map(item => {
-                item.moveable = true
-            });
-            this.img.moveable = true;
-        } else if (v == SItemStatus.Create) {
-            this.moveable = true;
-            this.textItemList.map(item => {
-                item.moveable = false
-            });
-            this.img.moveable = false;
-        }
-
-        this.update();
-    } // Set status
-
-    /** 锚点 list */
-    anchorList: SAnchorItem[] = [];
-    /** 是否显示文字 */
-    _showText: boolean = true;
-    get showText(): boolean {
-        return this._showText;
-    } // Get showText
-    set showText(v: boolean) {
-        if (v === this._showText) {
-            return;
-        }
-
-        this._showText = v;
-        if (v) {
-            this.textItemList.map(item => {
-                item.show()
-            });
-        } else {
-            this.textItemList.map(item => {
-                item.hide()
-            });
-        }
-    } // Set showText
-
-    /** 是否被选中 */
-    get selected(): boolean {
-        return this._selected && this.selectable && this.enabled;
-    } // Get selected
-    set selected(value: boolean) {
-        // 如果选择状态未变更
-        if (this.selected == value) {
-            return;
-        }
-
-        this._selected = value;
-        if (value) {
-            this.img.scale = 1.25;
-            this.zOrder = ItemOrder.highLightOrder;
-        } else {
-            this.img.scale = 1;
-            this.zOrder = ItemOrder.markOrder;
-        }
-
-        this.update();
-    } // Set selected
-
-    /** 是否激活 */
-    _isActive: boolean = false;
-    get isActive(): boolean {
-        return this._isActive;
-    } // Get isActive
-    set isActive(v: boolean) {
-        this._isActive = v;
-        if (v) {
-            this.cursor = "pointer";
-            this.textItemList.map(item => {
-                item.cursor = "pointer"
-            });
-            this.img.cursor = "pointer";
-        } else {
-            this.cursor = "auto";
-            this.textItemList.map(item => {
-                item.cursor = "auto"
-            });
-            this.img.cursor = "auto";
-        }
-
-        this.update();
-    } // Set isActive
-
-    /** 激活显示颜色 */
-    _activeColor: SColor = new SColor("#00000033");
-    get activeColor(): SColor {
-        return this._activeColor;
-    } // Get activeColor
-    set activeColor(v: SColor) {
-        this._activeColor = v;
-        this.update();
-    } // Set activeColor
-
-    /** X 轴坐标 */
-    get x(): number {
-        return this.pos.x;
-    } // Get x
-    set x(v: number) {
-        this.pos.x = v;
-        this.$emit("changePos");
-        this.update();
-    } // Set x
-
-    /** Y 轴坐标 */
-    get y(): number {
-        return this.pos.y;
-    } // Get y
-    set y(v: number) {
-        this.pos.y = v;
-        this.$emit("changePos");
-        this.update();
-    } // Set y
-
-    /** icon 宽 */
-    get sWidth(): number {
-        return this.img.width;
-    } // Get sWidth
-    set sWidth(v: number) {
-        this.img.width = v;
-        this.img.origin = new SPoint(
-            this.img.width * 0.5,
-            this.img.height * 0.5
-        );
-        this.changeAnchorPoint();
-        this.update();
-    } // Set sWidth
-
-    /** icon 高 */
-    get sHeight(): number {
-        return this.img.height;
-    } // Get sHeight
-    set sHeight(v: number) {
-        this.img.height = v;
-        this.img.origin = new SPoint(
-            this.img.width * 0.5,
-            this.img.height * 0.5
-        );
-        this.changeAnchorPoint();
-        this.update();
-    } // Set sHeight
-
-    /** 是否显示锚点 */
-    private _showAnchor: boolean = true;
-    get showAnchor(): boolean {
-        return this._showAnchor;
-    } // Get showAnchor
-    set showAnchor(v: boolean) {
-        this._showAnchor = v;
-        this.anchorList.forEach(t => {
-            t.visible = v;
-        });
-    } // Set showAnchor
-
-    /** 文本颜色 */
-    get color(): SColor {
-        if (this.textItemList.length) {
-            return this.textItemList[0].color;
-        } else {
-            return new SColor();
-        }
-    } // Get color
-    set color(v: SColor) {
-        this.textItemList.forEach(item => {
-            item.color = v;
-        })
-        this.update();
-    } // Set color
-
-    /** 文本字体 */
-    get font(): SFont {
-        if (this.textItemList.length) {
-            return this.textItemList[0].font
-        } else {
-            return new SFont
-        }
-    } // Get font
-
-    set font(v: SFont) {
-        this.textItemList.forEach(item => {
-            item.font = v
-        })
-        this.update();
-    } // Set font
-
-    /** 图像 */
-    img: SBaseImageEdit = new SBaseImageEdit(this);
-
-    /** 文本数组 */
-    textItemList: SBaseTextEdit[] = [];
-
-    /** 当前选中的文本item */
-    curTextItem: SBaseTextEdit | null = null;
-
-    /**
-     * 构造体
-     *
-     * @param parent  父节点
-     * @param data    锚点数据
-    */
-    constructor(parent: SGraphItem | null, data: Marker | null = null) {
-        super(parent);
-        this.showSelect = false;
-        this.img.showSelect = false;
-        this.data = data;
-    } // Constructor
-
-    /**
-     * 如果 data 设置;初始化data
-     */
-    initData() {
-        if (!this.data) return;
-        if (this.data.size) {
-            this.sWidth = this.data.size.width;
-            this.sHeight = this.data.size.height;
-        }
-        this.img.connect("onMove", this, this.changeAnchorPoint.bind(this));
-        const anchorPoint = [
-            { x: this.img.x, y: this.img.y, id: "" },
-        ];
-        this.anchorList = anchorPoint.map(t => {
-            let item = new SAnchorItem(this);
-            if (t.id) {
-                item.id = t.id;
-            }
-            item.moveTo(t.x, t.y);
-            return item;
-        });
-
-        this.showAnchor = false;
-        // 对文本数据进行处理
-        if (this.data.style && this.data.style.default && this.data.style.default.textList) {
-            const textList = this.data.style.default.textList;
-            if (textList.length) {
-                const textItemList: any[] = [];
-                textList.forEach((item: any, index: number) => {
-                    let obj = new SBaseTextEdit(this, null);
-                    obj.propertyData = item;
-                    obj.text = item.text;
-                    if (item.pos) {
-                        obj.moveTo(item.pos.x, item.pos.x)
-                    } else {
-                        obj.moveTo(
-                            this.img.width * 0.5,
-                            -(this.font.size * 1.25 * 0.5) + (index) * 10
-                        );
-                    }
-                    obj.font.size = item.font;
-                    obj.isTransform = false;
-                    obj.showSelect = false;
-                    obj.color = new SColor(item.color);
-                    obj.connect('textSelect', this, this.textSelectChange)
-                    textItemList.push(obj)
-                })
-                this.textItemList = textItemList;
-            }
-        }
-        this.img.url = this.data.style.default.url;
-
-        this.x = this.data.pos.x;
-        this.y = this.data.pos.y
-
-        this.moveable = true;
-        this.selectable = true;
-    }// Function initData()
-
-    /**
-     * 添加文本
-     *
-     * @param item 文本图例
-     */
-    addTextItem(item: SBaseTextEdit) {
-        this.textItemList.push(item)
-    }// Function addTextItem
-
-    /**
-     * 删除文本
-     *
-     * @param index 索引
-     */
-    removeTextItem(index: number) {
-        let [delteItem] = this.textItemList.splice(index, 1);
-        if (this.scene) {
-            this.scene.removeItem(delteItem)
-        }
-    }// Function removeTextItem
-
-    /**
-     * 计算并移动锚点的位置
-     */
-    changeAnchorPoint(): void {
-        // 判断是否有锚点
-        if (this.anchorList.length) {
-            let anchorPoint = [
-                { x: this.img.x, y: this.img.y },
-                { x: this.img.x, y: this.img.y },
-                { x: this.img.x, y: this.img.y },
-                { x: this.img.x, y: this.img.y }
-            ];
-            this.anchorList.forEach((item, index) => {
-                item.moveTo(anchorPoint[index].x, anchorPoint[index].y);
-            });
-        }
-    } // Function changeAnchorPoint()
-
-    /**
-     * 选中的文本item变化
-    */
-    textSelectChange(item: SBaseTextEdit): void {
-        this.curTextItem = item;
-    } // Function textSelectChange()
-
-    /**
-     * 鼠标按下事件
-     *
-     * @param event   事件对象
-     * @return  是否处理事件
-    */
-    onMouseDown(event: SMouseEvent): boolean {
-        this.curTextItem = null;
-        if (this.status == SItemStatus.Normal) {
-            super.onMouseDown(event)
-            return true;
-        } else if (this.status == SItemStatus.Edit) {
-            return super.onMouseDown(event);
-        }
-        return true;
-    } // Function onMouseDown()
-
-    /**
-     * 宽高发发生变化
-     *
-     * @param oldSize   改之前的大小
-     * @param newSize   改之后大小
-    */
-    onResize(oldSize: SSize, newSize: SSize) {
-        // console.log(arguments);
-    } // Function onResize()
-
-    /**
-     * 鼠标双击事件
-     *
-     * @param event   鼠标事件
-     * @return 是否处理事件
-    */
-    onDoubleClick(event: SMouseEvent): boolean {
-        // 如果位show状态 双击改对象则需改为编辑状态
-        if (SItemStatus.Normal == this.status) {
-            this.status = SItemStatus.Edit;
-            this.grabItem(this);
-        } else if (SItemStatus.Edit == this.status) {
-            this.status = SItemStatus.Normal;
-            this.releaseItem();
-        }
-
-        this.update();
-        return true;
-    } // Function onDoubleClick()
-
-    /**
-     * 宽高发生变化
-     *
-     * @return SRect   所有子对象的并集
-    */
-    boundingRect(): SRect {
-        let rect = this.img
-            .boundingRect()
-            .adjusted(this.img.pos.x, this.img.pos.y, 0, 0);
-        if (this.showText) {
-            this.textItemList.forEach(item => {
-                rect = rect.unioned(
-                    item
-                        .boundingRect()
-                        .adjusted(item.pos.x, item.pos.y, 0, 0)
-                );
-            })
-        }
-        return rect.adjusted(-5, -5, 10, 10);
-    } // Function boundingRect()
-
-    /**
-     * Item 绘制操作
-     *
-     * @param painter    绘制对象
-     */
-    onDraw(painter: SPainter): void {
-        const rect = this.boundingRect();
-        const lw = painter.toPx(1);
-        // 编辑态和选中态出现绘制区域
-        if (this.status == SItemStatus.Edit || this.selected) {
-            // doto 如果子元素被选中
-            painter.pen.lineWidth = lw;
-            painter.pen.lineDash = [3 * lw, 7 * lw];
-            painter.pen.color = SColor.Black;
-            painter.brush.color = SColor.Transparent;
-            painter.drawRect(rect);
-        }
-        // 编辑态出现四个角的圆点
-        if (this.status == SItemStatus.Edit) {
-            painter.pen.lineDash = [];
-            painter.brush.color = SColor.White;
-            painter.drawCircle(rect.x, rect.y, 5 * lw)
-            painter.drawCircle(rect.right, rect.bottom, 5 * lw)
-            painter.drawCircle(rect.x, rect.bottom, 5 * lw)
-            painter.drawCircle(rect.right, rect.y, 5 * lw)
-        }
-        if (this.isActive) {
-            painter.pen.color = SColor.Transparent;
-            painter.brush.color = this.activeColor;
-            if (this.selected) {
-                painter.shadow.shadowBlur = 10;
-                painter.shadow.shadowColor = this.activeColor;
-                painter.shadow.shadowOffsetX = 5;
-                painter.shadow.shadowOffsetY = 5;
-                painter.drawCircle(
-                    this.img.x,
-                    this.img.y,
-                    (this.sWidth / 2.0 + 3) * 1.25
-                );
-            } else {
-                painter.drawCircle(
-                    this.img.x,
-                    this.img.y,
-                    this.sWidth / 2.0 + 3
-                );
-            }
-        } else {
-            if (this.selected) {
-                painter.pen.color = SColor.Transparent;
-                painter.brush.color = SColor.Transparent;
-                painter.shadow.shadowBlur = 10;
-                painter.shadow.shadowColor = new SColor(`#00000033`);
-                painter.shadow.shadowOffsetX = 5;
-                painter.shadow.shadowOffsetY = 5;
-                painter.drawCircle(this.img.x, this.img.y, this.sWidth / 2.0);
-            }
-        }
-    } // Function onDraw()
-
-    /**
-    * 返回对象储存的相关数据
-    *
-    * @return 相关数据
-    */
-    toData(): any {
-        if (this.data) {
-            if (this.data.size) {
-                this.data.size.width = this.sWidth;
-                this.data.size.height = this.sHeight;
-            }
-            this.data.style.default.text = JSON.stringify(this.textItemList);
-            this.data.pos.x = this.pos.x;
-            this.data.pos.y = this.pos.y;
-            this.data.style.default.zorder = this.zOrder;
-            this.data.style.default.url = this.img.url;
-        }
-
-        const anchorPoint = [
-            { x: this.img.x, y: this.img.y, id: "" },
-        ];
-        this.anchorList = anchorPoint.map(t => {
-            let item = new SAnchorItem(this);
-            if (t.id) {
-                item.id = t.id;
-            }
-            item.moveTo(t.x, t.y);
-            return item;
-        });
-
-        // this.textItemList.font.size = this.data.style.default.font || 12;
-        // this.img.url = this.data.style.default.url;
-        if (this.data) {
-            this.x = this.data.pos.x;
-            this.y = this.data.pos.y
-
-        }
-    } // Function toData()
-} // Class SBaseIconTextEdit

File diff suppressed because it is too large
+ 0 - 497
src/components/editClass/edit/items/SBaseImageEdit.ts


+ 0 - 602
src/components/editClass/edit/items/SBaseLineEdit.ts

@@ -1,602 +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 { SColor, SLine, SPainter, SPoint, SRect } from "@persagy-web/draw/";
-import { SMouseButton, SMouseEvent, SUndoStack } from "@persagy-web/base";
-import { SMathUtil } from "@persagy-web/big/lib/utils/SMathUtil";
-import { SItemStatus } from "@persagy-web/big";
-import {
-    SGraphPointListInsert,
-    SGraphPointListUpdate,
-    SLineStyle,
-    SGraphItem
-} from "@persagy-web/graph/";
-import { SGraphEdit } from ".."
-import { Marker } from "../type/Marker";
-
-/**
- * 直线编辑类
- *
- * @author  韩耀龙 <han_yao_long@163.com>
- */
-export class SBaseLineEdit extends SGraphEdit {
-    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    //属性
-
-    /** 编辑相关操作的数据 */
-    data: Marker
-    /** 起始锚点 */
-    startItem: SGraphItem | null = null;
-    /** 结束锚点 */
-    endItem: SGraphItem | null = null;
-    /** X 坐标最小值 */
-    private minX = Number.MAX_SAFE_INTEGER;
-    /** X 坐标最大值 */
-    private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y 坐标最小值 */
-    private minY = Number.MAX_SAFE_INTEGER;
-    /** Y 坐标最大值 */
-    private maxY = Number.MIN_SAFE_INTEGER;
-    /** 线段 */
-    private _line: SPoint[] = [];
-    get line(): SPoint[] {
-        return this._line;
-    } // Get line
-    set line(arr: SPoint[]) {
-        this._line = arr;
-        this.update();
-    } // Set line
-
-    /** 是否垂直水平绘制 */
-    private _verAndLeve: Boolean = false;
-    get verAndLeve(): Boolean {
-        return this._verAndLeve;
-    } // Get verAndLeve
-    set verAndLeve(bool: Boolean) {
-        this._verAndLeve = bool;
-        this.update();
-    } // Set verAndLeve
-
-    /** 是否完成绘制 */
-    protected _status: SItemStatus = SItemStatus.Normal;
-    get status(): SItemStatus {
-        return this._status;
-    } // Get status
-    set status(v: SItemStatus) {
-        this._status = v;
-        this.undoStack.clear();
-        this.update();
-    } // Set status
-
-    /** 线条颜色 */
-    private _strokeColor: SColor = SColor.Black;
-    get strokeColor(): SColor {
-        return this._strokeColor;
-    } // Get strokeColor
-    set strokeColor(v: SColor) {
-        this._strokeColor = v;
-        this.update();
-    }// Get strokeColor
-
-    /** 线条样式 */
-    private _lineStyle: SLineStyle = SLineStyle.Solid;
-    get lineStyle(): SLineStyle {
-        return this._lineStyle;
-    } // Get lineStyle
-    set lineStyle(v: SLineStyle) {
-        this._lineStyle = v;
-        this.update();
-    } // Set lineStyle
-
-    /** 端点填充色 */
-    private _fillColor: SColor = SColor.White;
-    get fillColor(): SColor {
-        return this._fillColor;
-    } // Get fillColor
-    set fillColor(v: SColor) {
-        this._fillColor = v;
-        this.update();
-    } //Set fillColor
-
-    /** 选中端点填充色 */
-    private _activeFillColor: SColor = new SColor("#2196f3");
-    get activeFillColor(): SColor {
-        return this._activeFillColor;
-    } //Get activeFillColor
-    set activeFillColor(v: SColor) {
-        this._activeFillColor = v;
-        this.update();
-    } //Set activeFillColor
-
-    /** 线条宽度 */
-    private _lineWidth: number = 1;
-    get lineWidth(): number {
-        return this._lineWidth;
-    } //Get lineWidth
-    set lineWidth(v: number) {
-        this._lineWidth = v;
-        this.update();
-    } //Set lineWidth
-
-    /** 拖动灵敏度 */
-    dis: number = 5;
-    /** 拖动灵敏度 */
-    protected sceneDis: number = 5;
-    /** 当前点索引 */
-    curIndex: number = -1;
-    /** 当前点坐标 */
-    private curPoint: SPoint | null = null;
-    /** undo/redo 堆栈 */
-    private undoStack: SUndoStack = new SUndoStack();
-
-    /**
-     * 构造函数
-     *
-     * @param parent    父级
-     * @param data      坐标集合|第一个点坐标
-     */
-    constructor(parent: SGraphItem | null, data: Marker) {
-        super(parent);
-        this.showSelect = false;
-        this.data = data;
-        if (data.style) {
-            // 关于顶点
-            if (data.style.line) {
-                let setPointList: SPoint[];
-                setPointList = data.style.line.map((i: { x: number; y: number; }) => {
-                    return new SPoint(i.x, i.y)
-                });
-                this.line = setPointList;
-            }
-            if (data.style.default) {
-                // 颜色
-                if (data.style.default.strokeColor) {
-                    this.strokeColor = new SColor(data.style.default.strokeColor)
-                }
-                // 颜色
-                if (data.style.default.fillColor) {
-                    this.fillColor = new SColor(data.style.default.fillColor)
-                }
-                // 线宽
-                if (data.style.default.lineWidth) {
-                    this.lineWidth = data.style.default.lineWidth
-                }
-
-                // 线样式
-                if (data.style.default.lineStyle) {
-                    this.lineStyle = data.style.default.lineStyle
-                }
-            }
-        }
-    }
-
-    /**
-     * 添加点至数组中
-     *
-     * @param p       添加的点
-     */
-    private addPoint(p: SPoint): void {
-        if (this.line.length < 2) {
-            this.line.push(p);
-            this.recordAction(SGraphPointListInsert, [this.line, p]);
-        } else {
-            this.line[1] = p;
-            this.recordAction(SGraphPointListInsert, [this.line, p, 1]);
-            this.status = SItemStatus.Normal;
-            this.releaseItem();
-            this.$emit("finishCreated");
-            this.pointChange();
-        }
-
-        this.update();
-    } // Function addPoint()
-
-    /**
-     * 鼠标双击事件
-     *
-     * @param	event       事件参数
-     * @return	该事件是否被处理
-     */
-    onDoubleClick(event: SMouseEvent): boolean {
-        if (this.status == SItemStatus.Normal) {
-            this.status = SItemStatus.Edit;
-            this.grabItem(this);
-        } else if (this.status == SItemStatus.Edit) {
-            this.status = SItemStatus.Normal;
-            this.releaseItem();
-        }
-
-        this.update();
-        return true;
-    } // Function onDoubleClick()
-
-    /**
-     * 鼠标按下事件
-     *
-     * @param event   鼠标事件
-     * @return  是否处理事件
-     */
-    onMouseDown(event: SMouseEvent): boolean {
-        this.curIndex = -1;
-        this.curPoint = null;
-        if (event.shiftKey || this._verAndLeve) {
-            event = this.compare(event);
-        }
-        if (event.buttons == SMouseButton.LeftButton) {
-            if (this.status == SItemStatus.Normal) {
-                // return super.onMouseDown(event);
-                super.onMouseDown(event);
-                return true;
-            } else if (this.status == SItemStatus.Edit) {
-                // 判断是否点击到端点上(获取端点索引值)
-                this.findNearestPoint(new SPoint(event.x, event.y));
-            } else if (this.status == SItemStatus.Create) {
-                this.addPoint(new SPoint(event.x, event.y));
-                return true;
-            }
-        }
-
-        return true;
-    } // Function onMouseDown()
-
-    /**
-     * 鼠标抬起事件
-     *
-     * @param	event     事件参数
-     * @return	 是否处理该事件
-     */
-    onMouseUp(event: SMouseEvent): boolean {
-        if (this.status == SItemStatus.Edit) {
-            if (this.curIndex > -1) {
-                const p = new SPoint(
-                    this.line[this.curIndex].x,
-                    this.line[this.curIndex].y
-                );
-                this.recordAction(SGraphPointListUpdate, [
-                    this.line,
-                    this.curPoint,
-                    p,
-                    this.curIndex
-                ]);
-            }
-        } else if (this.status == SItemStatus.Normal) {
-            super.onMouseUp(event);
-            return true
-        }
-
-        this.curIndex = -1;
-        this.curPoint = null;
-        return true;
-    } // Function onMouseUp()
-
-    /**
-      * 鼠标抬起事件
-      *
-      * @param event     事件参数
-      * @return	 是否处理该事件
-      */
-    onKeyUp(event: KeyboardEvent): void {
-        // 当 ESC 时
-        if (27 == event.keyCode) {
-            if (this.status == SItemStatus.Edit) {
-                this.status = SItemStatus.Normal;
-                this.releaseItem();
-            } else if (this.status == SItemStatus.Create) {
-                this.update()
-                this.releaseItem();
-                this.parent = null;
-            }
-        }
-    } // Function onKeyUp()
-
-    /**
-     * 鼠标移动事件
-     *
-     * @param event   鼠标事件
-     * @return 是否处理事件
-     */
-    onMouseMove(event: SMouseEvent): boolean {
-        if (event.shiftKey || this._verAndLeve) {
-            event = this.compare(event);
-        }
-
-        if (this.status == SItemStatus.Create) {
-            if (this.line[0] instanceof SPoint) {
-                this.line[1] = new SPoint(event.x, event.y);
-                this.pointChange();
-            }
-        } else if (this.status == SItemStatus.Edit) {
-            if (-1 != this.curIndex) {
-                this.line[this.curIndex].x = event.x;
-                this.line[this.curIndex].y = event.y;
-                this.pointChange();
-            }
-        } else {
-            return super.onMouseMove(event);
-        }
-
-        this.update();
-        return true;
-    } // Function onMouseMove()
-
-     /**
-     * 点发生变化
-     */
-    protected pointChange(): void {
-        // do nothing
-    } // Function pointChange()
-
-    /**
-     * 获取点击点与 Point[] 中的点距离最近点
-     *
-     * @param p   鼠标点击点
-     */
-    findNearestPoint(p: SPoint): void {
-        let len = this.sceneDis;
-        for (let i = 0; i < this.line.length; i++) {
-            let dis = SMathUtil.pointDistance(
-                p.x,
-                p.y,
-                this.line[i].x + this.x,
-                this.line[i].y + this.y
-            );
-            if (dis < len) {
-                len = dis;
-                this.curIndex = i;
-                this.curPoint = new SPoint(this.line[this.curIndex]);
-            }
-        }
-    } // Function findNearestPoint()
-
-    /**
-     * 记录相关动作并推入栈中
-     *
-     * @param SGraphCommand   相关命令类
-     * @param any             对应传入参数
-     */
-    protected recordAction(SGraphCommand: any, any: any[]): void {
-        // 记录相关命令并推入堆栈中
-        const command = new SGraphCommand(this.scene, this, ...any);
-        this.undoStack.push(command);
-    } // Function recordAction()
-
-    /**
-     * 移动后处理所有坐标,并肩原点置为场景原点
-     *
-     * @param x   x 坐标
-     * @param y   y 坐标
-     */
-    moveToOrigin(): void {
-        this.line = this.line.map(t => {
-            t.x = t.x + this.x;
-            t.y = t.y + this.y;
-            return t;
-        });
-        this.x = 0;
-        this.y = 0;
-    } // Function moveToOrigin()
-
-    /**
-     * shift 垂直水平创建或编辑
-     *
-     * @param event   事件
-     * @return 鼠标事件
-     */
-    compare(event: SMouseEvent): SMouseEvent {
-        if (this.line.length) {
-            let last = new SPoint(event.x, event.y);
-            if (this.status == SItemStatus.Create) {
-                last = this.line[0];
-            } else if (this.status == SItemStatus.Edit) {
-                if (this.curIndex == 1) {
-                    last = this.line[0];
-                } else if (this.curIndex == 0) {
-                    last = this.line[1];
-                }
-            }
-
-            const dx = Math.abs(event.x - last.x);
-            const dy = Math.abs(event.y - last.y);
-            if (dy > dx) {
-                event.x = last.x;
-            } else {
-                event.y = last.y;
-            }
-        }
-
-        return event;
-    } // Function compare()
-
-    /**
-     * 判断点是否在区域内
-     *
-     * @param x     x 坐标
-     * @param y     y 坐标
-     * @return 是否在区域内
-     */
-    contains(x: number, y: number): boolean {
-        if (this.line.length == 2) {
-            let p = new SPoint(x, y);
-            if (
-                SMathUtil.pointToLine(p, new SLine(this.line[0], this.line[1]))
-                    .MinDis < this.sceneDis
-            ) {
-                return true;
-            }
-        }
-
-        return false;
-    } // Function contains()
-
-    /**
-     * 撤销操作
-     */
-    undo(): void {
-        if (this.status != SItemStatus.Normal) {
-            this.undoStack.undo();
-        }
-    } // Function undo()
-
-    /**
-     * 重做操作
-     */
-    redo(): void {
-        if (this.status != SItemStatus.Normal) {
-            this.undoStack.redo();
-        }
-    } // Function redo()
-
-    /**
-     * 取消操作 item 事件
-     */
-    cancelOperate(): void {
-        if (this.status == SItemStatus.Create) {
-            this.parent = null;
-            this.releaseItem();
-        } else if (this.status == SItemStatus.Edit) {
-            this.status = SItemStatus.Normal;
-            this.releaseItem();
-        }
-    } // Function cancelOperate()
-
-    /**
-     * Item 对象边界区域
-     *
-     * @return	边界区域
-     */
-    boundingRect(): SRect {
-        if (this.line.length) {
-            this.minX = this.line[0].x;
-            this.maxX = this.line[0].x;
-            this.minY = this.line[0].y;
-            this.maxY = this.line[0].y;
-            this.line.forEach(it => {
-                let x = it.x,
-                    y = it.y;
-                if (x < this.minX) {
-                    this.minX = x;
-                }
-
-                if (y < this.minY) {
-                    this.minY = y;
-                }
-
-                if (x > this.maxX) {
-                    this.maxX = x;
-                }
-
-                if (y > this.maxY) {
-                    this.maxY = y;
-                }
-            });
-        }
-
-        return new SRect(
-            this.minX,
-            this.minY,
-            this.maxX - this.minX,
-            this.maxY - this.minY
-        );
-    } // Function boundingRect()
-
-    /**
-     * 返回对象储存的相关数据
-     *
-     * @return	对象数据
-     */
-    toData(): any {
-        this.moveToOrigin()
-        const Line = [{ x: this.line[0].x, y: this.line[0].y }, { x: this.line[1].x, y: this.line[1].y }];
-        this.data.style.line = Line;
-        this.data.style.default.lineWidth = this.lineWidth;
-        this.data.style.default.lineStyle = this.lineStyle;
-        this.data.style.default.strokeColor = this.strokeColor.value;
-        this.data.style.default.fillColor = this.fillColor.value;
-        return this.data
-    } // Function toData()
-
-    /**
-     * Item 绘制操作
-     *
-     * @param painter    绘制对象
-     */
-    onDraw(painter: SPainter): void {
-        this.sceneDis = painter.toPx(this.dis);
-        painter.pen.lineWidth = painter.toPx(this.lineWidth);
-        painter.pen.color = this.strokeColor;
-        if (this.line.length == 2) {
-            // 绘制直线
-            painter.pen.color = 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.selected && this.status == SItemStatus.Normal) {
-                painter.pen.lineWidth = painter.toPx(this.lineWidth * 2);
-                painter.shadow.shadowBlur = 10;
-                painter.shadow.shadowColor = new SColor(`#00000033`);
-                painter.shadow.shadowOffsetX = 5;
-                painter.shadow.shadowOffsetY = 5;
-            }
-
-            painter.drawLine(this.line[0], this.line[1]);
-            if (
-                this.status == SItemStatus.Edit ||
-                this.status == SItemStatus.Create
-            ) {
-                // 绘制端点
-                this.line.forEach((p, i): void => {
-                    painter.brush.color = this.fillColor;
-                    if (i == this.curIndex) {
-                        painter.brush.color = this.activeFillColor;
-                    }
-                    painter.drawCircle(p.x, p.y, painter.toPx(5));
-                });
-            }
-        } else if (this.line.length == 1) {
-            if (
-                this.status == SItemStatus.Edit ||
-                this.status == SItemStatus.Create
-            ) {
-                // 绘制端点
-                painter.brush.color = this.fillColor;
-                painter.drawCircle(
-                    this.line[0].x,
-                    this.line[0].y,
-                    painter.toPx(5)
-                );
-            }
-        }
-    } // Function onDraw()
-} // Class SBaseLineEdit

+ 0 - 956
src/components/editClass/edit/items/SBasePolygonEdit.ts

@@ -1,956 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .F88X
- *        X8888Y
- *      .}888888N;
- *        i888888N;        .:!              .I$WI:
- *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
- *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
- *            +888888N;  .8888888Y                                  "&&8Y.}8,
- *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
- *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
- *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
- *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
- *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
- *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
- *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
- *      .:R888888I
- *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
- *        ~8888'
- *        .!88~                                                                     All rights reserved.
- *
- * *********************************************************************************************************************
- */
-
-import {
-    SGraphItem,
-    SGraphPointListDelete,
-    SGraphPointListInsert,
-    SGraphPointListUpdate,
-    SLineStyle
-} from "@persagy-web/graph";
-import { SKeyCode, SMouseEvent, SUndoStack } from "@persagy-web/base/";
-import {
-    SColor,
-    SLine,
-    SLineCapStyle,
-    SPainter,
-    SPoint,
-    SPolygonUtil,
-    SRect,
-    SSize
-} from "@persagy-web/draw";
-import { SItemStatus, ItemOrder } from "@persagy-web/big";
-import { Marker } from "../type/Marker";
-import { SMathUtil } from "@persagy-web/big/lib/utils/SMathUtil";
-import { SGraphEdit } from ".."
-
-/**
- * 编辑多边形
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export class SBasePolygonEdit extends SGraphEdit {
-    /** X 坐标最小值 */
-    private minX = Number.MAX_SAFE_INTEGER;
-    /** X 坐标最大值 */
-    private maxX = Number.MIN_SAFE_INTEGER;
-    /** Y 坐标最小值 */
-    private minY = Number.MAX_SAFE_INTEGER;
-    /** Y 坐标最大值 */
-    private maxY = Number.MIN_SAFE_INTEGER;
-    /** 图例节点对象数据 */
-    data: Marker;
-    /** 轮廓线坐标 */
-    private pointList: SPoint[] = [];
-    get getPointList(): SPoint[] {
-        return this.pointList;
-    } // Get getPointList
-    set setPointList(arr: SPoint[]) {
-        this.pointList = arr;
-        this.update();
-    } // Set getPointList
-
-    /** 当前状态 */
-    protected _status: number = SItemStatus.Normal;
-    get status(): SItemStatus {
-        return this._status;
-    } // Get status
-    set status(value: SItemStatus) {
-        this._status = value;
-        this.undoStack.clear();
-        this.update();
-    } // Set status
-
-    /** 边框颜色 */
-    _strokeColor: SColor = SColor.Black;
-    /** 画笔颜色 */
-    get strokeColor(): SColor {
-        return this._strokeColor;
-    } // Get strokeColor
-    set strokeColor(v: SColor) {
-        this._strokeColor = v;
-        this.update();
-    } // Set strokeColor
-
-    /** 填充颜色 */
-    _fillColor: SColor = new SColor("#2196f3");
-    get fillColor(): SColor {
-        return this._fillColor;
-    } // Get fillColor
-    set fillColor(v: SColor) {
-        this._fillColor = v;
-        this.update();
-    } // Set fillColor
-
-    /** 边框样式 */
-    _lineStyle: SLineStyle = SLineStyle.Solid;
-    get lineStyle(): SLineStyle {
-        return this._lineStyle;
-    } // Get lineStyle
-    set lineStyle(v: SLineStyle) {
-        this._lineStyle = v;
-        this.update();
-    } // Set lineStyle
-
-    /** 边框的宽只可输入像素宽 */
-    _lineWidth: number = 1;
-    get lineWidth(): number {
-        return this._lineWidth;
-    } // Get lineWidth
-    set lineWidth(v: number) {
-        this._lineWidth = v;
-        this.update();
-    } // Set lineWidth
-
-    /** 是否闭合 */
-    closeFlag: boolean = false;
-    /** 鼠标移动点 */
-    private lastPoint: SPoint | null = null;
-    /** 当前鼠标获取顶点对应索引 */
-    private curIndex: number = -1;
-    /** 当前鼠标获取顶点对应坐标 */
-    private curPoint: null | SPoint = null;
-    /** 灵敏像素 */
-    private len: number = 10;
-    /** 场景像素内部将灵敏像素换算为场景实际距离 */
-    private scenceLen: number = 15;
-    /** 场景像素 */
-    private isAlt: boolean = false;
-    /** undo/redo 堆栈 */
-    protected undoStack: SUndoStack = new SUndoStack();
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      图例节点对象数据
-     */
-    constructor(parent: SGraphItem | null, data: Marker) {
-        super(parent);
-        // this.textItem.originPosition = STextOrigin.Centrum;
-        // this.textItem.isTransform = false;
-        this.zOrder = ItemOrder.polygonOrder;
-        this.data = data;
-        this.name = data.name;
-        this.showSelect = false;
-        // this.text = data.Name;
-        if (data.style) {
-            this.setPointList = [];
-            let setPointList: SPoint[];
-            if (data.style.outLine) {
-                if (data.style.outLine[0] instanceof SPoint) {
-                    // @ts-ignore
-                    this.setPointList = data.style.outLine;
-                } else {
-                    setPointList = data.style.outLine.map(i => {
-                        return (new SPoint(i.x, i.y))
-                    })
-                    this.setPointList = setPointList;
-                }
-            }
-
-            // 样式相关
-            if (data.style.default) {
-                // 颜色
-                if (data.style.default.strokeColor) {
-                    this.strokeColor = new SColor(data.style.default.strokeColor)
-                }
-
-                // 线宽
-                if (data.style.default.lineWidth) {
-                    this.lineWidth = data.style.default.lineWidth
-                }
-
-                // 线样式
-                if (data.style.default.lineStyle) {
-                    this.lineStyle = data.style.default.lineStyle
-                }
-
-                // 填充色
-                if (data.style.default.fillColor) {
-                    this.fillColor = new SColor(data.style.default.fillColor)
-                }
-            }
-        }
-        // if (data) {
-        //     if (data.Properties.Zorder) {
-        //         this.zOrder = data.Properties.Zorder;
-        //     }
-        //     // 设置线宽
-
-        //     if (data.Properties.TextPos) {
-        //         this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
-        //     }
-        //     if (data.Properties.color) {
-        //         this.color = new SColor(data.Properties.color);
-        //     }
-        //     if (data.Properties.font) {
-        //         this.font = new SFont("sans-serif", data.Properties.font);
-        //     }
-        //     if (data.Properties && data.Properties.IsActive) {
-        //         this.isActive = data.Properties.IsActive;
-        //     }
-        // }
-        // 监听多边形创建完成事件,并动态计算文本位置
-        // this.connect("finishCreated", this, () => {
-        //     // 计算文本位置
-        //     let x: number = this.getPointList.reduce((pre, cur, index, arr) => {
-        //         return pre + (cur.x / arr.length)
-        //     }, 0),
-        //         y: number = this.getPointList.reduce((pre, cur, index, arr) => {
-        //             return pre + (cur.y / arr.length)
-        //         }, 0);
-        //     this.textItem.moveTo(x, y);
-        // })
-    }
-
-    //////////////////
-    //  以下为对pointList 数组的操作方法
-
-    /**
-     * 储存新的多边形顶点
-     *
-     * @param x   点位得 x 坐标
-     * @param y   点位得 y 坐标
-     * @param i   储存所在索引
-     * @return 添加的顶点
-     */
-    insertPoint(x: number, y: number, i: number | null = null): SPoint {
-        const point = new SPoint(x, y);
-        if (i == null) {
-            this.pointList.push(point);
-        } else {
-            this.pointList.splice(i, 0, point);
-        }
-
-        this.update();
-        return point;
-    } // Function insertPoint()
-
-    /**
-     * 删除点位
-     *
-     * @param i   删除点所在的索引
-     * @return   索引不在数组范围则返回 null
-     */
-    deletePoint(i: number | null = null): SPoint | null {
-        let point;
-        if (i != null) {
-            if (i >= this.pointList.length || i < 0) {
-                point = null;
-            } else {
-                point = new SPoint(this.pointList[i].x, this.pointList[i].y);
-                this.pointList.splice(i, 1);
-            }
-        } else {
-            if (this.pointList.length) {
-                point = this.pointList[this.pointList.length - 1];
-                this.pointList.pop();
-            } else {
-                point = null;
-            }
-        }
-
-        this.curIndex = -1;
-        this.curPoint = null;
-        this.update();
-        return point;
-    } // Function deletePoint()
-
-    /**
-     * 多边形顶点的移动位置
-     *
-     * @param x   点位得 x 坐标
-     * @param y   点位得 y 坐标
-     * @param i   点位得 i 坐标
-     * @return    移动对应得点。如果索引无法找到移动顶点,则返回 null
-     */
-    movePoint(x: number, y: number, i: number): SPoint | null {
-        let point
-        if (i >= this.pointList.length || i < 0) {
-            return null;
-        }
-
-        if (this.pointList.length) {
-            this.pointList[i].x = x;
-            this.pointList[i].y = y;
-        }
-
-        point = this.pointList[i];
-        return point;
-    } // Function movePoint()
-
-    /**
-     * 展示状态 -- 绘制多边形数组
-     *
-     * @param painter      绘制类
-     * @param pointList    绘制多边形数组
-     */
-    protected drawShowPolygon(painter: SPainter, pointList: SPoint[]): void {
-        painter.save();
-        painter.pen.lineCapStyle = SLineCapStyle.Square;
-        painter.pen.color = this.strokeColor;
-        painter.brush.color = this.fillColor;
-        painter.pen.lineWidth = painter.toPx(this.lineWidth);
-        if (this.lineStyle == SLineStyle.Dashed) {
-            painter.pen.lineDash = [
-                painter.toPx(this.lineWidth * 3),
-                painter.toPx(this.lineWidth * 7)
-            ];
-        } else if (this.lineStyle == SLineStyle.Dotted) {
-            painter.pen.lineDash = [
-                painter.toPx(this.lineWidth),
-                painter.toPx(this.lineWidth)
-            ];
-        }
-
-        if (this.selected) {
-            painter.shadow.shadowBlur = 10;
-            painter.shadow.shadowColor = new SColor(`#00000033`);
-            painter.shadow.shadowOffsetX = 5;
-            painter.shadow.shadowOffsetY = 5;
-        } else {
-            painter.shadow.shadowColor = SColor.Transparent;
-        }
-
-        painter.drawPolygon([...pointList]);
-        painter.restore();
-    } // Function drawShowPolygon()
-
-    /**
-     * 创建状态 -- 绘制多边形数组
-     *
-     * @param painter      绘制类
-     * @param pointList    绘制多边形数组
-     */
-    protected drawCreatePolygon(painter: SPainter, pointList: SPoint[]): void {
-        painter.pen.lineCapStyle = SLineCapStyle.Square;
-        painter.pen.color = this.strokeColor;
-        painter.pen.lineWidth = painter.toPx(this.lineWidth);
-        if (this.lastPoint && pointList.length) {
-            painter.drawLine(
-                pointList[pointList.length - 1].x,
-                pointList[pointList.length - 1].y,
-                this.lastPoint.x,
-                this.lastPoint.y
-            );
-        }
-
-        painter.drawPolyline(pointList);
-        painter.pen.color = SColor.Transparent;
-        painter.brush.color = new SColor(this.fillColor.value);
-        painter.pen.lineWidth = painter.toPx(this.lineWidth);
-        if (this.lastPoint) {
-            painter.drawPolygon([...pointList, this.lastPoint]);
-            // 绘制顶点块
-            painter.pen.color = SColor.Black;
-            painter.brush.color = SColor.White;
-            pointList.forEach(item => {
-                painter.drawCircle(item.x, item.y, painter.toPx(this.len / 2));
-            });
-            // 如果最后一个点在第一个点的灵敏度范围内,第一个点填充变红
-            if (this.pointList.length) {
-                if (
-                    SMathUtil.pointDistance(
-                        this.lastPoint.x,
-                        this.lastPoint.y,
-                        this.pointList[0].x,
-                        this.pointList[0].y
-                    ) < this.scenceLen
-                ) {
-                    // 绘制第一个点的顶点块
-                    painter.pen.color = SColor.Black;
-                    painter.brush.color = SColor.Red;
-                    painter.drawCircle(
-                        this.pointList[0].x,
-                        this.pointList[0].y,
-                        painter.toPx(this.len / 2)
-                    );
-                }
-            }
-        } else {
-            painter.drawPolygon(pointList);
-        }
-    } // Function drawCreatePolygon()
-
-    /**
-     *
-     * 编辑状态 -- 绘制多边形数组
-     *
-     * @param painter      绘制类
-     * @param pointList    绘制多边形数组
-     */
-    protected drawEditPolygon(painter: SPainter, pointList: SPoint[]): void {
-        // 展示多边形
-        painter.pen.lineCapStyle = SLineCapStyle.Square;
-        painter.pen.color = this.strokeColor;
-        painter.pen.lineWidth = painter.toPx(this.lineWidth);
-        painter.brush.color = new SColor(this.fillColor.value);
-        painter.drawPolygon([...pointList]);
-        // 绘制顶点块
-        painter.pen.color = SColor.Black;
-        painter.brush.color = SColor.White;
-        pointList.forEach((item, index) => {
-            painter.brush.color = SColor.White;
-            if (index == this.curIndex) {
-                painter.brush.color = new SColor("#2196f3");
-            }
-
-            painter.drawCircle(item.x, item.y, painter.toPx(this.len / 2));
-        });
-    } // Function drawCreatePolygon()
-
-    /**
-     * 编辑状态操作多边形数组
-     *
-     * @param event    鼠标事件
-     */
-    protected editPolygonPoint(event: SMouseEvent): void {
-        //  判断是否为删除状态 isAlt = true为删除状态
-        if (this.isAlt) {
-            // 1 判断是否点击在多边形顶点
-            let lenIndex = -1; // 当前点击到的点位索引;
-            let curenLen = this.scenceLen; // 当前的灵敏度
-            this.pointList.forEach((item, index) => {
-                let dis = SMathUtil.pointDistance(
-                    event.x,
-                    event.y,
-                    item.x,
-                    item.y
-                );
-                if (dis < curenLen) {
-                    curenLen = dis;
-                    lenIndex = index;
-                }
-            });
-
-            // 若点击到,对该索引对应的点做删除
-            if (lenIndex != -1) {
-                if (this.pointList.length <= 3) {
-                    return;
-                }
-
-                const delePoint = new SPoint(
-                    this.pointList[lenIndex].x,
-                    this.pointList[lenIndex].y
-                );
-                this.deletePoint(lenIndex);
-                // 记录顶点操作记录压入堆栈
-                this.recordAction(SGraphPointListDelete, [
-                    this.pointList,
-                    delePoint,
-                    lenIndex
-                ]);
-            }
-        } else {
-            // 1 判断是否点击在多边形顶点
-            this.curIndex = -1;
-            this.curPoint = null;
-            let lenIndex = -1; // 当前点击到的点位索引;
-            let curenLen = this.scenceLen; // 当前的灵敏度
-            this.pointList.forEach((item, index) => {
-                let dis = SMathUtil.pointDistance(
-                    event.x,
-                    event.y,
-                    item.x,
-                    item.y
-                );
-                if (dis < curenLen) {
-                    curenLen = dis;
-                    lenIndex = index;
-                }
-            });
-            this.curIndex = lenIndex;
-            // 2判断是否点击在多边形得边上
-            if (-1 == lenIndex) {
-                let len = SMathUtil.pointToLine(
-                    new SPoint(event.x, event.y),
-                    new SLine(this.pointList[0], this.pointList[1])
-                ),
-                    index = 0;
-                if (this.pointList.length > 2) {
-                    for (let i = 1; i < this.pointList.length; i++) {
-                        let dis = SMathUtil.pointToLine(
-                            new SPoint(event.x, event.y),
-                            new SLine(this.pointList[i], this.pointList[i + 1])
-                        );
-                        if (i + 1 == this.pointList.length) {
-                            dis = SMathUtil.pointToLine(
-                                new SPoint(event.x, event.y),
-                                new SLine(this.pointList[i], this.pointList[0])
-                            );
-                        }
-                        if (dis.MinDis < len.MinDis) {
-                            len = dis;
-                            index = i;
-                        }
-                    }
-                }
-
-                // 判断是否有点
-                if (len.Point) {
-                    // 点在了多边形的边上
-                    if (len.MinDis <= this.scenceLen) {
-                        this.pointList.splice(index + 1, 0, len.Point);
-                        // 记录新增顶点操作记录压入堆栈
-                        this.recordAction(SGraphPointListInsert, [
-                            this.pointList,
-                            len.Point,
-                            index + 1
-                        ]);
-                    } else {
-                        //没点在多边形边上也没点在多边形顶点上
-                        super.onMouseDown(event);
-                    }
-                }
-            } else {
-                // 当捕捉到顶点后 ,记录当前点的xy坐标,用于undo、redo操作
-                this.curPoint = new SPoint(
-                    this.pointList[this.curIndex].x,
-                    this.pointList[this.curIndex].y
-                );
-            }
-
-            // 刷新视图
-            this.update();
-        }
-    } // Function editPolygonPoint()
-
-    /////////////////////
-    // undo、redo相关操作
-    /**
-     * 记录相关动作并推入栈中
-     *
-     * @param SGraphCommand      相关命令类
-     * @param any                对应传入参数
-     */
-    protected recordAction(SGraphCommand: any, any: any[]): void {
-        // 记录相关命令并推入堆栈中
-        const sgraphcommand = new SGraphCommand(this.scene, this, ...any);
-        this.undoStack.push(sgraphcommand);
-    } // Function recordAction()
-
-    /**
-     * 执行取消操作执行
-     */
-    undo(): void {
-        if (this.status == SItemStatus.Normal) {
-            return;
-        }
-        this.undoStack.undo();
-    } // Function undo()
-
-    /**
-     * 执行重做操作执行
-     */
-    redo(): void {
-        if (this.status == SItemStatus.Normal) {
-            return;
-        }
-
-        this.undoStack.redo();
-    } // Function redo()
-
-    ///////////////////////////////
-    // 以下为鼠标事件
-
-    /**
-     * 鼠标双击事件
-     *
-     * @param event    事件参数
-     * @return  是否处理该事件
-     */
-    onDoubleClick(event: SMouseEvent): boolean {
-        // 如果位show状态 双击改对象则需改为编辑状态
-        if (SItemStatus.Normal == this.status) {
-            this.status = SItemStatus.Edit;
-            this.grabItem(this);
-        } else if (SItemStatus.Edit == this.status) {
-            this.status = SItemStatus.Normal;
-            this.releaseItem();
-        }
-
-        this.update();
-        return true;
-    } // Function onDoubleClick()
-
-    /**
-     * 键盘事件
-     *
-     * @param event    事件参数
-     * @return  是否处理该事件
-     */
-    onKeyDown(event: KeyboardEvent): boolean {
-        if (this.status == SItemStatus.Normal) {
-            return false;
-        } else if (this.status == SItemStatus.Create) {
-            if (event.code == "Enter") {
-                // 当顶点大于二个时才又条件执行闭合操作并清空堆栈
-                if (this.pointList.length > 2) {
-                    this.status = SItemStatus.Normal;
-                    //3 传递完成事件状态
-                    this.$emit("finishCreated");
-                    //1 grabItem 置为null
-                    this.releaseItem();
-                }
-            }
-        } else if (this.status == SItemStatus.Edit) {
-            if (event.key == "Alt") {
-                this.isAlt = true;
-            }
-        }
-
-        this.update();
-        return true;
-    } // Function onKeyDown()
-
-    /**
-     * 键盘键抬起事件
-     *
-     * @param event    事件参数
-     */
-    onKeyUp(event: KeyboardEvent): void {
-        if (this.status == SItemStatus.Edit) {
-            if (event.key == "Alt") {
-                this.isAlt = false;
-            } else if (event.keyCode == SKeyCode.Delete) {
-                // 当多边形的顶点大于三个允许删除点
-                if (this.pointList.length > 3) {
-                    this.deletePoint(this.curIndex);
-                }
-            }
-        }
-
-        this.update();
-    } // Function onKeyUp()
-
-    /**
-     * 鼠标按下事件
-     *
-     * @param	event      事件参数
-     * @return	 是否处理该事件
-     */
-    onMouseDown(event: SMouseEvent): boolean {
-        if (event.shiftKey) {
-            event = this.compare(event);
-        }
-
-        // 如果状态为编辑状态则添加点
-        if (this.status == SItemStatus.Create) {
-            // 新增顶点
-            let len = -1;
-            if (this.pointList.length) {
-                len = SMathUtil.pointDistance(
-                    event.x,
-                    event.y,
-                    this.pointList[0].x,
-                    this.pointList[0].y
-                );
-            }
-
-            if (this.pointList.length > 2 && len > 0 && len < this.scenceLen) {
-                this.status = SItemStatus.Normal;
-                //3 传递完成事件状态
-                this.$emit("finishCreated");
-                //1 grabItem 置为null
-                this.releaseItem();
-            } else {
-                this.insertPoint(event.x, event.y);
-                // 记录新增顶点操作记录压入堆栈
-                let pos = new SPoint(event.x, event.y);
-                this.recordAction(SGraphPointListInsert, [this.pointList, pos]);
-            }
-        } else if (this.status == SItemStatus.Edit) {
-            // 对多边形数组做编辑操作
-            this.editPolygonPoint(event);
-        } else {
-            // return super.onMouseDown(event);
-            super.onMouseDown(event);
-        }
-
-        return true;
-    } // Function onMouseDown()
-
-    /**
-     * 鼠标移入事件
-     *
-     * @param event   事件参数
-     * @return 是否处理该事件
-     */
-    onMouseEnter(event: SMouseEvent): boolean {
-        return true;
-    } // Function onMouseEnter()
-
-    /**
-     * 鼠标移出事件
-     *
-     * @param event    事件参数
-     * @return 是否处理该事件
-     */
-    onMouseLeave(event: SMouseEvent): boolean {
-        return true;
-    } // Function onMouseLeave()
-
-    /**
-     * 鼠标移动事件
-     *
-     * @param event    事件参数
-     * @return 是否处理该事件
-     */
-    onMouseMove(event: SMouseEvent): boolean {
-        if (event.shiftKey) {
-            event = this.compare(event);
-        }
-
-        if (this.status == SItemStatus.Create) {
-            this.lastPoint = new SPoint();
-            this.lastPoint.x = event.x;
-            this.lastPoint.y = event.y;
-            this.update();
-        } else if (this.status == SItemStatus.Edit) {
-            if (event.buttons == 1) {
-                if (-1 != this.curIndex) {
-                    this.pointList[this.curIndex].x = event.x;
-                    this.pointList[this.curIndex].y = event.y;
-                }
-            }
-            this.update();
-        } else {
-            return super.onMouseMove(event);
-        }
-
-        return true;
-    } // Function onMouseMove()
-
-    /**
-     * shift 垂直水平创建或编辑
-     *
-     * @param event   事件
-     */
-    compare(event: SMouseEvent): SMouseEvent {
-        if (this.pointList.length) {
-            let last = new SPoint(event.x, event.y);
-            if (this.status == SItemStatus.Create) {
-                last = this.pointList[this.pointList.length - 1];
-            } else if (this.status == SItemStatus.Edit) {
-                if (this.curIndex > 0) {
-                    last = this.pointList[this.curIndex - 1];
-                }
-            }
-
-            const dx = Math.abs(event.x - last.x);
-            const dy = Math.abs(event.y - last.y);
-            if (dy > dx) {
-                event.x = last.x;
-            } else {
-                event.y = last.y;
-            }
-        }
-
-        return event;
-    } // Function compare()
-
-    /**
-     * 鼠标抬起事件
-     *
-     * @param event    事件参数
-     * @return 是否处理该事件
-     */
-    onMouseUp(event: SMouseEvent): boolean {
-        if (this.status == SItemStatus.Edit) {
-            if (-1 != this.curIndex) {
-                const pos = new SPoint(
-                    this.pointList[this.curIndex].x,
-                    this.pointList[this.curIndex].y
-                );
-                this.recordAction(SGraphPointListUpdate, [
-                    this.pointList,
-                    this.curPoint,
-                    pos,
-                    this.curIndex
-                ]);
-            }
-        } else if (this.status == SItemStatus.Normal) {
-            return super.onMouseUp(event);
-        }
-        return true;
-    } // Function onMouseUp()
-
-    /**
-     * 移动后处理所有坐标,并肩原点置为场景原点
-     */
-    moveToOrigin(): void {
-        this.pointList = this.pointList.map(t => {
-            t.x = t.x + this.x;
-            t.y = t.y + this.y;
-            return t;
-        });
-
-        this.x = 0;
-        this.y = 0;
-    } // Function moveToOrigin()
-
-    /**
-     * 适配事件
-     *
-     * @param event     事件参数
-     * @return 是否处理该事件
-     */
-    onResize(event: SMouseEvent): boolean {
-        return true;
-    } // Function onResize()
-
-    /**
-     * 取消操作
-     */
-    cancelOperate(): void {
-        // 当状态为展示状态
-        if (this.status == SItemStatus.Create) {
-            // 闭合多边形
-            this.parent = null;
-        } else if (this.status == SItemStatus.Edit) {
-            // 编辑状态
-            this.status = SItemStatus.Normal;
-        }
-
-        this.update();
-    } // Function cancelOperate()
-
-    /**
-     * Item 对象边界区域
-     *
-     * @return 边界区域
-     */
-    boundingRect(): SRect {
-        if (this.pointList.length) {
-            this.minX = this.pointList[0].x;
-            this.maxX = this.pointList[0].x;
-            this.minY = this.pointList[0].y;
-            this.maxY = this.pointList[0].y;
-            this.pointList.forEach(it => {
-                let x = it.x,
-                    y = it.y;
-                if (x < this.minX) {
-                    this.minX = x;
-                }
-
-                if (y < this.minY) {
-                    this.minY = y;
-                }
-
-                if (x > this.maxX) {
-                    this.maxX = x;
-                }
-
-                if (y > this.maxY) {
-                    this.maxY = y;
-                }
-
-            });
-        }
-
-        return new SRect(
-            this.minX,
-            this.minY,
-            this.maxX - this.minX,
-            this.maxY - this.minY
-        );
-    } // Function boundingRect()
-
-    /**
-     * 判断点是否在区域内
-     *
-     * @param x     x 坐标
-     * @param y     y 坐标
-     * @return 是否在该区域内
-     */
-    contains(x: number, y: number): boolean {
-        let arr = this.pointList;
-        if (arr.length < 3 || !SPolygonUtil.pointIn(x, y, arr)) {
-            return false;
-        }
-
-        return true;
-    } // Function contains()
-
-    /**
-     * 返回对象储存的相关数据
-     *
-     * @return	对象参数
-     */
-    toData() : any {
-        this.moveToOrigin();        
-        const Line = this.pointList.map(pos => {
-            return {
-                x: pos.x,
-                y: pos.y
-            }
-        });
-
-        this.data.style.outLine = Line;
-        this.data.style.default.lineWidth = this.lineWidth;
-        this.data.style.default.lineStyle = this.lineStyle;
-        this.data.style.default.strokeColor = this.strokeColor.value;
-        this.data.style.default.fillColor = this.fillColor.value;
-        return this.data
-    } // Function toData()
-
-    /**
-     * 选择器放缩控制大小变化'
-     * 
-     * @param old    旧的大小
-     * @param newS   新的大小
-    */
-    resize(old: SSize, newS: SSize): void {
-        const xs = newS.width / old.width;
-        const ys = newS.height / old.height;
-        this.pointList = this.pointList.map(item => {
-            item.x = item.x * xs;
-            item.y = item.y * ys;
-            return item
-        });
-    }
-
-    /**
-     * Item 绘制操作
-     *
-     * @param painter    绘制对象
-     */
-    onDraw(painter: SPainter): void {
-        this.scenceLen = painter.toPx(this.len);
-        // 当状态为展示状态
-        if (this.status == SItemStatus.Normal) {
-            // 闭合多边形
-            this.drawShowPolygon(painter, this.pointList);
-        } else if (this.status == SItemStatus.Create) {
-            // 创建状态
-            this.drawCreatePolygon(painter, this.pointList);
-        } else {
-            // 编辑状态
-            this.drawEditPolygon(painter, this.pointList);
-        }
-    } // Function onDraw()
-} // Class SBasePolygonEdit

+ 0 - 705
src/components/editClass/edit/items/SBasePolylineEdit.ts

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

+ 0 - 410
src/components/editClass/edit/items/SBaseRectEdit.ts

@@ -1,410 +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 { SColor, SPainter, SPoint, SRect } from "@persagy-web/draw";
-import { SMouseButton, SMouseEvent, SUndoStack } from "@persagy-web/base";
-import { SItemStatus } from "@persagy-web/big";;
-import {
-    SLineStyle,
-    SGraphItem, SGraphPointListInsert
-} from "@persagy-web/graph/";
-import { SGraphEdit } from "..";
-import { Marker } from "../type/Marker";
-
-/**
- * 矩形编辑类
- *
- * @author  韩耀龙 <han_yao_long@163.com>
- */
-export class SBaseRectEdit extends SGraphEdit {
-    /** 是否绘制完成 */
-    _status: SItemStatus = SItemStatus.Normal;
-    get status(): SItemStatus {
-        return this._status;
-    }  // Get status
-    set status(v: SItemStatus) {
-        this._status = v;
-        this.undoStack.clear();
-        this.update();
-    } // Set status
-
-    /** 宽度 */
-    get width(): number {
-        return this._rightBottom.x - this._leftTop.x;
-    }
-    /** 高度 */
-    get height(): number {
-        return this._rightBottom.y - this._leftTop.y;
-    }
-    /** 矩形两个对角 */
-    private _line: SPoint[] = [];
-    get line(): SPoint[] {
-        return this._line;
-    } // Get line
-    set line(arr: SPoint[]) {
-        this._line = arr;
-        this.update();
-    } // Get line
-
-    /** 矩形左上角 */
-    private _leftTop: SPoint = new SPoint();
-    /** 矩形右下角 */
-    private _rightBottom: SPoint = new SPoint();
-    /** 绘制矩形的圆角半径 */
-    private _radius: number = 0;
-    get radius(): number {
-        return this._radius;
-    } // Get radius
-    set radius(v: number) {
-        if (v == this._radius) {
-            return;
-        }
-        this._radius = v;
-        this.update();
-    } // Set radius
-
-    /** 线条颜色 */
-    _strokeColor: SColor = SColor.Black;
-    get strokeColor(): SColor {
-        return this._strokeColor;
-    }  // Get strokeColor
-    set strokeColor(v: SColor) {
-        this._strokeColor = v;
-        this.update();
-    }   // Set strokeColor
-
-    /** 填充色 */
-    _fillColor: SColor = new SColor("#2196f3");
-    get fillColor(): SColor {
-        return this._fillColor;
-    } // Get fillColor
-    set fillColor(v: SColor) {
-        this._fillColor = v;
-        this.update();
-    } // Set fillColor
-
-    /** 边框样式 */
-    _lineStyle: SLineStyle = SLineStyle.Solid;
-    get lineStyle(): SLineStyle {
-        return this._lineStyle;
-    } // Get lineStyle
-    set lineStyle(v: SLineStyle) {
-        this._lineStyle = v;
-        this.update();
-    } // Set lineStyle
-
-    /** 线条宽度 */
-    _lineWidth: number = 1;
-    get lineWidth(): number {
-        return this._lineWidth;
-    } // Get lineWidth
-    set lineWidth(v: number) {
-        this._lineWidth = v;
-        this.update();
-    } // Set lineWidth
-
-    /** undo/redo 堆栈 */
-    private undoStack: SUndoStack = new SUndoStack();
-    /** 传入数据 */
-    data: Marker;
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      矩形数据
-     */
-    constructor(parent: SGraphItem | null, data: Marker) {
-        super(parent);
-        this.data = data;
-        if (data.style && data.style.default) {
-            // 关于顶点
-            if (data.style.default.line) {
-                let setPointList: SPoint[];
-                setPointList = data.style.default.line.map(i => {
-                    return new SPoint(i.x, i.y)
-                });
-                this.line = setPointList;
-                this.calRect()
-            }
-            // 颜色
-            if (data.style.default.strokeColor) {
-                this.strokeColor = new SColor(data.style.default.strokeColor)
-            }
-            if (data.style.default.fillColor) {
-                this.fillColor = new SColor(data.style.default.fillColor)
-            }
-            // 线宽
-            if (data.style.default.lineWidth) {
-                this.lineWidth = data.style.default.lineWidth
-            }
-            // 线样式
-            if (data.style.default.lineStyle) {
-                this.lineStyle = data.style.default.lineStyle
-            }
-        }
-    } // Constructor
-
-    /**
-     * 大小改变
-     *
-     * @param oldSize   之前的大小
-     * @param newSize   新的大小
-     */
-    resize(oldSize: SRect, newSize: SRect): void {
-        const xs = newSize.width / oldSize.width;
-        const ys = newSize.height / oldSize.height;
-        this.line = this.line.map(t => {
-            t.x = t.x * xs;
-            t.y = t.y * ys;
-            return t;
-        });
-        this.calRect();
-        this.update();
-    } // Function resize()
-
-    /**
-     * 鼠标按下事件
-     *
-     * @param event   鼠标事件
-     * @return 是否处理事件
-     */
-    onMouseDown(event: SMouseEvent): boolean {
-        if (event.buttons == SMouseButton.LeftButton) {
-            if (this.status == SItemStatus.Create) {
-                this.addPoint(new SPoint(event.x, event.y));
-                return true;
-            } else {
-                return super.onMouseDown(event);
-            }
-        }
-
-        return true;
-    } // Function onMouseDown()
-
-    /**
-     * 鼠标移动事件
-     *
-     * @param event   鼠标事件
-     * @return 是否处理事件
-     */
-    onMouseMove(event: SMouseEvent): boolean {
-        if (this.status == SItemStatus.Create) {
-            if (this.line[0] instanceof SPoint) {
-                this.line[1] = new SPoint(event.x, event.y);
-                this.calRect()
-            }
-        } else {
-            return super.onMouseMove(event);
-        }
-
-        this.update();
-        return true;
-    } // Function onMouseMove()
-
-    /**
-     * 鼠标抬起事件
-     *
-     * @param event     事件参数
-     * @return 是否处理事件
-     */
-    onMouseUp(event: SMouseEvent): boolean {
-        if (this.status != SItemStatus.Create) {
-            super.onMouseUp(event);
-        }
-
-        return true;
-    } // Function onMouseUp()
-
-    /**
-     * 计算矩形的左上角和右下角
-     */
-    private calRect(): void {
-        if (this.line.length > 1) {
-            const fi = this.line[0];
-            const se = this.line[1];
-            let minx, maxx, miny, maxy;
-            if (fi.x < se.x) {
-                minx = fi.x;
-                maxx = se.x;
-            } else {
-                minx = se.x;
-                maxx = fi.x;
-            }
-
-            if (fi.y < se.y) {
-                miny = fi.y;
-                maxy = se.y;
-            } else {
-                miny = se.y;
-                maxy = fi.y;
-            }
-
-            this._leftTop = new SPoint(minx, miny);
-            this._rightBottom = new SPoint(maxx, maxy);
-        }
-    } // Function calRect()
-
-    /**
-     * 添加点至数组中
-     *
-     * @param p     添加的点
-     */
-    private addPoint(p: SPoint): void {
-        if (this.line.length < 2) {
-            this.line.push(p);
-            this.recordAction(SGraphPointListInsert, [this.line, p]);
-        } else {
-            this.line[1] = p;
-            this.recordAction(SGraphPointListInsert, [this.line, p, 1]);
-            this.status = SItemStatus.Normal;
-            this.releaseItem();
-            this.$emit("finishCreated");
-        }
-
-        this.calRect();
-        this.update();
-    } // Function addPoint()
-
-    /**
-     * 记录相关动作并推入栈中
-     *
-     * @param	SGraphCommand   相关命令类
-     * @param	any             对应传入参数
-     */
-    protected recordAction(SGraphCommand: any, any: any[]): void {
-        // 记录相关命令并推入堆栈中
-        const command = new SGraphCommand(this.scene, this, ...any);
-        this.undoStack.push(command);
-    } // Function recordAction()
-
-    /**
-     * Item 对象边界区域
-     *
-     * @return 外接矩阵
-     */
-    boundingRect(): SRect {
-        if (this.line.length > 1) {
-            // this.calRect();
-            return new SRect(this._leftTop, this._rightBottom);
-        }
-
-        return new SRect();
-    } // Function boundingRect()
-
-    /**
-     * 撤销操作
-     */
-    undo(): void {
-        if (this._status != SItemStatus.Normal) {
-            this.undoStack.undo();
-        }
-    } // Function undo()
-
-    /**
-     * 重做操作
-     */
-    redo(): void {
-        if (this._status != SItemStatus.Normal) {
-            this.undoStack.redo();
-        }
-    } // Function redo()
-
-    /**
-     * 取消操作执行
-     */
-    cancelOperate(): void {
-        if (this.status == SItemStatus.Create) {
-            this.parent = null;
-            this.releaseItem();
-        } else if (this.status == SItemStatus.Edit) {
-            this.status = SItemStatus.Normal;
-            this.releaseItem();
-        }
-    } // Function cancelOperate()
-
-    /**
-     * 移动后处理所有坐标,并肩原点置为场景原点
-     */
-    moveToOrigin(): void {
-        this.line = this.line.map(t => {
-            t.x = t.x + this.x;
-            t.y = t.y + this.y;
-            return t;
-        });
-        this.x = 0;
-        this.y = 0;
-    } // Function moveToOrigin()
-
-    /**
-     * 返回对象储存的相关数据
-     *
-     * @return 对象储存的相关数据
-     */
-    toData(): any {
-        this.moveToOrigin();
-        const Line: any = [];
-        this.line.forEach(item => {
-            Line.push({ x: item.x, y: item.y })
-        });
-        this.data.style.default.line = Line;
-        this.data.style.default.lineWidth = this.lineWidth;
-        this.data.style.default.lineStyle = this.lineStyle;
-        this.data.style.default.strokeColor = this.strokeColor.value;
-        this.data.style.default.fillColor = this.fillColor.value;
-        return this.data;
-    } // Function toData()
-
-    /**
-     * Item 绘制操作
-     *
-     * @param painter   绘制对象
-     */
-    onDraw(painter: SPainter): void {
-        if (this.line.length == 2) {
-            // this.calRect();
-            painter.pen.color = this.strokeColor;
-            painter.brush.color = this.fillColor;
-            painter.pen.lineWidth = this.lineWidth;
-            if (this.lineStyle == SLineStyle.Dashed) {
-                painter.pen.lineDash = [
-                    painter.toPx(this.lineWidth * 3),
-                    painter.toPx(this.lineWidth * 7)
-                ];
-            } else if (this.lineStyle == SLineStyle.Dotted) {
-                painter.pen.lineDash = [
-                    painter.toPx(this.lineWidth * 2),
-                    painter.toPx(this.lineWidth * 2)
-                ];
-            }
-
-            if (this.radius != 0) {
-                painter.drawRoundRect(this._leftTop, this._rightBottom, this.radius);
-            } else {
-                painter.drawRect(this._leftTop, this._rightBottom);
-            }
-        }
-    } // Function onDraw()
-} // Class SBaseRectEdit

+ 0 - 410
src/components/editClass/edit/items/SBaseTextEdit.ts

@@ -1,410 +0,0 @@
-/*
- * *********************************************************************************************************************
- *
- *          !!
- *        .F88X
- *        X8888Y
- *      .}888888N;
- *        i888888N;        .:!              .I$WI:
- *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
- *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
- *            +888888N;  .8888888Y                                  "&&8Y.}8,
- *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
- *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
- *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
- *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
- *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
- *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
- *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
- *      .:R888888I
- *      .&888888I                                          Copyright (c) 2016-2020.  博锐尚格科技股份有限公司
- *        ~8888'
- *        .!88~                                                                     All rights reserved.
- *
- * *********************************************************************************************************************
- */
-import { SPainter, SRect, SColor, SFont, SPoint, SSize } from "@persagy-web/draw";
-import { SGraphItem, STextOrigin, SLineStyle, SAnchorItem } from "@persagy-web/graph/";
-import { SItemStatus } from "@persagy-web/big";
-import { SGraphEdit } from ".."
-import { Marker } from "../type/Marker";
-import { ItemOrder } from '@persagy-web/big/lib';
-import { SMouseEvent } from '@persagy-web/base/lib';
-
-/**
- * 文本编辑类
- *
- * @author  韩耀龙 <han_yao_long@163.com>
- */
-export class SBaseTextEdit extends SGraphEdit {
-    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    //属性
-    /**编辑相关操作的数据 */
-    data: Marker | null = null;
-    /** 存储相关的信息数据 */
-    propertyData: any
-    /** 起始锚点 */
-    startItem: SGraphItem | null = null;
-    /** 结束锚点 */
-    endItem: SGraphItem | null = null;
-    /** 编辑状态 */
-    protected _status: SItemStatus = SItemStatus.Normal;
-    get status(): SItemStatus {
-        return this._status;
-    } //Get status
-    set status(value: SItemStatus) {
-        const oldStatus = this._status;
-        const newStatus = value;
-        this._status = value;
-        //状态变更触发事件
-        this.$emit('StatusChange', oldStatus, newStatus)
-        this.update();
-    } //Set status
-
-    /** 记录 painter */
-    private _painter: SPainter | null = null;
-
-    /** 文本内容 */
-    private _text: string = "";
-    get text(): string {
-        return this._text;
-    } //Get text
-    set text(v: string) {
-        this._text = v;
-        this._textArr = this.text.split(/\n/g);
-        this.drawFormatText();
-        this.update();
-    } //Set text
-
-    /** 切割后的文本数组 */
-    private _textArr: string[] = [];
-    /** 锚点 list */
-    anchorList: SAnchorItem[] = [];
-    /** 宽度 */
-    private _width: number = 64;
-    get width(): number {
-        return this._width;
-    } //Get width
-    set width(v: number) {
-        if (v > 0) {
-            if (v != this._width) {
-                let w = this._width;
-                this._width = v;
-                this.onResize(
-                    new SSize(w, this._height),
-                    new SSize(this._width, this._height)
-                );
-            }
-        }
-    } //Set width
-
-    /** 高度 */
-    private _height: number = 64;
-    get height(): number {
-        return this._height;
-    } //Get height
-    set height(v: number) {
-        if (v > 0) {
-            if (v != this._height) {
-                let h = this._height;
-                this._height = v;
-                this.onResize(
-                    new SSize(this._width, h),
-                    new SSize(this._width, this._height)
-                );
-            }
-        }
-    } //Set height
-
-    /** 原点 */
-    origin = new SPoint();
-
-    /** 文本颜色 */
-    private _color: SColor = new SColor("#333333");
-    get color(): SColor {
-        return this._color;
-    } //Get color
-    set color(v: SColor) {
-        this._color = v;
-        this.update();
-    } //Set color
-
-    /** 字体 */
-    private _font: SFont = new SFont("sans-serif", 12);
-    get font(): SFont {
-        return this._font;
-    } //Get font
-    set font(v: SFont) {
-        this._font = v;
-        this.drawFormatText();
-        this.update();
-    } //Set font
-
-    /** 背景色 */
-    private _backgroundColor: SColor = SColor.Transparent;
-    get backgroundColor(): SColor {
-        return this._backgroundColor;
-    } //Get backgroundColor
-    set backgroundColor(v: SColor) {
-        this._backgroundColor = v;
-        this.update();
-    } //Set backgroundColor
-
-    /** 边框色 */
-    private _strokeColor: SColor = SColor.Transparent;
-    get strokeColor(): SColor {
-        return this._strokeColor;
-    } //Get strokeColor
-    set strokeColor(v: SColor) {
-        this._strokeColor = v;
-        this.update();
-    } //Set strokeColor
-
-    /** 边框宽度 */
-    private _lineWidth: number = 1;
-    get lineWidth(): number {
-        return this._lineWidth;
-    } //Get lineWidth
-    set lineWidth(v: number) {
-        this._lineWidth = v;
-        this.update();
-    } //Set lineWidth
-
-    /** 边框样式 */
-    private _borderStyle: SLineStyle = SLineStyle.None;
-    get borderStyle(): SLineStyle {
-        return this._borderStyle;
-    } //Get borderStyle
-    set borderStyle(v: SLineStyle) {
-        this._borderStyle = v;
-        this.update();
-    } //Set borderStyle
-
-    /** 原点位置 */
-    private _originPosition: STextOrigin = STextOrigin.LeftTop;
-    get originPosition(): STextOrigin {
-        return this._originPosition;
-    } //Get originPosition
-    set originPosition(v: STextOrigin) {
-        this._originPosition = v;
-        this.update();
-    } //Set originPosition
-
-    /** 文本绘制最大宽 */
-    maxWidth: number | undefined = undefined;
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父 Item
-     * @param data      文本数据
-     */
-    constructor(parent: SGraphItem | null, data: Marker | null) {
-        super(parent);
-        if (data) {
-            this.initData(data)
-        }
-    } // Constructor
-
-    /**
-     * 初始化 当data传入时设置相关状态
-     *
-     * @param data      Mark 数据
-     */
-    initData(data: Marker) {
-        this.showSelect = false;
-        this.zOrder = ItemOrder.textOrder;
-        this.isTransform = false;
-        this.data = data;
-        this.name = data.name;
-        this.moveTo(data.pos.x, data.pos.y);
-        if (data.size) {
-            this.width = data.size.width;
-            this.height = data.size.height;
-        }
-        if (data.style && data.style.default) {
-            // 高度
-            if (data.style.default.zorder) {
-                this.zOrder = data.style.default.zorder;
-            }
-            // 文本
-            if (data.style.default.text) {
-                this.text = data.style.default.text;
-            }
-            // 文本颜色
-            if (data.style.default.strokeColor) {
-                this.strokeColor = new SColor(data.style.default.strokeColor);
-            }
-            // 字体大小
-            if (data.style.default.font) {
-                this.font = new SFont("sans-serif", data.style.default.font);
-            }
-            // 背景色
-            if (data.style.default.backgroundColor) {
-                this.backgroundColor = new SColor(data.style.default.backgroundColor);
-            }
-        }
-    }
-
-    /**
-     * 宽高发发生变化
-     *
-     * @param oldSize 改之前的大小
-     * @param newSize 改之后大小
-     */
-    protected onResize(oldSize: SSize, newSize: SSize) { } // Function onResize()
-
-    /**
-     * 对象边界区域
-     *
-     * @return 边界区域
-     */
-    boundingRect(): SRect {
-        return new SRect(
-            -this.origin.x,
-            -this.origin.y,
-            this.width,
-            this.height
-        );
-    } // Function boundingRect()
-
-    /**
-     * 移动后处理所有坐标,并肩原点置为场景原点
-     *
-     * @param x   x 坐标
-     * @param y   y 坐标
-     */
-    // moveToOrigin(x: number, y: number): void {
-    //     this.moveTo(this.x + x, this.y + y);
-    // } // Function moveToOrigin()
-
-    /**
-     * 鼠标按下事件
-     *
-     * @param event   保存事件参数
-     * @return 是否处理事件
-     */
-    onMouseDown(event: SMouseEvent): boolean {
-        this.$emit('textSelect')
-        super.onMouseDown(event);
-        return this.moveable;
-    } // Function onMouseDown()
-
-    /**
-     * 释放鼠标事件
-     *
-     * @param event   保存事件参数
-     * @return 是否处理事件
-     */
-    onMouseUp(event: SMouseEvent): boolean {
-        super.onMouseUp(event);
-        return this.moveable;
-    } // Function onMouseUp()
-
-    /**
-     * 绘制显示状态文本 Item
-     *
-     * @param painter    绘制类
-     */
-    protected drawShowText(painter: SPainter): void {
-        painter.translate(-this.origin.x, -this.origin.y);
-        //绘制矩形轮廓
-        if (this.selected) {
-            painter.shadow.shadowBlur = 10;
-            painter.shadow.shadowColor = new SColor(`#00000033`);
-            painter.shadow.shadowOffsetX = 5;
-            painter.shadow.shadowOffsetY = 5;
-        } else {
-            painter.shadow.shadowColor = SColor.Transparent;
-        }
-
-        painter.brush.color = this.backgroundColor;
-        painter.pen.lineWidth = this.lineWidth;
-        painter.pen.color = this.strokeColor;
-        painter.drawRect(0, 0, this.width, this.height);
-
-        //绘制文本
-        painter.brush.color = new SColor(this.color);
-        painter.shadow.shadowColor = SColor.Transparent;
-        painter.font = this.font;
-        this._textArr.forEach((text: string, index: number) => {
-            painter.drawText(
-                text,
-                this.font.size / 4,
-                index * (this.font.size * 1.25) + this.font.size / 4,
-                this.maxWidth
-            );
-        });
-    } // Function drawShowText()
-
-    /**
-     * 根据换行切割文本,绘制多行并计算外轮廓宽高
-     */
-    protected drawFormatText(): void {
-        if (this._painter instanceof SPainter) {
-            this._painter.save();
-            this._painter.font = this.font;
-            let textMaxWidth = 0;
-            let fontSize: number = this.font.size;
-            this._textArr.forEach((text: string, index: number) => {
-                let textWidth: number = this._painter
-                    ? this._painter.textWidth(text) + fontSize / 2
-                    : fontSize / 2;
-                if (textWidth > textMaxWidth) {
-                    textMaxWidth = textWidth;
-                }
-            });
-            // 在绘制文本后计算文本的宽高
-            this.width = textMaxWidth;
-            this.height = fontSize * 1.25 * this._textArr.length + fontSize / 8;
-            // 设置原点位置(默认左上角)
-            if (this.originPosition == STextOrigin.Center) {
-                this.origin = new SPoint(this.width / 2, this.height / 2);
-            }
-
-            this._painter.restore();
-        }
-    } // Function drawFormatText()
-
-    /**
-     * 返回对象储存的相关数据
-     *
-     * @return 对象储存的相关数据
-     */
-    toData(): any {
-        if (!this.data) return;
-
-        if (this.data.size) {
-            this.data.size.width = this.width;
-            this.data.size.height = this.height;
-        } else {
-            this.data.size = {
-                width: this.width,
-                height: this.height
-            }
-        }
-
-        this.data.pos.x = this.pos.x;
-        this.data.pos.y = this.pos.y;
-        this.data.style.default.zorder = this.zOrder;
-        this.data.style.default.text = this.text;
-        this.data.style.default.strokeColor = this.strokeColor.value;
-        this.data.style.default.font = this.font.size;
-        this.data.style.default.backgroundColor = this.backgroundColor.value;
-        return this.data;
-    } // Function toData()
-
-    /**
-     * Item 绘制操作
-     *
-     * @param painter       绘画类
-     */
-    onDraw(painter: SPainter): void {
-        if (!(this._painter instanceof SPainter)) {
-            this._painter = painter;
-            this.drawFormatText();
-        }
-
-        this.drawShowText(painter);
-    } // Function onDraw()
-} // Class SBaseTextEdit

+ 0 - 365
src/components/editClass/edit/items/SBaseTriangleEdit.ts

@@ -1,365 +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 { SColor, SPainter, SPoint, SRect } from "@persagy-web/draw";
-import { SMouseButton, SMouseEvent, SUndoStack } from "@persagy-web/base";
-import { SItemStatus } from "@persagy-web/big";
-import {
-    SLineStyle,
-    SGraphItem, SGraphPointListInsert
-} from "@persagy-web/graph/";
-import { SGraphEdit } from "..";
-import { Marker } from "../type/Marker";
-
-/**
- * 折线编辑类
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export class SBaseTriangleEdit extends SGraphEdit {
-    /** 是否绘制完成 */
-    _status: SItemStatus = SItemStatus.Normal;
-    get status(): SItemStatus {
-        return this._status;
-    } // Get status
-    set status(v: SItemStatus) {
-        this._status = v;
-        this.undoStack.clear();
-        this.update();
-    } // Set status
-
-    /** 编辑相关操作的数据 */
-    data: Marker;
-    /** 矩形两个对角 */
-    private _line: SPoint[] = [];
-    get line(): SPoint[] {
-        return this._line;
-    } // Get line
-    set line(arr: SPoint[]) {
-        this._line = arr;
-        this.update();
-    } // Get line
-
-    /** 矩形左上角 */
-    private _leftTop: SPoint = new SPoint();
-    /** 矩形右下角 */
-    private _rightBottom: SPoint = new SPoint();
-    /** 绘制三角形的点数组 */
-    private pointList: SPoint[] = [];
-    /** 线条颜色 */
-    _strokeColor: SColor = SColor.Black;
-    get strokeColor(): SColor {
-        return this._strokeColor;
-    } // Get strokeColor
-    set strokeColor(v: SColor) {
-        this._strokeColor = v;
-        this.update();
-    } // Set strokeColor
-
-    /** 填充色 */
-    _fillColor: SColor = new SColor("#2196f3");
-    get fillColor(): SColor {
-        return this._fillColor;
-    } // Get fillColor
-    set fillColor(v: SColor) {
-        this._fillColor = v;
-        this.update();
-    } // Set fillColor
-
-    /** 边框样式 */
-    _lineStyle: SLineStyle = SLineStyle.Solid;
-    get lineStyle(): SLineStyle {
-        return this._lineStyle;
-    } // Get lineStyle
-    set lineStyle(v: SLineStyle) {
-        this._lineStyle = v;
-        this.update();
-    } // Set lineStyle
-
-    /** 线条宽度 */
-    _lineWidth: number = 1;
-    get lineWidth(): number {
-        return this._lineWidth;
-    } // Get lineWidth
-    set lineWidth(v: number) {
-        this._lineWidth = v;
-        this.update();
-    } // Set lineWidth
-
-    /** undo/redo 堆栈 */
-    private undoStack: SUndoStack = new SUndoStack();
-
-    /**
-     * 构造函数
-     *
-     * @param parent    指向父对象
-     * @param data      数据
-     */
-    constructor(parent: SGraphItem | null, data: Marker) {
-        super(parent);
-        this.data = data;
-        if (data.style && data.style.default) {
-            // 关于顶点
-            if (data.style.default.Line) {
-                let setPointList: SPoint[];
-                setPointList = data.style.default.line.map(i => {
-                    return new SPoint(i.x, i.y)
-                });
-                this.line = setPointList;
-            }
-
-            // 颜色
-            if (data.style.default.strokeColor) {
-                this.strokeColor = new SColor(data.style.default.strokeColor)
-            }
-
-            // 线宽
-            if (data.style.default.lineWidth) {
-                this.lineWidth = data.style.default.lineWidth
-            }
-
-            // 线样式
-            if (data.style.default.lineStyle) {
-                this.lineStyle = data.style.default.lineStyle
-            }
-        }
-    } // Constructor
-
-    /**
-     * 宽高发发生变化
-     *
-     * @param oldSize 改之前的大小
-     * @param newSize 改之后大小
-     */
-    resize(oldSize: SRect, newSize: SRect): void {
-        const xs = newSize.width / oldSize.width;
-        const ys = newSize.height / oldSize.height;
-        this.line = this.line.map(t => {
-            t.x = t.x * xs;
-            t.y = t.y * ys;
-            return t;
-        });
-        this.calRect();
-        this.update();
-    } // Function resize()
-
-    /**
-     * 鼠标按下事件
-     *
-     * @param event   鼠标事件
-     * @return 是否处理事件
-     */
-    onMouseDown(event: SMouseEvent): boolean {
-        if (event.buttons == SMouseButton.LeftButton) {
-            if (this.status == SItemStatus.Create) {
-                this.addPoint(new SPoint(event.x, event.y));
-                return true;
-            } else {
-                return super.onMouseDown(event);
-            }
-        }
-
-        return true;
-    } // Function onMouseDown()
-
-    /**
-     * 鼠标移动事件
-     *
-     * @param event     事件参数
-     * @return 是否处理事件
-     */
-    onMouseMove(event: SMouseEvent): boolean {
-        if (this.status == SItemStatus.Create) {
-            if (this.line[0] instanceof SPoint) {
-                this.line[1] = new SPoint(event.x, event.y);
-                this.calRect()
-            }
-        } else {
-            return super.onMouseMove(event);
-        }
-
-        this.update();
-        return true;
-    } // Function onMouseMove()
-
-    /**
-     * 鼠标抬起事件
-     *
-     * @param event     事件参数
-     * @return 是否处理事件
-     */
-    onMouseUp(event: SMouseEvent): boolean {
-        if (this.status != SItemStatus.Create) {
-            super.onMouseUp(event);
-        }
-
-        return true;
-    } // Function onMouseUp()
-
-    /**
-     * 计算矩形的左上角和右下角
-     */
-    private calRect(): void {
-        if (this.line.length > 1) {
-            const fi = this.line[0];
-            const se = this.line[1];
-            let minx, maxx, miny, maxy;
-            if (fi.x < se.x) {
-                minx = fi.x;
-                maxx = se.x;
-            } else {
-                minx = se.x;
-                maxx = fi.x;
-            }
-
-            if (fi.y < se.y) {
-                miny = fi.y;
-                maxy = se.y;
-            } else {
-                miny = se.y;
-                maxy = fi.y;
-            }
-
-            this._leftTop = new SPoint(minx, miny);
-            this._rightBottom = new SPoint(maxx, maxy);
-            this.calTriangle()
-        }
-    } // Function calRect()
-
-    /**
-     * 计算绘制图形的 3 个点
-     */
-    private calTriangle(): void {
-        this.pointList = [];
-        this.pointList.push(new SPoint(this._leftTop.x, this._rightBottom.y));
-        this.pointList.push(new SPoint((this._leftTop.x + this._rightBottom.x) / 2, this._leftTop.y));
-        this.pointList.push(new SPoint(this._rightBottom.x, this._rightBottom.y));
-    } // Function calTriangle()
-
-    /**
-     * 添加点至数组中
-     *
-     * @param p     添加的点
-     */
-    private addPoint(p: SPoint): void {
-        if (this.line.length < 2) {
-            this.line.push(p);
-            this.recordAction(SGraphPointListInsert, [this.line, p]);
-        } else {
-            this.line[1] = p;
-            this.recordAction(SGraphPointListInsert, [this.line, p, 1]);
-            this.status = SItemStatus.Normal;
-            this.releaseItem();
-            this.$emit("finishCreated");
-        }
-
-        this.calRect();
-        this.update();
-    } // Function addPoint()
-
-    /**
-     * 记录相关动作并推入栈中
-     *
-     * @param	SGraphCommand   相关命令类
-     * @param	any             对应传入参数
-     */
-    protected recordAction(SGraphCommand: any, any: any[]): void {
-        // 记录相关命令并推入堆栈中
-        const command = new SGraphCommand(this.scene, this, ...any);
-        this.undoStack.push(command);
-    } // Function recordAction()
-
-    /**
-     * Item对象边界区域
-     *
-     * @return 边界区域
-     */
-    boundingRect(): SRect {
-        if (this.line.length > 1) {
-            this.calRect();
-            return new SRect(this._leftTop, this._rightBottom);
-        }
-
-        return new SRect()
-    } // Function boundingRect()
-
-    /**
-     * 撤销操作
-     */
-    undo(): void {
-        if (this._status != SItemStatus.Normal) {
-            this.undoStack.undo();
-        }
-    } // Function undo()
-
-    /**
-     * 重做操作
-     */
-    redo(): void {
-        if (this._status != SItemStatus.Normal) {
-            this.undoStack.redo();
-        }
-    } // Function redo()
-
-    /**
-     * 取消操作执行
-     */
-    cancelOperate(): void {
-        if (this.status == SItemStatus.Create) {
-            this.parent = null;
-            this.releaseItem();
-        } else if (this.status == SItemStatus.Edit) {
-            this.status = SItemStatus.Normal;
-            this.releaseItem();
-        }
-    } // Function cancelOperate()
-
-    /**
-     * Item 绘制操作
-     *
-     * @param painter   绘制对象
-     */
-    onDraw(painter: SPainter): void {
-        if (this.line.length == 2) {
-            painter.pen.color = this.strokeColor;
-            painter.brush.color = this.fillColor;
-            painter.pen.lineWidth = this.lineWidth;
-            if (this.lineStyle == SLineStyle.Dashed) {
-                painter.pen.lineDash = [
-                    painter.toPx(this.lineWidth * 3),
-                    painter.toPx(this.lineWidth * 7)
-                ];
-            } else if (this.lineStyle == SLineStyle.Dotted) {
-                painter.pen.lineDash = [
-                    painter.toPx(this.lineWidth * 2),
-                    painter.toPx(this.lineWidth * 2)
-                ];
-            }
-
-            painter.drawPolygon(this.pointList);
-        }
-    } // Function onDraw()
-} // Class SBaseTriangleEdit

+ 0 - 39
src/components/editClass/edit/type/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 "./Point";
-
-/**
- * 锚点 item 接口
- *
- * @author 韩耀龙 <han_yao_long@163.com>
- */
-export interface Anchor {
-    /** 锚点 ID */
-    anchorId: string;
-    /** 锚点的坐标 */
-    Pos: Point;
-} // Interface Anchor

+ 0 - 43
src/components/editClass/edit/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
src/components/editClass/edit/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 "./Point";
-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
src/components/editClass/edit/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;
-} // Interface Marker

+ 0 - 37
src/components/editClass/edit/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;
-} // Interface Point

+ 0 - 62
src/components/editClass/edit/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;
-} // Interface Relation

+ 16 - 5
src/components/editClass/persagy-edit/PTopoFactory.ts

@@ -24,14 +24,12 @@
  * *********************************************************************************************************************
  * *********************************************************************************************************************
  */
  */
 
 
-import { SColor, SFont, SPoint, SArrowStyleType } from "@persagy-web/draw";
-import { SArrowItem, SPolygonItem, SArrowPoly, SItemFactory, ItemOrder, SPolylineItem } from "@persagy-web/big"
-import { SGraphCircleItem, STextItem, SImageItem, SGraphLineItem } from "@persagy-web/graph/lib"
+import { Marker } from "@persagy-web/big"
 import { SBaseInfoPoint } from "./items/SBaseInfoPoint"
 import { SBaseInfoPoint } from "./items/SBaseInfoPoint"
 import { SBasePipeUninTool } from "./items/SBasePipeUninTool"
 import { SBasePipeUninTool } from "./items/SBasePipeUninTool"
 import { SBaseBtns } from "./items/SBaseBtns"
 import { SBaseBtns } from "./items/SBaseBtns"
-import { SLineStyle } from "@persagy-web/graph"
-import { BigEditFactory, Legend, Marker, Relation, ElementData } from "@persagy-web/big-edit"
+import { SBaseEquation } from "./items/SBaseEquation"
+import { BigEditFactory } from "@persagy-web/big-edit"
 /**
 /**
  * item 创建工厂
  * item 创建工厂
  *
  *
@@ -81,4 +79,17 @@ export class PTopoFactory extends BigEditFactory {
         item.data = data;
         item.data = data;
         return item;
         return item;
     }
     }
+
+    /**
+     * 创建公式
+     *
+     * @param data  数据
+     * @return 线
+     */
+    createBaseEqation(data: Marker): SBaseEquation {
+        const item = new SBaseEquation(null, data);
+        item.data = data;
+        return item;
+    }
+
 }
 }

+ 4 - 2
src/components/editClass/persagy-edit/PTopoParser.ts

@@ -23,8 +23,7 @@
  *
  *
  * ****/
  * ****/
 
 
-import { SParser, ItemOrder } from '@persagy-web/big/lib';
-import { BigEditFactory, Legend, Marker, Relation, ElementData } from "@persagy-web/big-edit"
+import { ElementData, Legend, Marker, Relation, SParser } from '@persagy-web/big/lib';
 import { PTopoFactory } from "./PTopoFactory"
 import { PTopoFactory } from "./PTopoFactory"
 
 
 /**
 /**
@@ -113,6 +112,9 @@ export class PTopoParser extends SParser {
                 case "baseBtn":
                 case "baseBtn":
                     this.markers.push(this.factory.createBaseBaseBtn(data));
                     this.markers.push(this.factory.createBaseBaseBtn(data));
                     break;
                     break;
+                case "Equation":
+                        this.markers.push(this.factory.createBaseEqation(data));
+                    break;
                 case "BaseArrowPolygon":
                 case "BaseArrowPolygon":
                     this.markers.push(this.factory.createBasePolygonArrowEdit(data));
                     this.markers.push(this.factory.createBasePolygonArrowEdit(data));
             }
             }

+ 90 - 35
src/components/editClass/persagy-edit/PTopoScene.ts

@@ -25,14 +25,13 @@
 
 
 import { SBaseEditScene, SBasePipe, SBaseEquipment } from "@persagy-web/big-edit";
 import { SBaseEditScene, SBasePipe, SBaseEquipment } from "@persagy-web/big-edit";
 import { SGraphEdit } from "@persagy-web/edit";
 import { SGraphEdit } from "@persagy-web/edit";
-import { SMouseEvent } from "@persagy-web/base/lib";
-import { SGraphAddCommand, SGraphPropertyCommand, SGraphSelectContainer, SLineStyle } from "@persagy-web/graph";
-import { SItemStatus } from "@persagy-web/big/lib/enums/SItemStatus";
+import { SMouseEvent, SObject } from "@persagy-web/base/lib";
+import { SGraphAddCommand, SGraphGroupMoveCommand, SGraphItem, SGraphMoveCommand, SGraphPropertyCommand, SGraphSelectContainer, SLineStyle } from "@persagy-web/graph";
 import { rgbaNum } from "@persagy-web/big-edit/lib/until";
 import { rgbaNum } from "@persagy-web/big-edit/lib/until";
 // 引入命令
 // 引入命令
-import { SColor, SFont, SArrowStyleType } from '@persagy-web/draw/lib';
+import { SColor, SFont, SArrowStyleType, SPoint } from '@persagy-web/draw/lib';
 import { PTopoParser, SBasePipeUninTool, SBaseEquation, SBaseInfoPoint, SBaseBtns } from "./"
 import { PTopoParser, SBasePipeUninTool, SBaseEquation, SBaseInfoPoint, SBaseBtns } from "./"
-import { ItemOrder } from '@persagy-web/big/lib';
+import { ItemOrder, SItemStatus } from '@persagy-web/big/lib';
 
 
 /**
 /**
  * 拓扑图场景类
  * 拓扑图场景类
@@ -45,6 +44,7 @@ export class PTopoScene extends SBaseEditScene {
 
 
     /** 是否打开吸附功能 */
     /** 是否打开吸附功能 */
     isAdsorb:boolean = true;
     isAdsorb:boolean = true;
+
     // 静态服务器路径
     // 静态服务器路径
     public imgServeUrl: string = '';
     public imgServeUrl: string = '';
     // 联通方式
     // 联通方式
@@ -57,6 +57,8 @@ export class PTopoScene extends SBaseEditScene {
         super()
         super()
         // 选择绑定选额item事件
         // 选择绑定选额item事件
         this.selectContainer.connect("listChange", this, this.listChange);
         this.selectContainer.connect("listChange", this, this.listChange);
+        this.selectContainer.connect("groupMove", this, this.groupMove);
+        this.undoStack.connect("cmdListChange", this, this.stackChange)
     }
     }
 
 
     /**
     /**
@@ -72,7 +74,7 @@ export class PTopoScene extends SBaseEditScene {
             } else {
             } else {
                 const colorlist: any = rgbaNum(val);
                 const colorlist: any = rgbaNum(val);
                 if (!colorlist) return
                 if (!colorlist) return
-                this.view.backgroundColor = new SColor(Number(colorlist[0]), Number(colorlist[1]), Number(colorlist[2]), colorlist[3] * 255))
+                this.view.backgroundColor = new SColor(Number(colorlist[0]), Number(colorlist[1]), Number(colorlist[2]), colorlist[3] * 255)
             }
             }
             this.view.update()
             this.view.update()
 
 
@@ -111,14 +113,14 @@ export class PTopoScene extends SBaseEditScene {
     onMouseDown(event: SMouseEvent): any {
     onMouseDown(event: SMouseEvent): any {
         this.vueOnMouseDown(event) //外部调用
         this.vueOnMouseDown(event) //外部调用
         if (this.grabItem) {
         if (this.grabItem) {
-            if (this.grabItem instanceof SBasePipe) {
+            if (this.grabItem instanceof SBasePipe && this.isAdsorb) {
                 this.setTipeEndanchor(event)
                 this.setTipeEndanchor(event)
                 return true;
                 return true;
             }
             }
             return this.grabItem.onMouseDown(event);
             return this.grabItem.onMouseDown(event);
         }
         }
         if (this.editCmd == "EditBaseLine") {
         if (this.editCmd == "EditBaseLine") {
-            this.addPolyLineArrow(event);
+            const item = this.addPolyLineArrow(event);
             this.clearCmdStatus();
             this.clearCmdStatus();
         } else if (this.editCmd == "EditBasePolyLine") {
         } else if (this.editCmd == "EditBasePolyLine") {
             this.addPolyLine(event);
             this.addPolyLine(event);
@@ -126,40 +128,40 @@ export class PTopoScene extends SBaseEditScene {
         } else if (this.editCmd == "EditBasetext") {
         } else if (this.editCmd == "EditBasetext") {
             this.addTextItem(event);
             this.addTextItem(event);
             this.clearCmdStatus();
             this.clearCmdStatus();
-        }
-        else if (this.editCmd == "BaseExplain") {
+        } else if (this.editCmd == "BaseExplain") {
             this.addExplainItem(event);
             this.addExplainItem(event);
             this.clearCmdStatus();
             this.clearCmdStatus();
         } else if (this.editCmd == "EditBaseImage") {
         } else if (this.editCmd == "EditBaseImage") {
             this.addImageItem(event)
             this.addImageItem(event)
             this.clearCmdStatus();
             this.clearCmdStatus();
-        }
-        else if (this.editCmd == "EditBasePolygon") {
-            this.addPolygonItem(event);
+        } else if (this.editCmd == "EditBasePolygon") { //
+            const item = this.addPolygonItem(event);
+            item.moveable = true;
             this.clearCmdStatus();
             this.clearCmdStatus();
-        } else if (this.editCmd == "EditBaseRect") {
-            this.addRectItem(event)
+        } else if (this.editCmd == "EditBaseRect") { // 设置层级与多边形一致
+            const item = this.addRectItem(event)
+            item.zOrder = ItemOrder.polygonOrder;
             this.clearCmdStatus();
             this.clearCmdStatus();
         } else if (this.editCmd == "EditBaseTriangle") {
         } else if (this.editCmd == "EditBaseTriangle") {
             this.addTriangleItem(event)
             this.addTriangleItem(event)
             this.clearCmdStatus();
             this.clearCmdStatus();
-        } else if (this.editCmd == "EditBaseCircle") {
-            this.addCircleItem(event)
+        } else if (this.editCmd == "EditBaseCircle") { // 设置层级与多边形一致
+            const item = this.addCircleItem(event)
+            item.zOrder = ItemOrder.polygonOrder
+            item.moveable = true;
             this.clearCmdStatus();
             this.clearCmdStatus();
-        }
-        else if (this.editCmd == "EditBaseArrows") {
-            this.addPolygonArrow(event)
+        } else if (this.editCmd == "EditBaseArrows") { // 设置层级与多边形一致
+            const item = this.addPolygonArrow(event)
+            item.zOrder = ItemOrder.polygonOrder
+            item.moveable = true;
             this.clearCmdStatus();
             this.clearCmdStatus();
-        }
-        else if (this.editCmd == "wantou" || this.editCmd == "santong" || this.editCmd == "sitong") {
+        } else if (this.editCmd == "wantou" || this.editCmd == "santong" || this.editCmd == "sitong") {
             this.addPipeUninTool(event, this.editCmd)
             this.addPipeUninTool(event, this.editCmd)
             this.clearCmdStatus();
             this.clearCmdStatus();
-        }
-        else if (this.editCmd == "EditBasePipe") {
+        } else if (this.editCmd == "EditBasePipe") {
             this.addBasePipe(event, this.legendObj);
             this.addBasePipe(event, this.legendObj);
             this.clearCmdStatus();
             this.clearCmdStatus();
-        }
-        else if (this.editCmd == "equation") {
+        } else if (this.editCmd == "equation") {
             // 添加公式
             // 添加公式
             this.addEquation(event, this.editCmd);
             this.addEquation(event, this.editCmd);
             this.clearCmdStatus();
             this.clearCmdStatus();
@@ -201,12 +203,12 @@ export class PTopoScene extends SBaseEditScene {
      * @param event     鼠标事件
      * @param event     鼠标事件
      * @param cmd       命令
      * @param cmd       命令
      */
      */
-    addPipeUninTool(event: SMouseEvent, cmd: string): void {
+    addPipeUninTool(event: SMouseEvent, cmd: string): SBasePipeUninTool {
         const data = {
         const data = {
             /** 名称 */
             /** 名称 */
             name: '基础管道接头',
             name: '基础管道接头',
             /** 图标 (Image),线类型 (Line) */
             /** 图标 (Image),线类型 (Line) */
-            type: "Image",
+            type: "Line",
             /** 位置 */
             /** 位置 */
             pos: { x: event.x, y: event.y },
             pos: { x: event.x, y: event.y },
             /** 由应用自己定义 */
             /** 由应用自己定义 */
@@ -217,15 +219,14 @@ export class PTopoScene extends SBaseEditScene {
                 uninToolType: cmd,  //分别分二头连接器、三头连接器、四头连接器
                 uninToolType: cmd,  //分别分二头连接器、三头连接器、四头连接器
                 default: {
                 default: {
                     strokecolor: "#c0ccda",
                     strokecolor: "#c0ccda",
-                    url: this.uninType[cmd],
+                    width:64,
+                    height:64,
                     zorder: ItemOrder.markOrder
                     zorder: ItemOrder.markOrder
                 }
                 }
             }
             }
         };
         };
 
 
         const item = new SBasePipeUninTool(null, data);
         const item = new SBasePipeUninTool(null, data);
-        item.url = this.imgServeUrl + this.uninType[cmd];
-        console.log('vvv', item.url)
         item.selectable = true;
         item.selectable = true;
         item.moveable = true;
         item.moveable = true;
         this.addItem(item);
         this.addItem(item);
@@ -234,13 +235,14 @@ export class PTopoScene extends SBaseEditScene {
         if (this.view) {
         if (this.view) {
             this.view.update();
             this.view.update();
         }
         }
+        return item;
     }
     }
 
 
     /**
     /**
      * 添加公式
      * 添加公式
      * @param event
      * @param event
      */
      */
-    addEquation(event: SMouseEvent, cmd: string) {
+    addEquation(event: SMouseEvent, cmd: string): SBaseEquation {
         const data = {
         const data = {
             /** 名称 */
             /** 名称 */
             name: '公式',
             name: '公式',
@@ -269,13 +271,14 @@ export class PTopoScene extends SBaseEditScene {
         this.grabItem = null;
         this.grabItem = null;
         item.connect("onContextMenu", this, this.getItem);
         item.connect("onContextMenu", this, this.getItem);
         this.finishCreated(item);
         this.finishCreated(item);
+        return item;
     }
     }
 
 
     /**
     /**
      * 添加信息点
      * 添加信息点
      * @param event
      * @param event
      */
      */
-    addInfoPoint(event: SMouseEvent, cmd: string) {
+    addInfoPoint(event: SMouseEvent, cmd: string): SBaseInfoPoint {
         const data = {
         const data = {
             /** 名称 */
             /** 名称 */
             name: '信息点',
             name: '信息点',
@@ -304,13 +307,14 @@ export class PTopoScene extends SBaseEditScene {
         this.grabItem = null;
         this.grabItem = null;
         item.connect("onContextMenu", this, this.getItem);
         item.connect("onContextMenu", this, this.getItem);
         this.finishCreated(item);
         this.finishCreated(item);
+        return item;
     }
     }
 
 
     /**
     /**
      * 添加按钮
      * 添加按钮
      * @param event
      * @param event
      */
      */
-    SBaseBtn(event: SMouseEvent) {
+    SBaseBtn(event: SMouseEvent): SBaseBtns {
         const data = {
         const data = {
             /** 名称 */
             /** 名称 */
             name: '按钮',
             name: '按钮',
@@ -342,6 +346,7 @@ export class PTopoScene extends SBaseEditScene {
         this.grabItem = null;
         this.grabItem = null;
         item.connect("onContextMenu", this, this.getItem);
         item.connect("onContextMenu", this, this.getItem);
         this.finishCreated(item);
         this.finishCreated(item);
+        return item;
     }
     }
 
 
 
 
@@ -393,6 +398,11 @@ export class PTopoScene extends SBaseEditScene {
             List.forEach((item: SGraphEdit) => {
             List.forEach((item: SGraphEdit) => {
                 item.defaultUrl = changestyle
                 item.defaultUrl = changestyle
             })
             })
+        } else if (styletype == "rotate") { // 弯头设置旋转角度
+            styleValue = changestyle;
+        } else if (styletype == "radius") { // 圆角折线拐角半径
+            styleValue = changestyle;
+            console.log(changestyle, '===========');
         } else {
         } else {
             styleValue = changestyle
             styleValue = changestyle
         }
         }
@@ -485,7 +495,7 @@ export class PTopoScene extends SBaseEditScene {
      */
      */
     save(isAll: boolean = true) {
     save(isAll: boolean = true) {
         if (!this.view) return;
         if (!this.view) return;
-        const Marktype: string[] = ['BasePolygon', 'BaseLine', 'BaseText', 'BaseExplain', 'BaseImage', 'BaseCircle', 'BaseArrow', 'BaseTriangle', 'BaseRect', 'BaseArrowPolygon', 'InfoPoint', 'BasePipeUninTool','baseBtn'];
+        const Marktype: string[] = ['BasePolygon', 'BaseLine', 'BaseText', 'BaseExplain', 'BaseImage', 'BaseCircle', 'BaseArrow', 'BaseTriangle', 'BaseRect', 'BaseArrowPolygon', 'InfoPoint', 'BasePipeUninTool','baseBtn',"Equation"];
         const NodeType: string[] = ['BaseEquipment'];
         const NodeType: string[] = ['BaseEquipment'];
         const RelationType: string[] = ["BasePipe"];
         const RelationType: string[] = ["BasePipe"];
         const markers: any = [];   /**图例节点 */  // 与工程信息无关的标识对象(增加文本注释,图上的图片说明)
         const markers: any = [];   /**图例节点 */  // 与工程信息无关的标识对象(增加文本注释,图上的图片说明)
@@ -546,4 +556,49 @@ export class PTopoScene extends SBaseEditScene {
         this.addListCommand(graphItemList);
         this.addListCommand(graphItemList);
         this.view ? this.view.update() : '';
         this.view ? this.view.update() : '';
     }
     }
+
+    /**
+     * 覆盖底层添加 item 方法,增加绑定移动事件
+    */
+    addItem(item: SGraphItem): void {
+        super.addItem(item);
+        if (!(item instanceof SGraphSelectContainer)) {
+            item.connect('moveEnd', this, this.onItemMove.bind(this));
+        }
+    }
+
+    /**
+     * 添加移动命令到命令栈
+    */
+    onItemMove(item: SGraphItem, arg: SPoint[]): void {
+        this.undoStack.push(new SGraphMoveCommand(this, item, arg[0], arg[1]));
+    }
+
+    /**
+     * 接收选择器抛出的批量移动的事件
+     *
+     * @param sender 事件发送者
+     * @param args   返回的参数
+    */
+    groupMove(sender: SGraphItem, args: []): void {
+        if (args.length > 2) {
+            // @ts-ignore
+            const itemList = args[0] as SGraphItem[];
+            // @ts-ignore
+            const oldList = args[1] as SPoint[];
+            // @ts-ignore
+            const newList = args[2] as SPoint[];
+            this.undoStack.push(new SGraphGroupMoveCommand(this, itemList, oldList, newList))
+
+        }
+    }
+
+    /**
+     * 命令栈当前命令索引发生变化
+     *
+     * @param sender 事件发送者
+    */
+    stackChange(sender: SObject): void {
+        this.selectContainer.getSize()
+    }
 }
 }

+ 1 - 1
src/components/editClass/persagy-edit/item/SPersagyImageEdit.ts

@@ -26,8 +26,8 @@
 
 
 import { SBaseImageEdit } from '@persagy-web/edit';
 import { SBaseImageEdit } from '@persagy-web/edit';
 import { SGraphItem } from "@persagy-web/graph";
 import { SGraphItem } from "@persagy-web/graph";
-import { Marker } from "@persagy-web/big-edit/lib/types/Marker";
 import { SMouseEvent } from "@persagy-web/base/lib";
 import { SMouseEvent } from "@persagy-web/base/lib";
+import { Marker } from '@persagy-web/big/lib';
 
 
 /**
 /**
  * 编辑基础图片类
  * 编辑基础图片类

+ 1 - 1
src/components/editClass/persagy-edit/items/SBaseArrow.ts

@@ -27,8 +27,8 @@
 import { SColor, SFont, SPainter, SArrowStyleType } from "@persagy-web/draw/";
 import { SColor, SFont, SPainter, SArrowStyleType } from "@persagy-web/draw/";
 import { SBasePolylineEdit } from '@persagy-web/edit';
 import { SBasePolylineEdit } from '@persagy-web/edit';
 import { SGraphItem, SLineStyle } from "@persagy-web/graph/lib";
 import { SGraphItem, SLineStyle } from "@persagy-web/graph/lib";
-import { Marker } from "@persagy-web/big-edit/lib/types/Marker";
 import { SMouseEvent } from "@persagy-web/base/lib";
 import { SMouseEvent } from "@persagy-web/base/lib";
+import { Marker } from "@persagy-web/big/lib";
 
 
 /**
 /**
  * 编辑箭头(折线)
  * 编辑箭头(折线)

+ 4 - 5
src/components/editClass/persagy-edit/items/SBaseBtns.ts

@@ -24,11 +24,10 @@
 * *********************************************************************************************************************
 * *********************************************************************************************************************
 */
 */
 
 
-import { SBaseTextEdit, SGraphEdit } from "@persagy-web/edit";
-import { SGraphItem, STextItem, SLineStyle } from "@persagy-web/graph/lib";
-import { Marker } from "@persagy-web/big-edit/lib/types/Marker";
-import { SMouseEvent } from "@persagy-web/base/lib";
-import { SColor, SPainter, SSize, SRect } from '@persagy-web/draw/lib';
+import { SBaseTextEdit } from "@persagy-web/edit";
+import { SGraphItem } from "@persagy-web/graph/lib";
+import { SColor, SPainter } from '@persagy-web/draw/lib';
+import { Marker } from "@persagy-web/big/lib";
 
 
 /**
 /**
   * 编辑基础按钮类
   * 编辑基础按钮类

+ 1 - 1
src/components/editClass/persagy-edit/items/SBaseCursor.ts

@@ -26,8 +26,8 @@
 
 
 import { SBaseImageEdit } from "@persagy-web/edit";
 import { SBaseImageEdit } from "@persagy-web/edit";
 import { SGraphItem } from "@persagy-web/graph/lib";
 import { SGraphItem } from "@persagy-web/graph/lib";
-import { Marker } from "@persagy-web/edit/lib/type/Marker";
 import { SMouseEvent } from "@persagy-web/base/lib";
 import { SMouseEvent } from "@persagy-web/base/lib";
+import { Marker } from "@persagy-web/big/lib";
 
 
 /**
 /**
  * 编辑鼠标图例
  * 编辑鼠标图例

+ 2 - 4
src/components/editClass/persagy-edit/items/SBaseEquation.ts

@@ -25,10 +25,8 @@
  */
  */
 
 
 import { SBaseTextEdit } from "@persagy-web/edit"
 import { SBaseTextEdit } from "@persagy-web/edit"
-import { SColor, SFont, SPainter } from "@persagy-web/draw/";
-import { SGraphItem, SLineStyle } from "@persagy-web/graph/lib";
-import { Marker } from "@persagy-web/big-edit/lib/types/Marker";
-import { SMouseEvent } from "@persagy-web/base/lib";
+import { SGraphItem } from "@persagy-web/graph/lib";
+import { Marker } from "@persagy-web/big/lib";
 
 
 /**
 /**
  * 公式类
  * 公式类

+ 2 - 4
src/components/editClass/persagy-edit/items/SBaseInfoPoint.ts

@@ -24,11 +24,9 @@
  * *********************************************************************************************************************
  * *********************************************************************************************************************
  */
  */
 
 
+import { Marker } from "@persagy-web/big/lib";
 import { SBaseTextEdit } from "@persagy-web/edit"
 import { SBaseTextEdit } from "@persagy-web/edit"
-import { SColor, SFont, SPainter } from "@persagy-web/draw/";
-import { SGraphItem, SLineStyle } from "@persagy-web/graph/lib";
-import { Marker } from "@persagy-web/big-edit/lib/types/Marker";
-import { SMouseEvent } from "@persagy-web/base/lib";
+import { SGraphItem } from "@persagy-web/graph/lib";
 
 
 /**
 /**
  * 信息点
  * 信息点

+ 238 - 7
src/components/editClass/persagy-edit/items/SBasePipeUninTool.ts

@@ -24,22 +24,95 @@
  * *********************************************************************************************************************
  * *********************************************************************************************************************
  */
  */
 
 
-import { SBaseImageEdit } from "@persagy-web/edit";
+import { SGraphEdit, SBaseCirclePolylineEdit } from "@persagy-web/edit";
 import { SGraphItem } from "@persagy-web/graph/lib";
 import { SGraphItem } from "@persagy-web/graph/lib";
-import { Marker } from "@persagy-web/edit/lib/type/Marker";
 import { SMouseEvent } from "@persagy-web/base/lib";
 import { SMouseEvent } from "@persagy-web/base/lib";
-import { svgTobase64 } from "@persagy-web/big-edit/lib/until"
-
+import { Marker } from "@persagy-web/big/lib";
+import { SColor, SPath, SFont, SPainter, SPoint, SRect, SSize } from "@persagy-web/draw/lib";
 
 
 /**
 /**
  * 编辑基础管道接头类
  * 编辑基础管道接头类
  *
  *
  * @author 韩耀龙 <han_yao_long@163.com>
  * @author 韩耀龙 <han_yao_long@163.com>
  */
  */
-export class SBasePipeUninTool extends SBaseImageEdit {
+export class SBasePipeUninTool extends SGraphEdit {
 
 
     ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //属性
     //属性
+
+    // 数据
+    data: Marker;
+    // 宽高
+    width: number = 64;
+    // get width(): number {
+    //     return this._width;
+    // }
+    // set width(v: number) {
+    //     this._width = v
+    //     this.update();
+    // }
+
+    height: number = 64;
+    // get height(): number {
+    //     return this._height;
+    // }
+    // set height(v: number) {
+    //     this._height = v
+    //     this.update();
+    // }
+    // 轮廓点
+    outLineTpye: any = {
+        'wantou': 2,
+        'santong': 3,
+        'sitong': 4,
+    }
+
+    // 旋转角度
+    _angle: number = 0;
+    get angle(): number {
+        return this._angle;
+    }
+    set angle(v: number) {
+        this._angle = v;
+        this.update();
+    }
+
+    /** path 对象 */
+    path: SPath = new SPath();
+    /** 轮廓点 */
+    outLineLine: SPoint[] = [];
+
+    /** 填充色 */
+    _fillColor: SColor = new SColor('#2196f3');
+    get fillColor(): SColor {
+        return this._fillColor;
+    }
+    set fillColor(v: SColor) {
+        this._fillColor = v;
+        this.update();
+    }
+
+    /** 弧度 */
+    _radius: number = 0;
+    get radius(): number {
+        return this._radius;
+    }
+    set radius(v: number) {
+        this._radius = v;
+        this.generatePath(this.outLineLine, v)
+        this.update();
+    }
+
+    /** 线条宽度 */
+    _lineWidth: number = 20;
+    get lineWidth(): number {
+        return this._lineWidth;
+    }
+    set lineWidth(v: number) {
+        this._lineWidth = v;
+        this.update();
+    }
+
     /**
     /**
      * 构造函数
      * 构造函数
      *
      *
@@ -47,11 +120,34 @@ export class SBasePipeUninTool extends SBaseImageEdit {
      * @param data      数据
      * @param data      数据
      */
      */
     constructor(parent: SGraphItem | null, data: Marker) {
     constructor(parent: SGraphItem | null, data: Marker) {
-        super(parent, data);
+        super(parent);
         this.data = data;
         this.data = data;
+        // this._resizeable = false;
+        // this.showSelect = false;
+        this.initData(data);
     } // Constructor
     } // Constructor
 
 
     /**
     /**
+     * 初始化数据
+     *
+     * @param data Mark
+     */
+    initData(data: Marker) {
+        this.width = data.size?.width ? data.size?.width : 64;
+        this.height = data.size?.height ? data.size?.height : 64;
+        this.moveTo(data.pos.x, data.pos.y);
+        // 判断为几通管道
+        this.computeUninNumber(this.outLineTpye[data.style.uninToolType]);
+        this.zOrder = this.data.style.default.zorder ? this.data.style.default.zorder : this.zOrder;
+        this.fillColor = this.data.style.default.fillColor ? new SColor(this.data.style.default.fillColor) : this.fillColor;
+        this.angle = this.data.style.default.angle ? this.data.style.default.angle : 0
+        this.radius = this.data.style.default.radius ? this.data.style.default.radius : this.radius;
+        this.lineWidth = this.data.style.default.lineWidth ? this.data.style.default.lineWidth : this.lineWidth;
+
+        this.update()
+    }
+
+    /**
      * 鼠标按下事件
      * 鼠标按下事件
      *
      *
      * @param event   保存事件参数
      * @param event   保存事件参数
@@ -61,6 +157,60 @@ export class SBasePipeUninTool extends SBaseImageEdit {
         super.onMouseDown(event);
         super.onMouseDown(event);
         return true;
         return true;
     }
     }
+    /**
+     * 实时变化宽高
+     *
+     * @param oldSize 旧大小
+     * @param newSize 新大小
+     */
+    resize(oldSize: SSize, newSize: SSize) {
+        if(this.angle == 90 || this.angle == 270){
+            this.width = newSize.height;
+            this.height = newSize.width;
+        }else{
+            this.width = newSize.width;
+            this.height = newSize.height;
+        }
+
+        this.computeUninNumber(this.outLineTpye[this.data.style.uninToolType]);
+        // this.outLine.pointList = this.outLineLine; //赋值轮廓
+        this.update();
+    }
+
+    /**
+     * Item 对象边界区域
+     *
+     * @return 对象边界区域
+     */
+    boundingRect(): SRect {
+        if(this.angle == 90 || this.angle == 270){
+            return new SRect( -this.height/2,-this.width/2, this.height,this.width);
+        }else{
+            return new SRect(-this.width/2, -this.height/2, this.width, this.height);
+        }
+    }
+
+    /**
+     * 计算对应点位
+     * @param type 接口数量
+     */
+    computeUninNumber(type: number) {
+        //  如果为二通
+        const topPoint = new SPoint(0, -this.height/2);
+        const centerPoint = new SPoint(0,0)
+        const rightPoint = new SPoint(this.width/2, 0);
+        const leftPoint = new SPoint(-this.width/2, 0);
+        const bottomPoint = new SPoint(0, this.height/2)
+        if (2 == type) {
+            this.outLineLine = [topPoint, centerPoint, rightPoint];
+        } else if (3 == type) {
+            this.outLineLine = [topPoint, centerPoint, rightPoint, leftPoint];
+        } else if (4 == type) {
+            this.outLineLine = [topPoint, centerPoint, rightPoint, leftPoint, centerPoint, bottomPoint];
+        }
+        this.generatePath(this.outLineLine, this.radius)
+    }
+
 
 
     /**
     /**
      * 返回对象储存的相关数据
      * 返回对象储存的相关数据
@@ -68,6 +218,87 @@ export class SBasePipeUninTool extends SBaseImageEdit {
      * @return 相关数据
      * @return 相关数据
      */
      */
     toData(): any {
     toData(): any {
-        return super.toData()
+
+        if (!this.data) return;
+        if (this.data.size) {
+            this.data.size.width = this.width;
+            this.data.size.height = this.height;
+        } else {
+            this.data.size = {
+                width: this.width,
+                height: this.height
+            }
+        }
+
+        this.data.pos.x = this.pos.x;
+        this.data.pos.y = this.pos.y;
+        this.data.style.default.zorder = this.zOrder;
+        this.data.style.default.fillColor = this.fillColor.value;
+        this.data.style.default.angle = this.angle;
+        this.data.style.default.radius = this.radius;
+        this.data.style.default.lineWidth = this.lineWidth;
+        return this.data;
+    }
+
+    /**
+     * 根据点集生成 path 对象
+     *
+     * @param list  需要生成的点击
+     * @param r     拐点处圆角半径
+     */
+    generatePath(list: SPoint[], r: number = 0): void {
+        const len = list.length;
+        // 当前这小有效
+        if (len) {
+            this.path = new SPath();
+            this.path.moveTo(list[0].x, list[0].y);
+            // 遍历点集列表
+            for (let i = 1; i < len - 1; i++) {
+                const temp = list[i];
+                const next = list[i + 1];
+                this.path.arcTo(temp.x, temp.y, next.x, next.y, r);
+            }
+            const last = list[len - 1];
+            this.path.lineTo(last.x, last.y);
+        }
+    }
+
+    /**
+     * Item 绘制操作
+     *
+     * @param painter   绘画对象
+     */
+    onDraw(painter: SPainter): void {
+        super.onDraw(painter);
+        //设置旋转角度
+        if (this.angle != 0) {
+            painter.rotate(this.angle);
+        }
+        const topPoint = this.outLineLine[0];
+        const rightPoint = this.outLineLine[2];
+        const leftPoint = this.outLineLine[3];
+        const bottomPoint = this.outLineLine[5];
+        const pipeWidth = this.lineWidth;
+        painter.pen.color = this.fillColor;
+        painter.pen.lineWidth = this.lineWidth;
+        painter.drawPath(this.path);
+        const lineWidth = this.lineWidth / 4;
+        painter.pen.lineWidth = lineWidth;
+
+        // 绘制装饰线
+        if (3 == this.outLineLine.length) {
+            painter.drawLine(topPoint.x - pipeWidth, topPoint.y, topPoint.x + pipeWidth, topPoint.y);
+            painter.drawLine(rightPoint.x, rightPoint.y - pipeWidth, rightPoint.x, rightPoint.y + pipeWidth);
+        } else if (4 == this.outLineLine.length) {
+            painter.drawLine(topPoint.x - pipeWidth, topPoint.y, topPoint.x + pipeWidth, topPoint.y);
+            painter.drawLine(rightPoint.x, rightPoint.y - pipeWidth, rightPoint.x, rightPoint.y + pipeWidth);
+            painter.drawLine(leftPoint.x, leftPoint.y - pipeWidth, leftPoint.x, leftPoint.y + pipeWidth);
+        } else {
+            painter.drawLine(topPoint.x - pipeWidth, topPoint.y, topPoint.x + pipeWidth, topPoint.y);
+            painter.drawLine(rightPoint.x, rightPoint.y - pipeWidth, rightPoint.x, rightPoint.y + pipeWidth);
+            painter.drawLine(leftPoint.x, leftPoint.y - pipeWidth, leftPoint.x, leftPoint.y + pipeWidth);
+            painter.drawLine(bottomPoint.x - pipeWidth, bottomPoint.y, bottomPoint.x + pipeWidth, bottomPoint.y);
+        }
+
     }
     }
 }
 }

+ 59 - 8
src/components/editview/baseTopoEditer.vue

@@ -6,6 +6,7 @@
       ref="topoTooltip"
       ref="topoTooltip"
       @closeTooltip="showTooltip = false"
       @closeTooltip="showTooltip = false"
       :havItem="havItem"
       :havItem="havItem"
+      :havEquipItem="havEquipItem"
       :isLock="isLock"
       :isLock="isLock"
     ></topoTooltip>
     ></topoTooltip>
     <canvas
     <canvas
@@ -24,7 +25,7 @@ import {
   PTopoParser,
   PTopoParser,
   PTopoView,
   PTopoView,
 } from "@/components/editClass/persagy-edit";
 } from "@/components/editClass/persagy-edit";
-import { SBaseEquipment } from "@/components/editClass/big-edit";
+import { SBaseEquipment } from "@persagy-web/big-edit";
 import topoTooltip from "./topoTooltip.vue";
 import topoTooltip from "./topoTooltip.vue";
 import zoom from "./zoom";
 import zoom from "./zoom";
 import { mapState, mapMutations } from "vuex";
 import { mapState, mapMutations } from "vuex";
@@ -41,7 +42,7 @@ import {
 } from "@/api/editer";
 } from "@/api/editer";
 import { publishGraph } from "@/api/home";
 import { publishGraph } from "@/api/home";
 import crypto from "crypto-js/";
 import crypto from "crypto-js/";
-import { equipAnchor } from "./equipAnchor"
+import { equipAnchor } from "./equipAnchor";
 //////////////////////////////////////
 //////////////////////////////////////
 // 常量
 // 常量
 // 图服务路径
 // 图服务路径
@@ -61,11 +62,14 @@ export default {
       canvasWidth: 700, //画布宽
       canvasWidth: 700, //画布宽
       canvasHeight: 700, //画布高
       canvasHeight: 700, //画布高
       havItem: false, //右击是否选中item
       havItem: false, //右击是否选中item
+      havEquipItem: false, //右击是否为设备
       showTooltip: false, //是否显示tooltip
       showTooltip: false, //是否显示tooltip
       topoContent: {}, // 读图后存储图所有数据
       topoContent: {}, // 读图后存储图所有数据
       autoSave: null, // 自动保存定时器
       autoSave: null, // 自动保存定时器
       isLock: false, //右键item是否锁定
       isLock: false, //右键item是否锁定
       viewScale: 0, //视图缩放比例
       viewScale: 0, //视图缩放比例
+      changeScaleByClick: false, //区分滚轮,点击 事件改变的缩放比例
+      initScale: 1,
     };
     };
   },
   },
   computed: {
   computed: {
@@ -120,6 +124,7 @@ export default {
       "EDITEQUIPITEM",
       "EDITEQUIPITEM",
       "SETVERSION",
       "SETVERSION",
       "SETVBACKGROUND",
       "SETVBACKGROUND",
+      "SYNCSCENCEEQUIp",
     ]),
     ]),
     // 恢复命令状态
     // 恢复命令状态
     clearCmdStatus() {
     clearCmdStatus() {
@@ -135,9 +140,15 @@ export default {
         } else {
         } else {
           this.isLock = true;
           this.isLock = true;
         }
         }
+        if (item.legendData?.properties.type == "BaseEquipment") {
+          this.havEquipItem = true;
+        } else {
+          this.havEquipItem = false;
+        }
         this.havItem = true;
         this.havItem = true;
       } else {
       } else {
         this.havItem = false;
         this.havItem = false;
+        this.havEquipItem = false;
       }
       }
       const doms = document.getElementsByClassName("topoTooltip-box")[0];
       const doms = document.getElementsByClassName("topoTooltip-box")[0];
       doms.style.left = event.offsetX + "px";
       doms.style.left = event.offsetX + "px";
@@ -163,11 +174,15 @@ export default {
       bus.$off("topoUndo");
       bus.$off("topoUndo");
       bus.$on("topoUndo", (val) => {
       bus.$on("topoUndo", (val) => {
         this.scene.undo();
         this.scene.undo();
+        //撤销后 scence中设备与vuex设备数组做同步
+        this.SyncVuex();
       });
       });
       // 重做
       // 重做
       bus.$off("topoRedo");
       bus.$off("topoRedo");
       bus.$on("topoRedo", (val) => {
       bus.$on("topoRedo", (val) => {
         this.scene.redo();
         this.scene.redo();
+        //撤销后 scence中设备与vuex设备数组做同步
+        this.SyncVuex();
       });
       });
       // 删除
       // 删除
       bus.$off("deleteItem");
       bus.$off("deleteItem");
@@ -209,7 +224,8 @@ export default {
           `${this.topoContent.name}.png`,
           `${this.topoContent.name}.png`,
           "png",
           "png",
           this.canvasWidth,
           this.canvasWidth,
-          this.canvasHeight
+          this.canvasHeight,
+          this.view.backgroundColor.value
         );
         );
       });
       });
       // 发布图片
       // 发布图片
@@ -244,6 +260,27 @@ export default {
       bus.$on("changeBackgroundColor", (val) => {
       bus.$on("changeBackgroundColor", (val) => {
         this.scene.changeBackgroundColor(val);
         this.scene.changeBackgroundColor(val);
       });
       });
+      // 比例缩放
+      bus.$off("scale");
+      bus.$on("scale", (newV, oldV) => {
+        this.changeScaleByClick = true;
+        this.view.scaleByPoint(
+          newV / oldV,
+          this.canvasWidth / 2,
+          this.canvasHeight / 2
+        );
+        this.changeScaleByClick = false;
+      });
+    },
+    // 同步场景与vuex设备数据
+    SyncVuex() {
+      const arr = [];
+      this.scene.root.children.forEach((item) => {
+        if (item instanceof SBaseEquipment) {
+          arr.push(item);
+        }
+      });
+      this.SYNCSCENCEEQUIp(arr);
     },
     },
     // 读取拓扑图
     // 读取拓扑图
     readtopoMsg() {
     readtopoMsg() {
@@ -312,8 +349,8 @@ export default {
       });
       });
       parse.relations.forEach((t) => {
       parse.relations.forEach((t) => {
         // 设置锚点
         // 设置锚点
-        // (此处为吸附功能、需要要求注掉)
-        if (t.anchor1Id) {
+
+        if (t.anchor1Id && this.scene.isAdsorb) {
           let startAnc = null;
           let startAnc = null;
           anchorList.forEach((aItem) => {
           anchorList.forEach((aItem) => {
             if (aItem.id == t.anchor1Id) {
             if (aItem.id == t.anchor1Id) {
@@ -327,7 +364,7 @@ export default {
             t.startAnchor = startAnc || null;
             t.startAnchor = startAnc || null;
           }
           }
         }
         }
-        if (t.anchor2Id) {
+        if (t.anchor2Id && this.scene.isAdsorb) {
           let endAnc = null;
           let endAnc = null;
           anchorList.forEach((aItem) => {
           anchorList.forEach((aItem) => {
             if (aItem.id == t.anchor2Id) {
             if (aItem.id == t.anchor2Id) {
@@ -344,6 +381,11 @@ export default {
         t.connect("onContextMenu", this, this.scene.getItem);
         t.connect("onContextMenu", this, this.scene.getItem);
         this.scene.addItem(t);
         this.scene.addItem(t);
       });
       });
+      // 读取完成后默认走保存一次
+      this.saveTopoDraft();
+      // 设置初始化缩放比例
+      this.initScale = this.view.scale;
+      bus.$emit("initScale", this.view.scale);
     },
     },
     // 生成快照并保存草稿
     // 生成快照并保存草稿
     saveTopoDraft() {
     saveTopoDraft() {
@@ -508,7 +550,7 @@ export default {
           },
           },
         };
         };
         if (equipAnchor[item.classCode]) {
         if (equipAnchor[item.classCode]) {
-          data.anchorList = equipAnchor[item.classCode]
+          data.anchorList = equipAnchor[item.classCode];
         }
         }
         parse.addNode(data);
         parse.addNode(data);
       });
       });
@@ -533,7 +575,7 @@ export default {
     changeSize(isbiger) {
     changeSize(isbiger) {
       if (isbiger) {
       if (isbiger) {
         this.view.scaleByPoint(
         this.view.scaleByPoint(
-          (this.view.scale * 1.1) / this.view.scale,
+          this.view.scale + 0.1,
           this.canvasWidth / 2,
           this.canvasWidth / 2,
           this.canvasHeight / 2
           this.canvasHeight / 2
         );
         );
@@ -565,6 +607,15 @@ export default {
       },
       },
       deep: true,
       deep: true,
     },
     },
+    // 监听scale的变化
+    "view.scale": {
+      handler(scale) {
+        // 滚轮触发的缩放
+        if (!this.changeScaleByClick) {
+          bus.$emit("mouseScale", scale / this.initScale);
+        }
+      },
+    },
   },
   },
   created() {
   created() {
     this.SETPROJECT(this.$route.query);
     this.SETPROJECT(this.$route.query);

+ 42 - 0
src/components/editview/equipAnchor.js

@@ -1,3 +1,14 @@
+// 中心点
+// const centerPos=     {
+//   id: '',
+//   pos: {
+//     x:-0.5,
+//     y: 0
+//   }
+// },
+// const leftcenter = {
+
+// }
 export const equipAnchor = {
 export const equipAnchor = {
   "WSSTSP": [
   "WSSTSP": [
     {
     {
@@ -37,5 +48,36 @@ export const equipAnchor = {
         y: -10
         y: -10
       }
       }
     },
     },
+  ],
+  // 离心式冷水机组
+  'ACCCCC': [
+    {
+      id: '',
+      pos: {
+        x: -25,
+        y: 0
+      }
+    },
+    {
+      id: '',
+      pos: {
+        x: -25,
+        y: 10
+      }
+    },
+    {
+      id: '',
+      pos: {
+        x: 25,
+        y: 0
+      }
+    },
+    {
+      id: '',
+      pos: {
+        x: 25,
+        y: 10
+      }
+    },
   ]
   ]
 }
 }

+ 5 - 5
src/components/editview/leftToolBar.vue

@@ -171,10 +171,10 @@ li {
     width: 20px;
     width: 20px;
     height: 40px;
     height: 40px;
     position: absolute;
     position: absolute;
-    right: -250px;
+    right: -240px;
     top: 50%;
     top: 50%;
     transform: translateY(-50%);
     transform: translateY(-50%);
-    z-index: 99999;
+    z-index: 999;
     border-radius: 0px 5px 5px 0;
     border-radius: 0px 5px 5px 0;
     cursor: pointer;
     cursor: pointer;
     font-size: 28px;
     font-size: 28px;
@@ -192,9 +192,9 @@ li {
   }
   }
 }
 }
 .el-drawer__wrapper {
 .el-drawer__wrapper {
-  left: 64px;
-  top: 86px;
-  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1);
+  left: 54px;
+  top: 84px;
+  // box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1);
   width: 221px;
   width: 221px;
   border-right: 1px solid #eee;
   border-right: 1px solid #eee;
 }
 }

+ 1 - 1
src/components/editview/leftToolBar/addBaseItem.vue

@@ -119,7 +119,7 @@ export default {
 <style lang="less" scoped>
 <style lang="less" scoped>
 .base-item-list {
 .base-item-list {
   .baseItemInput {
   .baseItemInput {
-    margin: 12px 0;
+    margin: 12px 16px;
   }
   }
   .lengend-item {
   .lengend-item {
     width: 100%;
     width: 100%;

+ 4 - 5
src/components/editview/leftToolBar/addItemModel.vue

@@ -421,16 +421,15 @@ export default {
     // 选中table回调
     // 选中table回调
     handleSelectionChange(list) {
     handleSelectionChange(list) {
       let arr = [];
       let arr = [];
-      // let newList = this.choiceEquipList.concat(list);
+      // this.choiceEquipList = this.choiceEquipList.concat(...list);
       this.choiceEquipList = list;
       this.choiceEquipList = list;
-      // newList = this._.uniqBy(newList, "id");
       list.forEach((item) => {
       list.forEach((item) => {
         if (arr.length) {
         if (arr.length) {
           let index = -1;
           let index = -1;
           arr.forEach((aItem) => {
           arr.forEach((aItem) => {
             if (aItem.id == item.classCode) {
             if (aItem.id == item.classCode) {
               index = 1;
               index = 1;
-              aItem.children.push(item);
+              aItem.children.push(_.cloneDeep(item));
               aItem.number++;
               aItem.number++;
             }
             }
           });
           });
@@ -438,7 +437,7 @@ export default {
             let obj = {
             let obj = {
               id: item.classCode,
               id: item.classCode,
               title: item.codeName,
               title: item.codeName,
-              children: [item],
+              children: [_.cloneDeep(item)],
               number: 1,
               number: 1,
               showChildren: true,
               showChildren: true,
             };
             };
@@ -452,7 +451,7 @@ export default {
             number: 1,
             number: 1,
             showChildren: true,
             showChildren: true,
           };
           };
-          obj.children.push(item);
+          obj.children.push(_.cloneDeep(item));
           arr.push(obj);
           arr.push(obj);
         }
         }
       });
       });

+ 6 - 6
src/components/editview/leftToolBar/data.js

@@ -87,12 +87,12 @@ export const baseEditItems = [{
             //     icon: require("./../../../assets/images/leftImgs/" + "equipList.png"),
             //     icon: require("./../../../assets/images/leftImgs/" + "equipList.png"),
             //     activeIcon: require("./../../../assets/images/leftImgs/" + "equipList" + "Active" + ".png")
             //     activeIcon: require("./../../../assets/images/leftImgs/" + "equipList" + "Active" + ".png")
             // },
             // },
-            // {
-            //     name: '通用实例',
-            //     id: "publicItem",
-            //     icon: require("./../../../assets/images/leftImgs/" + "publicItem.png"),
-            //     activeIcon: require("./../../../assets/images/leftImgs/" + "publicItem" + "Active" + ".png")
-            // }
+            {
+                name: '通用实例',
+                id: "publicItem",
+                icon: require("./../../../assets/images/leftImgs/" + "publicItem.png"),
+                activeIcon: require("./../../../assets/images/leftImgs/" + "publicItem" + "Active" + ".png")
+            }
         ]
         ]
     },
     },
     {
     {

+ 7 - 1
src/components/editview/leftToolBar/equipmentList.vue

@@ -7,7 +7,7 @@
         class="baseItemInput"
         class="baseItemInput"
         :width="188"
         :width="188"
         iconType="search"
         iconType="search"
-        placeholder="请搜索元素名称"
+        placeholder="请搜索实例名称"
         v-model="getPressMsg"
         v-model="getPressMsg"
         @pressEnter="pressEnter"
         @pressEnter="pressEnter"
         @clear="pressEnter"
         @clear="pressEnter"
@@ -119,6 +119,7 @@
                         v-show="hoverIndex == '' + index + i + b"
                         v-show="hoverIndex == '' + index + i + b"
                         type="base"
                         type="base"
                         placement="top-center"
                         placement="top-center"
+                        :key="a.legendData.nodeId"
                       >
                       >
                         <template slot="content">
                         <template slot="content">
                           <Button @click="deleteItem(a)" type="text" icon="edit"
                           <Button @click="deleteItem(a)" type="text" icon="edit"
@@ -176,6 +177,7 @@
               v-show="hoverIndex == '' + 10000 + 10000 + b"
               v-show="hoverIndex == '' + 10000 + 10000 + b"
               type="base"
               type="base"
               placement="top-center"
               placement="top-center"
+              :key="a.legendData.nodeId"
             >
             >
               <template slot="content">
               <template slot="content">
                 <Button @click="deleteItem(a)" type="text" icon="edit"
                 <Button @click="deleteItem(a)" type="text" icon="edit"
@@ -454,6 +456,7 @@ li {
             box-sizing: border-box;
             box-sizing: border-box;
             flex: 1;
             flex: 1;
             .t {
             .t {
+              max-width: 120px;
               font-size: 14px;
               font-size: 14px;
               color: #1f2429;
               color: #1f2429;
               overflow: hidden;
               overflow: hidden;
@@ -461,6 +464,7 @@ li {
               white-space: nowrap;
               white-space: nowrap;
             }
             }
             .b {
             .b {
+              max-width: 120px;
               font-size: 10px;
               font-size: 10px;
               color: #8d9399;
               color: #8d9399;
               overflow: hidden;
               overflow: hidden;
@@ -555,6 +559,7 @@ li {
       box-sizing: border-box;
       box-sizing: border-box;
       flex: 1;
       flex: 1;
       .t {
       .t {
+        max-width: 120px;
         font-size: 14px;
         font-size: 14px;
         color: #1f2429;
         color: #1f2429;
         overflow: hidden;
         overflow: hidden;
@@ -562,6 +567,7 @@ li {
         white-space: nowrap;
         white-space: nowrap;
       }
       }
       .b {
       .b {
+        max-width: 120px;
         font-size: 10px;
         font-size: 10px;
         color: #8d9399;
         color: #8d9399;
         overflow: hidden;
         overflow: hidden;

+ 74 - 1
src/components/editview/rightPropertyBar/BaseEquipment.vue

@@ -117,6 +117,29 @@
         </div>
         </div>
       </el-tab-pane>
       </el-tab-pane>
     </el-tabs>
     </el-tabs>
+    <div
+      v-show="activeName == 'second' && this.checkedList.length"
+      class="choiced"
+      @mouseenter="showTip = true"
+      @mouseleave="showTip = false"
+    >
+      <div v-show="showTip" class="transition-box">
+        <transition v-show="showTip" name="el-zoom-in-bottom">
+          <div v-show="showTip" class="transition">
+            <el-tag
+              v-for="(tag, index) in this.checkedList"
+              :key="index"
+              closable
+              @close="closeTag(tag)"
+              type="info"
+            >
+              {{ tag.name }}
+            </el-tag>
+          </div>
+        </transition>
+      </div>
+      <span> 已选信息点 {{ this.checkedList.length }} </span>
+    </div>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
@@ -148,6 +171,8 @@ export default {
       local: "", //局部加载
       local: "", //局部加载
       localName: "", //设备本地名称
       localName: "", //设备本地名称
       anotherMsg: "", // 附加信息
       anotherMsg: "", // 附加信息
+      showTip: "", //显示已选信息
+      checkedList: [], //已经选信息点
     };
     };
   },
   },
   methods: {
   methods: {
@@ -264,6 +289,20 @@ export default {
         equipId: this.EquipData.attachObjectIds[0],
         equipId: this.EquipData.attachObjectIds[0],
       });
       });
       bus.$emit("changeEquipMsgPoint", item);
       bus.$emit("changeEquipMsgPoint", item);
+      //同步选中信息点
+      if (!item.checked) {
+        let trueList = [];
+        trueList = this.checkedList.filter((item) => {
+          return item.checked == true;
+        });
+        this.checkedList = trueList;
+      } else {
+         this.checkedList.push(item);
+      }
+    },
+    // 删除tag标签
+    closeTag(tag) {
+      this.changeCheck(tag);
     },
     },
     // 搜索回车操作
     // 搜索回车操作
     pressEnter() {
     pressEnter() {
@@ -299,6 +338,7 @@ export default {
       const data = {
       const data = {
         Type: val.properties.classCode,
         Type: val.properties.classCode,
       };
       };
+      // 获取该设备所有信息点
       queryDict(data)
       queryDict(data)
         .then((res) => {
         .then((res) => {
           let arr = [];
           let arr = [];
@@ -309,7 +349,7 @@ export default {
             msgData.map((item) => {
             msgData.map((item) => {
               item.checked = false;
               item.checked = false;
               this.InfoPointList.forEach((a) => {
               this.InfoPointList.forEach((a) => {
-                if (a.id == item.id) {
+                if (a.code == item.code) {
                   item.checked = true;
                   item.checked = true;
                 }
                 }
               });
               });
@@ -381,6 +421,11 @@ export default {
             }
             }
           });
           });
           this.msgData = arr;
           this.msgData = arr;
+          const checkedList = []
+          this.InfoPointList.forEach(item=>{
+                  checkedList.push(item)
+          });
+          this.checkedList  = checkedList;
           this.$loading.close(this.local);
           this.$loading.close(this.local);
         })
         })
         .catch((err) => {
         .catch((err) => {
@@ -410,6 +455,7 @@ p {
   list-style-type: none;
   list-style-type: none;
 }
 }
 #equip_pro {
 #equip_pro {
+  position: relative;
   .title {
   .title {
     height: 47px;
     height: 47px;
     border-bottom: 1px solid #979797;
     border-bottom: 1px solid #979797;
@@ -539,5 +585,32 @@ p {
       -o-transform: rotate(-90deg); /* Opera */
       -o-transform: rotate(-90deg); /* Opera */
     }
     }
   }
   }
+  .choiced {
+    width: 240px;
+    padding: 20px;
+    height: 50px;
+    background: #ffffff;
+    box-shadow: 1px 2px 10px 0px rgba(0, 0, 0, 0.11);
+    font-size: 14px;
+    color: #646a73;
+    line-height: 18px;
+    position: relative;
+    bottom: 0;
+    //更多信息点浮框
+    .transition-box {
+      position: absolute;
+      bottom: 50px;
+      right: 0px;
+      width: 480px;
+      height: 200px;
+      .transition {
+        width: 100%;
+        height: 200px;
+        overflow-x: hidden;
+        overflow-y: scroll;
+        background: #ffffff;
+      }
+    }
+  }
 }
 }
 </style>
 </style>

+ 2 - 1
src/components/editview/rightPropertyBar/BaseGraphy.vue

@@ -36,7 +36,7 @@
                 show-alpha
                 show-alpha
                 @change="changeFillcolor"
                 @change="changeFillcolor"
                 class="fix-box-1"
                 class="fix-box-1"
-                v-model="fillColor"
+                v-model="fillcolor"
               ></el-color-picker>
               ></el-color-picker>
             </div>
             </div>
             <span>颜色</span>
             <span>颜色</span>
@@ -125,6 +125,7 @@ export default {
         },
         },
       ],
       ],
       linestyle: "Solid",
       linestyle: "Solid",
+      fillcolor: ''
     };
     };
   },
   },
   methods: {
   methods: {

+ 43 - 3
src/components/editview/rightPropertyBar/BaseImagePro.vue

@@ -26,14 +26,14 @@
               placeholder="请输入内容"
               placeholder="请输入内容"
             ></el-input>
             ></el-input>
           </div>
           </div>
-          <el-upload
+          <!-- <el-upload
             class="avatar-uploader"
             class="avatar-uploader"
             action="https://jsonplaceholder.typicode.com/posts/"
             action="https://jsonplaceholder.typicode.com/posts/"
             :show-file-list="false"
             :show-file-list="false"
             :before-upload="beforeAvatarUpload"
             :before-upload="beforeAvatarUpload"
           >
           >
             <i class="el-icon-link"></i>
             <i class="el-icon-link"></i>
-          </el-upload>
+          </el-upload> -->
         </div>
         </div>
       </li>
       </li>
       <li>
       <li>
@@ -83,6 +83,17 @@
           </div>
           </div>
         </div>
         </div>
       </li>
       </li>
+      <li>
+        <div class="small-title">图片</div>
+        <el-upload
+          class="avatar-uploader"
+          action="https://jsonplaceholder.typicode.com/posts/"
+          :show-file-list="false"
+          :before-upload="beforeAvatarUpload"
+        >
+          <el-button size="small" plain>点击上传</el-button>
+        </el-upload>
+      </li>
       <li v-show="isSvg">
       <li v-show="isSvg">
         <div class="small-title">滤镜(只针对svg)</div>
         <div class="small-title">滤镜(只针对svg)</div>
         <div class="color-box">
         <div class="color-box">
@@ -97,6 +108,19 @@
           <span>颜色</span>
           <span>颜色</span>
         </div>
         </div>
       </li>
       </li>
+      <li v-show="isSvg">
+        <div class="small-title">旋转角度</div>
+        <div>
+          <span>度</span>
+          <el-input
+            style="width: 74px; margin-left: 6px"
+            size="mini"
+            v-model="rotate"
+            @input="changeRotate"
+            placeholder="请输入内容"
+          ></el-input>
+        </div>
+      </li>
     </ul>
     </ul>
   </div>
   </div>
 </template>
 </template>
@@ -110,7 +134,7 @@ const imgBaseUrl = window.__systemConf.imgServeUri;
 const imgServeUpload = window.__systemConf.imgServeUpload;
 const imgServeUpload = window.__systemConf.imgServeUpload;
 import { uploadGroup, getImageGroup } from "@/api/editer";
 import { uploadGroup, getImageGroup } from "@/api/editer";
 export default {
 export default {
-  props: ["strokeColor", "lineStyle", "lineWidth", "Width", "Height", "isSvg"],
+  props: ["strokeColor", "lineStyle", "lineWidth", "Width", "Height", "isSvg", "Rotate"],
   data() {
   data() {
     return {
     return {
       width: 0,
       width: 0,
@@ -134,6 +158,7 @@ export default {
       linestyle: "solid",
       linestyle: "solid",
       url: "",
       url: "",
       filterColor: "",
       filterColor: "",
+      rotate: 0, // 对象旋转角度
     };
     };
   },
   },
   methods: {
   methods: {
@@ -154,6 +179,18 @@ export default {
     changeColor(val) {
     changeColor(val) {
       bus.$emit("updateStyle", "strokeColor", val);
       bus.$emit("updateStyle", "strokeColor", val);
     },
     },
+    // 改变旋转角度
+    changeRotate(val) {
+      if (val.length > 0 && !isNaN(Number(val))) {
+        if (val > 360) {
+          val = 360;
+        }
+        if (val < -360) {
+          val = -360;
+        }
+        bus.$emit("updateStyle", "rotate", Number(val));
+      }
+    },
     beforeAvatarUpload(file) {
     beforeAvatarUpload(file) {
       let that = this;
       let that = this;
       const fileReader = new FileReader();
       const fileReader = new FileReader();
@@ -258,6 +295,9 @@ export default {
     Url(val) {
     Url(val) {
       this.url = val;
       this.url = val;
     },
     },
+    Rotate(val) {
+      this.rotate = val;
+    }
   },
   },
 };
 };
 </script>
 </script>

+ 40 - 29
src/components/editview/rightPropertyBar/BasePipe.vue

@@ -8,41 +8,18 @@
         <div class="property">
         <div class="property">
           <div class="color-box">
           <div class="color-box">
             <div class="cololorSelect">
             <div class="cololorSelect">
-              <el-color-picker
-                show-alpha
-                @change="changeColor"
-                class="fix-box-1"
-                v-model="color"
-              ></el-color-picker>
+              <el-color-picker show-alpha @change="changeColor" class="fix-box-1" v-model="color"></el-color-picker>
             </div>
             </div>
             <span>颜色</span>
             <span>颜色</span>
           </div>
           </div>
           <div class="line-width">
           <div class="line-width">
-            <el-input-number
-              style="width: 80px"
-              v-model="linewidth"
-              controls-position="right"
-              @change="changeWidth"
-              size="mini"
-              :min="1"
-              :max="20"
-              :maxlength="100"
-            ></el-input-number>
+            <el-input-number style="width: 80px" v-model="linewidth" controls-position="right" @change="changeWidth" size="mini" :min="1" :max="20"
+              :maxlength="100"></el-input-number>
             <span>线宽</span>
             <span>线宽</span>
           </div>
           </div>
           <div class="line-width">
           <div class="line-width">
-            <a-select
-              style="width: 80px"
-              v-model="linestyle"
-              :default-value="borderLineOption[0].id"
-              @change="changeLineStyle"
-            >
-              <a-select-option
-                v-for="item in borderLineOption"
-                :key="item.id"
-                :label="item.src"
-                :value="item.id"
-              >
+            <a-select style="width: 80px" v-model="linestyle" :default-value="borderLineOption[0].id" @change="changeLineStyle">
+              <a-select-option v-for="item in borderLineOption" :key="item.id" :label="item.src" :value="item.id">
                 <img :src="item.src" alt width="60" />
                 <img :src="item.src" alt width="60" />
               </a-select-option>
               </a-select-option>
             </a-select>
             </a-select>
@@ -50,13 +27,26 @@
           </div>
           </div>
         </div>
         </div>
       </li>
       </li>
+      <li>
+        <div class="small-title">拐角</div>
+        <div>
+          <el-radio-group v-model="corner" @change="changeRadio">
+            <el-radio label="1">直角</el-radio>
+            <el-radio label="2">圆角</el-radio>
+          </el-radio-group>
+        </div>
+        <div style="margin-top: 10px;" v-if="corner=='2'">
+          <label for="radius">设置圆角半径: </label>
+          <el-input-number v-model="radius" controls-position="right" size="mini" @change="changeCornerRaduis" :min="0" :step-strictly="true"></el-input-number>
+        </div>
+      </li>
     </ul>
     </ul>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
 import bus from "@/bus/bus";
 import bus from "@/bus/bus";
 export default {
 export default {
-  props: ["strokeColor", "lineStyle", "lineWidth"],
+  props: ["strokeColor", "lineStyle", "lineWidth", "Radius"],
   data() {
   data() {
     return {
     return {
       color: "",
       color: "",
@@ -73,6 +63,8 @@ export default {
         },
         },
         {},
         {},
       ],
       ],
+      corner: '1', // 默认直角
+      radius: 0, // 圆角半径
     };
     };
   },
   },
   methods: {
   methods: {
@@ -92,6 +84,17 @@ export default {
     changeArrowType(dir) {
     changeArrowType(dir) {
       bus.$emit("updateStyle", dir, this[dir]);
       bus.$emit("updateStyle", dir, this[dir]);
     },
     },
+    // 改变拐角半径
+    changeCornerRaduis(val) {
+      bus.$emit("updateStyle", 'radius', this.radius);
+    },
+    // 拐角类型变化
+    changeRadio() {
+      if (this.corner == '1') {
+        this.radius = 0;
+      }
+      bus.$emit("updateStyle", 'radius', this.radius);
+    }
   },
   },
   watch: {
   watch: {
     strokeColor(val) {
     strokeColor(val) {
@@ -103,6 +106,11 @@ export default {
     lineStyle(val) {
     lineStyle(val) {
       this.linestyle = val;
       this.linestyle = val;
     },
     },
+    Radius(val) {
+      console.log(val);
+      this.corner = val > 0 ? "2" : "1"
+      this.radius = val;
+    }
   },
   },
 };
 };
 </script>
 </script>
@@ -183,6 +191,9 @@ li {
           margin-top: 4px;
           margin-top: 4px;
         }
         }
       }
       }
+      /deep/.el-input-number--mini {
+        width: 100px;
+      }
     }
     }
   }
   }
 }
 }

+ 285 - 0
src/components/editview/rightPropertyBar/BaseUnitPro.vue

@@ -0,0 +1,285 @@
+<!--基础管道弯头属性-->
+<template>
+  <div class="base-pipe">
+    <ul>
+      <!-- <li>
+        <div class="small-title">尺寸大小</div>
+        <div class="property">
+          <div>
+            <span>W</span>
+            <el-input
+              style="width: 74px; margin-left: 6px"
+              size="mini"
+              v-model="width"
+              @input="changeWidth"
+              placeholder="请输入内容"
+            ></el-input>
+          </div>
+          <div>
+            <span>H</span>
+            <el-input
+              style="width: 74px; margin-left: 6px"
+              size="mini"
+              v-model="height"
+              @input="changeHeight"
+              placeholder="请输入内容"
+            ></el-input>
+          </div>
+        </div>
+      </li> -->
+      <li>
+        <div class="small-title">属性</div>
+        <div class="property">
+          <div class="color-box">
+            <div class="cololorSelect">
+              <el-color-picker
+                show-alpha
+                @change="changeColor"
+                class="fix-box-1"
+                v-model="color"
+              ></el-color-picker>
+            </div>
+            <span>颜色</span>
+          </div>
+          <div class="line-width">
+            <el-select
+              v-model="angle"
+              @change="changeAngle"
+              placeholder="请选择"
+            >
+              <el-option
+                v-for="item in angleList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+            <span>旋转</span>
+          </div>
+          <div class="line-width">
+            <el-input-number
+              style="width: 80px"
+              v-model="linewidth"
+              controls-position="right"
+              @change="changeLineWidth"
+              size="mini"
+              :min="1"
+              :max="60"
+              :maxlength="100"
+            ></el-input-number>
+            <span>线宽</span>
+          </div>
+        </div>
+      </li>
+      <li>
+        <div class="small-title">拐角</div>
+        <div>
+          <el-radio-group v-model="corner" @change="changeRadio">
+            <el-radio label="1">直角</el-radio>
+            <el-radio label="2">圆角</el-radio>
+          </el-radio-group>
+        </div>
+        <div style="margin-top: 10px" v-if="corner == '2'">
+          <label for="radius">设置圆角半径: </label>
+          <el-input-number
+            v-model="radius"
+            controls-position="right"
+            size="mini"
+            @change="changeCornerRaduis"
+            :min="0"
+            :max="maxR"
+            :step-strictly="true"
+          ></el-input-number>
+        </div>
+      </li>
+    </ul>
+  </div>
+</template>
+<script>
+import bus from "@/bus/bus";
+export default {
+  props: [
+    "fillColor",
+    "lineStyle",
+    "lineWidth",
+    "Radius",
+    "angles",
+    "Width",
+    "Height",
+  ],
+  data() {
+    return {
+      color: "",
+      linewidth: "",
+      width:0,
+      height:0,
+      corner: "1", // 默认直角
+      radius: 0, // 圆角半径
+      angleList: [
+        {
+          value: 0,
+          label: "0度",
+        },
+        {
+          value: 90,
+          label: "90度",
+        },
+        {
+          value: 180,
+          label: "180度",
+        },
+        {
+          value: 270,
+          label: "270度",
+        },
+      ],
+      angle: 0,
+    };
+  },
+  computed: {
+    maxR() {
+      return Math.min(this.width, this.height) / 2;
+    }
+  },
+  methods: {
+    changeHeight(val) {
+      bus.$emit("updateStyle", "height", val);
+    },
+    changeWidth(val) {
+      bus.$emit("updateStyle", "width", val);
+    },
+    // 改变线宽
+    changeLineWidth(val) {
+      bus.$emit("updateStyle", "lineWidth", val);
+    },
+    // 改变颜色
+    changeColor(val) {
+      bus.$emit("updateStyle", "fillColor", val);
+    },
+    // 改变拐角半径
+    changeCornerRaduis(val) {
+      bus.$emit("updateStyle", "radius", this.radius);
+    },
+    // 拐角类型变化
+    changeRadio() {
+      if (this.corner == "1") {
+        this.radius = 0;
+      }
+      bus.$emit("updateStyle", "radius", this.radius);
+    },
+    changeAngle(val) {
+      console.log("valval", val);
+      bus.$emit("updateStyle", "angle", val);
+    },
+  },
+  watch: {
+    fillColor(val) {
+      this.color = val;
+    },
+    lineWidth(val) {
+      this.linewidth = val;
+    },
+    lineStyle(val) {
+      this.linestyle = val;
+    },
+    Radius(val) {
+      this.corner = val > 0 ? "2" : "1";
+      this.radius = val;
+    },
+    angles(val) {
+      this.angle = val;
+    },
+    Width(val) {
+      this.width = val;
+    },
+    Height(val) {
+      this.height = val;
+    },
+  },
+};
+</script>
+<style lang="less" scoped>
+ul,
+li {
+  margin: 0;
+  padding: 0;
+  list-style-type: none;
+}
+.base-pipe {
+  .title {
+    height: 47px;
+    // border-bottom: 1px solid #979797;
+    color: #646c73;
+    font-size: 16px;
+    padding-left: 12px;
+    box-sizing: border-box;
+  }
+  ul {
+    width: calc(~"100% - 24px");
+    margin: -1px 12px 0 12px;
+    li {
+      // border-top: 1px solid #979797;
+      .small-title {
+        font-size: 12px;
+        color: #8d9399;
+        margin: 12px 0;
+      }
+      .property {
+        display: flex;
+        align-items: center;
+        justify-content: space-around;
+        .color-box {
+          display: flex;
+          align-items: center;
+          flex-direction: column;
+          .cololorSelect {
+            width: 32px;
+            height: 20px;
+            overflow: hidden;
+            position: relative;
+            margin: 4px 0;
+            .fix-box-1 {
+              margin-top: -8px;
+              margin-left: -8px;
+              /deep/ .el-color-picker__trigger {
+                width: 200px;
+                height: 200px;
+              }
+            }
+          }
+        }
+        .line-width {
+          display: flex;
+          align-items: center;
+          flex-direction: column;
+          margin-left: 8px;
+          position: relative;
+        }
+        .line-style {
+          width: 100%;
+          display: flex;
+          align-items: center;
+          justify-content: flex-start;
+          position: relative;
+          margin-top: 4px;
+          .nametype {
+            position: absolute;
+            left: 50%;
+            bottom: -80%;
+            transform: translateX(-140%);
+          }
+        }
+        span {
+          font-size: 12px;
+          color: #1f2429;
+          margin-top: 4px;
+        }
+      }
+      /deep/.el-input-number--mini {
+        width: 100px;
+      }
+    }
+  }
+}
+</style>

+ 17 - 5
src/components/editview/rightPropertyBar/InfoPoint.vue

@@ -8,12 +8,14 @@
       label-width="120px"
       label-width="120px"
       :model="formLabelAlign"
       :model="formLabelAlign"
       :rules="rules"
       :rules="rules"
+      :validate-on-rule-change="true"
       ref="infopointform"
       ref="infopointform"
     >
     >
       <el-form-item label="全局编码" prop="EqId">
       <el-form-item label="全局编码" prop="EqId">
         <el-input
         <el-input
           @keyup.enter.native="submitForm"
           @keyup.enter.native="submitForm"
           @blur="submitForm"
           @blur="submitForm"
+          placeholder="回车或失焦会促发请求"
           v-model="formLabelAlign.EqId"
           v-model="formLabelAlign.EqId"
         ></el-input>
         ></el-input>
       </el-form-item>
       </el-form-item>
@@ -22,17 +24,25 @@
           @keyup.enter.native="submitForm"
           @keyup.enter.native="submitForm"
           @blur="submitForm"
           @blur="submitForm"
           v-model="formLabelAlign.classCode"
           v-model="formLabelAlign.classCode"
+          placeholder="回车或失焦会促发请求"
         ></el-input>
         ></el-input>
       </el-form-item>
       </el-form-item>
       <el-form-item label="信息点编码(code)" prop="code">
       <el-form-item label="信息点编码(code)" prop="code">
         <el-input
         <el-input
           @keyup.enter.native="submitForm"
           @keyup.enter.native="submitForm"
           @blur="submitForm"
           @blur="submitForm"
+           placeholder="回车或失焦会促发请求"
           v-model="formLabelAlign.code"
           v-model="formLabelAlign.code"
         ></el-input>
         ></el-input>
       </el-form-item>
       </el-form-item>
-      <el-form-item label="信息点名称" v-show="InfoItem &&InfoItem.data.properties.infoData">
-        <el-input @change="changeText" v-model="formLabelAlign.subName"></el-input>
+      <el-form-item
+        label="信息点名称"
+        v-show="InfoItem && InfoItem.data.properties.infoData"
+      >
+        <el-input
+          @change="changeText"
+          v-model="formLabelAlign.subName"
+        ></el-input>
       </el-form-item>
       </el-form-item>
     </el-form>
     </el-form>
   </div>
   </div>
@@ -71,11 +81,12 @@ export default {
     // 提交表单
     // 提交表单
     submitForm() {
     submitForm() {
       this.$refs["infopointform"].validate((valid) => {
       this.$refs["infopointform"].validate((valid) => {
+        // 做校验判断
         if (valid) {
         if (valid) {
           // 请求信息
           // 请求信息
           this.queryMsg();
           this.queryMsg();
         } else {
         } else {
-          this.$message.error("信息点参数请求失败!");
+          // this.$message.error("信息点参数请求失败!");
           return false;
           return false;
         }
         }
       });
       });
@@ -103,11 +114,12 @@ export default {
           if (this.InfoItem) {
           if (this.InfoItem) {
             if (this.InfoItem.data.properties.infoData) {
             if (this.InfoItem.data.properties.infoData) {
               this.$delete(this.InfoItem.data.properties, "infoData");
               this.$delete(this.InfoItem.data.properties, "infoData");
-              console.log("this.InfoItem.data.properties",this.InfoItem.data.properties);
             }
             }
           }
           }
         }
         }
-      });
+      }).catch(()=>{
+         this.$message.error("信息点参数请求失败!");
+      })
     },
     },
     // 获取到信息点
     // 获取到信息点
     emitChoice(itemList) {
     emitChoice(itemList) {

+ 31 - 9
src/components/editview/rightPropertyBar/baseTextPro.vue

@@ -10,9 +10,9 @@
             <div class="cololorSelect">
             <div class="cololorSelect">
               <el-color-picker
               <el-color-picker
                 show-alpha
                 show-alpha
-                @change="changeColor"
+                @change="changeStrokeColor"
                 class="fix-box-1"
                 class="fix-box-1"
-                v-model="color"
+                v-model="strokecolor"
               ></el-color-picker>
               ></el-color-picker>
             </div>
             </div>
             <span>颜色</span>
             <span>颜色</span>
@@ -25,7 +25,7 @@
               @change="changeFontSize"
               @change="changeFontSize"
               size="mini"
               size="mini"
               :min="1"
               :min="1"
-              :max="20"
+              :max="60"
               :maxlength="100"
               :maxlength="100"
             ></el-input-number>
             ></el-input-number>
             <span>字号</span>
             <span>字号</span>
@@ -52,19 +52,35 @@
         ></el-input>
         ></el-input>
         <span>文本</span>
         <span>文本</span>
       </li>
       </li>
+      <li>
+        <div class="property" style="justify-content:flex-start">
+          <div class="color-box">
+            <div class="cololorSelect">
+              <el-color-picker
+                show-alpha
+                @change="changeColor"
+                class="fix-box-1"
+                v-model="color"
+              ></el-color-picker>
+            </div>
+            <span>文本颜色</span>
+          </div>
+        </div>
+      </li>
     </ul>
     </ul>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
 import bus from "@/bus/bus";
 import bus from "@/bus/bus";
 export default {
 export default {
-  props: ["strokeColor", "fontSize", "backgroundColor", "textMsg"],
+  props: ["strokeColor", "fontSize", "backgroundColor", "textMsg", "fontColor"],
   data() {
   data() {
     return {
     return {
       size: 0, //font-size
       size: 0, //font-size
       text: "", //文本
       text: "", //文本
-      color: "",
+      color: "", // 文本颜色
       backgroundcolor: "",
       backgroundcolor: "",
+      strokecolor: '', // 边框颜色
       borderLineOption: [
       borderLineOption: [
         {
         {
           id: "solid",
           id: "solid",
@@ -87,9 +103,9 @@ export default {
     changeText(val) {
     changeText(val) {
       bus.$emit("updateStyle", "text", val);
       bus.$emit("updateStyle", "text", val);
     },
     },
-    // 改变颜色
+    // 改变字体颜色
     changeColor(val) {
     changeColor(val) {
-      bus.$emit("updateStyle", "strokeColor", val);
+      bus.$emit("updateStyle", "color", val);
     },
     },
     // 改变背景颜色
     // 改变背景颜色
     changeBackground(val) {
     changeBackground(val) {
@@ -99,13 +115,17 @@ export default {
     changeFontSize(val) {
     changeFontSize(val) {
       bus.$emit("updateStyle", "font", val);
       bus.$emit("updateStyle", "font", val);
     },
     },
+    // 改变边框颜色
+    changeStrokeColor(val) {
+      bus.$emit("updateStyle", "strokeColor", val);
+    }
   },
   },
   mounted() {
   mounted() {
     // console.log(Select)
     // console.log(Select)
   },
   },
   watch: {
   watch: {
     strokeColor(val) {
     strokeColor(val) {
-      this.color = val;
+      this.strokecolor = val;
     },
     },
     fontSize(val) {
     fontSize(val) {
       this.size = val;
       this.size = val;
@@ -113,10 +133,12 @@ export default {
     backgroundColor(val) {
     backgroundColor(val) {
       this.backgroundcolor = val;
       this.backgroundcolor = val;
     },
     },
-
     textMsg(val) {
     textMsg(val) {
       this.text = val;
       this.text = val;
     },
     },
+    fontColor(val) {
+      this.color = val;
+    }
   },
   },
 };
 };
 </script>
 </script>

+ 38 - 13
src/components/editview/rightPropertyBar/property.vue

@@ -6,6 +6,7 @@
       :fontSize="fontSize"
       :fontSize="fontSize"
       :textMsg="textMsg"
       :textMsg="textMsg"
       :backgroundColor="backgroundColor"
       :backgroundColor="backgroundColor"
+      :fontColor="color"
       v-show="itemType == 'BaseText' || itemType == 'BaseExplain'"
       v-show="itemType == 'BaseText' || itemType == 'BaseExplain'"
     ></baseTextPro>
     ></baseTextPro>
     <BaseBtn
     <BaseBtn
@@ -14,7 +15,7 @@
       :lineWidth="lineWidth"
       :lineWidth="lineWidth"
       :Width="Width"
       :Width="Width"
       :Height="Height"
       :Height="Height"
-      :color ="color"
+      :color="color"
       :textMsg="textMsg"
       :textMsg="textMsg"
       :backgroundColor="backgroundColor"
       :backgroundColor="backgroundColor"
       :items="items"
       :items="items"
@@ -33,6 +34,7 @@
       :strokeColor="strokeColor"
       :strokeColor="strokeColor"
       :lineStyle="lineStyle"
       :lineStyle="lineStyle"
       :lineWidth="lineWidth"
       :lineWidth="lineWidth"
+      :Radius="Radius"
     ></BasePipe>
     ></BasePipe>
 
 
     <BaseGraphy
     <BaseGraphy
@@ -59,8 +61,18 @@
       :Width="Width"
       :Width="Width"
       :Height="Height"
       :Height="Height"
       :isSvg="isSvg"
       :isSvg="isSvg"
-      v-show="itemType == 'BaseImage' || itemType == 'BasePipeUninTool'"
+      :Rotate="Rotate"
+      v-show="itemType == 'BaseImage'"
     ></BaseImagePro>
     ></BaseImagePro>
+    <BaseUnitPro
+      :fillColor="fillColor"
+      :lineWidth="lineWidth"
+      :Width="Width"
+      :Height="Height"
+      :Radius="Radius"
+      :angles="angles"
+      v-show="itemType == 'BasePipeUninTool'"
+    ></BaseUnitPro>
     <BaseEquipment
     <BaseEquipment
       :Width="Width"
       :Width="Width"
       :Height="Height"
       :Height="Height"
@@ -92,6 +104,7 @@ import BaseGraphy from "./BaseGraphy";
 import BaseImagePro from "./BaseImagePro";
 import BaseImagePro from "./BaseImagePro";
 import BaseEquipment from "./BaseEquipment";
 import BaseEquipment from "./BaseEquipment";
 import BaseEquipmentMsg from "./BaseEquipmentMsg";
 import BaseEquipmentMsg from "./BaseEquipmentMsg";
+import BaseUnitPro from "./BaseUnitPro";
 import BasePipe from "./BasePipe";
 import BasePipe from "./BasePipe";
 import Equation from "./Equation";
 import Equation from "./Equation";
 import InfoPoint from "./InfoPoint";
 import InfoPoint from "./InfoPoint";
@@ -128,6 +141,7 @@ export default {
     Equation,
     Equation,
     InfoPoint,
     InfoPoint,
     BaseBtn,
     BaseBtn,
+    BaseUnitPro,
   },
   },
   data() {
   data() {
     return {
     return {
@@ -141,6 +155,7 @@ export default {
       Width: 0, //item 宽
       Width: 0, //item 宽
       Height: 0, //item 高
       Height: 0, //item 高
       Url: "", // 路径
       Url: "", // 路径
+      Rotate: 0, // 旋转角度
       fillColor: "", //填充色
       fillColor: "", //填充色
       begin: "", //开头样式
       begin: "", //开头样式
       end: "", //结尾样式
       end: "", //结尾样式
@@ -151,13 +166,15 @@ export default {
       EquipMsgItem: null, //设备信息点实例
       EquipMsgItem: null, //设备信息点实例
       AnotherMsg: "", // 附加信息 (只用与设备图例)
       AnotherMsg: "", // 附加信息 (只用与设备图例)
       isSvg: false, // 是否为svg图
       isSvg: false, // 是否为svg图
-      color:'',
-      items:null,
+      color: "",
+      items: null,
+      Radius: 0, // 管线的圆角半径
+      angles:0 //旋转角度
     };
     };
   },
   },
   mounted() {
   mounted() {
     const box = document.getElementsByClassName("propertys")[0];
     const box = document.getElementsByClassName("propertys")[0];
-    this.equipHeight = box.offsetHeight - 150 + "px";
+    this.equipHeight = box.offsetHeight - 210 + "px";
     bus.$on("emitChoice", this.emitChoice);
     bus.$on("emitChoice", this.emitChoice);
   },
   },
   methods: {
   methods: {
@@ -187,7 +204,7 @@ export default {
     // 同步样式
     // 同步样式
     linkStyle(itemList) {
     linkStyle(itemList) {
       const item = itemList[0];
       const item = itemList[0];
-      console.log('item',item)
+      console.log("item", item.legendData.properties.classCode);
       this.EquipMsgItem = null;
       this.EquipMsgItem = null;
       this.items = null;
       this.items = null;
       this.isSvg = false;
       this.isSvg = false;
@@ -199,22 +216,22 @@ export default {
         this.end = arrowType[item.end];
         this.end = arrowType[item.end];
       } else if (
       } else if (
         this.itemType == "BaseText" ||
         this.itemType == "BaseText" ||
-        this.itemType == "BaseExplain"
+        this.itemType == "BaseExplain" ||
+        this.itemType == "Equation"
       ) {
       ) {
-        this.strokeColor = item.color.toRgba();
+        this.strokeColor = item.strokeColor.toRgba();
         this.backgroundColor = item.backgroundColor.toRgba();
         this.backgroundColor = item.backgroundColor.toRgba();
         this.textMsg = item.text;
         this.textMsg = item.text;
         this.fontSize = item.font.size;
         this.fontSize = item.font.size;
-      } else if (
-        this.itemType == "BaseImage" ||
-        this.itemType == "BasePipeUninTool"
-      ) {
+        this.color = item.color.toRgba();
+      } else if (this.itemType == "BaseImage") {
         this.Width = item.width; //item 宽
         this.Width = item.width; //item 宽
         this.Height = item.height; //item 高
         this.Height = item.height; //item 高
         this.Url = item.url; // 路径
         this.Url = item.url; // 路径
         this.lineStyle = lineStyle[item.lineStyle];
         this.lineStyle = lineStyle[item.lineStyle];
         this.lineWidth = item.lineWidth;
         this.lineWidth = item.lineWidth;
         this.strokeColor = item.strokeColor.toRgba();
         this.strokeColor = item.strokeColor.toRgba();
+        this.Rotate = item.rotate;
         if (
         if (
           item.data.style.default.url &&
           item.data.style.default.url &&
           item.data.style.default.url.includes(".svg")
           item.data.style.default.url.includes(".svg")
@@ -260,13 +277,21 @@ export default {
         this.strokeColor = item.strokeColor.toRgba();
         this.strokeColor = item.strokeColor.toRgba();
         this.lineStyle = lineStyle[item.lineStyle];
         this.lineStyle = lineStyle[item.lineStyle];
         this.lineWidth = item.lineWidth;
         this.lineWidth = item.lineWidth;
+        this.Radius = item.radius;
+      } else if (this.itemType == "BasePipeUninTool") {
+        this.Width = item.width; //item 宽
+        this.Height = item.height; //item 高
+        this.Radius = item.radius;
+        this.lineWidth = item.lineWidth;
+        this.angles = item.angle;
+        this.fillColor = item.fillColor.toRgba();
       } else if (this.itemType == "baseBtn") {
       } else if (this.itemType == "baseBtn") {
         this.Width = item.width; //item 宽
         this.Width = item.width; //item 宽
         this.Height = item.height; //item 高
         this.Height = item.height; //item 高
         this.strokeColor = item.strokeColor.toRgba();
         this.strokeColor = item.strokeColor.toRgba();
         this.backgroundColor = item.backgroundColor.toRgba();
         this.backgroundColor = item.backgroundColor.toRgba();
         this.textMsg = item.text;
         this.textMsg = item.text;
-        this.items = item
+        this.items = item;
         this.color = item.color.toRgba();
         this.color = item.color.toRgba();
         this.lineWidth = item.lineWidth;
         this.lineWidth = item.lineWidth;
         this.fontSize = item.font.size;
         this.fontSize = item.font.size;

+ 1 - 1
src/components/editview/topToolBar.vue

@@ -344,7 +344,7 @@ li {
     cursor: pointer;
     cursor: pointer;
     font-size: 12px;
     font-size: 12px;
     color: #8d9399;
     color: #8d9399;
-    z-index: 99999;
+    z-index: 999;
     .box-card{
     .box-card{
       width: 240px;
       width: 240px;
       max-height: 500px;
       max-height: 500px;

+ 16 - 5
src/components/editview/topoTooltip.vue

@@ -4,10 +4,12 @@
     <div v-if="havItem" class="tooltip-card">
     <div v-if="havItem" class="tooltip-card">
       <ul>
       <ul>
         <li @click="editItem">编辑</li>
         <li @click="editItem">编辑</li>
-        <li @click="setLock">{{isLock?'解锁':"锁定"}}</li>
+        <li @click="setLock">{{ isLock ? "解锁" : "锁定" }}</li>
         <li @click="toTop">置顶</li>
         <li @click="toTop">置顶</li>
         <li @click="toBottom">置底</li>
         <li @click="toBottom">置底</li>
         <li @click="deleteItem">删除</li>
         <li @click="deleteItem">删除</li>
+        <li v-show="havEquipItem" @click="showItem(1)">显示</li>
+        <li v-show="havEquipItem" @click="showItem(0)">隐藏</li>
       </ul>
       </ul>
     </div>
     </div>
     <div v-else class="tooltip-card">
     <div v-else class="tooltip-card">
@@ -23,7 +25,7 @@
 import { SItemStatus } from "@persagy-web/big";
 import { SItemStatus } from "@persagy-web/big";
 import bus from "@/bus/bus";
 import bus from "@/bus/bus";
 export default {
 export default {
-  props: ["havItem","isLock"],
+  props: ["havItem", "havEquipItem", "isLock"],
   name: "topoTooltip",
   name: "topoTooltip",
   data() {
   data() {
     return {};
     return {};
@@ -55,23 +57,32 @@ export default {
     },
     },
     // 保存图
     // 保存图
     saveGraph() {
     saveGraph() {
-      bus.$emit('saveTopo');
+      bus.$emit("saveTopo");
       this.closetooltip();
       this.closetooltip();
     },
     },
     // 发布图
     // 发布图
     publishGraph() {
     publishGraph() {
-      bus.$emit('issueTopo');
+      bus.$emit("issueTopo");
       this.closetooltip();
       this.closetooltip();
     },
     },
     // 下载
     // 下载
     downPng() {
     downPng() {
-      bus.$emit('saveTopoImg');
+      bus.$emit("saveTopoImg");
       this.closetooltip();
       this.closetooltip();
     },
     },
     // 关闭窗口
     // 关闭窗口
     closetooltip() {
     closetooltip() {
       this.$emit("closeTooltip");
       this.$emit("closeTooltip");
     },
     },
+    //显示隐藏
+    showItem(val) {
+      if (val) {
+        bus.$emit("updateStyle", "visible", true);
+      } else {
+        bus.$emit("updateStyle", "visible", false);
+      }
+      this.closetooltip();
+    },
   },
   },
   mounted() {},
   mounted() {},
 };
 };

+ 42 - 3
src/components/editview/zoom.vue

@@ -2,20 +2,59 @@
 <template>
 <template>
   <div id="zoom">
   <div id="zoom">
     <i @click="sacle(1)" class="el-icon-zoom-in btn"></i>
     <i @click="sacle(1)" class="el-icon-zoom-in btn"></i>
-    <span>{{Math.floor(scale * 100)}}%</span>
+    <span>{{ sliderValPercent }}</span>
     <i @click="sacle(0)" class="el-icon-zoom-out btn"></i>
     <i @click="sacle(0)" class="el-icon-zoom-out btn"></i>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
+import bus from "@/bus/bus";
 export default {
 export default {
   props: ["scale"],
   props: ["scale"],
   data() {
   data() {
-    return {};
+    return {
+      min: 0.1,
+      max: 5,
+      initScale: 1, //初始 底图缩放比例
+      sliderVal: 1, // 缩放比例
+    };
+  },
+  computed: {
+    sliderValPercent() {
+      return `${(this.sliderVal * 100).toFixed(0)}%`;
+    },
   },
   },
   methods: {
   methods: {
     sacle(data) {
     sacle(data) {
-      this.$emit("sacle", data);
+      const oldV = this.sliderVal;
+      if (data) {
+        this.sliderVal = Number((this.sliderVal + 0.1).toFixed(1));
+        if (this.sliderVal > this.maxScale) {
+          this.sliderVal = this.maxScale;
+        }
+        bus.$emit("scale", this.sliderVal, oldV);
+      } else {
+        this.sliderVal = Number((this.sliderVal - 0.1).toFixed(1));
+        if (this.sliderVal < this.min) {
+          this.sliderVal = this.min;
+        }
+        bus.$emit("scale", this.sliderVal, oldV);
+      }
     },
     },
+    /**
+     * @name getMouseScale
+     * @description 滚轮滚动,导致的底图缩放比例 逻辑处理
+     */
+    getMouseScale() {
+      //  zoom 为缩放后改变的比例
+      bus.$off("mouseScale");
+      bus.$on("mouseScale", (zoom) => {
+        const s = Number((zoom * this.initScale).toFixed(2));
+        this.sliderVal = s > 0.1 ? s : 0.1;
+      });
+    },
+  },
+  mounted() {
+    this.getMouseScale();
   },
   },
 };
 };
 </script>
 </script>

+ 17 - 6
src/components/homeView/createGraphDialog.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
   <el-dialog class="create-dialog" title="新建拓扑图" width="600px" :visible.sync="outerVisible" :close-on-click-modal="false" custom-class="createDialog"
   <el-dialog class="create-dialog" title="新建拓扑图" width="600px" :visible.sync="outerVisible" :close-on-click-modal="false" custom-class="createDialog"
-    @close="closeModal">
+    @close="closeModal" @closed="closed">
     <graphTypeDialog ref="graphTypeDialog" @selectNode="selectNode"></graphTypeDialog>
     <graphTypeDialog ref="graphTypeDialog" @selectNode="selectNode"></graphTypeDialog>
     <div class="dialog-bodys">
     <div class="dialog-bodys">
       <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" label-position="top">
       <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" label-position="top">
@@ -11,7 +11,7 @@
           </el-button>
           </el-button>
         </el-form-item>
         </el-form-item>
         <el-form-item label="名称" prop="name">
         <el-form-item label="名称" prop="name">
-          <el-input v-model="ruleForm.name" placeholder="请输入名称" size="small"></el-input>
+          <el-input v-model="ruleForm.name" placeholder="请输入名称" size="small"  :maxlength="20"></el-input>
         </el-form-item>
         </el-form-item>
         <el-form-item label="标签" prop="resource">
         <el-form-item label="标签" prop="resource">
           <div class="tagContainer">
           <div class="tagContainer">
@@ -19,7 +19,7 @@
               {{tag}}
               {{tag}}
             </el-tag>
             </el-tag>
             <el-input class="input-new-tag" v-if="inputVisible" v-model="inputValue" ref="saveTagInput" size="small"
             <el-input class="input-new-tag" v-if="inputVisible" v-model="inputValue" ref="saveTagInput" size="small"
-              @keyup.enter.native="handleInputConfirm" @blur="handleInputConfirm" >
+              @keyup.enter.native="handleInputConfirm" @blur="handleInputConfirm">
             </el-input>
             </el-input>
             <el-button v-else class="button-new-tag" size="small" @click="showInput">+ 添加</el-button>
             <el-button v-else class="button-new-tag" size="small" @click="showInput">+ 添加</el-button>
           </div>
           </div>
@@ -35,6 +35,7 @@
 <script>
 <script>
 import graphTypeDialog from "@/components/homeView/graphTypeDialog"
 import graphTypeDialog from "@/components/homeView/graphTypeDialog"
 import { createGraph } from "@/api/home"
 import { createGraph } from "@/api/home"
+import { mapState } from "vuex";
 export default {
 export default {
   components: {
   components: {
     graphTypeDialog
     graphTypeDialog
@@ -62,6 +63,9 @@ export default {
       inputVisible: false,
       inputVisible: false,
     }
     }
   },
   },
+  computed: {
+    ...mapState([ "projectId"]),
+  },
   methods: {
   methods: {
     showDialog() {
     showDialog() {
       this.outerVisible = true;
       this.outerVisible = true;
@@ -105,7 +109,7 @@ export default {
     },
     },
     resetForm(formName) {
     resetForm(formName) {
       this.dynamicTags = [];
       this.dynamicTags = [];
-      this.buttonStr= '';
+      this.buttonStr = '';
       this.$refs[formName].resetFields();
       this.$refs[formName].resetFields();
       this.outerVisible = false
       this.outerVisible = false
     },
     },
@@ -121,13 +125,14 @@ export default {
       createGraph(pa).then(res => {
       createGraph(pa).then(res => {
         if (res.result == "success") {
         if (res.result == "success") {
           this.outerVisible = false;
           this.outerVisible = false;
-          this.$message.success('创建成功');
-          this.$router.push({
+          // this.$message.success('创建成功');
+          this.routeUrl = this.$router.resolve({
             name: 'Editer',
             name: 'Editer',
             query: {
             query: {
               graphId: res.entityList[0].graphId,
               graphId: res.entityList[0].graphId,
               id: res.entityList[0].id,
               id: res.entityList[0].id,
               categoryName: encodeURI(this.buttonStr),
               categoryName: encodeURI(this.buttonStr),
+              projectId: this.projectId,
               isPub: 0
               isPub: 0
             }
             }
           })
           })
@@ -138,6 +143,12 @@ export default {
     },
     },
     closeModal() {
     closeModal() {
       this.resetForm('ruleForm');
       this.resetForm('ruleForm');
+    },
+    closed() {
+      if (this.routeUrl) {
+        window.open(this.routeUrl.href, "_blank");
+      }
+      this.routeUrl = ''
     }
     }
   },
   },
 }
 }

+ 17 - 5
src/components/homeView/graphTypeDialog.vue

@@ -12,7 +12,7 @@
       <div class="right content">
       <div class="right content">
         <p>设备分类参考</p>
         <p>设备分类参考</p>
         <div class="treeContainer">
         <div class="treeContainer">
-          <el-tree :data="treeData" :props="defaultProps" accordion @current-change="changeNode"></el-tree>
+          <el-tree :data="treeData" :props="defaultProps" accordion></el-tree>
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
@@ -23,7 +23,7 @@
   </el-dialog>
   </el-dialog>
 </template>
 </template>
 <script>
 <script>
-import { queryCategoryGraph } from "@/api/home"
+import { mapState } from "vuex";
 export default {
 export default {
   data() {
   data() {
     return {
     return {
@@ -37,14 +37,26 @@ export default {
       selectNode: {}
       selectNode: {}
     }
     }
   },
   },
+  computed: {
+    ...mapState(["categoryGraph"]),
+  },
   mounted() {
   mounted() {
     this.init()
     this.init()
   },
   },
+  watch: {
+    categoryGraph: {
+      handler: function(v) {
+        this.treeData = v;
+      },
+      immediate: true,
+      deep: true
+    }
+  },
   methods: {
   methods: {
     init() {
     init() {
-      queryCategoryGraph({ switch: true }).then(res => {
-        this.treeData = res.content;
-      })
+      // queryCategoryGraph({ switch: true }).then(res => {
+      //   this.treeData = this.categoryGraph;
+      // })
     },
     },
     showDialog() {
     showDialog() {
       this.innerVisible = true
       this.innerVisible = true

+ 2 - 0
src/components/homeView/leftAsideTree.vue

@@ -52,6 +52,8 @@ export default {
         this.treeData = res.content;
         this.treeData = res.content;
         if (!res.content.length) {
         if (!res.content.length) {
           this.$emit("noTree");
           this.$emit("noTree");
+        } else {
+          this.$emit("getDataSuc")
         }
         }
       });
       });
     },
     },

+ 23 - 5
src/components/homeView/move.vue

@@ -11,7 +11,8 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { queryCategoryGraph, updateDraftsGraph, updatePubGraph } from "@/api/home"
+import { updateDraftsGraph, updatePubGraph } from "@/api/home"
+import { mapState } from "vuex";
 export default {
 export default {
   props: {
   props: {
     isPub: {
     isPub: {
@@ -32,14 +33,26 @@ export default {
       data: []
       data: []
     };
     };
   },
   },
+  computed: {
+    ...mapState(["categoryGraph"]),
+  },
   mounted() {
   mounted() {
     this.init()
     this.init()
   },
   },
+  watch: {
+    categoryGraph: {
+      handler: function(v) {
+        this.treeData = v;
+      },
+      immediate: true,
+      deep: true
+    }
+  },
   methods: {
   methods: {
     init() {
     init() {
-      queryCategoryGraph({ switch: true }).then(res => {
-        this.treeData = res.content;
-      })
+      // queryCategoryGraph({ switch: true }).then(res => {
+      //   this.treeData = res.content;
+      // })
     },
     },
     showDialog(data) {
     showDialog(data) {
       this.dialogVisible = true;
       this.dialogVisible = true;
@@ -51,6 +64,10 @@ export default {
         return
         return
       }
       }
       const categoryId = this.value[this.value.length - 1]
       const categoryId = this.value[this.value.length - 1]
+      if (categoryId == this.data[0].categoryId) {
+        this.$message.warning('目标位置与当前位置一致')
+        return
+      }
       const pa = {
       const pa = {
         content: [],
         content: [],
         projection: ['categoryId']
         projection: ['categoryId']
@@ -59,7 +76,8 @@ export default {
         return {
         return {
           id: t.id,
           id: t.id,
           graphId: t.graphId,
           graphId: t.graphId,
-          categoryId: categoryId
+          categoryId: categoryId,
+          name: this.data.name
         }
         }
       })
       })
       if (this.isPub) { // 已发布
       if (this.isPub) { // 已发布

+ 6 - 2
src/components/homeView/recycle.vue

@@ -60,8 +60,12 @@ export default {
     queryGraph() {
     queryGraph() {
       this.recycleLoading = true;
       this.recycleLoading = true;
       const pa = {
       const pa = {
-        Filters: `state=4`,
-        Orders: `${this.selVal} desc`
+        filters: `state=4`
+      }
+      if (this.selVal == 'name') {
+        pa.orders = `${this.selVal} asc`;
+      } else {
+        pa.orders = `${this.selVal} desc`;
       }
       }
       if (this.queryText) {
       if (this.queryText) {
         pa.Filters += `;name contain "${this.queryText}"`
         pa.Filters += `;name contain "${this.queryText}"`

+ 35 - 2
src/components/homeView/recycleDialog.vue

@@ -10,13 +10,38 @@
 
 
 <script>
 <script>
 import { recoveryGraph, queryDraftsGraph } from "@/api/home"
 import { recoveryGraph, queryDraftsGraph } from "@/api/home"
+import { mapState } from "vuex"
+function changeArr(list, map) {
+  for (let i = 0; i < list.length; i++) {
+    const ele = list[i];
+    if (ele.categoryList) {
+      changeArr(ele.categoryList, map);
+    }
+    map[ele.code] = ele;
+    delete map[ele.code].categoryList
+  }
+}
 export default {
 export default {
   data() {
   data() {
     return {
     return {
       dialogVisible: false,
       dialogVisible: false,
-      data: {}
+      data: {},
+      codeToName: {}
     };
     };
   },
   },
+  computed: {
+    ...mapState(["categoryGraph"])
+  },
+  watch: {
+    categoryGraph: {
+      handler: function(v) {
+        const temp = JSON.parse(JSON.stringify(v))
+        changeArr(temp, this.codeToName)
+      },
+      immediate: true,
+      deep: true
+    }
+  },
   methods: {
   methods: {
     showDialog(data) {
     showDialog(data) {
       this.data = data;
       this.data = data;
@@ -50,10 +75,18 @@ export default {
       if (res.result == "success") {
       if (res.result == "success") {
         this.dialogVisible = false;
         this.dialogVisible = false;
         this.$emit("recoverSuc");
         this.$emit("recoverSuc");
-        this.$message.success('恢复成功');
+        this.$message.success(`已恢复至${this.getCategoryName(this.data.categoryId) || ''}`);
       } else {
       } else {
         this.$message(res.message)
         this.$message(res.message)
       }
       }
+    },
+    // 获取恢复的图的分类
+    getCategoryName(id) {
+      if (!this.codeToName[id].parentId) {
+        return this.codeToName[id].name
+      } else {
+        return this.getCategoryName(this.codeToName[id].parentId) + '-' + this.codeToName[id].name
+      }
     }
     }
   }
   }
 };
 };

+ 3 - 2
src/components/homeView/rename.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
   <el-dialog title="重命名" :visible.sync="dialogVisible" width="480px" :close-on-click-modal="false" custom-class="renameDialog">
   <el-dialog title="重命名" :visible.sync="dialogVisible" width="480px" :close-on-click-modal="false" custom-class="renameDialog">
     <div>
     <div>
-      <el-input v-model="input" placeholder="请输入名称" size="small"></el-input>
+      <el-input v-model="input" placeholder="请输入名称" size="small" :maxlength="20"></el-input>
     </div>
     </div>
     <span slot="footer" class="dialog-footer">
     <span slot="footer" class="dialog-footer">
       <el-button @click="dialogVisible = false">取 消</el-button>
       <el-button @click="dialogVisible = false">取 消</el-button>
@@ -47,7 +47,8 @@ export default {
         content: [{
         content: [{
           id: this.data.id,
           id: this.data.id,
           graphId: this.data.graphId,
           graphId: this.data.graphId,
-          name: newName
+          name: newName,
+          categoryId: this.data.categoryId
         }],
         }],
         projection: ['name']
         projection: ['name']
       }
       }

+ 7 - 2
src/components/homeView/tagDialog.vue

@@ -17,7 +17,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { updatePubGraph } from "@/api/home"
+import { updatePubGraph, updateDraftsGraph } from "@/api/home"
 export default {
 export default {
   props: {
   props: {
     isPub: {
     isPub: {
@@ -65,7 +65,8 @@ export default {
         content: [{
         content: [{
           id: this.data.id,
           id: this.data.id,
           graphId: this.data.graphId,
           graphId: this.data.graphId,
-          label: this.dynamicTags
+          label: this.dynamicTags,
+          name: this.data.name
         }],
         }],
         projection: ['label']
         projection: ['label']
       }
       }
@@ -73,6 +74,10 @@ export default {
         updatePubGraph(pa).then(res => {
         updatePubGraph(pa).then(res => {
           this.updateCall(res)
           this.updateCall(res)
         })
         })
+      } else {
+        updateDraftsGraph(pa).then(res => {
+          this.updateCall(res)
+        })
       }
       }
     },
     },
     // 更新成功回调
     // 更新成功回调

+ 8 - 3
src/components/homeView/topoImageCard.vue

@@ -1,7 +1,7 @@
 <!--拓扑图缩略图卡片-->
 <!--拓扑图缩略图卡片-->
 <template>
 <template>
   <el-card
   <el-card
-    :class="{ 'box-card': true, active: data.checked }"
+    :class="{ 'box-card': true, active: data.showCheckFlag, checked: data.checked }"
     shadow="hover"
     shadow="hover"
     :body-style="{ padding: '0px' }"
     :body-style="{ padding: '0px' }"
   >
   >
@@ -96,7 +96,7 @@ export default {
         { name: "rename", label: "重命名", show: "any" }, // 类型为 未发布/已发布 时出现
         { name: "rename", label: "重命名", show: "any" }, // 类型为 未发布/已发布 时出现
         { name: "publish", label: "发布", show: 0 }, // 类型为 未发布 时出现
         { name: "publish", label: "发布", show: 0 }, // 类型为 未发布 时出现
         { name: "download", label: "下载", show: 1 }, // 类型为 已发布 时出现
         { name: "download", label: "下载", show: 1 }, // 类型为 已发布 时出现
-        { name: "editTag", label: "修改标签", show: 1 }, // 类型为 已发布 时出现
+        { name: "editTag", label: "修改标签", show: "any" }, // 类型为 未发布/已发布 时出现
         { name: "moveTo", label: "移动到", show: "any" }, // 类型为 未发布/已发布 时出现
         { name: "moveTo", label: "移动到", show: "any" }, // 类型为 未发布/已发布 时出现
         { name: "delete", label: "删除", show: "any" }, // 类型为 未发布/已发布 时出现
         { name: "delete", label: "删除", show: "any" }, // 类型为 未发布/已发布 时出现
         { name: "editGraph", label: "编辑", show: "any" }, // 类型为 未发布/已发布 时出现
         { name: "editGraph", label: "编辑", show: "any" }, // 类型为 未发布/已发布 时出现
@@ -171,7 +171,7 @@ export default {
   margin-bottom: 20px;
   margin-bottom: 20px;
   cursor: pointer;
   cursor: pointer;
   &:hover,
   &:hover,
-  &.active {
+  &.checked {
     border-color: #0091ff80;
     border-color: #0091ff80;
     box-shadow: 0px 8px 16px 0px rgba(195, 199, 203, 0.4);
     box-shadow: 0px 8px 16px 0px rgba(195, 199, 203, 0.4);
     .shadow {
     .shadow {
@@ -183,6 +183,11 @@ export default {
       }
       }
     }
     }
   }
   }
+  &.active{
+    .shadow {
+      display: block;
+    }
+  }
   .image {
   .image {
     display: block;
     display: block;
     width: 100%;
     width: 100%;

+ 19 - 2
src/store/index.ts

@@ -1,5 +1,6 @@
 import Vue from 'vue'
 import Vue from 'vue'
 import Vuex from 'vuex'
 import Vuex from 'vuex'
+import { queryCategoryGraph } from "@/api/home"
 
 
 Vue.use(Vuex)
 Vue.use(Vuex)
 
 
@@ -14,9 +15,10 @@ export default new Vuex.Store({
     categoryId: '',   //类型id 用于读图
     categoryId: '',   //类型id 用于读图
     tupoName: '',  //拓扑图名称
     tupoName: '',  //拓扑图名称
     version: "", //版本号
     version: "", //版本号
-    viewBackground:'',
+    viewBackground: '',
     equipmentItemList: [], // 图上相关的设备实例
     equipmentItemList: [], // 图上相关的设备实例
-    equipmentItemNum: 0 //图上相关的设备实例的数量
+    equipmentItemNum: 0, //图上相关的设备实例的数量
+    categoryGraph: [], // 拓扑图所属分类-所有分类list
   },
   },
   mutations: {
   mutations: {
     // 修改编辑器命令
     // 修改编辑器命令
@@ -71,9 +73,24 @@ export default new Vuex.Store({
       };
       };
       state.equipmentItemList = arr1;
       state.equipmentItemList = arr1;
       state.equipmentItemNum = state.equipmentItemList.length
       state.equipmentItemNum = state.equipmentItemList.length
+    },
+    // 获取完成所有分类后
+    SETCATEGORYGRAPH(state, val): void {
+      state.categoryGraph = val;
+    },
+
+    // 同步场景设备
+    SYNCSCENCEEQUIp(state, val = []) {
+      state.equipmentItemList = val;
+      state.equipmentItemNum = val.length;
     }
     }
   },
   },
   actions: {
   actions: {
+    async getAllCategoryType({ commit }) {
+      await queryCategoryGraph({ switch: true }).then(res => {
+        commit('SETCATEGORYGRAPH', res.content)
+      })
+    }
   },
   },
   modules: {
   modules: {
   }
   }

+ 1 - 1
src/views/editer.vue

@@ -4,7 +4,7 @@
       <div class="left">
       <div class="left">
         <div class="project-name">{{ tupoName }}</div>
         <div class="project-name">{{ tupoName }}</div>
         <div class="project-type">/ {{ categoryName }}</div>
         <div class="project-type">/ {{ categoryName }}</div>
-        <div class="project-save">自动保存成功- v {{ version }}</div>
+        <div class="project-save">自动保存成功- V{{ version }}</div>
       </div>
       </div>
       <div class="right">
       <div class="right">
         <el-tooltip
         <el-tooltip

+ 32 - 8
src/views/home.vue

@@ -41,6 +41,7 @@
           ref="leftAsideTree"
           ref="leftAsideTree"
           @changeNode="changeNode"
           @changeNode="changeNode"
           @noTree="(noTreeFlag = false), (popVisible = true)"
           @noTree="(noTreeFlag = false), (popVisible = true)"
+          @getDataSuc="getTreeSuc"
         ></leftAsideTree>
         ></leftAsideTree>
         <div
         <div
           class="recycle"
           class="recycle"
@@ -102,7 +103,7 @@
           </div>
           </div>
         </div>
         </div>
         <div class="main-body" v-loading="cardLoading">
         <div class="main-body" v-loading="cardLoading">
-          <div class="has-data-body" v-if="cardList.length">
+          <div class="has-data-body" v-if="noTreeFlag && cardList.length">
             <template v-for="t in cardList">
             <template v-for="t in cardList">
               <topoImageCard
               <topoImageCard
                 :isPub="isPub"
                 :isPub="isPub"
@@ -165,7 +166,7 @@ import tagDialog from "@/components/homeView/tagDialog";
 import recycle from "@/components/homeView/recycle";
 import recycle from "@/components/homeView/recycle";
 import createGraphDialog from "@/components/homeView/createGraphDialog";
 import createGraphDialog from "@/components/homeView/createGraphDialog";
 import { SNetUtil } from "@persagy-web/base";
 import { SNetUtil } from "@persagy-web/base";
-import { mapMutations, mapState } from "vuex";
+import { mapMutations, mapState, mapActions } from "vuex";
 ////////////////////////////////
 ////////////////////////////////
 // 常量
 // 常量
 // 图服务路径
 // 图服务路径
@@ -203,8 +204,11 @@ export default {
   },
   },
   methods: {
   methods: {
     ...mapMutations(["SETPROJECTID"]),
     ...mapMutations(["SETPROJECTID"]),
+    ...mapActions(['getAllCategoryType']),
     getProject(data) {
     getProject(data) {
       this.SETPROJECTID(data.id);
       this.SETPROJECTID(data.id);
+      // 判断垃圾箱是否可以点击
+      this.getRecycleData();
     },
     },
     // 创建拓扑图
     // 创建拓扑图
     createProject() {
     createProject() {
@@ -218,11 +222,15 @@ export default {
       } else {
       } else {
         this.selectCard.push(v);
         this.selectCard.push(v);
       }
       }
+      this.cardList.map(t => {
+        t.showCheckFlag = this.selectCard.length > 0;
+      })
     },
     },
     // 全选按钮
     // 全选按钮
     handleCheckAllChange(val) {
     handleCheckAllChange(val) {
       this.cardList = this.cardList.map((t) => {
       this.cardList = this.cardList.map((t) => {
         t.checked = val;
         t.checked = val;
+        t.showCheckFlag = val;
         return t;
         return t;
       });
       });
       this.selectCard = val
       this.selectCard = val
@@ -284,15 +292,21 @@ export default {
     },
     },
     // 删除成功
     // 删除成功
     deleteSuc() {
     deleteSuc() {
-      this.queryGraph();
       this.$refs.leftAsideTree.getCategoryGraph();
       this.$refs.leftAsideTree.getCategoryGraph();
     },
     },
     // 选中节点变化
     // 选中节点变化
     changeNode(data) {
     changeNode(data) {
+      this.noTreeFlag = true
       this.curCategory = data;
       this.curCategory = data;
       this.categoryName = data.name;
       this.categoryName = data.name;
       this.queryGraph();
       this.queryGraph();
     },
     },
+    // 树数据获取成功
+    getTreeSuc() {
+      this.noTreeFlag = true;
+      this.cardList = [];
+      this.queryGraph();
+    },
     // 发布修改
     // 发布修改
     changePub() {
     changePub() {
       this.queryGraph();
       this.queryGraph();
@@ -314,7 +328,6 @@ export default {
     },
     },
     // 回收站关闭
     // 回收站关闭
     recycleDialogClose() {
     recycleDialogClose() {
-      this.queryGraph();
       this.$refs.leftAsideTree.getCategoryGraph();
       this.$refs.leftAsideTree.getCategoryGraph();
     },
     },
     // 新建拓扑图成功
     // 新建拓扑图成功
@@ -380,9 +393,13 @@ export default {
       this.cardLoading = true;
       this.cardLoading = true;
       this.selectCard = [];
       this.selectCard = [];
       const pa = {
       const pa = {
-        filters: `categoryId="${this.curCategory.code}"`,
-        orders: `${this.selVal} desc`,
+        filters: `categoryId="${this.curCategory.code}"`
       };
       };
+      if (this.selVal == 'name') {
+        pa.orders = `${this.selVal} asc`;
+      } else {
+        pa.orders = `${this.selVal} desc`;
+      }
       if (this.queryText) {
       if (this.queryText) {
         pa.filters += `;name contain "${this.queryText}"`;
         pa.filters += `;name contain "${this.queryText}"`;
       }
       }
@@ -390,6 +407,7 @@ export default {
         queryPubGraph(pa).then((res) => {
         queryPubGraph(pa).then((res) => {
           this.cardList = res.content.map((t) => {
           this.cardList = res.content.map((t) => {
             t.checked = false;
             t.checked = false;
+            t.showCheckFlag = false;
             return t;
             return t;
           });
           });
           this.cardLoading = false;
           this.cardLoading = false;
@@ -399,6 +417,7 @@ export default {
         queryDraftsGraph(pa).then((res) => {
         queryDraftsGraph(pa).then((res) => {
           this.cardList = res.content.map((t) => {
           this.cardList = res.content.map((t) => {
             t.checked = false;
             t.checked = false;
+            t.showCheckFlag = false;
             return t;
             return t;
           });
           });
           this.cardLoading = false;
           this.cardLoading = false;
@@ -411,9 +430,13 @@ export default {
         return;
         return;
       }
       }
       const pa = {
       const pa = {
-        filters: `categoryId="${this.curCategory.code}"`,
-        orders: `${this.selVal} desc`,
+        filters: `categoryId="${this.curCategory.code}"`
       };
       };
+      if (this.selVal == 'name') {
+        pa.orders = `${this.selVal} asc`;
+      } else {
+        pa.orders = `${this.selVal} desc`;
+      }
       if (this.queryText) {
       if (this.queryText) {
         pa.filters += `;name contain ""`;
         pa.filters += `;name contain ""`;
       }
       }
@@ -483,6 +506,7 @@ export default {
 
 
     // 判断垃圾箱是否可以点击
     // 判断垃圾箱是否可以点击
     this.getRecycleData();
     this.getRecycleData();
+    this.getAllCategoryType()
   },
   },
 };
 };
 </script>
 </script>

+ 26 - 0
vue.config.js

@@ -1,3 +1,4 @@
+const CompressionPlugin = require("compression-webpack-plugin");
 module.exports = {
 module.exports = {
     devServer: {
     devServer: {
         // 关闭esline
         // 关闭esline
@@ -44,6 +45,31 @@ module.exports = {
     outputDir: 'persagyTopo',
     outputDir: 'persagyTopo',
     // 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录
     // 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录
     assetsDir: 'static',
     assetsDir: 'static',
+
+    // 配置webpack
+    // configureWebpack: (config) => {
+    //     // 生成环境,删除console.log和debugger
+    //     // if (process.env.VUE_Plan_RealEnv === "production") {
+    //     //     config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true; //删除console
+    //     //     config.optimization.minimizer[0].options.terserOptions.compress.drop_debugger = true; //删除 debugger
+    //     //     config.optimization.minimizer[0].options.terserOptions.compress.pure_funcs = ["console.log"]; //删除
+    //     // }
+    //     const plugins = [
+    //         // 压缩代码
+    //         new CompressionPlugin({
+    //             test: /\.js$|\.html$|\.css$/, // 匹配文件名
+    //             threshold: 10240, // 对超过10k的数据压缩
+    //             deleteOriginalAssets: true, // false 不删除源文件 true 删除源文件
+    //         }),
+    //     ];
+    //     // 生产环境打包分析体积 命令 npm run  build --report 或者 yarn build --report
+    //     // if (process.env.NODE_ENV === "production" && (process.env.npm_config_report || process.env.npm_config_argv.indexOf("--report") !== -1)) {
+    //     //     plugins.push(new BundleAnalyzerPlugin());
+    //     // }
+    //     return {
+    //         plugins,
+    //     };
+    // },
     // chainWebpack:config =>{
     // chainWebpack:config =>{
     //     config.module.rule('svg-sprite')
     //     config.module.rule('svg-sprite')
     //     .use('svgo-loader')
     //     .use('svgo-loader')