Browse Source

Merge remote-tracking branch 'origin/dev' into dev

shaun-sheep 4 years ago
parent
commit
6f7086fded
72 changed files with 11 additions and 8108 deletions
  1. 1 0
      .npmrc
  2. 1 0
      .yarnrc
  3. 5 5
      package.json
  4. 0 44
      src/assets/graphy/SGraphy/SCanvas.js
  5. 0 30
      src/assets/graphy/SGraphy/SGraphyEnums.js
  6. 0 396
      src/assets/graphy/SGraphy/SGraphyItem.js
  7. 0 201
      src/assets/graphy/SGraphy/SGraphyScene.js
  8. 0 280
      src/assets/graphy/SGraphy/SGraphyView.js
  9. 0 53
      src/assets/graphy/SGraphy/SMouseEvent.js
  10. 0 0
      src/assets/graphy/SGraphy/dataType.js
  11. 0 78
      src/assets/graphy/SGraphy/dataType.ts
  12. 0 70
      src/assets/graphy/SGraphy/items/SGraphyCircleItem.js
  13. 0 201
      src/assets/graphy/SGraphy/items/SGraphyClockItem.js
  14. 0 59
      src/assets/graphy/SGraphy/items/SGraphyImageItem.js
  15. 0 66
      src/assets/graphy/SGraphy/items/SGraphyLineItem.js
  16. 0 76
      src/assets/graphy/SGraphy/items/SGraphyPillarItems.js
  17. 0 257
      src/assets/graphy/SGraphy/items/SGraphyPolygonItem.js
  18. 0 100
      src/assets/graphy/SGraphy/items/SGraphyRectItem.js
  19. 0 51
      src/assets/graphy/SGraphy/items/SGraphyTextItems.js
  20. 0 66
      src/assets/graphy/SGraphy/items/SGraphyVirtualItem.js
  21. 0 240
      src/assets/graphy/SGraphy/mainScene.js
  22. 0 228
      src/assets/graphy/SGraphy/mainScene.ts
  23. 0 68
      src/assets/graphy/SGraphy/newItems/SGraphyCircleItem.js
  24. 0 65
      src/assets/graphy/SGraphy/newItems/SGraphyCircleItem.ts
  25. 0 111
      src/assets/graphy/SGraphy/newItems/SGraphyImgItem.js
  26. 0 116
      src/assets/graphy/SGraphy/newItems/SGraphyImgItem.ts
  27. 0 70
      src/assets/graphy/SGraphy/newItems/SGraphyPointItem.js
  28. 0 67
      src/assets/graphy/SGraphy/newItems/SGraphyPointItem.ts
  29. 0 212
      src/assets/graphy/SGraphy/newItems/SGraphyPolygonItem.js
  30. 0 220
      src/assets/graphy/SGraphy/newItems/SGraphyPolygonItem.ts
  31. 0 74
      src/assets/graphy/SGraphy/newItems/SGraphyRectItem.js
  32. 0 76
      src/assets/graphy/SGraphy/newItems/SGraphyRectItem.ts
  33. 0 92
      src/assets/graphy/SGraphy/newItems/SGraphyWallItem.js
  34. 0 89
      src/assets/graphy/SGraphy/newItems/SGraphyWallItem.ts
  35. 0 40
      src/assets/graphy/SGraphy/types/SPoint.js
  36. 0 169
      src/assets/graphy/SGraphy/types/SRect.js
  37. 0 25
      src/assets/graphy/SGraphy/until/pako.js
  38. 0 27
      src/assets/graphy/SGraphy/until/pako.ts
  39. 0 22
      src/assets/graphy/SGraphy/until/tool.js
  40. 0 21
      src/assets/graphy/SGraphy/until/tool.ts
  41. 0 14
      src/assets/graphy/index.js
  42. 0 70
      src/assets/js/items/SGraphyCircleItem.js
  43. 0 59
      src/assets/js/items/SGraphyImageItem.js
  44. 0 66
      src/assets/js/items/SGraphyLineItem.js
  45. 0 76
      src/assets/js/items/SGraphyPillarItems.js
  46. 0 257
      src/assets/js/items/SGraphyPolygonItem.js
  47. 0 100
      src/assets/js/items/SGraphyRectItem.js
  48. 0 51
      src/assets/js/items/SGraphyTextItems.js
  49. 0 66
      src/assets/js/items/SGraphyVirtualItem.js
  50. 0 44
      src/assets/node-templete/SGraphy/SCanvas.js
  51. 0 30
      src/assets/node-templete/SGraphy/SGraphyEnums.js
  52. 0 396
      src/assets/node-templete/SGraphy/SGraphyItem.js
  53. 0 201
      src/assets/node-templete/SGraphy/SGraphyScene.js
  54. 0 280
      src/assets/node-templete/SGraphy/SGraphyView.js
  55. 0 53
      src/assets/node-templete/SGraphy/SMouseEvent.js
  56. 0 201
      src/assets/node-templete/SGraphy/items/SGraphyClockItem.js
  57. 0 58
      src/assets/node-templete/SGraphy/items/SGraphyLineItem.js
  58. 0 57
      src/assets/node-templete/SGraphy/items/SGraphyPolygonItem.js
  59. 0 64
      src/assets/node-templete/SGraphy/items/SGraphyRectItem.js
  60. 0 61
      src/assets/node-templete/SGraphy/items/SGraphyVirtualItem.js
  61. 0 40
      src/assets/node-templete/SGraphy/types/SPoint.js
  62. 0 169
      src/assets/node-templete/SGraphy/types/SRect.js
  63. 0 9
      src/assets/node-templete/index.js
  64. 0 1365
      src/components/business_space/graphy/business.vue
  65. 1 1
      src/components/ledger/lib/bimDialog.vue
  66. 1 1
      src/components/ready/buildfloor/formItems.vue
  67. 1 1
      src/views/business_space/dataUtil/checkJsonUtil.vue
  68. 1 1
      src/views/data_admin/buildGraphy/graphyCanvas-copy.vue
  69. 0 59
      src/views/data_admin/buildGraphy/utils/LocationPointScene.js
  70. 0 49
      src/views/data_admin/buildGraphy/utils/LocationPointScene.ts
  71. 0 71
      src/views/data_admin/buildGraphy/utils/MarkerItem.js
  72. 0 73
      src/views/data_admin/buildGraphy/utils/MarkerItem.ts

+ 1 - 0
.npmrc

@@ -0,0 +1 @@
+@saga-web:registry=http://dev.dp.sagacloud.cn:8082/repository/npm-saga

+ 1 - 0
.yarnrc

@@ -0,0 +1 @@
+"@saga-web:registry" "http://dev.dp.sagacloud.cn:8082/repository/npm-saga"

+ 5 - 5
package.json

@@ -19,11 +19,11 @@
     "publish": "node publish.js"
   },
   "dependencies": {
-    "@saga-web/base": "2.1.9",
-    "@saga-web/cad-engine": "2.0.567",
-    "@saga-web/draw": "2.1.80",
-    "@saga-web/graphy": "2.1.52",
-    "@saga-web/topology": "1.0.83",
+    "@saga-web/base": "2.1.27",
+    "@saga-web/cad-engine": "2.0.574",
+    "@saga-web/draw": "2.1.110",
+    "@saga-web/graph": "2.1.131",
+    "@saga-web/topology": "1.0.85",
     "axios": "^0.18.0",
     "echarts": "^4.1.0",
     "el-cascader-multi": "^1.1.8",

+ 0 - 44
src/assets/graphy/SGraphy/SCanvas.js

@@ -1,44 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *               iFHS7.
- *              ;BBMBMBMc                  rZMBMBR              BMB
- *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
- *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
- *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
- *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
- *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
- *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
- *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
- *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
- *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
- *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
- *         i0BM: SWKHKGO  MBDv
- *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2018.  斯伯坦机器人世界
- *              ,  XMW  ..
- *                  r                                                                     All rights reserved.
- *
- * ********************************************************************************************************************
- */
-
-/**
- * Canvas功能扩展
- *
- * @author  Andy
- */
-Object.assign(CanvasRenderingContext2D.prototype, {
-  /**
-   * 绘制线段
-   *
-   * @param   x0    起点x坐标
-   * @param   y0    起点y坐标
-   * @param   x1    终点x坐标
-   * @param   y1    终点y坐标
-   */
-  drawLine (x0, y0, x1, y1) {
-    this.beginPath()
-    this.moveTo(x0, y0)
-    this.lineTo(x1, y1)
-    this.stroke()
-  } // Function drawLine()
-}) // Class CanvasRenderingContext2D

+ 0 - 30
src/assets/graphy/SGraphy/SGraphyEnums.js

@@ -1,30 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *               iFHS7.
- *              ;BBMBMBMc                  rZMBMBR              BMB
- *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
- *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
- *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
- *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
- *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
- *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
- *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
- *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
- *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
- *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
- *         i0BM: SWKHKGO  MBDv
- *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2018.  斯伯坦机器人世界
- *              ,  XMW  ..
- *                  r                                                                     All rights reserved.
- *
- * ********************************************************************************************************************
- */
-
-const SGraphyItemFlag = {
-  ItemIsMovable: 1,
-  ItemIsSelectable: 2
-}
-
-if (Object.freeze)
-  Object.freeze(SGraphyItemFlag)

+ 0 - 396
src/assets/graphy/SGraphy/SGraphyItem.js

@@ -1,396 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *               iFHS7.
- *              ;BBMBMBMc                  rZMBMBR              BMB
- *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
- *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
- *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
- *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
- *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
- *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
- *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
- *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
- *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
- *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
- *         i0BM: SWKHKGO  MBDv
- *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2018.  斯伯坦机器人世界
- *              ,  XMW  ..
- *                  r                                                                     All rights reserved.
- *
- * ********************************************************************************************************************
- */
-import SPoint from './types/SPoint'
-import SRect from './types/SRect'
-import SMouseEvent from './SMouseEvent'
-
-const sortItemZOrder = Symbol('sortItemZOrder')
-const toChildMouseEvent = Symbol('toChildMouseEvent')
-const grabItem = Symbol('grabItem')
-const releaseItem = Symbol('releaseItem')
-
-/**
- * SGraphyItem
- *
- * @author  Andy
- */
-export default class SGraphyItem {
-    /**
-     * 构造函数
-     */
-    constructor(parent) {
-            this.name = 'item'
-            this._scene = null
-            this._parent = parent
-            this.children = []
-
-            /** Z轴顺序 */
-            this.zOrder = 0
-                /** item位置 */
-            this._pos = new SPoint(0, 0)
-                /** 缩放比例 */
-            this._scale = new SPoint(1, 1)
-                /** 是否可见 */
-            this._isVisible = true
-
-            /** 鼠标按下时位置 */
-            this._mouseDownPos = new SPoint(4, 21)
-            this._isMove = false
-            this.canMove = false
-        } // Function constructor()
-
-    // ===================================================================================================================
-    // 属性
-    /** parent属性存值函数 */
-    get parent() {
-        return this._parent
-    }
-    set parent(value) {
-            if (this._parent === value) {
-                return
-            }
-            if (this._parent != null) { // 如果原parent不为空
-                // 将节点从原parent节点中摘除
-                let i = this._parent.children.indexOf(this)
-                this._parent.children.splice(i, 1)
-            }
-            this._parent = value
-
-            if (this._parent != null) { // 如果新parent不为空
-                // 将节点加入到新parent节点中
-                this._parent.children.push(this)
-                this._parent.children.sort(this[sortItemZOrder])
-            }
-            this._parent = value
-        } // Function set Parent()
-
-    /** scene属性 */
-    get scene() {
-        if (this._parent != null) {
-            return this._parent.scene
-        } else {
-            return this._scene
-        }
-    }
-
-    /** pos属性 */
-    get pos() {
-        return this._pos
-    }
-    set pos(value) {
-        this._pos = value
-    }
-
-    /** scale属性 */
-    get scale() {
-        return this._scale
-    }
-    set scale(value) {
-        this._scale = value
-    }
-
-    /** visible属性 */
-    get visible() {
-        return this._isVisible
-    }
-    set visible(value) {
-        this._isVisible = value
-    }
-
-    // ===================================================================================================================
-    // 函数
-    /**
-     * Item对象边界区域
-     *
-     * @return  SRect
-     */
-    boundingRect() {
-            return new SRect(0, 0, 10, 10)
-        } // Function boundingRect()
-
-    /**
-     * Item绘制操作
-     *
-     * @param   canvas        画布对象
-     * @param   rect          绘制区域
-     */
-    onDraw(canvas, rect) {
-            for (let item of this.children) {
-                // 保存画布状态
-                canvas.save()
-                    // item位移到指定位置绘制
-                canvas.translate(item.pos.x, item.pos.y)
-                    // 设置绘制区域
-                    // canvas.clip(item.boundingRect())
-                    // 绘制item
-                item.onDraw(canvas, rect)
-                    // 恢复画布状态
-                canvas.restore()
-            }
-        } // Function onDraw()
-
-    /**
-     * 更新Item
-     */
-    update() {
-            // TODO: PLX
-            // scene?.update()
-        } // Function update()
-
-    /**
-     * 移动item到指定位置
-     *
-     * @param   x           新位置的x坐标
-     * @param   y           新位置的y坐标
-     */
-    moveTo(x, y) {
-            this.pos = new SPoint(x, y)
-        } // moveTo()
-
-    /**
-     * 判断item是否包含点x,y
-     *
-     * @param   x       横坐标(当前item)
-     * @param   y       纵坐标(当前item)
-     *
-     * @return  boolean
-     */
-    contains(x, y) {
-            return this.boundingRect().contains(x - this.pos.x, y - this.pos.y)
-        } // Function contains()
-
-    /**
-     * 获得item的路径节点列表。(该节点被加载到场景中,如果未被加载到场景中,计算会出错)
-     *
-     * @return  *[]
-     */
-    itemPath() {
-            if (this.parent != null) {
-                let list = this.parent.itemPath()
-                list.push(this)
-                return list
-            }
-
-            return [this]
-        } // Function itemPath()
-
-    /**
-     * 将场景中的xy坐标转换成item坐标。(该节点被加载到场景中,如果未被加载到场景中,计算会出错)
-     *
-     * @param   x       场景中的横坐标
-     * @param   y       场景中的纵坐标
-     *
-     * @return  在item中的坐标
-     */
-    mapFromScene(x, y) {
-            let list = this.itemPath()
-            let x0 = x
-            let y0 = y
-            for (let item of list) {
-                x0 = (x0 - item.pos.x) / item.scale.x
-                y0 = (y0 - item.pos.y) / item.scale.y
-            }
-
-            return new SPoint(x0, y0)
-        } // Function mapFromScene()
-
-    /**
-     * 将item中的xy坐标转换成场景坐标。(该节点被加载到场景中,如果未被加载到场景中,计算会出错)
-     *
-     * @param   x       item中的横坐标
-     * @param   y       item中的纵坐标
-     *
-     * @return  在场景中的坐标
-     */
-    mapToScene(x, y) {
-            if (this.parent == null) {
-                return new SPoint(x, y)
-            }
-
-            return this.parent.mapToScene(x * this.scale.x + this.pos.x, y * this.scale.y + this.pos.y)
-        } // Function mapToScene()
-
-    // ===================================================================================================================
-    // 事件
-    /**
-     * 鼠标单击事件
-     *
-     * @param   e   保存事件参数
-     * @return  boolean
-     */
-    onClick(e) {
-            for (let item of this.children) {
-                if (!item.visible) { // 如果项目不可见
-                    continue
-                }
-                let ce = this[toChildMouseEvent](item, e)
-                if (item.contains(e.x, e.y) && item.onClick(ce)) { // 如果点在子项目上且子项目处理了事件
-                    return true
-                }
-            }
-
-            return false
-        } // Function onClick()
-
-    /**
-     * 鼠标双击事件
-     *
-     * @param   e   保存事件参数
-     * @return  boolean
-     */
-    onDbClick(e) {
-            for (let item of this.children) {
-                if (!item.visible) { // 如果项目不可见
-                    continue
-                }
-                let ce = this[toChildMouseEvent](item, e)
-                if (item.contains(e.x, e.y) && item.onDbClick(ce)) { // 如果点在子项目上且子项目处理了事件
-                    return true
-                }
-            }
-
-            return false
-        } // Function onClick()
-
-    /**
-     * 鼠标按下事件
-     *
-     * @param   e   保存事件参数
-     * @return  boolean
-     */
-    onMouseDown(e) {
-            // console.log(e)
-
-            for (let item of this.children) {
-                if (!item.visible) { // 如果项目不可见
-                    continue
-                }
-                let ce = this[toChildMouseEvent](item, e)
-                if (item.contains(e.x, e.y) && item.onMouseDown(ce)) { // 如果点在子项目上且子项目处理了事件
-                    return true
-                }
-            }
-
-            if (this.canMove) {
-                this._mouseDownPos = new SPoint(e.x, e.y)
-                this._isMove = true
-                this[grabItem](this)
-                    // console.log(this.scene.grabItem)
-                return true
-            }
-            return false
-        } // Function onMouseDown()
-
-    /**
-     * 鼠标移动事件
-     *
-     * @param   e   保存事件参数
-     * @return  boolean
-     */
-    onMouseMove(e) {
-            for (let item of this.children) {
-                if (!item.visible) { // 如果项目不可见
-                    continue
-                }
-                let ce = this[toChildMouseEvent](item, e)
-                if (item.contains(e.x, e.y) && item.onMouseMove(ce)) { // 如果点在子项目上且子项目处理了事件
-                    return true
-                }
-            }
-
-            if (e.buttons & SMouseEvent.LEFT_BUTTON && this.canMove && this._isMove) {
-                this.moveTo(this.pos.x + e.x - this._mouseDownPos.x, this.pos.y + e.y - this._mouseDownPos.y)
-            }
-
-            return false
-        } // Function onMouseMove()
-
-    /**
-     * 释放鼠标事件
-     *
-     * @param   e   保存事件参数
-     * @return  boolean
-     */
-    onMouseUp(e) {
-            for (let item of this.children) {
-                if (!item.visible) { // 如果项目不可见
-                    continue
-                }
-                let ce = this[toChildMouseEvent](item, e)
-                if (item.contains(e.x, e.y) && item.onMouseUp(ce)) { // 如果点在子项目上且子项目处理了事件
-                    return true
-                }
-            }
-
-            this._isMove = false
-            this[releaseItem]()
-            return false
-        } // Function onMouseUp()
-
-    // ===================================================================================================================
-    // 私有方法
-    /**
-     * 按ZOrder排序
-     *
-     * @param   a   比较元素1
-     * @param   b   比较元素2
-     * @return {number}
-     */
-    [sortItemZOrder](a, b) {
-        return a.zOrder - b.zOrder
-    } // Function sortItemZOrder()
-
-    /**
-     * 鼠标事件转子对象鼠标事件
-     *
-     * @param   child   子对象e
-     * @param   e       事件参数
-     * @return  {}
-     */
-    [toChildMouseEvent](child, e) {
-        let ce = {...e }
-        ce.x = (e.x - child.pos.x) / child.scale.x
-        ce.y = (e.y - child.pos.y) / child.scale.y
-        return ce
-    } // Function toChildMouseEvent()
-
-    /**
-     * 锁定item
-     *
-     * @param   item    被锁定的item
-     */
-    [grabItem](item) {
-        if (this.scene != null) {
-            this.scene.grabItem = item
-        }
-    } // Function grabItem
-
-    /**
-     * 释放被锁定的item
-     */
-    [releaseItem]() {
-        if (this.scene != null) {
-            this.scene.grabItem = null
-        }
-    } // Function grabItem
-} // Class SGraphyItem

+ 0 - 201
src/assets/graphy/SGraphy/SGraphyScene.js

@@ -1,201 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *               iFHS7.
- *              ;BBMBMBMc                  rZMBMBR              BMB
- *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
- *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
- *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
- *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
- *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
- *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
- *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
- *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
- *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
- *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
- *         i0BM: SWKHKGO  MBDv
- *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2018.  斯伯坦机器人世界
- *              ,  XMW  ..
- *                  r                                                                     All rights reserved.
- *
- * ********************************************************************************************************************
- */
-
-import SPoint from './types/SPoint'
-import SRect from './types/SRect'
-import SGraphyItem from './SGraphyItem'
-
-const toGrabItemMotionEvent = Symbol('toGrabItemMotionEvent')
-
-/**
- * SGraphy图形引擎场景类
- *
- * @author  Andy
- */
-export default class SGraphyScene {
-    /**
-     * 构造函数
-     */
-    constructor() {
-            this.view = null
-            console.log(this, 'this')
-            this.root = new SGraphyItem(null)
-            this.root._scene = this
-            this.pos = new SPoint(0, 0)
-            this.scale = new SPoint(1, 1)
-            this.grabItem = null
-        } // Function constructor()
-
-    /**
-     * 添加item对象到场景。
-     *
-     * @param   item        添加的对象
-     */
-    addItem(item) {
-            item.parent = this.root
-        } // Function addItem()
-
-    /**
-     * 从场景中移除Item。
-     *
-     * @param   item        被移除的对象
-     */
-    removeItem(item) {
-            item.parent = null
-        } // Function removeItem()
-
-    /**
-     * 绘制场景
-     *
-     * @param   canvas      画布
-     * @param   rect        更新绘制区域
-     */
-    drawScene(canvas, rect) {
-            this.root.onDraw(canvas, rect)
-        } // Function drawScene()
-
-    /**
-     * 绘制背景
-     *
-     * @param   canvas      画布
-     * @param   rect        更新绘制区域
-     */
-    drawBackground(canvas, rect) {
-            // DO NOTHING
-        } // Function drawBackground()
-
-    /**
-     * 绘制前景
-     *
-     * @param   canvas      画布
-     * @param   rect        更新绘制区域
-     */
-    drawForeground(canvas, rect) {
-            // DO NOTHING
-        } // Function drawForeground()
-
-    /**
-     * 返回场景的item边界。即所有item边界的并集。
-     *
-     * @return  SRect
-     */
-    worldRect() {
-            let rect = null
-
-            for (let item of this.root.children) { // 依次取item列中的所有item。将所有item的边界做并焦处理。
-                if (rect == null) {
-                    rect = item.boundingRect().adjusted(item.pos)
-                } else {
-                    rect.union(item.boundingRect().adjusted(item.pos))
-                }
-            }
-
-            return rect
-        } // Function worldsRect()
-
-    /**
-     * 更新
-     */
-    update() {} // Function update()
-        // ===================================================================================================================
-        // 事件
-        /**
-         * 鼠标单击事件
-         *
-         * @param   e   保存事件参数
-         * @return  boolean
-         */
-    onClick(e) {
-            if (this.grabItem != null) {
-                return this.grabItem.onClick(this[toGrabItemMotionEvent](this.grabItem, e))
-            }
-            return this.root.onClick(e)
-        } // onClick
-
-    /**
-     * 鼠标双击事件
-     *
-     * @param   e   保存事件参数
-     * @return  boolean
-     */
-    onDbClick(e) {
-            if (this.grabItem != null) {
-                return this.grabItem.onDbClick(this[toGrabItemMotionEvent](this.grabItem, e))
-            }
-            return this.root.onDbClick(e)
-        } // onClick
-
-    /**
-     * 鼠标按下事件
-     *
-     * @param   e   保存事件参数
-     * @return  boolean
-     */
-    onMouseDown(e) {
-            if (this.grabItem != null) {
-                return this.grabItem.onMouseDown(this[toGrabItemMotionEvent](this.grabItem, e))
-            }
-            return this.root.onMouseDown(e)
-        } // onMouseDown
-
-    /**
-     * 鼠标移动事件
-     *
-     * @param   e   保存事件参数
-     * @return  boolean
-     */
-    onMouseMove(e) {
-            if (this.grabItem != null) {
-                return this.grabItem.onMouseMove(this[toGrabItemMotionEvent](this.grabItem, e))
-            }
-            return this.root.onMouseMove(e)
-        } // onMouseMove
-
-    /**
-     * 释放鼠标事件
-     *
-     * @param   e   保存事件参数
-     * @return  boolean
-     */
-    onMouseUp(e) {
-            if (this.grabItem != null) {
-                return this.grabItem.onMouseUp(this[toGrabItemMotionEvent](this.grabItem, e))
-            }
-            return this.root.onMouseUp(e)
-        } // onMouseUp
-
-    /**
-     * 转换场景事件坐标到指定Item坐标事件
-     *
-     * @param   item        指定的item对象
-     * @param   e           场景事件
-     * @return  {}
-     */
-    [toGrabItemMotionEvent](item, e) {
-        let se = {...e }
-        let p = item.mapFromScene(e.x, e.y)
-        se.x = p.x
-        se.y = p.y
-        return se
-    } // Function toGrabItemMotionEvent()
-} // Class SGraphyScene

+ 0 - 280
src/assets/graphy/SGraphy/SGraphyView.js

@@ -1,280 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *               iFHS7.
- *              ;BBMBMBMc                  rZMBMBR              BMB
- *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
- *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
- *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
- *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
- *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
- *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
- *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
- *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
- *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
- *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
- *         i0BM: SWKHKGO  MBDv
- *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2018.  斯伯坦机器人世界
- *              ,  XMW  ..
- *                  r                                                                     All rights reserved.
- *
- * ********************************************************************************************************************
- */
-import './SCanvas'
-import SPoint from './types/SPoint'
-import SMouseEvent from './SMouseEvent'
-
-const bindEvent = Symbol('bindEvent')
-const toSceneMotionEvent = Symbol('toSceneMotionEvent')
-    /**
-     * Graphy图形引擎视图类
-     *
-     * @author  Andy
-     */
-export default class SGraphyView {
-    /**
-     * 构造函数
-     *
-     * @param   id    Canvas对象ID
-     */
-    constructor(id, scene) {
-            this.canvasView = document.getElementById(id)
-            this.canvas = this.canvasView.getContext('2d')
-            this[bindEvent](this.canvasView)
-            this.scene = scene
-            this.pos = new SPoint(10, 0)
-            this.scale = 1
-            this.minScale = 0.004
-            this.maxScale = 0.5
-            this._midKeyX = 0
-            this._midKeyY = 0
-            this.wheelZoom = 1.05
-
-            window.requestAnimationFrame(this.onDraw.bind(this))
-        } // Function constructor()
-
-    /**
-     * 绑定canvas事件
-     *
-     * @param   canvas      canvas对象
-     * @private
-     */
-    [bindEvent](canvasView) {
-        canvasView.onclick = this.onClick.bind(this)
-        canvasView.ondblclick = this.onDbClick.bind(this)
-        canvasView.onmousedown = this.onMouseDown.bind(this)
-        canvasView.onmousemove = this.onMouseMove.bind(this)
-        canvasView.onmouseup = this.onMouseUp.bind(this)
-        canvasView.onmousewheel = this.onMouseWheel.bind(this)
-        canvasView.onresize = this.onResize.bind(this)
-    } // Function [bindEvent]()
-
-    /**
-     * 获取canvas的宽度  
-     */
-
-    get width() {
-        return this.canvasView.width
-    }
-
-    get height() {
-        return this.canvasView.height
-    }
-
-    /**
-     * 将场景中的xy坐标转换成视图坐标。
-     *
-     * @param   x       场景中的横坐标
-     * @param   y       场景中的纵坐标
-     *
-     * @return  SPoint
-     */
-    mapFromScene(x, y = null) {
-            if (typeof(x) === 'object') { // 如果传入的是SPoint对象
-                return new SPoint(x.x * this.scale + this.pos.x, x.y * this.scale + this.pos.y)
-            }
-
-            return new SPoint(x * this.scale + this.pos.x, y * this.scale + this.pos.y)
-        } // Function mapFromScene()
-
-    /**
-     * 将item中的xy坐标转换成场景坐标。
-     *
-     * @param   x       item中的横坐标
-     * @param   y       item中的纵坐标
-     * @return  SPoint
-     */
-    mapToScene(x, y = null) {
-            if (typeof(x) === 'object') { // 如果传入的是SPoint对象
-                return new SPoint((x.x - this.pos.x) / this.scale, (x.y - this.pos.y) / this.scale)
-            }
-
-            return new SPoint((x - this.pos.x) / this.scale, (y - this.pos.y) / this.scale)
-        } // Function mapToScene()
-
-    /**
-     * 缩放视图时计算视图的位置与缩放比例
-     *
-     * @param   zoom        缩放比例
-     * @param   x0          缩放计算的中心点X坐标
-     * @param   y0          缩放计算的中心点Y坐标
-     */
-    scaleByPoint(zoom, x0, y0) {
-            let z = zoom
-                /**
-                 * 缩放比例在最小比例和最大比例范围内
-                 */
-            if (this.scale * zoom >= this.maxScale) { // 大于最大缩放比例
-                z = this.maxScale / this.scale
-                this.scale = this.maxScale
-            } else if (this.scale * zoom <= this.minScale) { // 小于最小绽放比例
-                z = this.minScale / this.scale
-                this.scale = this.minScale
-            } else {
-                this.scale *= zoom
-            }
-
-            this.pos.x = x0 - (x0 - this.pos.x) * z
-            this.pos.y = y0 - (y0 - this.pos.y) * z
-
-            // EventBus.getDefault().post(SGraphyViewZoomEvent(this, scale))
-            // EventBus.getDefault().post(SGraphyViewMoveEvent(this, pos.x, pos.y))
-            // return
-        } // Function scaleByPoint()
-        // ===================================================================================================================
-        // 事件
-    onDraw() {
-            this.canvas.save()
-            this.canvas.clearRect(0, 0, this.canvasView.width, this.canvasView.height)
-            this.canvas.restore()
-
-            if (this.scene != null) {
-                // 绘制背景
-                this.canvas.save()
-                this.scene.drawBackground(this.canvas)
-                this.canvas.restore()
-
-                // 绘制场景
-                this.canvas.save()
-                this.canvas.translate(this.pos.x, this.pos.y)
-                this.canvas.scale(this.scale, this.scale)
-                this.scene.drawScene(this.canvas)
-                this.canvas.restore()
-
-                // 绘制前景
-                this.canvas.save()
-                this.scene.drawForeground(this.canvas)
-                this.canvas.restore()
-            }
-
-            window.requestAnimationFrame(this.onDraw.bind(this))
-        } // Function onDraw()
-
-    /**
-     * 鼠标单击事件
-     *
-     * @param   e   保存事件参数
-     */
-    onClick(e) {
-            if (this.scene != null) {
-                let se = this[toSceneMotionEvent](e)
-                this.scene.onClick(se)
-            }
-        } // Function onClick()
-
-    /**
-     * 鼠标双击事件
-     *
-     * @param   e   保存事件参数
-     */
-    onDbClick(e) {
-            if (this.scene != null) {
-                let ce = this[toSceneMotionEvent](e)
-                this.scene.onDbClick(ce)
-            }
-        } // Function onDbClick()
-
-    /**
-     * 鼠标按下事件
-     *
-     * @param   e   保存事件参数
-     */
-    onMouseDown(e) {
-            let se = new SMouseEvent(e)
-            if (se.buttons & SMouseEvent.MIDDLE_BUTTON) { // 如果按下中键
-                this._midKeyX = e.x
-                this._midKeyY = e.y
-            }
-
-            if (this.scene != null) {
-                let ce = this[toSceneMotionEvent](e)
-                this.scene.onMouseDown(ce)
-            }
-        } // Function onMouseDown()
-
-    /**
-     * 鼠标移动事件
-     *
-     * @param   e   保存事件参数
-     */
-    onMouseMove(e) {
-            let se = new SMouseEvent(e)
-            if (se.buttons & SMouseEvent.MIDDLE_BUTTON) { // 如果按下中键,则移动视图
-                this.pos.x += e.x - this._midKeyX
-                this.pos.y += e.y - this._midKeyY
-                this._midKeyX = e.x
-                this._midKeyY = e.y
-                return
-            }
-            if (this.scene != null) {
-                let ce = this[toSceneMotionEvent](e)
-                this.scene.onMouseMove(ce)
-            }
-        } // Function onMouseMove()
-
-    /**
-     * 释放鼠标事件
-     *
-     * @param   e   保存事件参数
-     */
-    onMouseUp(e) {
-            if (this.scene != null) {
-                let ce = this[toSceneMotionEvent](e)
-                this.scene.onMouseUp(ce)
-            }
-        } // Function onMouseUp()
-
-    /**
-     * 鼠标滚轮事件
-     *
-     * @param   e   保存事件参数
-     */
-    onMouseWheel(e) {
-            let se = new SMouseEvent(e)
-            if (e.wheelDelta < 0) {
-                this.scaleByPoint(1 / this.wheelZoom, se.x, se.y)
-            } else {
-                this.scaleByPoint(this.wheelZoom, se.x, se.y)
-            }
-        } // Function onMouseWheel()
-
-    /**
-     * View大小发生变化事件
-     *
-     * @param   e   保存事件参数
-     */
-    onResize(e) {} // Function onResize()
-
-    /**
-     * MotionEvent转场景对象MotionEvent
-     *
-     * @param   e       MotionEvent
-     * @return  子对象MotionEvent
-     */
-    [toSceneMotionEvent](e) {
-        let se = new SMouseEvent(e)
-        se.x = (se.x - this.pos.x) / this.scale
-        se.y = (se.y - this.pos.y) / this.scale
-        return se
-    } // Function toSceneMotionEvent()
-} // Class SGraphyView

+ 0 - 53
src/assets/graphy/SGraphy/SMouseEvent.js

@@ -1,53 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *               iFHS7.
- *              ;BBMBMBMc                  rZMBMBR              BMB
- *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
- *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
- *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
- *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
- *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
- *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
- *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
- *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
- *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
- *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
- *         i0BM: SWKHKGO  MBDv
- *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2018.  斯伯坦机器人世界
- *              ,  XMW  ..
- *                  r                                                                     All rights reserved.
- *
- * ********************************************************************************************************************
- */
-
-/**
- * 鼠标事件
- *
- * @author  Andy
- */
-export default class SMouseEvent {
-  /**
-   * 构造函数
-   *
-   * @param   e       系统鼠标事件
-   */
-  constructor(e) {
-    let bbox          = e.srcElement.getBoundingClientRect()
-    this.type         = e.type
-    this.x            = e.clientX - bbox.left
-    this.y            = e.clientY - bbox.top
-    this.screenX      = e.screenX
-    this.screenY      = e.screenY
-    this.clientX      = e.clientX
-    this.clientY      = e.clientY
-    this.altKey       = e.altKey
-    this.ctrlKey      = e.ctrlKey
-    this.buttons      = e.buttons
-    this.wheelDelta   = e.wheelDelta
-  } // Function constructor()
-} // Class MouseEvent
-
-SMouseEvent.LEFT_BUTTON   = 0x01
-SMouseEvent.RIGHT_BUTTON  = 0x02
-SMouseEvent.MIDDLE_BUTTON = 0x04

+ 0 - 0
src/assets/graphy/SGraphy/dataType.js


+ 0 - 78
src/assets/graphy/SGraphy/dataType.ts

@@ -1,78 +0,0 @@
-import { SPen, SPainter, SColor } from "@sybotan-web/draw";
-import SGraphyPolygonItem from './newItems/SGraphyPolygonItem'
-/**
- * 接口类型
- * @param
- * 传入绘制地图参数的数据类型
- */
-//path 和paths 的接口类型
-interface dataItemPath {
-    X: number,
-    Y: number,
-    Z: number
-}
-// 一个空间item中的数据类型 
-//包括ColumnList EquipmentList,VirtualWallList,WallList
-interface dataItem {
-    Id: string,
-    Path?: dataItemPath[],
-    PointList: dataItemPath[],
-    BimId?: string,
-    LocationPoint?: dataItemPath,
-    Name?: string,
-    Paths?: dataItemPath[][],
-}
-// 一个空间item中的接口类型 
-// 包括SpaceList
-interface dataSpaceItem {
-    Id: string,
-    // PointList: dataItemPath[],
-    BimId: string,
-    LocationPoint: dataItemPath,
-    Name: string,
-    Paths: dataItemPath[][],
-    id: string,
-    type: number,                  //item类型
-    businessId?: string | null,  //绑定的业务id
-    isBusiness?: number,        //业务类型
-    fillColor?: SColor,         //填充颜色
-    color?: SColor,             //边框颜色
-    businessName?: string | null,  //业务名称
-    width?: number
-}
-// 传入的data 的接口类型 
-interface dataInterface {
-    ColumnList: dataItem[],  //柱体
-    EquipmentList: dataItem[], //设备
-    SpaceList: dataSpaceItem[], //空间
-    VirtualWallList: dataItem[], //虚拟墙
-    WallList: dataItem[],    //墙
-    images: ImgItemInterface[],  //图片
-}
-//获取绑定空间的接口
-interface businessDataInterface {
-    id: string,
-    name: string,
-    children: string[],
-    isAdjacent: boolean,
-    isAbut: boolean
-}
-// 多边形传入的参数接口
-interface PolygonItemInterface {
-    parent: SGraphyPolygonItem | null //父类
-    space: dataSpaceItem,       //传入的item 参数
-    businessType?: string
-}
-// 图片传入的参数接口
-interface ImgItemInterface {
-    parent: SGraphyPolygonItem | null //父类
-    X: number;
-    Y: number;
-    width: number;
-    height: number;
-    img: string;
-    id?: string;
-    name: string;
-}
-
-export { dataItemPath, dataItem, dataSpaceItem, dataInterface, businessDataInterface, PolygonItemInterface, ImgItemInterface }

+ 0 - 70
src/assets/graphy/SGraphy/items/SGraphyCircleItem.js

@@ -1,70 +0,0 @@
-/**
- * 线条
- */
-import SGraphyItem from '../SGraphyItem'
-import SRect from '../types/SRect';
-
-export default class SGraphyCircleItem extends SGraphyItem {
-    /**
-     * 构造函数
-     * 
-     * @param X  圆中心点X
-     * @param Y  圆中心点Y
-     * @param Radius   圆的半径
-     * 
-     * @param color  线的颜色
-     * @param isVirtual    是否为虚线
-     */
-    constructor(X, Y, color, Radius, isSolid, name, parent = null) {
-        super(parent)
-        this.X = X
-        this.Y = Y
-        this.color = color
-        this.Radius = Radius
-        this.isSolid = isSolid
-        this.minX = this.X - this.Radius
-        this.minY = this.Y - this.Radius
-        this.maxX = this.X + this.Radius
-        this.maxY = this.Y + this.Radius
-        this.sAngle = null || 0
-        this.eAngle = null || 2 * Math.PI
-        this.name = name
-        this.type = 6
-        this.lineWidth = null
-    }
-
-    /**
-     * Item对象边界区域
-     * 
-     * @return SRect
-     */
-    boundingRect() {
-        return new SRect(this.minX, this.minY, this.maxX - this.minX, this.maxY - this.minY)
-    }
-
-    /**
-     * 绘制线条
-     * 
-     * @param canvas 画布
-     * @param rect   绘制区域
-     */
-
-    onDraw(canvas, rect) {
-        canvas.lineWidth = this.lineWidth || 240
-        canvas.strokeStyle = this.color || '#000'
-        canvas.fillStyle = this.color || '#000'
-        canvas.beginPath();
-        canvas.arc(this.X, this.Y, this.Radius, this.sAngle, this.eAngle);
-        if (!!this.isSolid) {
-            canvas.fillStyle = this.color; //填充颜色,默认是黑色
-            canvas.fill(); //画实心圆
-        }
-        canvas.stroke()
-        if (!!this.name) {
-            canvas.font = "oblique small-caps bold " + this.lineWidth * 10 + "px Arial";
-            // canvas.font = "oblique small-caps bold " + 10 + "px Arial";
-            canvas.fillStyle = 'green'
-            canvas.fillText(this.name, this.X, this.Y);
-        }
-    }
-}

+ 0 - 201
src/assets/graphy/SGraphy/items/SGraphyClockItem.js

@@ -1,201 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *               iFHS7.
- *              ;BBMBMBMc                  rZMBMBR              BMB
- *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
- *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
- *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
- *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
- *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
- *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
- *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
- *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
- *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
- *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
- *         i0BM: SWKHKGO  MBDv
- *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2018.  斯伯坦机器人世界
- *              ,  XMW  ..
- *                  r                                                                     All rights reserved.
- *
- * ********************************************************************************************************************
- */
-
-import SGraphyItem from '../SGraphyItem'
-import SRect from '../types/SRect'
-
-/** 定义符号,用于定义私有成员变晴儿 */
-const drawScale     = Symbol('drawScale')
-const drawScaleText = Symbol('drawScaleText')
-const drawHour      = Symbol('drawHour')
-const drawMinute    = Symbol('drawMinute')
-const drawSecond    = Symbol('drawSecond')
-
-/**
- * SGraphy引擎时钟Item
- *
- * @author  Andy
- */
-export default class SGraphyClockItem extends SGraphyItem {
-  /**
-   * 构造函数
-   *
-   * @param   parent    指向父对象
-   */
-  constructor(width, height, parent = null) {
-    super(parent)
-    this.name = 'ClockItem'
-    this.width = width
-    this.height = height
-    /** 是否显示刻度 */
-    this.isShowScale = true
-    /** 刻度颜色 */
-    this.scaleColor = '#000'
-    /** 刻度文本颜色 */
-    this.textColor = '#000'
-    /** 时针颜色 */
-    this.hourColor = '#000'
-    /** 分针颜色 */
-    this.minuteColor = '#000'
-    /** 秒针颜色 */
-    this.secondColor = '#F00'
-    /** 是否显示钞针 */
-    this.isShowSecond = true
-    /** 是否平滑移动秒针 */
-    this.isSmooth = true
-    /** 边缘宽度 */
-    this.padding = 100.0
-  } // Function constructor()
-
-  /**
-   * Item对象边界区域
-   *
-   * @return  SRect
-   */
-  boundingRect() {
-    return new SRect(0, 0, this.width / 2, this.height / 2)
-  } // Function boundingRect()
-
-  /**
-   * 时钟半径,只读属性
-   *
-   * @return  number
-   */
-  get radius() {
-    return Math.min(this.width, this.height) / 2.0
-  } // getter radius()
-
-  /**
-   * 绘制时钟
-   *
-   * @param   canvas      画布
-   * @param   rect        绘制区域
-   */
-  onDraw(canvas, rect) {
-    canvas.translate(this.width / 2, this.height / 2)
-    canvas.arc(0, 0, this.radius, 0, 2 * Math.PI)
-    let t = new Date()
-
-    this[drawScale](canvas)
-    this[drawHour](canvas, t.getHours(), t.getMinutes(), t.getSeconds())
-    this[drawMinute](canvas, t.getMinutes(), t.getSeconds())
-    this[drawSecond](canvas, t.getSeconds() + t.getMilliseconds() / 1000.0)
-  } // Function onDraw()
-
-  /**
-   * 绘制刻度
-   *
-   * @param   canvas      画布
-   */
-  [drawScale](canvas) {
-    let scaleLength = Math.max(this.radius / 10.0, 2.0)
-    let scaleLength1 = scaleLength * 1.2
-    let strokeWidth = Math.max(this.radius / 100.0, 2.0)
-    let strokeWidth1 = strokeWidth * 2.0
-
-    canvas.save()
-    canvas.strokeStyle = this.scaleColor
-
-    for (let i = 1; i <= 12; i++) {          // 12小时刻度
-      canvas.lineWidth = strokeWidth1
-      canvas.drawLine(0, -this.radius, 0, -this.radius + scaleLength1)
-
-      if (this.radius >= 40) {              // 如果半度大于40显示分钟刻度
-        canvas.rotate(6 * Math.PI / 180)
-        for (let j = 1; j <= 4; j++) {       // 分钟刻度
-          canvas.lineWidth = strokeWidth
-          canvas.drawLine(0, -this.radius, 0, -this.radius + scaleLength)
-          canvas.rotate(6 * Math.PI / 180)
-        }
-      } else {
-        canvas.rotate(30 * Math.PI / 180)
-      }
-    }
-
-    canvas.restore()
-  } // Function drawScale()
-
-  /**
-   * 绘制刻度数字
-   *
-   * @param   canvas      画布
-   */
-  [drawScaleText](canvas) {
-
-  } // Function drawScaleText()
-
-  /**
-   * 绘制时针
-   *
-   * @param   canvas      画布
-   * @param   hour        时
-   * @param   minute      分
-   * @param   second      秒
-   */
-  [drawHour](canvas, hour, minute, second) {
-    canvas.save()
-    canvas.lineCap = 'round'
-    canvas.lineWidth = Math.max(this.radius / 30.0, 4.0)
-    canvas.strokeStyle = this.hourColor
-    canvas.rotate((hour * 30.0 + minute * 30.0 / 60 + second * 30.0 / 60 / 60) * Math.PI / 180)
-    canvas.drawLine(0, this.radius / 10.0, 0, -this.radius / 2.0)
-    canvas.restore()
-  } // Function drawHour()
-
-  /**
-   * 绘制分针
-   *
-   * @param   canvas      画布
-   * @param   minute      分
-   * @param   second      秒
-   */
-  [drawMinute](canvas, minute, second) {
-    canvas.save()
-    canvas.lineCap = 'round'
-    canvas.lineWidth = Math.max(this.radius / 40.0, 4.0)
-    canvas.strokeStyle = this.minuteColor
-    canvas.rotate((minute * 6 + second * 6 / 60.0) * Math.PI / 180.0)
-    canvas.drawLine(0, this.radius / 10.0, 0, -this.radius * 2.0 / 3.0)
-    canvas.restore()
-  } // Function drawMinute()
-
-  /**
-   * 绘制秒针
-   *
-   * @param   canvas      画布
-   * @param   second      秒
-   */
-  [drawSecond](canvas, second) {
-    canvas.save()
-    canvas.lineCap = 'round'
-    canvas.lineWidth = Math.max(this.radius / 100.0, 3.0)
-    canvas.strokeStyle = this.secondColor
-    canvas.rotate(second * 6 * Math.PI / 180)
-    canvas.drawLine(0, this.radius / 5.0, 0, -this.radius + this.radius / 10.0)
-    // canvas.drawCircle(0, 0, this.radius / 30.0)
-    // canvas.drawCircle(0, -this.radius + this.radius / 5.0, this.radius / 60.0)
-    // canvas.strokeStyle = Color.YELLOW
-    // canvas.drawCircle(0, 0, this.radius / 100.0)
-    canvas.restore()
-  } // Function drawSecond()
-} // Class SGraphyClockItem

+ 0 - 59
src/assets/graphy/SGraphy/items/SGraphyImageItem.js

@@ -1,59 +0,0 @@
-/**
- * 图片
- * 
- * 
- */
-import SGraphyItem from '../SGraphyItem'
-import SRect from '../types/SRect'
-export default class SGraphyImageItem extends SGraphyItem {
-    /**
-     * 构造函数
-     * 
-     * @param width  图片宽度
-     * @param height  图片高度
-     * @param url    图片url
-     * @param id     point的Id
-     * @param X      图片向x轴的偏移量
-     * @param Y      图片向y轴的偏移量
-     * @param downUrl 图片按下时的url
-     * @param parent  指向父元素
-     */
-    constructor(width, height, url, id, X, Y, downUrl, parent = null) {
-            super(parent)
-            this.width = width
-            this.height = height
-            this.url = url
-            this.id = id
-            this.X = X
-            this.Y = Y
-            this.downUrl = downUrl
-            this.imgFalg = false
-            this.img = new Image()
-            this.img.src = this.url
-            this.img.style.width = this.width
-            this.img.style.height = this.height
-            this.canMove = true
-            this.type = 1
-        } //constructor
-
-    /**
-     * Item对象边界区域
-     *
-     * @return  SRect
-     */
-    boundingRect() {
-            return new SRect(0, 0, this.width * 100, this.height * 100)
-        } // Function boundingRect()
-
-    /**
-     * 绘制图片
-     * 
-     * @param canvas 画布
-     * @param rect   绘制区域
-     */
-    onDraw(canvas, rect) {
-        // canvas.moveTo(this.X, this.Y)
-        // canvas.drawImage(this.img, 0, 0, this.width, this.height, this.X, this.Y, this.width * 100, this.height * 100)
-        canvas.drawImage(this.img, 0, 0, this.width, this.height, 0, 0, this.width * 100, this.height * 100)
-    }
-}

+ 0 - 66
src/assets/graphy/SGraphy/items/SGraphyLineItem.js

@@ -1,66 +0,0 @@
-/**
- * 线条
- */
-import SGraphyItem from '../SGraphyItem'
-import SRect from '../types/SRect';
-
-export default class SGraphyLineItem extends SGraphyItem {
-    /**
-     * 构造函数
-     * 
-     * @param startX  线的起始x坐标
-     * @param startY  线的起始y坐标
-     * @param endX    线的终止x坐标
-     * @param endY    线的终止y坐标
-     * @param width   线的宽度
-     * 
-     * @param color  线的颜色
-     * @param isVirtual    是否为虚线
-     */
-    constructor(startX, startY, endX, endY, color, width, isVirtual, parent = null) {
-        super(parent)
-        this.startX = startX
-        this.startY = startY
-        this.endX = endX
-        this.endY = endY
-        this.color = color
-        this.width = width
-        this.isVirtual = isVirtual
-        this.minX = Math.min(this.startX, this.endX)
-        this.minY = Math.min(this.startY, this.endY)
-        this.maxX = Math.max(this.startX, this.endX)
-        this.maxY = Math.max(this.startY, this.endY)
-        this.name = null
-        this.type = 2
-        this.lineWidth = null
-    }
-
-    /**
-     * Item对象边界区域
-     * 
-     * @return SRect
-     */
-    boundingRect() {
-        return new SRect(this.minX, this.minY, this.maxX - this.minX, this.maxY - this.minY)
-    }
-
-    /**
-     * 绘制线条
-     * 
-     * @param canvas 画布
-     * @param rect   绘制区域
-     */
-
-    onDraw(canvas, rect) {
-        canvas.lineWidth = this.lineWidth || this.width || 240
-        canvas.strokeStyle = this.color || '#000'
-        if (this.isVirtual) {
-            canvas.setLineDash([100, 80])
-            canvas.strokeStyle = 'green'
-        }
-        canvas.beginPath();
-        canvas.moveTo(this.startX, this.startY)
-        canvas.lineTo(this.endX, this.endY)
-        canvas.stroke()
-    }
-}

+ 0 - 76
src/assets/graphy/SGraphy/items/SGraphyPillarItems.js

@@ -1,76 +0,0 @@
-/**
- * 不规则多边形,元空间
- */
-import SGraphyItem from '../SGraphyItem'
-import SRect from '../types/SRect';
-
-function getItem(arr, name) {
-    if (arr && arr.length) {
-        return arr.map(item => {
-            return item[name]
-        })
-    } else {
-        return [0]
-    }
-}
-
-
-export default class SGraphyPolygonItem extends SGraphyItem {
-    /**
-     * 
-     * 构造函数
-     * 
-     * @param jsonArr  空间线条数组
-     * @param lineWidth    空间线条的宽度
-     * @param color    空间线条的颜色
-     * @param fillColor  空间的填充颜色
-     * 
-     */
-    constructor(jsonArr, lineWidth, color, fillColor, parent = null) {
-            super(parent)
-            this.jsonArr = jsonArr
-            this.lineWidth = lineWidth
-            this.color = color
-            this.fillColor = fillColor
-            let xArr = getItem(this.jsonArr, 'X')
-            let yArr = getItem(this.jsonArr, 'Y')
-            this.minX = Math.min.apply(null, xArr) || 0
-            this.minY = Math.min.apply(null, yArr) || 0
-            this.width = Math.max.apply(null, xArr) - this.minX || 0
-            this.height = Math.max.apply(null, yArr) - this.minY || 0
-            this.type = 5
-        } //constructor
-
-    /**
-     * Item的边界区域
-     * 
-     * @return SRect
-     */
-    boundingRect() {
-        return new SRect(this.minX, this.minY, this.width, this.height)
-    }
-
-    /**
-     * 绘制不规则多边形
-     * 
-     * @param canvas 画布
-     * @param rect   绘制区域
-     */
-    onDraw(canvas, rect) {
-        if (this.jsonArr && this.jsonArr.length) {
-            canvas.beginPath();
-            canvas.lineWidth = 240
-            canvas.lineCap = 'butt';
-            canvas.strokeStyle = this.color || '#000'
-            canvas.fillStyle = this.fillColor || '#fff'
-            canvas.moveTo(this.jsonArr[0].X, this.jsonArr[0].Y)
-            for (let i = 1; i < this.jsonArr.length; i++) {
-                canvas.lineTo(this.jsonArr[i].X, this.jsonArr[i].Y)
-            }
-            canvas.lineTo(this.jsonArr[0].X, this.jsonArr[0].Y)
-            canvas.closePath()
-            canvas.fill()
-            canvas.stroke()
-        }
-    }
-}

+ 0 - 257
src/assets/graphy/SGraphy/items/SGraphyPolygonItem.js

@@ -1,257 +0,0 @@
-/**
- * 不规则多边形,元空间
- */
-import SGraphyItem from '../SGraphyItem'
-import SRect from '../types/SRect';
-
-function getItem(arr, name) {
-    if (arr && arr.length) {
-        return arr.map(item => {
-            return item[name]
-        })
-    } else {
-        return [0]
-    }
-}
-
-function changeArr(arr) {
-    if (arr && arr.length) {
-        return arr.map(item => {
-            return [
-                item.X, item.Y
-            ]
-        })
-    } else {
-        return [0]
-    }
-}
-/**
- * 求不规则多边形重点
- * @param {points} 数组,多个点位坐标
- *  
- * @return {x, y} 重点点位坐标
- */
-// function getCenterOfGravityPoint(points) {
-//     let area = 0,
-//         gx = 0,
-//         gy = 0,
-//         i = 1,
-//         px1, px2, py1, py2, temp, length = points.length;
-//     for (i; i <= length; i++) {
-//         px1 = points[(i % length)].X;
-//         px2 = points[(i - 1)].X;
-//         py1 = points[(i % length)].Y;
-//         py2 = points[(i - 1)].Y;
-//         temp = (px1 * py2 - py1 * px2) / 2
-//         area += temp;
-//         gx += temp * (px1 + px2) / 3
-//         gy += temp * (py1 + py2) / 3
-//     }
-
-//     gx = gx / area
-//     gy = gy / area
-
-//     return {
-//         x: gx,
-//         y: gy
-//     }
-// }
-
-
-export default class SGraphyPolygonItem extends SGraphyItem {
-    /**
-     * 
-     * 构造函数
-     * 
-     * @param jsonArr  空间线条数组
-     * @param lineWidth    空间线条的宽度
-     * @param color    空间线条的颜色
-     * @param fillColor  空间的填充颜色
-     * 
-     */
-    constructor(jsonArr, lineWidth, color, fillColor, id, centerOfGravityPoint, name, paths, faceColor, businessColor, isBusiness, parent = null) {
-            super(parent)
-            this.jsonArr = jsonArr
-            this.lineWidth = lineWidth
-            this.color = color
-            this.id = id
-            this.name = name //实际渲染名字
-            this.fillColor = fillColor
-            let xArr = getItem(this.jsonArr, 'X')
-            let yArr = getItem(this.jsonArr, 'Y')
-            this.minX = Math.min.apply(null, xArr) || 0
-            this.maxX = Math.max.apply(null, xArr) || 0
-            this.maxY = Math.max.apply(null, yArr) || 0
-            this.minY = Math.min.apply(null, yArr) || 0
-            this.width = this.maxX - this.minX || 0
-            this.height = this.maxY - this.minY || 0
-            this.type = 3
-            this.businessName = null
-            this.faceColor = faceColor || '#cacaca' //颜色
-            this.businessId = null //业务空间id
-            this.isBusiness = isBusiness || 1 //状态
-            this.businessColor = businessColor || 'rgba(68,161,140,.4)' //业务空间颜色
-            this.businessFaceColor = "#333"
-            this.containsArr = changeArr(this.jsonArr)
-            this.paths = null
-            if (paths && paths.length > 1) {
-                this.paths = paths.map(item => {
-                    if (item && item.length) {
-                        return changeArr(item)
-                    } else {
-                        return undefined
-                    }
-                }).filter(d => d)
-            }
-            this.centerOfGravityPoint = centerOfGravityPoint
-        } //constructor
-
-    /**
-     * Item的边界区域
-     * 
-     * @return SRect
-     */
-    boundingRect() {
-        return new SRect(this.minX, this.minY, this.width, this.height)
-    }
-
-
-    /**
-     * 判断item是否包含点x,y
-     *
-     * @param   x       横坐标(当前item)
-     * @param   y       纵坐标(当前item)
-     *
-     * @return  boolean
-     */
-    contains(x, y) {
-        let falg = false,
-            isFullIn = false //是否在镂空图形内
-        if (this.paths instanceof Array) {
-            for (let i = 1; i < this.paths.length; i++) {
-                if (this.isIn(x, y, this.paths[i])) {
-                    //位置信息在镂空图形内
-                    isFullIn = true
-                    break
-                }
-            }
-            // //如果鼠标在大图形内切在镂空图形中返回false
-            if (this.isIn(x, y, this.containsArr) && isFullIn) {
-                falg = false
-            } else if (this.isIn(x, y, this.containsArr) && !isFullIn) {
-                falg = true
-            } else {
-                falg = this.isIn(x, y, this.containsArr)
-            }
-        } else {
-            falg = this.isIn(x, y, this.containsArr)
-        }
-        return falg
-    }
-
-
-    isIn(x, y, json) {
-        let nCross = 0,
-            point = typeof(x) == 'object' ? [x.x, x.y] : [x, y],
-            APoints = json,
-            length = APoints.length,
-            p1, p2, i, xinters;
-        p1 = APoints[0];
-        for (i = 1; i <= length; i++) {
-            p2 = APoints[i % length];
-            if (
-                point[0] > Math.min(p1[0], p2[0]) &&
-                point[0] <= Math.max(p1[0], p2[0])
-            ) {
-                if (point[1] <= Math.max(p1[1], p2[1])) {
-                    if (p1[0] != p2[0]) {
-                        //计算位置信息
-                        xinters = (point[0] - p1[0]) * (p2[1] - p1[1]) / (p2[0] - p1[0]) + p1[1];
-                        if (p1[1] == p2[1] || point[1] <= xinters) {
-                            nCross++
-                        }
-                    }
-                }
-            }
-            p1 = p2;
-        }
-        if (nCross % 2 == 0) {
-            return false
-        } else {
-            return true
-        }
-
-    }
-
-    /**
-     * 绘制不规则多边形
-     * 
-     * @param canvas 画布
-     * @param rect   绘制区域
-     */
-    onDraw(canvas, rect) {
-        if (this.jsonArr && this.jsonArr.length) {
-            canvas.beginPath();
-            canvas.lineWidth = 220
-            canvas.lineCap = 'butt';
-            if (this.isBusiness == 1) {
-                canvas.strokeStyle = this.color || '#000'
-                canvas.fillStyle = this.fillColor
-            } else if (this.isBusiness == 2) {
-                //已有id 的业务空间
-                canvas.strokeStyle = this.color || '#000'
-                canvas.fillStyle = this.businessColor || '#fff'
-            } else if (this.isBusiness == 3) {
-                //被选择的元空间
-                canvas.strokeStyle = this.color || '#000'
-                canvas.lineWidth = 800
-                canvas.fillStyle = '#1abc9c'
-            } else if (this.isBusiness == 4) {
-                canvas.strokeStyle = 'rgba(251,226,1,.8)' || '#000'
-                canvas.fillStyle = '#fff' || '#fff'
-            } else if (this.isBusiness == 5) {
-                canvas.fillStyle = 'rgba(11,12,12,.2)' || '#fff'
-            } else if (this.isBusiness == 6) {
-                canvas.fillStyle = '#1abc9c'
-                canvas.lineWidth = 800
-                canvas.strokeStyle = 'rgba(68,161,140,.4)' || '#fff'
-            } else if (this.isBusiness == 7) {
-                canvas.strokeStyle = this.color || '#000'
-                canvas.fillStyle = this.businessColor || '#fff'
-            }
-            canvas.moveTo(this.jsonArr[0].X, this.jsonArr[0].Y)
-            for (let i = 1; i < this.jsonArr.length; i++) {
-                canvas.lineTo(this.jsonArr[i].X, this.jsonArr[i].Y)
-            }
-            canvas.lineTo(this.jsonArr[0].X, this.jsonArr[0].Y)
-            canvas.closePath()
-            canvas.fill()
-            canvas.stroke()
-            if (!!this.name) {
-                canvas.font = "normal small-caps bold 500px Arial";
-                if (this.isBusiness == 1) {
-                    canvas.fillStyle = this.faceColor
-                } else if (this.isBusiness == 2) {
-                    canvas.fillStyle = this.businessFaceColor;
-                } else if (this.isBusiness == 3) {
-                    //业务空间异常状态
-                    canvas.fillStyle = '#fff'
-                } else if (this.isBusiness == 4) {
-                    canvas.fillStyle = '#cacaca'
-                } else if (this.isBusiness == 6) {
-                    canvas.fillStyle = '#fff'
-                } else if (this.isBusiness == 7) {
-                    canvas.fillStyle = 'red'
-                }
-                if (!!this.businessName || !!this.businessId) {
-                    name = '👇   ' + this.businessName
-                } else {
-                    name = '⬇️   ' + this.name
-                }
-                canvas.fillText(name, this.centerOfGravityPoint.x, this.centerOfGravityPoint.y);
-                // canvas.fillText(this.name, (this.maxX - this.minX) / 2 + this.minX, (this.maxY - this.minY) / 2 + this.minY);
-            }
-            // canvas.fillText(this.name, this.jsonArr[0].X, this.jsonArr[0].Y);
-        }
-    }
-}

+ 0 - 100
src/assets/graphy/SGraphy/items/SGraphyRectItem.js

@@ -1,100 +0,0 @@
-/**
- * 线条
- */
-import SGraphyItem from '../SGraphyItem'
-import SRect from '../types/SRect';
-
-export default class SGraphyRectItem extends SGraphyItem {
-    /**
-     * 构造函数
-     * 
-     * @param X  矩形的开始点X
-     * @param Y  矩形的开始点Y
-     * @param width   矩形的宽度
-     * @param height  矩形的高度
-     * 
-     * @param isFill  矩形的是否填充
-     * @param fillColor  矩形的填充色彩
-     * @param text  矩形的文字
-     * @param textSize  矩形的文字大小
-     * @param color  矩形的颜色
-     * @param Tip   提示
-     */
-    constructor(X, Y, width, height, isFill, fillColor, text, textSize, color, Tip, parent = null) {
-        super(parent)
-        this.X = X
-        this.Y = Y
-        this.width = width
-        this.height = height
-        this.isFill = isFill
-        this.fillColor = fillColor
-        this.color = color
-        this.textSize = textSize || 6
-        this.type = 10
-        this.hoverColor = null
-        this.text = text.split(",")
-        this.fontStart = this.X
-        this.Tip = Tip
-    }
-
-    /**
-     * Item对象边界区域
-     * 
-     * @return SRect
-     */
-    boundingRect() {
-        return new SRect(this.X, this.Y, this.width, this.height)
-    }
-
-    /**
-     * 判断item是否包含点x,y
-     *
-     * @param   x       横坐标(当前item)
-     * @param   y       纵坐标(当前item)
-     *
-     * @return  boolean
-     */
-    contains(x) {
-        if (this.X + this.width > x.x && x.x > this.X && this.Y + this.height > x.y && x.y > this.Y) {
-            return true
-        } else {
-            return false
-        }
-    }
-
-    /**
-     * 绘制线条
-     * 
-     * @param canvas 画布
-     * @param rect   绘制区域
-     */
-
-    onDraw(canvas, rect) {
-        canvas.beginPath();
-        canvas.lineWidth = "1";
-        if (this.isFill) {
-            if (!!this.hoverColor) {
-                canvas.fillStyle = this.hoverColor
-            } else {
-                canvas.fillStyle = this.fillColor
-            }
-            canvas.fillRect(this.X, this.Y, this.width, this.height);
-        } else {
-            canvas.rect(this.X, this.Y, this.width, this.height);
-        }
-        canvas.stroke();
-        if (!!this.text && this.text.length <= 1) {
-            canvas.font = this.textSize + "px 宋体";
-            canvas.fillStyle = this.color
-            canvas.fillText(this.text[0], this.fontStart, this.Y + this.height / 2);
-        } else if (!!this.text && this.text.length > 1) {
-            canvas.font = this.textSize + "px 宋体";
-            canvas.fillStyle = this.color
-            for (let i = 0; i < this.text.length; i++) {
-                canvas.fillText(this.text[i], this.fontStart, this.Y + this.height / 2 - this.textSize * i);
-            }
-        } else {
-            return
-        }
-    }
-}

+ 0 - 51
src/assets/graphy/SGraphy/items/SGraphyTextItems.js

@@ -1,51 +0,0 @@
-/**
- * 线条
- */
-import SGraphyItem from '../SGraphyItem'
-import SRect from '../types/SRect';
-
-export default class SGraphyTextItem extends SGraphyItem {
-    /**
-     * 构造函数
-     * 
-     * @param X  文字的开始点X
-     * @param Y  文字的开始点Y
-     * @param width   文字的宽度
-     * 
-     * @param color  文字的颜色
-     * @param text   文字的文字
-     */
-    constructor(X, Y, width, color, text, falg, font, parent = null) {
-        super(parent)
-        this.X = X
-        this.Y = Y
-        this.lineWidth = width
-        this.color = color
-        this.font = font ? font : "6px 宋体"
-        this.text = falg ? text + '→' : text
-    }
-
-    /**
-     * Item对象边界区域
-     * 
-     * @return SRect
-     */
-    boundingRect() {
-        return new SRect(this.X, this.Y, 0, 0)
-    }
-
-    /**
-     * 绘制线条
-     * 
-     * @param canvas 画布
-     * @param rect   绘制区域
-     */
-
-    onDraw(canvas, rect) {
-        if (!!this.text) {
-            canvas.font = this.font;
-            canvas.fillStyle = this.color
-            canvas.fillText(this.text, this.X, this.Y);
-        }
-    }
-}

+ 0 - 66
src/assets/graphy/SGraphy/items/SGraphyVirtualItem.js

@@ -1,66 +0,0 @@
-/**
- * 线条
- */
-import SGraphyItem from '../SGraphyItem'
-import SRect from '../types/SRect';
-
-export default class SGraphyLineItem extends SGraphyItem {
-    /**
-     * 构造函数
-     * 
-     * @param startX  线的起始x坐标
-     * @param startY  线的起始y坐标
-     * @param endX    线的终止x坐标
-     * @param endY    线的终止y坐标
-     * @param width   线的宽度
-     * 
-     * @param color  线的颜色
-     * @param isVirtual    是否为虚线
-     * 
-     * @param canMove  移动
-     */
-    constructor(startX, startY, endX, endY, color, width, isVirtual, canMove, parent = null) {
-        super(parent)
-        this.startX = startX
-        this.startY = startY
-        this.endX = endX
-        this.endY = endY
-        this.color = color
-        this.width = width
-        this.isVirtual = isVirtual
-        this.minX = Math.min(this.startX, this.endX)
-        this.minY = Math.min(this.startY, this.endY)
-        this.maxX = Math.max(this.startX, this.endX)
-        this.maxY = Math.max(this.startY, this.endY)
-        this.type = 4
-            // this.canMove = true
-    }
-
-    /**
-     * Item对象边界区域
-     * 
-     * @return SRect
-     */
-    boundingRect() {
-        return new SRect(this.minX, this.minY, (this.maxX - this.minX), (this.maxY - this.minY))
-    }
-
-    /**
-     * 绘制线条
-     * 
-     * @param canvas 画布
-     * @param rect   绘制区域
-     */
-
-    onDraw(canvas, rect) {
-        if (this.isVirtual) {
-            canvas.setLineDash([240, 240])
-        }
-        canvas.lineWidth = 240
-        canvas.strokeStyle = this.color || '#000'
-        canvas.beginPath();
-        canvas.moveTo(this.startX, this.startY)
-        canvas.lineTo(this.endX, this.endY)
-        canvas.stroke()
-    }
-}

+ 0 - 240
src/assets/graphy/SGraphy/mainScene.js

@@ -1,240 +0,0 @@
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = function (d, b) {
-        extendStatics = Object.setPrototypeOf ||
-            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-        return extendStatics(d, b);
-    };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
-import SGraphyPolygonItem from './newItems/SGraphyPolygonItem.js';
-import { SGraphyImgItem } from './newItems/SGraphyImgItem.js';
-import { SGraphyScene } from "@sybotan-web/graphy";
-import Axios from 'axios';
-import pako from "./until/pako.js";
-import tools from "./until/tool.js";
-/**
- * @name mainScene
- * @time 2019-07.07;
- * 添加所有item的场景到scene中
- */
-var mainScene = /** @class */ (function (_super) {
-    __extends(mainScene, _super);
-    /**
-     * @param data 绘制空间地图得所有参数
-     */
-    function mainScene(data) {
-        var _this_1 = _super.call(this) || this;
-        _this_1._isShowSpace = true; // 是否显示空间;
-        _this_1._isShowWallList = true; //是否展示墙体;
-        _this_1._isShowEquipmentList = true; //是否展示设备;
-        _this_1._isShowVrtualWallList = true; //是否展示虚拟墙
-        _this_1.data = data;
-        if (_this_1.data != null) {
-            _this_1.addAllItemList(_this_1.data);
-        }
-        return _this_1;
-    }
-    Object.defineProperty(mainScene.prototype, "isShowSpace", {
-        // 设置是否显示空间
-        get: function () {
-            return this._isShowSpace;
-        },
-        set: function (b) {
-            this._isShowSpace = b;
-        },
-        enumerable: true,
-        configurable: true
-    });
-    Object.defineProperty(mainScene.prototype, "isShowWallList", {
-        // 设置是否显示墙
-        get: function () {
-            return this._isShowWallList;
-        },
-        set: function (b) {
-            this._isShowWallList = b;
-        },
-        enumerable: true,
-        configurable: true
-    });
-    Object.defineProperty(mainScene.prototype, "isShowEquipmentList", {
-        // 设置是否显示设备
-        get: function () {
-            return this._isShowEquipmentList;
-        },
-        set: function (b) {
-            this._isShowEquipmentList = b;
-        },
-        enumerable: true,
-        configurable: true
-    });
-    Object.defineProperty(mainScene.prototype, "isShowVrtualWallList", {
-        // 设置是否显示虚拟墙
-        get: function () {
-            return this._isShowVrtualWallList;
-        },
-        set: function (b) {
-            this._isShowVrtualWallList = b;
-        },
-        enumerable: true,
-        configurable: true
-    });
-    //获取参数
-    mainScene.prototype.urlGetData = function (url) {
-        var _this_1 = this;
-        var that = this;
-        return new Promise(function (relove, reject) {
-            Axios({
-                method: 'get',
-                url: url,
-                data: {},
-                responseType: 'blob',
-            }).then(function (res) {
-                var blob = res.data;
-                _this_1.zipToJson(blob).then(function (jsonData) {
-                    that.addAllItemList(jsonData);
-                    relove();
-                }).catch(function (error) {
-                    console.log(error);
-                });
-                // console.log(reader)
-            }).catch(function (res) {
-                console.log(res);
-            });
-        });
-    };
-    // 压缩包变为json格式数据
-    mainScene.prototype.zipToJson = function (blob) {
-        var data = null;
-        var reader = new FileReader();
-        reader.readAsBinaryString(blob);
-        var _this = this;
-        return new Promise(function (resolve) {
-            reader.onload = function (readerEvt) {
-                var binaryString = readerEvt.target.result;
-                //解压数据
-                var base64Data = btoa(binaryString);
-                var unGzipData = pako.unzip(base64Data);
-                data = unGzipData;
-                if (data.WallList && data.WallList.length) {
-                    tools.changeMap(data.WallList, -1, "PointList");
-                }
-                if (data.SpaceList && data.SpaceList.length) {
-                    tools.changeMap(data.SpaceList, -1, "Paths");
-                }
-                if (data.ColumnList && data.ColumnList.length) {
-                    tools.changeMap(data.ColumnList, -1, "Path");
-                }
-                if (data.VirtualWallList && data.VirtualWallList.length) {
-                    tools.changeMap(data.VirtualWallList, -1, "PointList");
-                }
-                if (data.EquipmentList && data.EquipmentList.length) {
-                    tools.changeMap(data.EquipmentList, -1, "PointList");
-                }
-                resolve(data);
-            };
-        });
-    };
-    // 以下是绘制方法
-    /**
-     * 增添所有绘制item(地图);
-    */
-    mainScene.prototype.addAllItemList = function (data) {
-        var space = data.SpaceList;
-        // let wall:
-        this.addSpaceList(space); //绘制空间
-        this.addWallList(); //绘制墙
-        var images = data.images;
-        this.addImageList(images);
-    };
-    /**
-     * 添加所有空间到scene 中
-     * @param space 空间list
-     */
-    mainScene.prototype.addSpaceList = function (space) {
-        if (space && space.length) {
-            for (var i = 0; i < space.length; i++) {
-                if (space[i].Paths[1] && space[i].Paths[1].length >= 2) {
-                    this.addItem(this.constructeItem({
-                        parent: null,
-                        space: space[i],
-                        businessType: 'space'
-                    }));
-                }
-            }
-            for (var i = 0; i < space.length; i++) {
-                if (space[i].Paths[0] && space[i].Paths[0].length >= 2 && !space[i].Paths[1]) {
-                    this.addItem(this.constructeItem({
-                        parent: null,
-                        space: space[i],
-                        businessType: 'space'
-                    }));
-                }
-            }
-        }
-    };
-    // 绘制墙体
-    mainScene.prototype.addWallList = function () {
-    };
-    // 绘制设备
-    mainScene.prototype.addEquipmentList = function () {
-    };
-    // 绘制柱体
-    mainScene.prototype.addColumnListList = function () {
-    };
-    // 绘制虚拟墙
-    mainScene.prototype.addVrtualWallList = function () {
-    };
-    // 绘制图片
-    mainScene.prototype.addImageList = function (imageList) {
-        var _this_1 = this;
-        if (imageList && imageList.length) {
-            imageList.map(function (t) {
-                _this_1.addItem(new SGraphyImgItem(null, t.img, t.X, t.Y, t.width, t.height));
-            });
-        }
-    };
-    /**
-     * 产生item实例
-     */
-    mainScene.prototype.constructeItem = function (PolygonItemInterfaceData) {
-        return new SGraphyPolygonItem(PolygonItemInterfaceData);
-    };
-    // 鼠标交互类事件
-    // 点击
-    mainScene.prototype.click = function (_this, fn) {
-        this.root.children.forEach(function (item) {
-            item.connect("click", _this, fn);
-        });
-    };
-    // 双击
-    mainScene.prototype.dbclick = function (_this, fn) {
-        this.root.children.forEach(function (item) {
-            item.connect("doubleClick", _this, fn);
-        });
-    };
-    // 按下
-    mainScene.prototype.mouseDown = function (_this, fn) {
-        this.root.children.forEach(function (item) {
-            item.connect("mouseDown", _this, fn);
-        });
-    };
-    //移动
-    mainScene.prototype.mouseMove = function (_this, fn) {
-        this.root.children.forEach(function (item) {
-            item.connect("mouseMove", _this, fn);
-        });
-    };
-    // 点解结束
-    mainScene.prototype.mouseUp = function (_this, fn) {
-        this.root.children.forEach(function (item) {
-            item.connect("mouseUp", _this, fn);
-        });
-    };
-    return mainScene;
-}(SGraphyScene));
-export default mainScene;

+ 0 - 228
src/assets/graphy/SGraphy/mainScene.ts

@@ -1,228 +0,0 @@
-
-import { SRect, SSize, SPoint } from "@sybotan-web/base";
-import SGraphyPolygonItem from './newItems/SGraphyPolygonItem.js'
-import { SGraphyImgItem } from './newItems/SGraphyImgItem.js'
-import { SGraphyScene, SMouseEvent } from "@sybotan-web/graphy";
-import { SPen, SPainter, SColor } from "@sybotan-web/draw";
-import { dataItemPath, dataItem, dataSpaceItem, dataInterface, PolygonItemInterface, ImgItemInterface } from './dataType'   //传入参数的参数接口类型
-import Axios from 'axios';
-import pako from "./until/pako.js"
-import tools from "./until/tool.js"
-/**
- * @name mainScene
- * @time 2019-07.07;
- * 添加所有item的场景到scene中
- */
-
-export default class mainScene extends SGraphyScene {
-
-    data: dataInterface | null;
-
-    private _isShowSpace: boolean = true;  // 是否显示空间;
-    private _isShowWallList: boolean = true;  //是否展示墙体;
-    private _isShowEquipmentList: boolean = true; //是否展示设备;
-    private _isShowVrtualWallList: boolean = true; //是否展示虚拟墙
-
-    // 设置是否显示空间
-    get isShowSpace(): boolean {
-        return this._isShowSpace
-    }
-    set isShowSpace(b: boolean) {
-        this._isShowSpace = b
-    }
-
-    // 设置是否显示墙
-    get isShowWallList(): boolean {
-        return this._isShowWallList
-    }
-    set isShowWallList(b: boolean) {
-        this._isShowWallList = b
-    }
-
-    // 设置是否显示设备
-    get isShowEquipmentList(): boolean {
-        return this._isShowEquipmentList
-    }
-    set isShowEquipmentList(b: boolean) {
-        this._isShowEquipmentList = b
-    }
-
-    // 设置是否显示虚拟墙
-    get isShowVrtualWallList(): boolean {
-        return this._isShowVrtualWallList
-    }
-    set isShowVrtualWallList(b: boolean) {
-        this._isShowVrtualWallList = b
-    }
-
-    /**
-     * @param data 绘制空间地图得所有参数
-     */
-
-    constructor(data: dataInterface | null) {
-        super()
-        this.data = data;
-        if (this.data != null) {
-            this.addAllItemList(this.data);
-        }
-    }
-    //获取参数
-    urlGetData(url: string) {
-        let that = this;
-        return new Promise((relove, reject) => {
-            Axios({
-                method: 'get',
-                url: url,
-                data: {},
-                responseType: 'blob',
-                // contentType: "charset=utf-8"
-            }).then(res => {
-                var blob = res.data;
-                this.zipToJson(blob).then((jsonData: any) => {
-                    that.addAllItemList(jsonData)
-                    relove()
-                }).catch((error: any) => {
-                    console.log(error)
-                });
-                // console.log(reader)
-            }).catch(res => {
-                console.log(res)
-            })
-        })
-
-    }
-    // 压缩包变为json格式数据
-    zipToJson(blob: any): any {
-        let data = null;
-        var reader = new FileReader();
-        reader.readAsBinaryString(blob);
-        let _this = this;
-        return new Promise((resolve) => {
-            reader.onload = function (readerEvt: any) {
-                var binaryString = readerEvt.target.result;
-                //解压数据
-                let base64Data = btoa(binaryString)
-                let unGzipData = pako.unzip(base64Data)
-                data = unGzipData;
-                if (data.WallList && data.WallList.length) {
-                    tools.changeMap(data.WallList, -1, "PointList");
-                }
-                if (data.SpaceList && data.SpaceList.length) {
-                    tools.changeMap(data.SpaceList, -1, "Paths");
-                }
-                if (data.ColumnList && data.ColumnList.length) {
-                    tools.changeMap(data.ColumnList, -1, "Path");
-                }
-                if (data.VirtualWallList && data.VirtualWallList.length) {
-                    tools.changeMap(data.VirtualWallList, -1, "PointList");
-                }
-                if (data.EquipmentList && data.EquipmentList.length) {
-                    tools.changeMap(data.EquipmentList, -1, "PointList");
-                }
-                resolve(data)
-            };
-        })
-    }
-    // 以下是绘制方法
-
-    /** 
-     * 增添所有绘制item(地图);
-    */
-    addAllItemList(data: dataInterface) {
-        let space: dataSpaceItem[] = data.SpaceList;
-        // let wall:
-        this.addSpaceList(space) //绘制空间
-        this.addWallList()       //绘制墙
-        let images: ImgItemInterface[] = data.images
-        this.addImageList(images)
-    }
-
-    /**
-     * 添加所有空间到scene 中
-     * @param space 空间list
-     */
-    addSpaceList(space: dataSpaceItem[]): void {
-        if (space && space.length) {
-            for (let i = 0; i < space.length; i++) {
-                if (space[i].Paths[1] && space[i].Paths[1].length >= 2) {
-                    this.addItem(this.constructeItem(
-                        {
-                            parent: null,
-                            space: space[i],
-                            businessType: 'space'
-                        }));
-                }
-            }
-            for (let i = 0; i < space.length; i++) {
-                if (space[i].Paths[0] && space[i].Paths[0].length >= 2 && !space[i].Paths[1]) {
-                    this.addItem(this.constructeItem(
-                        {
-                            parent: null,
-                            space: space[i],
-                            businessType: 'space'
-                        }));
-                }
-            }
-        }
-    }
-    // 绘制墙体
-    addWallList(): void {
-
-    }
-    // 绘制设备
-    addEquipmentList() {
-    }
-    // 绘制柱体
-    addColumnListList(): void {
-    }
-    // 绘制虚拟墙
-    addVrtualWallList(): void {
-    }
-    // 绘制图片
-    addImageList(imageList: ImgItemInterface[]): void {
-        if (imageList && imageList.length) {
-            imageList.map(t => {
-                this.addItem(new SGraphyImgItem(null, t.img, t.X, t.Y, t.width, t.height))
-            })
-        }
-    }
-    /**
-     * 产生item实例
-     */
-    constructeItem(PolygonItemInterfaceData: PolygonItemInterface): SGraphyPolygonItem {
-        return new SGraphyPolygonItem(PolygonItemInterfaceData)
-    }
-    // 鼠标交互类事件
-
-    // 点击
-    click(_this: any, fn: any): void {
-        this.root.children.forEach(item => {
-            item.connect("click", _this, fn);
-        });
-    }
-    // 双击
-    dbclick(_this: any, fn: any): void {
-        this.root.children.forEach(item => {
-            item.connect("doubleClick", _this, fn);
-        });
-    }
-    // 按下
-    mouseDown(_this: any, fn: any) {
-        this.root.children.forEach(item => {
-            item.connect("mouseDown", _this, fn);
-        });
-    }
-    //移动
-    mouseMove(_this: any, fn: any) {
-        this.root.children.forEach(item => {
-            item.connect("mouseMove", _this, fn);
-        });
-    }
-    // 点解结束
-    mouseUp(_this: any, fn: any) {
-        this.root.children.forEach(item => {
-            item.connect("mouseUp", _this, fn);
-        });
-    }
-
-} 

+ 0 - 68
src/assets/graphy/SGraphy/newItems/SGraphyCircleItem.js

@@ -1,68 +0,0 @@
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = function (d, b) {
-        extendStatics = Object.setPrototypeOf ||
-            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-        return extendStatics(d, b);
-    };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
-import { SGraphyItem } from '@sybotan-web/graphy';
-import { SRect } from "@sybotan-web/base";
-import { SColor } from "@sybotan-web/draw";
-/**
- * 圆Item类
- *
- */
-var SGraphyCircleItem = /** @class */ (function (_super) {
-    __extends(SGraphyCircleItem, _super);
-    /**
-     * 构造函数
-     *
-     * @param r          圆半径
-     * @param width      圆线的宽度
-     * @param color      圆线的颜色
-     * @param fillColor  圆填充的颜色
-     * @param parent
-     */
-    function SGraphyCircleItem(parent, r, fillColor, color, width) {
-        if (fillColor === void 0) { fillColor = SColor.White; }
-        if (color === void 0) { color = SColor.Black; }
-        if (width === void 0) { width = 1; }
-        var _this = _super.call(this, parent) || this;
-        _this.fillColor = SColor.White;
-        _this.color = SColor.Black;
-        _this.width = 1;
-        _this.r = r;
-        _this.color = color;
-        _this.fillColor = fillColor;
-        _this.width = width;
-        return _this;
-    } // Constructor()
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    SGraphyCircleItem.prototype.boundingRect = function () {
-        return new SRect(-this.r, -this.r, 2 * this.r, 2 * this.r);
-    }; // Function boundingRect()
-    /**
-     * Item绘制操作
-     *
-     * @param   painter       painter对象
-     * @param   rect          绘制区域
-     */
-    SGraphyCircleItem.prototype.onDraw = function (painter, rect) {
-        // painter.pen = new SPen(new SColor("#FF0000"), 22);
-        painter.pen.color = this.color;
-        painter.brush.color = this.fillColor;
-        painter.drawCircle(500, 500, this.r);
-    };
-    return SGraphyCircleItem;
-}(SGraphyItem)); // Class SGraphyCircleItem
-export default SGraphyCircleItem;

+ 0 - 65
src/assets/graphy/SGraphy/newItems/SGraphyCircleItem.ts

@@ -1,65 +0,0 @@
-
-import { SGraphyItem } from '@sybotan-web/graphy';
-import { SRect, SSize } from "@sybotan-web/base";
-import { SPen, SPainter, SColor } from "@sybotan-web/draw";
-
-/**
- * 圆Item类
- *
- */
-export default class SGraphyCircleItem extends SGraphyItem {
-    r: number;
-    fillColor: SColor = SColor.White;
-    color: SColor = SColor.Black;
-    width: number = 1;
-
-    /**
-     * 构造函数
-     *
-     * @param r          圆半径
-     * @param width      圆线的宽度
-     * @param color      圆线的颜色
-     * @param fillColor  圆填充的颜色
-     * @param parent    
-     */
-    constructor(
-        parent: SGraphyItem | null,
-        r: number,
-        fillColor: SColor = SColor.White,
-        color: SColor = SColor.Black,
-        width: number = 1
-    ) {
-        super(parent);
-        this.r = r;
-        this.color = color;
-        this.fillColor = fillColor;
-        this.width = width;
-    } // Constructor()
-
-    /**
-     * Item对象边界区域
-     * 
-     * @return SRect
-     */
-    boundingRect(): SRect {
-        return new SRect(
-            -this.r,
-            -this.r,
-            2 * this.r,
-            2 * this.r
-        );
-    } // Function boundingRect()
-
-    /**
-     * Item绘制操作
-     *
-     * @param   painter       painter对象
-     * @param   rect          绘制区域
-     */
-    onDraw(painter: SPainter, rect?: SRect): void {
-        // painter.pen = new SPen(new SColor("#FF0000"), 22);
-        painter.pen.color = this.color;
-        painter.brush.color = this.fillColor;
-        painter.drawCircle(500, 500, this.r);
-    }
-} // Class SGraphyCircleItem

+ 0 - 111
src/assets/graphy/SGraphy/newItems/SGraphyImgItem.js

@@ -1,111 +0,0 @@
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = function (d, b) {
-        extendStatics = Object.setPrototypeOf ||
-            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-        return extendStatics(d, b);
-    };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
-import { SGraphyItem } from '@sybotan-web/graphy';
-import { SRect } from "@sybotan-web/base";
-/**
- * 图形Item类  todo
- *
- */
-var SGraphyImgItem = /** @class */ (function (_super) {
-    __extends(SGraphyImgItem, _super);
-    /**
-     * 构造函数
-     *
-     * @param width        		图片宽度
-     * @param height   				图片高度
-     * @param imgSource     	图片源
-     * @param X        				图片向x轴的偏移量
-     * @param Y        				图片向y轴的偏移量
-     * @param parent   				指向父元素
-     */
-    function SGraphyImgItem(parent, imgSource, X, Y, width, height) {
-        var _this = _super.call(this, parent) || this;
-        _this.width = 0;
-        _this.height = 0;
-        _this.imgSource = imgSource;
-        _this.X = X;
-        _this.Y = Y;
-        _this.width = width;
-        _this.height = height;
-        _this.img = new Image();
-        _this.img.src = _this.imgSource;
-        return _this;
-    } // Constructor()
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    SGraphyImgItem.prototype.boundingRect = function () {
-        return new SRect(this.X, this.Y, this.width, this.height);
-    }; // Function boundingRect()
-    // contains(x: number, y: number): boolean {
-    // 	return this.boundingRect().contains(x - this.X, y - this.Y);
-    // }
-    SGraphyImgItem.prototype.onClick = function (event) {
-        this.$emit('click', event);
-        return true;
-    }; // Function onClick()
-    /**
-  * 鼠标双击事件
-  *
-  * @param   event   保存事件参数
-  * @return  boolean
-  */
-    SGraphyImgItem.prototype.onDoubleClick = function (event) {
-        this.$emit('doubleClick', event);
-        return true;
-    };
-    /**
-  * 鼠标按下事件
-  *
-  * @param   event   保存事件参数
-  * @return  boolean
-  */
-    SGraphyImgItem.prototype.onMouseDown = function (event) {
-        this.$emit('mouseDown', event);
-        return true;
-    }; // Function onMouseDown()
-    /**
-     * 鼠标移动事件
-     *
-     * @param   event   保存事件参数
-     * @return  boolean
-     */
-    SGraphyImgItem.prototype.onMouseMove = function (event) {
-        this.$emit('mouseMove', event);
-        return true;
-    }; // Function onMouseMove()
-    /**
-     * 释放鼠标事件
-     *
-     * @param   event   保存事件参数
-     * @return  boolean
-     */
-    SGraphyImgItem.prototype.onMouseUp = function (event) {
-        this.$emit('mouseUp', event);
-        return true;
-    };
-    /**
-     * Item绘制操作
-     *
-     * @param   painter       painter对象
-     * @param   rect          绘制区域
-     */
-    SGraphyImgItem.prototype.onDraw = function (painter, rect) {
-        painter.drawImage(this.img, this.X, this.Y, this.width, this.height);
-    };
-    return SGraphyImgItem;
-}(SGraphyItem)); // Class SGraphyImgItem
-export { SGraphyImgItem };

+ 0 - 116
src/assets/graphy/SGraphy/newItems/SGraphyImgItem.ts

@@ -1,116 +0,0 @@
-import { SGraphyItem, SMouseEvent } from '@sybotan-web/graphy'
-import { SRect, SSize } from "@sybotan-web/base";
-import { SPen, SPainter, SColor } from "@sybotan-web/draw";
-
-/**
- * 图形Item类  todo
- *
- */
-export class SGraphyImgItem extends SGraphyItem {
-	imgSource: string; //可以为url,base64
-	X: number;
-	Y: number;
-	width: number = 0;
-	height: number = 0;
-	img: CanvasImageSource
-
-	/**
-	 * 构造函数
-	 * 
-	 * @param width        		图片宽度
-	 * @param height   				图片高度
-	 * @param imgSource     	图片源
-	 * @param X        				图片向x轴的偏移量
-	 * @param Y        				图片向y轴的偏移量
-	 * @param parent   				指向父元素
-	 */
-	constructor(
-		parent: SGraphyItem | null,
-		imgSource: string,
-		X: number,
-		Y: number,
-		width: number,
-		height: number,
-	) {
-		super(parent);
-		this.imgSource = imgSource;
-		this.X = X;
-		this.Y = Y;
-		this.width = width;
-		this.height = height;
-		this.img = new Image();
-		this.img.src = this.imgSource;
-	} // Constructor()
-
-	/**
-	 * Item对象边界区域
-	 * 
-	 * @return SRect
-	 */
-	boundingRect(): SRect {
-		return new SRect(
-			this.X,
-			this.Y,
-			this.width,
-			this.height
-		);
-	} // Function boundingRect()
-	// contains(x: number, y: number): boolean {
-	// 	return this.boundingRect().contains(x - this.X, y - this.Y);
-	// }
-	onClick(event: SMouseEvent): boolean {
-		this.$emit('click', event);
-		return true;
-	} // Function onClick()
-	/**
-  * 鼠标双击事件
-  *
-  * @param   event   保存事件参数
-  * @return  boolean
-  */
-	onDoubleClick(event: SMouseEvent): boolean {
-		this.$emit('doubleClick', event);
-		return true;
-	}
-	/**
-  * 鼠标按下事件
-  *
-  * @param   event   保存事件参数
-  * @return  boolean
-  */
-	onMouseDown(event: SMouseEvent): boolean {
-		this.$emit('mouseDown', event);
-		return true;
-	} // Function onMouseDown()
-
-	/**
-	 * 鼠标移动事件
-	 *
-	 * @param   event   保存事件参数
-	 * @return  boolean
-	 */
-	onMouseMove(event: SMouseEvent): boolean {
-		this.$emit('mouseMove', event);
-		return true;
-	} // Function onMouseMove()
-
-	/**
-	 * 释放鼠标事件
-	 *
-	 * @param   event   保存事件参数
-	 * @return  boolean
-	 */
-	onMouseUp(event: SMouseEvent): boolean {
-		this.$emit('mouseUp', event);
-		return true;
-	}
-	/**
-	 * Item绘制操作
-	 *
-	 * @param   painter       painter对象
-	 * @param   rect          绘制区域
-	 */
-	onDraw(painter: SPainter, rect?: SRect): void {
-		painter.drawImage(this.img, this.X, this.Y, this.width, this.height);
-	}
-} // Class SGraphyImgItem

+ 0 - 70
src/assets/graphy/SGraphy/newItems/SGraphyPointItem.js

@@ -1,70 +0,0 @@
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = function (d, b) {
-        extendStatics = Object.setPrototypeOf ||
-            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-        return extendStatics(d, b);
-    };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
-import { SGraphyItem } from '@sybotan-web/graphy';
-import { SRect, SPoint } from "@sybotan-web/base";
-import { SColor } from "@sybotan-web/draw";
-/**
- * 坐标点
- *
- */
-var SGraphyPointItem = /** @class */ (function (_super) {
-    __extends(SGraphyPointItem, _super);
-    /**
-     * 构造函数
-     *
-     * @param r          圆半径
-     * @param width      圆线的宽度
-     * @param color      圆线的颜色
-     * @param fillColor  圆填充的颜色
-     * @param parent
-     */
-    function SGraphyPointItem(parent, width, point, color, fillColor) {
-        if (width === void 0) { width = 100; }
-        if (point === void 0) { point = new SPoint(0, 0); }
-        if (color === void 0) { color = new SColor('#F56C6C'); }
-        if (fillColor === void 0) { fillColor = new SColor('#F56C6C'); }
-        var _this = _super.call(this, parent) || this;
-        _this.width = 100;
-        _this.width = width;
-        _this.point = point;
-        _this.color = color;
-        _this.fillColor = fillColor;
-        return _this;
-    } // Constructor()
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    SGraphyPointItem.prototype.boundingRect = function () {
-        var minX = this.point.x;
-        var miny = this.point.y;
-        var maxX = this.point.x + this.width;
-        var maxY = this.point.y + this.width;
-        return new SRect(minX, miny, maxX, maxY);
-    }; // Function boundingRect()
-    /**
-     * Item绘制操作
-     *
-     * @param   painter       painter对象
-     * @param   rect          绘制区域
-     */
-    SGraphyPointItem.prototype.onDraw = function (painter, rect) {
-        painter.pen.color = this.color;
-        painter.brush.color = this.fillColor;
-        painter.drawRect(this.point.x, this.point.y, this.width, this.width);
-    };
-    return SGraphyPointItem;
-}(SGraphyItem)); // Class SGraphyCircleItem
-export default SGraphyPointItem;

+ 0 - 67
src/assets/graphy/SGraphy/newItems/SGraphyPointItem.ts

@@ -1,67 +0,0 @@
-
-import { SGraphyItem } from '@sybotan-web/graphy';
-import { SRect, SSize, SPoint } from "@sybotan-web/base";
-import { SPen, SPainter, SColor } from "@sybotan-web/draw";
-/**
- * 坐标点
- *
- */
-export default class SGraphyPointItem extends SGraphyItem {
-    width: number = 100;
-    point: SPoint;
-    color: SColor;
-    fillColor: SColor;
-
-    /**
-     * 构造函数
-     *
-     * @param r          圆半径
-     * @param width      圆线的宽度
-     * @param color      圆线的颜色
-     * @param fillColor  圆填充的颜色
-     * @param parent    
-     */
-    constructor(
-        parent: SGraphyItem | null,
-        width: number = 100,
-        point: SPoint = new SPoint(0, 0),
-        color: SColor = new SColor('#F56C6C'),
-        fillColor: SColor = new SColor('#F56C6C')
-    ) {
-        super(parent);
-        this.width = width;
-        this.point = point;
-        this.color = color;
-        this.fillColor = fillColor;
-   
-    } // Constructor()
-
-    /**
-     * Item对象边界区域
-     * 
-     * @return SRect
-     */
-    boundingRect(): SRect {
-        let minX = this.point.x;
-        let miny = this.point.y;
-        let maxX = this.point.x + this.width;
-        let maxY = this.point.y + this.width;
-        return new SRect(
-            minX,
-            miny,
-            maxX, maxY
-        );
-    } // Function boundingRect()
-
-    /**
-     * Item绘制操作
-     *
-     * @param   painter       painter对象
-     * @param   rect          绘制区域
-     */
-    onDraw(painter: SPainter, rect?: SRect): void {
-        painter.pen.color = this.color;
-        painter.brush.color = this.fillColor;
-        painter.drawRect(this.point.x,this.point.y,this.width,this.width)
-    }
-} // Class SGraphyCircleItem

+ 0 - 212
src/assets/graphy/SGraphy/newItems/SGraphyPolygonItem.js

@@ -1,212 +0,0 @@
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = function (d, b) {
-        extendStatics = Object.setPrototypeOf ||
-            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-        return extendStatics(d, b);
-    };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
-import { SGraphyItem } from '@sybotan-web/graphy';
-import { SRect, SPoint } from "@sybotan-web/base";
-import { SColor } from "@sybotan-web/draw";
-/**
- * 不规则多边形Item类
- *
- */
-var SGraphyPolygonItem = /** @class */ (function (_super) {
-    __extends(SGraphyPolygonItem, _super);
-    // actived: boolean = false; 				//是否激活
-    /**
-     * 构造函数
-     *
-     * @param pointArr									点坐标list
-     * @param width											边框的宽度
-     * @param color											边框的颜色
-     * @param fillColor   							多边形填充的颜色
-     * @param businessId								空间id
-     * @param businessName							空间名称
-     * @param centerOfGravityPoint			中心点
-     * @param isBusiness								状态
-     * @param parent
-     */
-    function SGraphyPolygonItem(PolygonItemData) {
-        var _this = _super.call(this, PolygonItemData.parent) || this;
-        _this.fillColor = new SColor('#F2F6FC');
-        _this.color = SColor.Black;
-        _this.width = 200;
-        _this.viewText = ''; //绘出的文案
-        _this.isBusiness = 1;
-        _this.cacheColor = SColor.Black; //需要缓存的边框
-        _this.cacheFillColor = new SColor('#F2F6FC'); //需要缓存的填充色
-        _this.cacheWidth = 100;
-        _this.businessType = ''; //类型
-        // 修改绘制路径格式
-        var newSpacePaths = PolygonItemData.space.Paths[0].map(function (item) {
-            return new SPoint(item.X, item.Y);
-        });
-        _this.pointArr = newSpacePaths;
-        // 填充色
-        _this.fillColor = PolygonItemData.space.fillColor ? PolygonItemData.space.fillColor : new SColor('#F2F6FC');
-        // 边框色
-        _this.color = PolygonItemData.space.color ? PolygonItemData.space.color : SColor.Black;
-        //边框宽度
-        _this.width = PolygonItemData.space.width ? PolygonItemData.space.width : 100;
-        //中心点
-        _this.centerOfGravityPoint = {
-            x: PolygonItemData.space.LocationPoint.X,
-            y: -PolygonItemData.space.LocationPoint.Y
-        };
-        //业务空间类型
-        _this.isBusiness = PolygonItemData.space.isBusiness ? PolygonItemData.space.isBusiness : 1;
-        //业务空间id
-        _this.businessId = PolygonItemData.space.businessId ? PolygonItemData.space.businessId : null;
-        //业务空间名称
-        _this.businessName = PolygonItemData.space.Name;
-        _this.initName = PolygonItemData.space.Name;
-        // 空间id
-        _this.id = PolygonItemData.space.id;
-        _this.viewText = PolygonItemData.space.Name;
-        //类型
-        _this.businessType = PolygonItemData.businessType ? PolygonItemData.businessType : '';
-        return _this;
-    }
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    SGraphyPolygonItem.prototype.boundingRect = function () {
-        var minX = this.pointArr[0].x;
-        var maxX = minX;
-        var minY = this.pointArr[0].y;
-        var maxY = minY;
-        for (var i = 1; i < this.pointArr.length; i++) {
-            if (this.pointArr[i].x < minX) {
-                minX = this.pointArr[i].x;
-            }
-            if (this.pointArr[i].y < minY) {
-                minY = this.pointArr[i].y;
-            }
-            if (this.pointArr[i].x > maxX) {
-                maxX = this.pointArr[i].x;
-            }
-            if (this.pointArr[i].y > maxY) {
-                maxY = this.pointArr[i].y;
-            }
-        }
-        return new SRect(minX, minY, maxX - minX, maxY - minY);
-    }; // Function boundingRect()
-    /**
-     * 判断点是否在区域内
-     *
-     * @param x
-     * @param y
-     */
-    SGraphyPolygonItem.prototype.contains = function (x, y) {
-        var nCross = 0, point = [x, y], APoints = this.pointArr, length = APoints.length, p1, p2, i, xinters;
-        p1 = APoints[0];
-        for (i = 1; i <= length; i++) {
-            p2 = APoints[i % length];
-            if (point[0] > Math.min(p1.x, p2.x) &&
-                point[0] <= Math.max(p1.x, p2.x)) {
-                if (point[1] <= Math.max(p1.y, p2.y)) {
-                    if (p1.x != p2.x) {
-                        //计算位置信息
-                        xinters = (point[0] - p1.x) * (p2.y - p1.y) / (p2.x - p1.x) + p1.y;
-                        if (p1.y == p2.y || point[1] <= xinters) {
-                            nCross++;
-                        }
-                    }
-                }
-            }
-            p1 = p2;
-        }
-        return nCross % 2 === 1;
-    };
-    /**
-     *
-     * @param text 修改的文字
-     * @param centerOfGravityPoint 文字的坐标
-     */
-    SGraphyPolygonItem.prototype.addText = function (text, centerOfGravityPoint) {
-        this.viewText = text;
-        if (centerOfGravityPoint) {
-            this.centerOfGravityPoint = centerOfGravityPoint;
-        }
-    };
-    /**
-     * Item绘制操作
-     *
-     * @param   painter       painter对象
-     * @param   rect          绘制区域
-     */
-    SGraphyPolygonItem.prototype.onDraw = function (painter, rect) {
-        if (this.pointArr.length) {
-            painter.pen.color = this.color;
-            painter.brush.color = this.fillColor;
-            painter.pen.lineWidth = this.width;
-            painter.drawPolygon(this.pointArr);
-            // let text = ''
-            // if (this.businessName || this.businessId) {
-            // 	text = '👇   ' + this.businessName
-            // } else {
-            // 	text = '⬇️   ' + this.initName
-            // }
-            painter.font.size = this.scale * 200;
-            painter.brush.color = SColor.Black;
-            // painter.drawText(text,this.centerOfGravityPoint.x,this.centerOfGravityPoint.y)
-            painter.drawText(this.viewText, this.centerOfGravityPoint.x, this.centerOfGravityPoint.y);
-        }
-    };
-    SGraphyPolygonItem.prototype.onClick = function (event) {
-        this.$emit('click', { item: this, event: event });
-        return true;
-    }; // Function onClick()
-    /**
-  * 鼠标双击事件
-  *
-  * @param   event   保存事件参数
-  * @return  boolean
-  */
-    SGraphyPolygonItem.prototype.onDoubleClick = function (event) {
-        this.$emit('doubleClick', event);
-        return true;
-    };
-    /**
-  * 鼠标按下事件
-  *
-  * @param   event   保存事件参数
-  * @return  boolean
-  */
-    SGraphyPolygonItem.prototype.onMouseDown = function (event) {
-        this.$emit('mouseDown', event);
-        return true;
-    }; // Function onMouseDown()
-    /**
-     * 鼠标移动事件
-     *
-     * @param   event   保存事件参数
-     * @return  boolean
-     */
-    SGraphyPolygonItem.prototype.onMouseMove = function (event) {
-        this.$emit('mouseMove', event);
-        return true;
-    }; // Function onMouseMove()
-    /**
-     * 释放鼠标事件
-     *
-     * @param   event   保存事件参数
-     * @return  boolean
-     */
-    SGraphyPolygonItem.prototype.onMouseUp = function (event) {
-        this.$emit('mouseUp', event);
-        return true;
-    };
-    return SGraphyPolygonItem;
-}(SGraphyItem)); // Class SGraphyPolygonItem
-export default SGraphyPolygonItem;

+ 0 - 220
src/assets/graphy/SGraphy/newItems/SGraphyPolygonItem.ts

@@ -1,220 +0,0 @@
-
-import { SGraphyItem, SMouseEvent } from '@sybotan-web/graphy'
-import { SRect, SSize, SPoint } from "@sybotan-web/base";
-import { SPen, SPainter, SColor, SFont } from "@sybotan-web/draw";
-import { dataItemPath, dataItem, dataSpaceItem, dataInterface, PolygonItemInterface } from './../dataType'   //传入参数的参数接口类型
-/**
- * 不规则多边形Item类
- *
- */
-export default class SGraphyPolygonItem extends SGraphyItem {
-	pointArr: SPoint[];
-	fillColor: SColor = new SColor('#F2F6FC');
-	color: SColor = SColor.Black;
-	width: number = 200;
-	businessId: string | null;
-	id: string | null;
-	centerOfGravityPoint: { x: number, y: number };
-	businessName: null | string | undefined;    //业务空间名字
-	initName: null | string | undefined;        //空间名字
-	viewText: string = ''                        //绘出的文案
-	isBusiness: number = 1;
-	cacheColor: SColor = SColor.Black             //需要缓存的边框
-	cacheFillColor: SColor = new SColor('#F2F6FC');        //需要缓存的填充色
-	cacheWidth: number = 100;
-	businessType: string = ''													//类型
-	// actived: boolean = false; 				//是否激活
-	/**
-	 * 构造函数
-	 *
-	 * @param pointArr									点坐标list
-	 * @param width											边框的宽度
-	 * @param color											边框的颜色
-	 * @param fillColor   							多边形填充的颜色 
-	 * @param businessId								空间id
-	 * @param businessName							空间名称
-	 * @param centerOfGravityPoint			中心点
-	 * @param isBusiness								状态
-	 * @param parent    
-	 */
-	constructor(PolygonItemData: PolygonItemInterface) {
-		super(PolygonItemData.parent);
-		// 修改绘制路径格式
-		let newSpacePaths: SPoint[] = PolygonItemData.space.Paths[0].map(item => {
-			return new SPoint(item.X, item.Y)
-		});
-		this.pointArr = newSpacePaths;
-		// 填充色
-		this.fillColor = PolygonItemData.space.fillColor ? PolygonItemData.space.fillColor : new SColor('#F2F6FC');
-		// 边框色
-		this.color = PolygonItemData.space.color ? PolygonItemData.space.color : SColor.Black;
-		//边框宽度
-		this.width = PolygonItemData.space.width ? PolygonItemData.space.width : 100;
-		//中心点
-		this.centerOfGravityPoint = {
-			x: PolygonItemData.space.LocationPoint.X,
-			y: -PolygonItemData.space.LocationPoint.Y
-		};
-		//业务空间类型
-		this.isBusiness = PolygonItemData.space.isBusiness ? PolygonItemData.space.isBusiness : 1;
-		//业务空间id
-		this.businessId = PolygonItemData.space.businessId ? PolygonItemData.space.businessId : null
-		//业务空间名称
-		this.businessName = PolygonItemData.space.Name;
-		this.initName = PolygonItemData.space.Name;
-		// 空间id
-		this.id = PolygonItemData.space.id;
-		this.viewText = PolygonItemData.space.Name;
-		//类型
-		this.businessType = PolygonItemData.businessType ? PolygonItemData.businessType : ''
-	}
-
-	/**
-	 * Item对象边界区域
-	 * 
-	 * @return SRect
-	 */
-	boundingRect(): SRect {
-		let minX = this.pointArr[0].x;
-		let maxX = minX;
-		let minY = this.pointArr[0].y;
-		let maxY = minY;
-		for (let i = 1; i < this.pointArr.length; i++) {
-			if (this.pointArr[i].x < minX) {
-				minX = this.pointArr[i].x
-			}
-			if (this.pointArr[i].y < minY) {
-				minY = this.pointArr[i].y
-			}
-			if (this.pointArr[i].x > maxX) {
-				maxX = this.pointArr[i].x
-			}
-			if (this.pointArr[i].y > maxY) {
-				maxY = this.pointArr[i].y
-			}
-		}
-
-		return new SRect(
-			minX,
-			minY,
-			maxX - minX,
-			maxY - minY
-		);
-	} // Function boundingRect()
-
-	/**
-	 * 判断点是否在区域内
-	 * 
-	 * @param x 
-	 * @param y 
-	 */
-	contains(x: number, y: number): boolean {
-		let nCross = 0,
-			point = [x, y],
-			APoints = this.pointArr,
-			length = APoints.length,
-			p1, p2, i, xinters;
-		p1 = APoints[0];
-		for (i = 1; i <= length; i++) {
-			p2 = APoints[i % length];
-			if (
-				point[0] > Math.min(p1.x, p2.x) &&
-				point[0] <= Math.max(p1.x, p2.x)
-			) {
-				if (point[1] <= Math.max(p1.y, p2.y)) {
-					if (p1.x != p2.x) {
-						//计算位置信息
-						xinters = (point[0] - p1.x) * (p2.y - p1.y) / (p2.x - p1.x) + p1.y;
-						if (p1.y == p2.y || point[1] <= xinters) {
-							nCross++
-						}
-					}
-				}
-			}
-			p1 = p2;
-		}
-		return nCross % 2 === 1
-	}
-	/**
-	 * 
-	 * @param text 修改的文字
-	 * @param centerOfGravityPoint 文字的坐标
-	 */
-	addText(text: string, centerOfGravityPoint?: { x: number, y: number }) {
-		this.viewText = text;
-		if (centerOfGravityPoint) {
-			this.centerOfGravityPoint = centerOfGravityPoint
-		}
-	}
-	/**
-	 * Item绘制操作
-	 *
-	 * @param   painter       painter对象
-	 * @param   rect          绘制区域
-	 */
-	onDraw(painter: SPainter, rect?: SRect): void {
-		if (this.pointArr.length) {
-			painter.pen.color = this.color;
-			painter.brush.color = this.fillColor;
-			painter.pen.lineWidth = this.width;
-			painter.drawPolygon(this.pointArr)
-			// let text = ''
-			// if (this.businessName || this.businessId) {
-			// 	text = '👇   ' + this.businessName
-			// } else {
-			// 	text = '⬇️   ' + this.initName
-			// }
-			painter.font.size = this.scale * 200;
-			painter.brush.color = SColor.Black;
-			// painter.drawText(text,this.centerOfGravityPoint.x,this.centerOfGravityPoint.y)
-			painter.drawText(this.viewText, this.centerOfGravityPoint.x, this.centerOfGravityPoint.y)
-		}
-	}
-	onClick(event: SMouseEvent): boolean {
-		this.$emit('click', { item: this, event: event });
-		return true;
-	} // Function onClick()
-	/**
-  * 鼠标双击事件
-  *
-  * @param   event   保存事件参数
-  * @return  boolean
-  */
-	onDoubleClick(event: SMouseEvent): boolean {
-		this.$emit('doubleClick', event);
-		return true;
-	}
-	/**
-  * 鼠标按下事件
-  *
-  * @param   event   保存事件参数
-  * @return  boolean
-  */
-	onMouseDown(event: SMouseEvent): boolean {
-		this.$emit('mouseDown', event);
-		return true;
-	} // Function onMouseDown()
-
-	/**
-	 * 鼠标移动事件
-	 *
-	 * @param   event   保存事件参数
-	 * @return  boolean
-	 */
-	onMouseMove(event: SMouseEvent): boolean {
-		this.$emit('mouseMove', event);
-		return true;
-	} // Function onMouseMove()
-
-	/**
-	 * 释放鼠标事件
-	 *
-	 * @param   event   保存事件参数
-	 * @return  boolean
-	 */
-	onMouseUp(event: SMouseEvent): boolean {
-		this.$emit('mouseUp', event);
-		return true;
-	}
-
-} // Class SGraphyPolygonItem

+ 0 - 74
src/assets/graphy/SGraphy/newItems/SGraphyRectItem.js

@@ -1,74 +0,0 @@
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = function (d, b) {
-        extendStatics = Object.setPrototypeOf ||
-            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-        return extendStatics(d, b);
-    };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
-import { SGraphyItem } from '@sybotan-web/graphy';
-import { SRect } from "@sybotan-web/base";
-import { SColor } from "@sybotan-web/draw";
-/**
- * 矩形Item类
- *
- */
-var SGraphyRectItem = /** @class */ (function (_super) {
-    __extends(SGraphyRectItem, _super);
-    /**
-     * 构造函数
-     *
-     * @param startX      线的起始x坐标
-   * @param startY      线的起始y坐标
-   * @param width       矩形的宽度
-   * @param height      矩形的宽度
-     * @param color       矩形边框的颜色
-     * @param fillColor   矩形填充的颜色
-     * @param parent
-   * @param isVirtual   是否为虚线
-     */
-    function SGraphyRectItem(parent, startX, startY, width, height, fillColor, color, isVirtual) {
-        if (fillColor === void 0) { fillColor = SColor.White; }
-        if (color === void 0) { color = SColor.Black; }
-        if (isVirtual === void 0) { isVirtual = false; }
-        var _this = _super.call(this, parent) || this;
-        _this.fillColor = SColor.White;
-        _this.color = SColor.Black;
-        _this.isVirtual = false;
-        _this.startX = startX;
-        _this.startY = startY;
-        _this.width = width;
-        _this.height = height;
-        _this.color = color;
-        _this.fillColor = fillColor;
-        _this.isVirtual = isVirtual;
-        return _this;
-    } // Constructor()
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    SGraphyRectItem.prototype.boundingRect = function () {
-        return new SRect(this.startX, this.startY, this.width, this.height);
-    }; // Function boundingRect()
-    /**
-     * Item绘制操作
-     *
-     * @param   painter       painter对象
-     * @param   rect          绘制区域
-     */
-    SGraphyRectItem.prototype.onDraw = function (painter, rect) {
-        // painter.pen = new SPen(this.color, this.width);
-        painter.pen.color = this.color;
-        painter.brush.color = this.fillColor;
-        painter.drawRect(this.startX, this.startY, this.width, this.height);
-    };
-    return SGraphyRectItem;
-}(SGraphyItem)); // Class SGraphyRectItem
-export default SGraphyRectItem;

+ 0 - 76
src/assets/graphy/SGraphy/newItems/SGraphyRectItem.ts

@@ -1,76 +0,0 @@
-
-import { SGraphyItem } from '@sybotan-web/graphy'
-import { SRect, SSize, SPoint } from "@sybotan-web/base";
-import { SPen, SPainter, SColor } from "@sybotan-web/draw";
-
-/**
- * 矩形Item类
- *
- */
-export default class SGraphyRectItem extends SGraphyItem {
-  startX: number;
-  startY: number;
-  width: number;
-  height: number;
-  fillColor: SColor = SColor.White;
-  color: SColor = SColor.Black;
-  isVirtual: boolean = false;
-	/**
-	 * 构造函数
-	 *
-	 * @param startX      线的起始x坐标
-   * @param startY      线的起始y坐标
-   * @param width       矩形的宽度
-   * @param height      矩形的宽度
-	 * @param color       矩形边框的颜色 
-	 * @param fillColor   矩形填充的颜色 
-	 * @param parent    
-   * @param isVirtual   是否为虚线
-	 */
-  constructor(
-    parent: SGraphyItem | null,
-    startX: number,
-    startY: number,
-    width: number,
-    height: number,
-    fillColor: SColor = SColor.White,
-    color: SColor = SColor.Black,
-    isVirtual: boolean = false
-  ) {
-    super(parent);
-    this.startX = startX
-    this.startY = startY
-    this.width = width;
-    this.height = height
-    this.color = color;
-    this.fillColor = fillColor;
-    this.isVirtual = isVirtual;
-  } // Constructor()
-
-	/**
-	 * Item对象边界区域
-	 * 
-	 * @return SRect
-	 */
-  boundingRect(): SRect {
-    return new SRect(
-      this.startX,
-      this.startY,
-      this.width,
-      this.height
-    );
-  } // Function boundingRect()
-
-	/**
-	 * Item绘制操作
-	 *
-	 * @param   painter       painter对象
-	 * @param   rect          绘制区域
-	 */
-  onDraw(painter: SPainter, rect?: SRect): void {
-    // painter.pen = new SPen(this.color, this.width);
-    painter.pen.color = this.color;
-    painter.brush.color = this.fillColor;
-    painter.drawRect(this.startX, this.startY, this.width, this.height)
-  }
-} // Class SGraphyRectItem

+ 0 - 92
src/assets/graphy/SGraphy/newItems/SGraphyWallItem.js

@@ -1,92 +0,0 @@
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = function (d, b) {
-        extendStatics = Object.setPrototypeOf ||
-            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-        return extendStatics(d, b);
-    };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
-import { SGraphyItem } from '@sybotan-web/graphy';
-import { SRect } from "@sybotan-web/base";
-import { SColor } from "@sybotan-web/draw";
-/**
- * 墙Item类
- *
- */
-var SGraphyWallItem = /** @class */ (function (_super) {
-    __extends(SGraphyWallItem, _super);
-    /**
-     * 构造函数
-     *
-     * @param pointArr  		点坐标list
-     * @param isVirtual 		墙类型(实体墙-虚拟墙)
-     * @param color  				墙的颜色
-     * @param fillColor  		墙的填充颜色
-     * @param width   			墙的宽度
-     * @param parent
-     */
-    function SGraphyWallItem(parent, pointArr, isVirtual, fillColor, color, width) {
-        if (isVirtual === void 0) { isVirtual = false; }
-        if (fillColor === void 0) { fillColor = SColor.White; }
-        if (color === void 0) { color = SColor.Black; }
-        if (width === void 0) { width = 1; }
-        var _this = _super.call(this, parent) || this;
-        _this.isVirtual = false;
-        _this.fillColor = SColor.White;
-        _this.color = SColor.Black;
-        _this.width = 1;
-        _this.isVirtual = isVirtual;
-        _this.pointArr = pointArr;
-        _this.color = color;
-        _this.fillColor = fillColor;
-        _this.width = width;
-        return _this;
-    } // Constructor()
-    /**
-     * Item对象边界区域
-     *
-     * @return SRect
-     */
-    SGraphyWallItem.prototype.boundingRect = function () {
-        var minX = this.pointArr[0].x;
-        var maxX = minX;
-        var minY = this.pointArr[0].y;
-        var maxY = minY;
-        for (var i = 1; i < this.pointArr.length; i++) {
-            if (this.pointArr[i].x < minX) {
-                minX = this.pointArr[i].x;
-            }
-            if (this.pointArr[i].y < minY) {
-                minY = this.pointArr[i].y;
-            }
-            if (this.pointArr[i].x > maxX) {
-                maxX = this.pointArr[i].x;
-            }
-            if (this.pointArr[i].y > maxY) {
-                maxY = this.pointArr[i].y;
-            }
-        }
-        return new SRect(minX, minY, maxX - minX, maxY - minY);
-    }; // Function boundingRect()
-    /**
-     * Item绘制操作
-     *
-     * @param   painter       painter对象
-     * @param   rect          绘制区域
-     */
-    SGraphyWallItem.prototype.onDraw = function (painter, rect) {
-        if (this.pointArr.length) {
-            // painter.pen = new SPen(this.color, this.width);
-            painter.pen.color = this.color;
-            painter.brush.color = this.fillColor;
-            painter.drawPolyline(this.pointArr);
-        }
-    };
-    return SGraphyWallItem;
-}(SGraphyItem)); // Class SGraphyPolygonItem
-export default SGraphyWallItem;

+ 0 - 89
src/assets/graphy/SGraphy/newItems/SGraphyWallItem.ts

@@ -1,89 +0,0 @@
-
-import { SGraphyItem } from '@sybotan-web/graphy'
-import { SRect, SSize, SPoint } from "@sybotan-web/base";
-import { SPen, SPainter, SColor } from "@sybotan-web/draw";
-
-/**
- * 墙Item类
- *
- */
-export default class SGraphyWallItem extends SGraphyItem {
-	pointArr: SPoint[];
-	isVirtual: boolean = false;
-	fillColor: SColor = SColor.White;
-	color: SColor = SColor.Black;
-	width: number = 1;
-	/**
-	 * 构造函数
-	 *
-	 * @param pointArr  		点坐标list
-	 * @param isVirtual 		墙类型(实体墙-虚拟墙)
-	 * @param color  				墙的颜色
-	 * @param fillColor  		墙的填充颜色
-	 * @param width   			墙的宽度
-	 * @param parent    
-	 */
-	constructor(
-		parent: SGraphyItem | null,
-		pointArr: SPoint[],
-		isVirtual: boolean = false,
-		fillColor: SColor = SColor.White,
-		color: SColor = SColor.Black,
-		width: number = 1,
-	) {
-		super(parent);
-		this.isVirtual = isVirtual;
-		this.pointArr = pointArr;
-		this.color = color;
-		this.fillColor = fillColor;
-		this.width = width;
-	} // Constructor()
-
-	/**
-	 * Item对象边界区域
-	 * 
-	 * @return SRect
-	 */
-	boundingRect(): SRect {
-		let minX = this.pointArr[0].x;
-		let maxX = minX;
-		let minY = this.pointArr[0].y;
-		let maxY = minY;
-		for (let i = 1; i < this.pointArr.length; i++) {
-			if (this.pointArr[i].x < minX) {
-				minX = this.pointArr[i].x
-			}
-			if (this.pointArr[i].y < minY) {
-				minY = this.pointArr[i].y
-			}
-			if (this.pointArr[i].x > maxX) {
-				maxX = this.pointArr[i].x
-			}
-			if (this.pointArr[i].y > maxY) {
-				maxY = this.pointArr[i].y
-			}
-		}
-
-		return new SRect(
-			minX,
-			minY,
-			maxX - minX,
-			maxY - minY
-		);
-	} // Function boundingRect()
-
-	/**
-	 * Item绘制操作
-	 *
-	 * @param   painter       painter对象
-	 * @param   rect          绘制区域
-	 */
-	onDraw(painter: SPainter, rect?: SRect): void {
-		if (this.pointArr.length) {
-			// painter.pen = new SPen(this.color, this.width);
-			painter.pen.color = this.color;
-			painter.brush.color = this.fillColor;
-			painter.drawPolyline(this.pointArr)
-		}
-	}
-} // Class SGraphyPolygonItem

+ 0 - 40
src/assets/graphy/SGraphy/types/SPoint.js

@@ -1,40 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *               iFHS7.
- *              ;BBMBMBMc                  rZMBMBR              BMB
- *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
- *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
- *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
- *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
- *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
- *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
- *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
- *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
- *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
- *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
- *         i0BM: SWKHKGO  MBDv
- *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2018.  斯伯坦机器人世界
- *              ,  XMW  ..
- *                  r                                                                     All rights reserved.
- *
- * ********************************************************************************************************************
- */
-
-/**
- * 坐标点
- *
- * @author  Andy
- */
-export default class SPoint {
-  /**
-   * 构造函数
-   *
-   * @param   x     X坐标
-   * @param   y     Y坐标
-   */
-  constructor(x, y) {
-    this.x = x
-    this.y = y
-  } // constructor
-} // Class SPoint

+ 0 - 169
src/assets/graphy/SGraphy/types/SRect.js

@@ -1,169 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *               iFHS7.
- *              ;BBMBMBMc                  rZMBMBR              BMB
- *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
- *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
- *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
- *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
- *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
- *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
- *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
- *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
- *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
- *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
- *         i0BM: SWKHKGO  MBDv
- *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2018.  斯伯坦机器人世界
- *              ,  XMW  ..
- *                  r                                                                     All rights reserved.
- *
- * ********************************************************************************************************************
- */
-
-/**
- * 矩形
- *
- * @author  Andy
- */
-export default class SRect {
-  /**
-   * 构造函数
-   *
-   * @param   x       X坐标
-   * @param   y       Y坐标
-   * @param   width   宽度
-   * @param   height  高度
-   */
-  constructor(x = 0, y = 0, width = 0, height = 0) {
-    this._x = x
-    this._y = y
-    this._width = Math.max(width, 0)
-    this._height = Math.max(height, 0)
-  } // constructor
-
-  /**
-   * left属性
-   */
-  get left() {
-    return this._x
-  }
-  set left(value) {
-    this._x = value
-  }
-
-  /**
-   * right属性
-   */
-  get right() {
-    return this._x + this._width
-  }
-  set right(value) {
-    this._width = Math.max(value - this._x, 0)
-  }
-
-  /**
-   * top属性
-   */
-  get top() {
-    return this._y
-  }
-  set top(value) {
-    this._y = value
-  }
-
-  /**
-   * top属性
-   */
-  get bottom() {
-    return this._y + this._height
-  }
-  set bottom(value) {
-    this._height = Math.max(value - this._y, 0)
-  }
-
-  /**
-   * x属性
-   *
-   * @return {*}
-   */
-  get x() {
-    return this._x
-  }
-  set x(value) {
-    this._x = value
-  }
-
-  /**
-   * x属性
-   *
-   * @return {*}
-   */
-  get y() {
-    return this._y
-  }
-  set y(value) {
-    this._y = value
-  }
-
-  /**
-   * width 属性
-   *
-   * @return {number}
-   */
-  get width() {
-    return this._width
-  }
-  set width(value) {
-    this._width = Math.max(value, 0)
-  }
-
-  /**
-   * height 属性
-   * @return {number}
-   */
-  get height() {
-    return this._height
-  }
-  set height(value) {
-    this._height = Math.max(value, 0)
-  }
-
-  /**
-   * 判断矩形空间是否包含点x,y
-   *
-   * @param   x       横坐标(当前item)
-   * @param   y       纵坐标(当前item)
-   * @return  boolean
-   */
-  contains(x, y) {
-    return (x >= this.x && x <= this.right) && (y >= this.top && y <= this.bottom)
-  } // Function contains()
-
-  /**
-   * 调整Rect位置
-   *
-   * @param x
-   * @param y
-   * @return  SRect
-   */
-  adjusted(x, y = null) {
-    if (typeof (x) === 'object') {     // 如果传入的是SPoint对象
-      return new SRect(this.x + x.x, this.y + x.y, this.width, this.height)
-    }
-
-    return new SRect(this.x + x, this.y + y, this.width, this.height)
-  } // Function adjusted()
-
-  /**
-   * 合并rect
-   *
-   * @param   rect
-   */
-  union(rect) {
-    this.left = Math.min(this.left, rect.left)
-    this.top = Math.min(this.top, rect.top)
-    this.right = Math.max(this.right, rect.right)
-    this.bottom = Math.max(this.bottom, rect.bottom)
-  } // Function union()
-} // Class SRect

+ 0 - 25
src/assets/graphy/SGraphy/until/pako.js

@@ -1,25 +0,0 @@
-// import pako from 'pako'
-var pako = require('pako');
-var funcTo = atob;
-console.log(funcTo);
-var pakoObj = {
-    unzip: function unzip(b64Data) {
-        // console.log(b64Data)
-        var strData = funcTo(b64Data);
-        // Convert binary string to character-number array
-        var charData = strData.split('').map(function (x) { return x.charCodeAt(0); });
-        // console.log("charData", charData)
-        // Turn number array into byte-array
-        var binData = new Uint8Array(charData);
-        // // unzip
-        var data = pako.inflate(binData, { to: 'string' });
-        return eval("(" + data + ")");
-    },
-    // 压缩
-    zip: function (str) {
-        //escape(str)  --->压缩前编码,防止中午乱码
-        var binaryString = pako.gzip(escape(str), { to: 'string' });
-        return binaryString;
-    }
-};
-export default pakoObj;

+ 0 - 27
src/assets/graphy/SGraphy/until/pako.ts

@@ -1,27 +0,0 @@
-// import pako from 'pako'
-let pako = require('pako');
-let funcTo = atob
-console.log(funcTo)
-
-const pakoObj = {
-    unzip: function unzip(b64Data:any) {
-        // console.log(b64Data)
-        var strData = funcTo(b64Data);
-        // Convert binary string to character-number array
-        var charData = strData.split('').map(function(x) { return x.charCodeAt(0); });
-        // console.log("charData", charData)
-        // Turn number array into byte-array
-        var binData = new Uint8Array(charData);
-        // // unzip
-        var data = pako.inflate(binData, { to: 'string' });
-        return eval("(" + data + ")");
-    },
-    // 压缩
-    zip: function(str:any) {
-        //escape(str)  --->压缩前编码,防止中午乱码
-        var binaryString = pako.gzip(escape(str), { to: 'string' });
-        return binaryString;
-    }
-}
-
-export default pakoObj

+ 0 - 22
src/assets/graphy/SGraphy/until/tool.js

@@ -1,22 +0,0 @@
-var tools = {
-    changeMap: function (arr, k, name) {
-        var data = arr.map(function (items) {
-            if (items[name] && items[name].length) {
-                items[name].map(function (children) {
-                    if (Array.isArray(children)) {
-                        return children.map(function (res) {
-                            res.Y = res.Y * k;
-                            return res;
-                        });
-                    }
-                    else {
-                        children.Y = children.Y * k;
-                        return children;
-                    }
-                });
-            }
-        });
-        return data;
-    }
-};
-export default tools;

+ 0 - 21
src/assets/graphy/SGraphy/until/tool.ts

@@ -1,21 +0,0 @@
-let tools = {
-    changeMap(arr: any, k: any, name: any) {
-        let data = arr.map((items: any) => {
-            if (items[name] && items[name].length) {
-                items[name].map((children: any) => {
-                    if (Array.isArray(children)) {
-                        return children.map(res => {
-                            res.Y = res.Y * k
-                            return res
-                        })
-                    } else {
-                        children.Y = children.Y * k
-                        return children
-                    }
-                })
-            }
-        })
-        return data
-    }
-}
-export default tools

+ 0 - 14
src/assets/graphy/index.js

@@ -1,14 +0,0 @@
-
-import SGraphyPolygonItem from './SGraphy/newItems/SGraphyPolygonItem.js'
-import SGraphyCircleItem from './SGraphy/items/SGraphyCircleItem'
-import SGraphyImageItem from './SGraphy/items/SGraphyImageItem'
-import SGraphyPillarItems from './SGraphy/items/SGraphyPillarItems'
-import SGraphyTextItems from './SGraphy/items/SGraphyTextItems'
-import SGraphyVirtualItem from './SGraphy/items/SGraphyVirtualItem'
-import mainScene from './SGraphy/mainScene.js'
-import SGraphyRectItem from './SGraphy/newItems/SGraphyRectItem.js' 
-
-import SGraphyView from './SGraphy/SGraphyView';
-import SGraphyScene from './SGraphy/SGraphyScene'
-import SGraphyLineItem from './SGraphy/items/SGraphyLineItem'
-export {SGraphyView,SGraphyScene,SGraphyLineItem,mainScene,SGraphyRectItem, SGraphyPolygonItem, SGraphyCircleItem, SGraphyImageItem, SGraphyPillarItems, SGraphyTextItems, SGraphyVirtualItem }

+ 0 - 70
src/assets/js/items/SGraphyCircleItem.js

@@ -1,70 +0,0 @@
-/**
- * 线条
- */
-import SGraphyItem from '../../node-templete/SGraphy/SGraphyItem'
-import SRect from '../../node-templete/SGraphy/types/SRect';
-
-export default class SGraphyCircleItem extends SGraphyItem {
-    /**
-     * 构造函数
-     * 
-     * @param X  圆中心点X
-     * @param Y  圆中心点Y
-     * @param Radius   圆的半径
-     * 
-     * @param color  线的颜色
-     * @param isVirtual    是否为虚线
-     */
-    constructor(X, Y, color, Radius, isSolid, name, parent = null) {
-        super(parent)
-        this.X = X
-        this.Y = Y
-        this.color = color
-        this.Radius = Radius
-        this.isSolid = isSolid
-        this.minX = this.X - this.Radius
-        this.minY = this.Y - this.Radius
-        this.maxX = this.X + this.Radius
-        this.maxY = this.Y + this.Radius
-        this.sAngle = null || 0
-        this.eAngle = null || 2 * Math.PI
-        this.name = name
-        this.type = 6
-        this.lineWidth = null
-    }
-
-    /**
-     * Item对象边界区域
-     * 
-     * @return SRect
-     */
-    boundingRect() {
-        return new SRect(this.minX, this.minY, this.maxX - this.minX, this.maxY - this.minY)
-    }
-
-    /**
-     * 绘制线条
-     * 
-     * @param canvas 画布
-     * @param rect   绘制区域
-     */
-
-    onDraw(canvas, rect) {
-        canvas.lineWidth = this.lineWidth || 240
-        canvas.strokeStyle = this.color || '#000'
-        canvas.fillStyle = this.color || '#000'
-        canvas.beginPath();
-        canvas.arc(this.X, this.Y, this.Radius, this.sAngle, this.eAngle);
-        if (!!this.isSolid) {
-            canvas.fillStyle = this.color; //填充颜色,默认是黑色
-            canvas.fill(); //画实心圆
-        }
-        canvas.stroke()
-        if (!!this.name) {
-            canvas.font = "oblique small-caps bold " + this.lineWidth * 10 + "px Arial";
-            // canvas.font = "oblique small-caps bold " + 10 + "px Arial";
-            canvas.fillStyle = 'green'
-            canvas.fillText(this.name, this.X, this.Y);
-        }
-    }
-}

+ 0 - 59
src/assets/js/items/SGraphyImageItem.js

@@ -1,59 +0,0 @@
-/**
- * 图片
- * 
- * 
- */
-import SGraphyItem from '../../node-templete/SGraphy/SGraphyItem'
-import SRect from '../../node-templete/SGraphy/types/SRect'
-export default class SGraphyImageItem extends SGraphyItem {
-    /**
-     * 构造函数
-     * 
-     * @param width  图片宽度
-     * @param height  图片高度
-     * @param url    图片url
-     * @param id     point的Id
-     * @param X      图片向x轴的偏移量
-     * @param Y      图片向y轴的偏移量
-     * @param downUrl 图片按下时的url
-     * @param parent  指向父元素
-     */
-    constructor(width, height, url, id, X, Y, downUrl, parent = null) {
-            super(parent)
-            this.width = width
-            this.height = height
-            this.url = url
-            this.id = id
-            this.X = X
-            this.Y = Y
-            this.downUrl = downUrl
-            this.imgFalg = false
-            this.img = new Image()
-            this.img.src = this.url
-            this.img.style.width = this.width
-            this.img.style.height = this.height
-            this.canMove = true
-            this.type = 1
-        } //constructor
-
-    /**
-     * Item对象边界区域
-     *
-     * @return  SRect
-     */
-    boundingRect() {
-            return new SRect(0, 0, this.width * 100, this.height * 100)
-        } // Function boundingRect()
-
-    /**
-     * 绘制图片
-     * 
-     * @param canvas 画布
-     * @param rect   绘制区域
-     */
-    onDraw(canvas, rect) {
-        // canvas.moveTo(this.X, this.Y)
-        // canvas.drawImage(this.img, 0, 0, this.width, this.height, this.X, this.Y, this.width * 100, this.height * 100)
-        canvas.drawImage(this.img, 0, 0, this.width, this.height, 0, 0, this.width * 100, this.height * 100)
-    }
-}

+ 0 - 66
src/assets/js/items/SGraphyLineItem.js

@@ -1,66 +0,0 @@
-/**
- * 线条
- */
-import SGraphyItem from '../../node-templete/SGraphy/SGraphyItem'
-import SRect from '../../node-templete/SGraphy/types/SRect';
-
-export default class SGraphyLineItem extends SGraphyItem {
-    /**
-     * 构造函数
-     * 
-     * @param startX  线的起始x坐标
-     * @param startY  线的起始y坐标
-     * @param endX    线的终止x坐标
-     * @param endY    线的终止y坐标
-     * @param width   线的宽度
-     * 
-     * @param color  线的颜色
-     * @param isVirtual    是否为虚线
-     */
-    constructor(startX, startY, endX, endY, color, width, isVirtual, parent = null) {
-        super(parent)
-        this.startX = startX
-        this.startY = startY
-        this.endX = endX
-        this.endY = endY
-        this.color = color
-        this.width = width
-        this.isVirtual = isVirtual
-        this.minX = Math.min(this.startX, this.endX)
-        this.minY = Math.min(this.startY, this.endY)
-        this.maxX = Math.max(this.startX, this.endX)
-        this.maxY = Math.max(this.startY, this.endY)
-        this.name = null
-        this.type = 2
-        this.lineWidth = null
-    }
-
-    /**
-     * Item对象边界区域
-     * 
-     * @return SRect
-     */
-    boundingRect() {
-        return new SRect(this.minX, this.minY, this.maxX - this.minX, this.maxY - this.minY)
-    }
-
-    /**
-     * 绘制线条
-     * 
-     * @param canvas 画布
-     * @param rect   绘制区域
-     */
-
-    onDraw(canvas, rect) {
-        canvas.lineWidth = this.lineWidth || this.width || 240
-        canvas.strokeStyle = this.color || '#000'
-        if (this.isVirtual) {
-            canvas.setLineDash([100, 80])
-            canvas.strokeStyle = 'green'
-        }
-        canvas.beginPath();
-        canvas.moveTo(this.startX, this.startY)
-        canvas.lineTo(this.endX, this.endY)
-        canvas.stroke()
-    }
-}

+ 0 - 76
src/assets/js/items/SGraphyPillarItems.js

@@ -1,76 +0,0 @@
-/**
- * 不规则多边形,元空间
- */
-import SGraphyItem from '../../node-templete/SGraphy/SGraphyItem'
-import SRect from '../../node-templete/SGraphy/types/SRect';
-
-function getItem(arr, name) {
-    if (arr && arr.length) {
-        return arr.map(item => {
-            return item[name]
-        })
-    } else {
-        return [0]
-    }
-}
-
-
-export default class SGraphyPolygonItem extends SGraphyItem {
-    /**
-     * 
-     * 构造函数
-     * 
-     * @param jsonArr  空间线条数组
-     * @param lineWidth    空间线条的宽度
-     * @param color    空间线条的颜色
-     * @param fillColor  空间的填充颜色
-     * 
-     */
-    constructor(jsonArr, lineWidth, color, fillColor, parent = null) {
-            super(parent)
-            this.jsonArr = jsonArr
-            this.lineWidth = lineWidth
-            this.color = color
-            this.fillColor = fillColor
-            let xArr = getItem(this.jsonArr, 'X')
-            let yArr = getItem(this.jsonArr, 'Y')
-            this.minX = Math.min.apply(null, xArr) || 0
-            this.minY = Math.min.apply(null, yArr) || 0
-            this.width = Math.max.apply(null, xArr) - this.minX || 0
-            this.height = Math.max.apply(null, yArr) - this.minY || 0
-            this.type = 5
-        } //constructor
-
-    /**
-     * Item的边界区域
-     * 
-     * @return SRect
-     */
-    boundingRect() {
-        return new SRect(this.minX, this.minY, this.width, this.height)
-    }
-
-    /**
-     * 绘制不规则多边形
-     * 
-     * @param canvas 画布
-     * @param rect   绘制区域
-     */
-    onDraw(canvas, rect) {
-        if (this.jsonArr && this.jsonArr.length) {
-            canvas.beginPath();
-            canvas.lineWidth = 240
-            canvas.lineCap = 'butt';
-            canvas.strokeStyle = this.color || '#000'
-            canvas.fillStyle = this.fillColor || '#fff'
-            canvas.moveTo(this.jsonArr[0].X, this.jsonArr[0].Y)
-            for (let i = 1; i < this.jsonArr.length; i++) {
-                canvas.lineTo(this.jsonArr[i].X, this.jsonArr[i].Y)
-            }
-            canvas.lineTo(this.jsonArr[0].X, this.jsonArr[0].Y)
-            canvas.closePath()
-            canvas.fill()
-            canvas.stroke()
-        }
-    }
-}

+ 0 - 257
src/assets/js/items/SGraphyPolygonItem.js

@@ -1,257 +0,0 @@
-/**
- * 不规则多边形,元空间
- */
-import SGraphyItem from '../../node-templete/SGraphy/SGraphyItem'
-import SRect from '../../node-templete/SGraphy/types/SRect';
-
-function getItem(arr, name) {
-    if (arr && arr.length) {
-        return arr.map(item => {
-            return item[name]
-        })
-    } else {
-        return [0]
-    }
-}
-
-function changeArr(arr) {
-    if (arr && arr.length) {
-        return arr.map(item => {
-            return [
-                item.X, item.Y
-            ]
-        })
-    } else {
-        return [0]
-    }
-}
-/**
- * 求不规则多边形重点
- * @param {points} 数组,多个点位坐标
- *  
- * @return {x, y} 重点点位坐标
- */
-// function getCenterOfGravityPoint(points) {
-//     let area = 0,
-//         gx = 0,
-//         gy = 0,
-//         i = 1,
-//         px1, px2, py1, py2, temp, length = points.length;
-//     for (i; i <= length; i++) {
-//         px1 = points[(i % length)].X;
-//         px2 = points[(i - 1)].X;
-//         py1 = points[(i % length)].Y;
-//         py2 = points[(i - 1)].Y;
-//         temp = (px1 * py2 - py1 * px2) / 2
-//         area += temp;
-//         gx += temp * (px1 + px2) / 3
-//         gy += temp * (py1 + py2) / 3
-//     }
-
-//     gx = gx / area
-//     gy = gy / area
-
-//     return {
-//         x: gx,
-//         y: gy
-//     }
-// }
-
-
-export default class SGraphyPolygonItem extends SGraphyItem {
-    /**
-     * 
-     * 构造函数
-     * 
-     * @param jsonArr  空间线条数组
-     * @param lineWidth    空间线条的宽度
-     * @param color    空间线条的颜色
-     * @param fillColor  空间的填充颜色
-     * 
-     */
-    constructor(jsonArr, lineWidth, color, fillColor, id, centerOfGravityPoint, name, paths, faceColor, businessColor, isBusiness, parent = null) {
-            super(parent)
-            this.jsonArr = jsonArr
-            this.lineWidth = lineWidth
-            this.color = color
-            this.id = id
-            this.name = name //实际渲染名字
-            this.fillColor = fillColor
-            let xArr = getItem(this.jsonArr, 'X')
-            let yArr = getItem(this.jsonArr, 'Y')
-            this.minX = Math.min.apply(null, xArr) || 0
-            this.maxX = Math.max.apply(null, xArr) || 0
-            this.maxY = Math.max.apply(null, yArr) || 0
-            this.minY = Math.min.apply(null, yArr) || 0
-            this.width = this.maxX - this.minX || 0
-            this.height = this.maxY - this.minY || 0
-            this.type = 3
-            this.businessName = null
-            this.faceColor = faceColor || '#cacaca' //颜色
-            this.businessId = null //业务空间id
-            this.isBusiness = isBusiness || 1 //状态
-            this.businessColor = businessColor || 'rgba(68,161,140,.4)' //业务空间颜色
-            this.businessFaceColor = "#333"
-            this.containsArr = changeArr(this.jsonArr)
-            this.paths = null
-            if (paths && paths.length > 1) {
-                this.paths = paths.map(item => {
-                    if (item && item.length) {
-                        return changeArr(item)
-                    } else {
-                        return undefined
-                    }
-                }).filter(d => d)
-            }
-            this.centerOfGravityPoint = centerOfGravityPoint
-        } //constructor
-
-    /**
-     * Item的边界区域
-     * 
-     * @return SRect
-     */
-    boundingRect() {
-        return new SRect(this.minX, this.minY, this.width, this.height)
-    }
-
-
-    /**
-     * 判断item是否包含点x,y
-     *
-     * @param   x       横坐标(当前item)
-     * @param   y       纵坐标(当前item)
-     *
-     * @return  boolean
-     */
-    contains(x, y) {
-        let falg = false,
-            isFullIn = false //是否在镂空图形内
-        if (this.paths instanceof Array) {
-            for (let i = 1; i < this.paths.length; i++) {
-                if (this.isIn(x, y, this.paths[i])) {
-                    //位置信息在镂空图形内
-                    isFullIn = true
-                    break
-                }
-            }
-            // //如果鼠标在大图形内切在镂空图形中返回false
-            if (this.isIn(x, y, this.containsArr) && isFullIn) {
-                falg = false
-            } else if (this.isIn(x, y, this.containsArr) && !isFullIn) {
-                falg = true
-            } else {
-                falg = this.isIn(x, y, this.containsArr)
-            }
-        } else {
-            falg = this.isIn(x, y, this.containsArr)
-        }
-        return falg
-    }
-
-
-    isIn(x, y, json) {
-        let nCross = 0,
-            point = typeof(x) == 'object' ? [x.x, x.y] : [x, y],
-            APoints = json,
-            length = APoints.length,
-            p1, p2, i, xinters;
-        p1 = APoints[0];
-        for (i = 1; i <= length; i++) {
-            p2 = APoints[i % length];
-            if (
-                point[0] > Math.min(p1[0], p2[0]) &&
-                point[0] <= Math.max(p1[0], p2[0])
-            ) {
-                if (point[1] <= Math.max(p1[1], p2[1])) {
-                    if (p1[0] != p2[0]) {
-                        //计算位置信息
-                        xinters = (point[0] - p1[0]) * (p2[1] - p1[1]) / (p2[0] - p1[0]) + p1[1];
-                        if (p1[1] == p2[1] || point[1] <= xinters) {
-                            nCross++
-                        }
-                    }
-                }
-            }
-            p1 = p2;
-        }
-        if (nCross % 2 == 0) {
-            return false
-        } else {
-            return true
-        }
-
-    }
-
-    /**
-     * 绘制不规则多边形
-     * 
-     * @param canvas 画布
-     * @param rect   绘制区域
-     */
-    onDraw(canvas, rect) {
-        if (this.jsonArr && this.jsonArr.length) {
-            canvas.beginPath();
-            canvas.lineWidth = 220
-            canvas.lineCap = 'butt';
-            if (this.isBusiness == 1) {
-                canvas.strokeStyle = this.color || '#000'
-                canvas.fillStyle = this.fillColor
-            } else if (this.isBusiness == 2) {
-                //已有id 的业务空间
-                canvas.strokeStyle = this.color || '#000'
-                canvas.fillStyle = this.businessColor || '#fff'
-            } else if (this.isBusiness == 3) {
-                //被选择的元空间
-                canvas.strokeStyle = this.color || '#000'
-                canvas.lineWidth = 800
-                canvas.fillStyle = '#1abc9c'
-            } else if (this.isBusiness == 4) {
-                canvas.strokeStyle = 'rgba(251,226,1,.8)' || '#000'
-                canvas.fillStyle = '#fff' || '#fff'
-            } else if (this.isBusiness == 5) {
-                canvas.fillStyle = 'rgba(11,12,12,.2)' || '#fff'
-            } else if (this.isBusiness == 6) {
-                canvas.fillStyle = '#1abc9c'
-                canvas.lineWidth = 800
-                canvas.strokeStyle = 'rgba(68,161,140,.4)' || '#fff'
-            } else if (this.isBusiness == 7) {
-                canvas.strokeStyle = this.color || '#000'
-                canvas.fillStyle = this.businessColor || '#fff'
-            }
-            canvas.moveTo(this.jsonArr[0].X, this.jsonArr[0].Y)
-            for (let i = 1; i < this.jsonArr.length; i++) {
-                canvas.lineTo(this.jsonArr[i].X, this.jsonArr[i].Y)
-            }
-            canvas.lineTo(this.jsonArr[0].X, this.jsonArr[0].Y)
-            canvas.closePath()
-            canvas.fill()
-            canvas.stroke()
-            if (!!this.name) {
-                canvas.font = "normal small-caps bold 500px Arial";
-                if (this.isBusiness == 1) {
-                    canvas.fillStyle = this.faceColor
-                } else if (this.isBusiness == 2) {
-                    canvas.fillStyle = this.businessFaceColor;
-                } else if (this.isBusiness == 3) {
-                    //业务空间异常状态
-                    canvas.fillStyle = '#fff'
-                } else if (this.isBusiness == 4) {
-                    canvas.fillStyle = '#cacaca'
-                } else if (this.isBusiness == 6) {
-                    canvas.fillStyle = '#fff'
-                } else if (this.isBusiness == 7) {
-                    canvas.fillStyle = 'red'
-                }
-                if (!!this.businessName || !!this.businessId) {
-                    name = '👇   ' + this.businessName
-                } else {
-                    name = '⬇️   ' + this.name
-                }
-                canvas.fillText(name, this.centerOfGravityPoint.x, this.centerOfGravityPoint.y);
-                // canvas.fillText(this.name, (this.maxX - this.minX) / 2 + this.minX, (this.maxY - this.minY) / 2 + this.minY);
-            }
-            // canvas.fillText(this.name, this.jsonArr[0].X, this.jsonArr[0].Y);
-        }
-    }
-}

+ 0 - 100
src/assets/js/items/SGraphyRectItem.js

@@ -1,100 +0,0 @@
-/**
- * 线条
- */
-import SGraphyItem from '../../node-templete/SGraphy/SGraphyItem'
-import SRect from '../../node-templete/SGraphy/types/SRect';
-
-export default class SGraphyRectItem extends SGraphyItem {
-    /**
-     * 构造函数
-     * 
-     * @param X  矩形的开始点X
-     * @param Y  矩形的开始点Y
-     * @param width   矩形的宽度
-     * @param height  矩形的高度
-     * 
-     * @param isFill  矩形的是否填充
-     * @param fillColor  矩形的填充色彩
-     * @param text  矩形的文字
-     * @param textSize  矩形的文字大小
-     * @param color  矩形的颜色
-     * @param Tip   提示
-     */
-    constructor(X, Y, width, height, isFill, fillColor, text, textSize, color, Tip, parent = null) {
-        super(parent)
-        this.X = X
-        this.Y = Y
-        this.width = width
-        this.height = height
-        this.isFill = isFill
-        this.fillColor = fillColor
-        this.color = color
-        this.textSize = textSize || 6
-        this.type = 10
-        this.hoverColor = null
-        this.text = text.split(",")
-        this.fontStart = this.X
-        this.Tip = Tip
-    }
-
-    /**
-     * Item对象边界区域
-     * 
-     * @return SRect
-     */
-    boundingRect() {
-        return new SRect(this.X, this.Y, this.width, this.height)
-    }
-
-    /**
-     * 判断item是否包含点x,y
-     *
-     * @param   x       横坐标(当前item)
-     * @param   y       纵坐标(当前item)
-     *
-     * @return  boolean
-     */
-    contains(x) {
-        if (this.X + this.width > x.x && x.x > this.X && this.Y + this.height > x.y && x.y > this.Y) {
-            return true
-        } else {
-            return false
-        }
-    }
-
-    /**
-     * 绘制线条
-     * 
-     * @param canvas 画布
-     * @param rect   绘制区域
-     */
-
-    onDraw(canvas, rect) {
-        canvas.beginPath();
-        canvas.lineWidth = "1";
-        if (this.isFill) {
-            if (!!this.hoverColor) {
-                canvas.fillStyle = this.hoverColor
-            } else {
-                canvas.fillStyle = this.fillColor
-            }
-            canvas.fillRect(this.X, this.Y, this.width, this.height);
-        } else {
-            canvas.rect(this.X, this.Y, this.width, this.height);
-        }
-        canvas.stroke();
-        if (!!this.text && this.text.length <= 1) {
-            canvas.font = this.textSize + "px 宋体";
-            canvas.fillStyle = this.color
-            canvas.fillText(this.text[0], this.fontStart, this.Y + this.height / 2);
-        } else if (!!this.text && this.text.length > 1) {
-            canvas.font = this.textSize + "px 宋体";
-            canvas.fillStyle = this.color
-            for (let i = 0; i < this.text.length; i++) {
-                canvas.fillText(this.text[i], this.fontStart, this.Y + this.height / 2 - this.textSize * i);
-            }
-        } else {
-            return
-        }
-    }
-}

+ 0 - 51
src/assets/js/items/SGraphyTextItems.js

@@ -1,51 +0,0 @@
-/**
- * 线条
- */
-import SGraphyItem from '../../node-templete/SGraphy/SGraphyItem'
-import SRect from '../../node-templete/SGraphy/types/SRect';
-
-export default class SGraphyTextItem extends SGraphyItem {
-    /**
-     * 构造函数
-     * 
-     * @param X  文字的开始点X
-     * @param Y  文字的开始点Y
-     * @param width   文字的宽度
-     * 
-     * @param color  文字的颜色
-     * @param text   文字的文字
-     */
-    constructor(X, Y, width, color, text, falg, font, parent = null) {
-        super(parent)
-        this.X = X
-        this.Y = Y
-        this.lineWidth = width
-        this.color = color
-        this.font = font ? font : "6px 宋体"
-        this.text = falg ? text + '→' : text
-    }
-
-    /**
-     * Item对象边界区域
-     * 
-     * @return SRect
-     */
-    boundingRect() {
-        return new SRect(this.X, this.Y, 0, 0)
-    }
-
-    /**
-     * 绘制线条
-     * 
-     * @param canvas 画布
-     * @param rect   绘制区域
-     */
-
-    onDraw(canvas, rect) {
-        if (!!this.text) {
-            canvas.font = this.font;
-            canvas.fillStyle = this.color
-            canvas.fillText(this.text, this.X, this.Y);
-        }
-    }
-}

+ 0 - 66
src/assets/js/items/SGraphyVirtualItem.js

@@ -1,66 +0,0 @@
-/**
- * 线条
- */
-import SGraphyItem from '../../node-templete/SGraphy/SGraphyItem'
-import SRect from '../../node-templete/SGraphy/types/SRect';
-
-export default class SGraphyLineItem extends SGraphyItem {
-    /**
-     * 构造函数
-     * 
-     * @param startX  线的起始x坐标
-     * @param startY  线的起始y坐标
-     * @param endX    线的终止x坐标
-     * @param endY    线的终止y坐标
-     * @param width   线的宽度
-     * 
-     * @param color  线的颜色
-     * @param isVirtual    是否为虚线
-     * 
-     * @param canMove  移动
-     */
-    constructor(startX, startY, endX, endY, color, width, isVirtual, canMove, parent = null) {
-        super(parent)
-        this.startX = startX
-        this.startY = startY
-        this.endX = endX
-        this.endY = endY
-        this.color = color
-        this.width = width
-        this.isVirtual = isVirtual
-        this.minX = Math.min(this.startX, this.endX)
-        this.minY = Math.min(this.startY, this.endY)
-        this.maxX = Math.max(this.startX, this.endX)
-        this.maxY = Math.max(this.startY, this.endY)
-        this.type = 4
-            // this.canMove = true
-    }
-
-    /**
-     * Item对象边界区域
-     * 
-     * @return SRect
-     */
-    boundingRect() {
-        return new SRect(this.minX, this.minY, (this.maxX - this.minX), (this.maxY - this.minY))
-    }
-
-    /**
-     * 绘制线条
-     * 
-     * @param canvas 画布
-     * @param rect   绘制区域
-     */
-
-    onDraw(canvas, rect) {
-        if (this.isVirtual) {
-            canvas.setLineDash([240, 240])
-        }
-        canvas.lineWidth = 240
-        canvas.strokeStyle = this.color || '#000'
-        canvas.beginPath();
-        canvas.moveTo(this.startX, this.startY)
-        canvas.lineTo(this.endX, this.endY)
-        canvas.stroke()
-    }
-}

+ 0 - 44
src/assets/node-templete/SGraphy/SCanvas.js

@@ -1,44 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *               iFHS7.
- *              ;BBMBMBMc                  rZMBMBR              BMB
- *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
- *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
- *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
- *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
- *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
- *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
- *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
- *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
- *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
- *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
- *         i0BM: SWKHKGO  MBDv
- *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2018.  斯伯坦机器人世界
- *              ,  XMW  ..
- *                  r                                                                     All rights reserved.
- *
- * ********************************************************************************************************************
- */
-
-/**
- * Canvas功能扩展
- *
- * @author  Andy
- */
-Object.assign(CanvasRenderingContext2D.prototype, {
-  /**
-   * 绘制线段
-   *
-   * @param   x0    起点x坐标
-   * @param   y0    起点y坐标
-   * @param   x1    终点x坐标
-   * @param   y1    终点y坐标
-   */
-  drawLine (x0, y0, x1, y1) {
-    this.beginPath()
-    this.moveTo(x0, y0)
-    this.lineTo(x1, y1)
-    this.stroke()
-  } // Function drawLine()
-}) // Class CanvasRenderingContext2D

+ 0 - 30
src/assets/node-templete/SGraphy/SGraphyEnums.js

@@ -1,30 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *               iFHS7.
- *              ;BBMBMBMc                  rZMBMBR              BMB
- *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
- *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
- *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
- *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
- *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
- *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
- *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
- *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
- *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
- *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
- *         i0BM: SWKHKGO  MBDv
- *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2018.  斯伯坦机器人世界
- *              ,  XMW  ..
- *                  r                                                                     All rights reserved.
- *
- * ********************************************************************************************************************
- */
-
-const SGraphyItemFlag = {
-  ItemIsMovable: 1,
-  ItemIsSelectable: 2
-}
-
-if (Object.freeze)
-  Object.freeze(SGraphyItemFlag)

+ 0 - 396
src/assets/node-templete/SGraphy/SGraphyItem.js

@@ -1,396 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *               iFHS7.
- *              ;BBMBMBMc                  rZMBMBR              BMB
- *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
- *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
- *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
- *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
- *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
- *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
- *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
- *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
- *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
- *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
- *         i0BM: SWKHKGO  MBDv
- *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2018.  斯伯坦机器人世界
- *              ,  XMW  ..
- *                  r                                                                     All rights reserved.
- *
- * ********************************************************************************************************************
- */
-import SPoint from './types/SPoint'
-import SRect from './types/SRect'
-import SMouseEvent from './SMouseEvent'
-
-const sortItemZOrder = Symbol('sortItemZOrder')
-const toChildMouseEvent = Symbol('toChildMouseEvent')
-const grabItem = Symbol('grabItem')
-const releaseItem = Symbol('releaseItem')
-
-/**
- * SGraphyItem
- *
- * @author  Andy
- */
-export default class SGraphyItem {
-    /**
-     * 构造函数
-     */
-    constructor(parent) {
-            this.name = 'item'
-            this._scene = null
-            this._parent = parent
-            this.children = []
-
-            /** Z轴顺序 */
-            this.zOrder = 0
-                /** item位置 */
-            this._pos = new SPoint(0, 0)
-                /** 缩放比例 */
-            this._scale = new SPoint(1, 1)
-                /** 是否可见 */
-            this._isVisible = true
-
-            /** 鼠标按下时位置 */
-            this._mouseDownPos = new SPoint(4, 21)
-            this._isMove = false
-            this.canMove = false
-        } // Function constructor()
-
-    // ===================================================================================================================
-    // 属性
-    /** parent属性存值函数 */
-    get parent() {
-        return this._parent
-    }
-    set parent(value) {
-            if (this._parent === value) {
-                return
-            }
-            if (this._parent != null) { // 如果原parent不为空
-                // 将节点从原parent节点中摘除
-                let i = this._parent.children.indexOf(this)
-                this._parent.children.splice(i, 1)
-            }
-            this._parent = value
-
-            if (this._parent != null) { // 如果新parent不为空
-                // 将节点加入到新parent节点中
-                this._parent.children.push(this)
-                this._parent.children.sort(this[sortItemZOrder])
-            }
-            this._parent = value
-        } // Function set Parent()
-
-    /** scene属性 */
-    get scene() {
-        if (this._parent != null) {
-            return this._parent.scene
-        } else {
-            return this._scene
-        }
-    }
-
-    /** pos属性 */
-    get pos() {
-        return this._pos
-    }
-    set pos(value) {
-        this._pos = value
-    }
-
-    /** scale属性 */
-    get scale() {
-        return this._scale
-    }
-    set scale(value) {
-        this._scale = value
-    }
-
-    /** visible属性 */
-    get visible() {
-        return this._isVisible
-    }
-    set visible(value) {
-        this._isVisible = value
-    }
-
-    // ===================================================================================================================
-    // 函数
-    /**
-     * Item对象边界区域
-     *
-     * @return  SRect
-     */
-    boundingRect() {
-            return new SRect(0, 0, 10, 10)
-        } // Function boundingRect()
-
-    /**
-     * Item绘制操作
-     *
-     * @param   canvas        画布对象
-     * @param   rect          绘制区域
-     */
-    onDraw(canvas, rect) {
-            for (let item of this.children) {
-                // 保存画布状态
-                canvas.save()
-                    // item位移到指定位置绘制
-                canvas.translate(item.pos.x, item.pos.y)
-                    // 设置绘制区域
-                    // canvas.clip(item.boundingRect())
-                    // 绘制item
-                item.onDraw(canvas, rect)
-                    // 恢复画布状态
-                canvas.restore()
-            }
-        } // Function onDraw()
-
-    /**
-     * 更新Item
-     */
-    update() {
-            // TODO: PLX
-            // scene?.update()
-        } // Function update()
-
-    /**
-     * 移动item到指定位置
-     *
-     * @param   x           新位置的x坐标
-     * @param   y           新位置的y坐标
-     */
-    moveTo(x, y) {
-            this.pos = new SPoint(x, y)
-        } // moveTo()
-
-    /**
-     * 判断item是否包含点x,y
-     *
-     * @param   x       横坐标(当前item)
-     * @param   y       纵坐标(当前item)
-     *
-     * @return  boolean
-     */
-    contains(x, y) {
-            return this.boundingRect().contains(x - this.pos.x, y - this.pos.y)
-        } // Function contains()
-
-    /**
-     * 获得item的路径节点列表。(该节点被加载到场景中,如果未被加载到场景中,计算会出错)
-     *
-     * @return  *[]
-     */
-    itemPath() {
-            if (this.parent != null) {
-                let list = this.parent.itemPath()
-                list.push(this)
-                return list
-            }
-
-            return [this]
-        } // Function itemPath()
-
-    /**
-     * 将场景中的xy坐标转换成item坐标。(该节点被加载到场景中,如果未被加载到场景中,计算会出错)
-     *
-     * @param   x       场景中的横坐标
-     * @param   y       场景中的纵坐标
-     *
-     * @return  在item中的坐标
-     */
-    mapFromScene(x, y) {
-            let list = this.itemPath()
-            let x0 = x
-            let y0 = y
-            for (let item of list) {
-                x0 = (x0 - item.pos.x) / item.scale.x
-                y0 = (y0 - item.pos.y) / item.scale.y
-            }
-
-            return new SPoint(x0, y0)
-        } // Function mapFromScene()
-
-    /**
-     * 将item中的xy坐标转换成场景坐标。(该节点被加载到场景中,如果未被加载到场景中,计算会出错)
-     *
-     * @param   x       item中的横坐标
-     * @param   y       item中的纵坐标
-     *
-     * @return  在场景中的坐标
-     */
-    mapToScene(x, y) {
-            if (this.parent == null) {
-                return new SPoint(x, y)
-            }
-
-            return this.parent.mapToScene(x * this.scale.x + this.pos.x, y * this.scale.y + this.pos.y)
-        } // Function mapToScene()
-
-    // ===================================================================================================================
-    // 事件
-    /**
-     * 鼠标单击事件
-     *
-     * @param   e   保存事件参数
-     * @return  boolean
-     */
-    onClick(e) {
-            for (let item of this.children) {
-                if (!item.visible) { // 如果项目不可见
-                    continue
-                }
-                let ce = this[toChildMouseEvent](item, e)
-                if (item.contains(e.x, e.y) && item.onClick(ce)) { // 如果点在子项目上且子项目处理了事件
-                    return true
-                }
-            }
-
-            return false
-        } // Function onClick()
-
-    /**
-     * 鼠标双击事件
-     *
-     * @param   e   保存事件参数
-     * @return  boolean
-     */
-    onDbClick(e) {
-            for (let item of this.children) {
-                if (!item.visible) { // 如果项目不可见
-                    continue
-                }
-                let ce = this[toChildMouseEvent](item, e)
-                if (item.contains(e.x, e.y) && item.onDbClick(ce)) { // 如果点在子项目上且子项目处理了事件
-                    return true
-                }
-            }
-
-            return false
-        } // Function onClick()
-
-    /**
-     * 鼠标按下事件
-     *
-     * @param   e   保存事件参数
-     * @return  boolean
-     */
-    onMouseDown(e) {
-            // console.log(e)
-
-            for (let item of this.children) {
-                if (!item.visible) { // 如果项目不可见
-                    continue
-                }
-                let ce = this[toChildMouseEvent](item, e)
-                if (item.contains(e.x, e.y) && item.onMouseDown(ce)) { // 如果点在子项目上且子项目处理了事件
-                    return true
-                }
-            }
-
-            if (this.canMove) {
-                this._mouseDownPos = new SPoint(e.x, e.y)
-                this._isMove = true
-                this[grabItem](this)
-                    // console.log(this.scene.grabItem)
-                return true
-            }
-            return false
-        } // Function onMouseDown()
-
-    /**
-     * 鼠标移动事件
-     *
-     * @param   e   保存事件参数
-     * @return  boolean
-     */
-    onMouseMove(e) {
-            for (let item of this.children) {
-                if (!item.visible) { // 如果项目不可见
-                    continue
-                }
-                let ce = this[toChildMouseEvent](item, e)
-                if (item.contains(e.x, e.y) && item.onMouseMove(ce)) { // 如果点在子项目上且子项目处理了事件
-                    return true
-                }
-            }
-
-            if (e.buttons & SMouseEvent.LEFT_BUTTON && this.canMove && this._isMove) {
-                this.moveTo(this.pos.x + e.x - this._mouseDownPos.x, this.pos.y + e.y - this._mouseDownPos.y)
-            }
-
-            return false
-        } // Function onMouseMove()
-
-    /**
-     * 释放鼠标事件
-     *
-     * @param   e   保存事件参数
-     * @return  boolean
-     */
-    onMouseUp(e) {
-            for (let item of this.children) {
-                if (!item.visible) { // 如果项目不可见
-                    continue
-                }
-                let ce = this[toChildMouseEvent](item, e)
-                if (item.contains(e.x, e.y) && item.onMouseUp(ce)) { // 如果点在子项目上且子项目处理了事件
-                    return true
-                }
-            }
-
-            this._isMove = false
-            this[releaseItem]()
-            return false
-        } // Function onMouseUp()
-
-    // ===================================================================================================================
-    // 私有方法
-    /**
-     * 按ZOrder排序
-     *
-     * @param   a   比较元素1
-     * @param   b   比较元素2
-     * @return {number}
-     */
-    [sortItemZOrder](a, b) {
-        return a.zOrder - b.zOrder
-    } // Function sortItemZOrder()
-
-    /**
-     * 鼠标事件转子对象鼠标事件
-     *
-     * @param   child   子对象e
-     * @param   e       事件参数
-     * @return  {}
-     */
-    [toChildMouseEvent](child, e) {
-        let ce = {...e }
-        ce.x = (e.x - child.pos.x) / child.scale.x
-        ce.y = (e.y - child.pos.y) / child.scale.y
-        return ce
-    } // Function toChildMouseEvent()
-
-    /**
-     * 锁定item
-     *
-     * @param   item    被锁定的item
-     */
-    [grabItem](item) {
-        if (this.scene != null) {
-            this.scene.grabItem = item
-        }
-    } // Function grabItem
-
-    /**
-     * 释放被锁定的item
-     */
-    [releaseItem]() {
-        if (this.scene != null) {
-            this.scene.grabItem = null
-        }
-    } // Function grabItem
-} // Class SGraphyItem

+ 0 - 201
src/assets/node-templete/SGraphy/SGraphyScene.js

@@ -1,201 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *               iFHS7.
- *              ;BBMBMBMc                  rZMBMBR              BMB
- *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
- *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
- *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
- *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
- *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
- *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
- *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
- *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
- *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
- *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
- *         i0BM: SWKHKGO  MBDv
- *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2018.  斯伯坦机器人世界
- *              ,  XMW  ..
- *                  r                                                                     All rights reserved.
- *
- * ********************************************************************************************************************
- */
-
-import SPoint from './types/SPoint'
-import SRect from './types/SRect'
-import SGraphyItem from './SGraphyItem'
-
-const toGrabItemMotionEvent = Symbol('toGrabItemMotionEvent')
-
-/**
- * SGraphy图形引擎场景类
- *
- * @author  Andy
- */
-export default class SGraphyScene {
-    /**
-     * 构造函数
-     */
-    constructor() {
-            this.view = null
-            console.log(this, 'this')
-            this.root = new SGraphyItem(null)
-            this.root._scene = this
-            this.pos = new SPoint(0, 0)
-            this.scale = new SPoint(1, 1)
-            this.grabItem = null
-        } // Function constructor()
-
-    /**
-     * 添加item对象到场景。
-     *
-     * @param   item        添加的对象
-     */
-    addItem(item) {
-            item.parent = this.root
-        } // Function addItem()
-
-    /**
-     * 从场景中移除Item。
-     *
-     * @param   item        被移除的对象
-     */
-    removeItem(item) {
-            item.parent = null
-        } // Function removeItem()
-
-    /**
-     * 绘制场景
-     *
-     * @param   canvas      画布
-     * @param   rect        更新绘制区域
-     */
-    drawScene(canvas, rect) {
-            this.root.onDraw(canvas, rect)
-        } // Function drawScene()
-
-    /**
-     * 绘制背景
-     *
-     * @param   canvas      画布
-     * @param   rect        更新绘制区域
-     */
-    drawBackground(canvas, rect) {
-            // DO NOTHING
-        } // Function drawBackground()
-
-    /**
-     * 绘制前景
-     *
-     * @param   canvas      画布
-     * @param   rect        更新绘制区域
-     */
-    drawForeground(canvas, rect) {
-            // DO NOTHING
-        } // Function drawForeground()
-
-    /**
-     * 返回场景的item边界。即所有item边界的并集。
-     *
-     * @return  SRect
-     */
-    worldRect() {
-            let rect = null
-
-            for (let item of this.root.children) { // 依次取item列中的所有item。将所有item的边界做并焦处理。
-                if (rect == null) {
-                    rect = item.boundingRect().adjusted(item.pos)
-                } else {
-                    rect.union(item.boundingRect().adjusted(item.pos))
-                }
-            }
-
-            return rect
-        } // Function worldsRect()
-
-    /**
-     * 更新
-     */
-    update() {} // Function update()
-        // ===================================================================================================================
-        // 事件
-        /**
-         * 鼠标单击事件
-         *
-         * @param   e   保存事件参数
-         * @return  boolean
-         */
-    onClick(e) {
-            if (this.grabItem != null) {
-                return this.grabItem.onClick(this[toGrabItemMotionEvent](this.grabItem, e))
-            }
-            return this.root.onClick(e)
-        } // onClick
-
-    /**
-     * 鼠标双击事件
-     *
-     * @param   e   保存事件参数
-     * @return  boolean
-     */
-    onDbClick(e) {
-            if (this.grabItem != null) {
-                return this.grabItem.onDbClick(this[toGrabItemMotionEvent](this.grabItem, e))
-            }
-            return this.root.onDbClick(e)
-        } // onClick
-
-    /**
-     * 鼠标按下事件
-     *
-     * @param   e   保存事件参数
-     * @return  boolean
-     */
-    onMouseDown(e) {
-            if (this.grabItem != null) {
-                return this.grabItem.onMouseDown(this[toGrabItemMotionEvent](this.grabItem, e))
-            }
-            return this.root.onMouseDown(e)
-        } // onMouseDown
-
-    /**
-     * 鼠标移动事件
-     *
-     * @param   e   保存事件参数
-     * @return  boolean
-     */
-    onMouseMove(e) {
-            if (this.grabItem != null) {
-                return this.grabItem.onMouseMove(this[toGrabItemMotionEvent](this.grabItem, e))
-            }
-            return this.root.onMouseMove(e)
-        } // onMouseMove
-
-    /**
-     * 释放鼠标事件
-     *
-     * @param   e   保存事件参数
-     * @return  boolean
-     */
-    onMouseUp(e) {
-            if (this.grabItem != null) {
-                return this.grabItem.onMouseUp(this[toGrabItemMotionEvent](this.grabItem, e))
-            }
-            return this.root.onMouseUp(e)
-        } // onMouseUp
-
-    /**
-     * 转换场景事件坐标到指定Item坐标事件
-     *
-     * @param   item        指定的item对象
-     * @param   e           场景事件
-     * @return  {}
-     */
-    [toGrabItemMotionEvent](item, e) {
-        let se = {...e }
-        let p = item.mapFromScene(e.x, e.y)
-        se.x = p.x
-        se.y = p.y
-        return se
-    } // Function toGrabItemMotionEvent()
-} // Class SGraphyScene

+ 0 - 280
src/assets/node-templete/SGraphy/SGraphyView.js

@@ -1,280 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *               iFHS7.
- *              ;BBMBMBMc                  rZMBMBR              BMB
- *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
- *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
- *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
- *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
- *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
- *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
- *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
- *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
- *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
- *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
- *         i0BM: SWKHKGO  MBDv
- *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2018.  斯伯坦机器人世界
- *              ,  XMW  ..
- *                  r                                                                     All rights reserved.
- *
- * ********************************************************************************************************************
- */
-import './SCanvas'
-import SPoint from './types/SPoint'
-import SMouseEvent from './SMouseEvent'
-
-const bindEvent = Symbol('bindEvent')
-const toSceneMotionEvent = Symbol('toSceneMotionEvent')
-    /**
-     * Graphy图形引擎视图类
-     *
-     * @author  Andy
-     */
-export default class SGraphyView {
-    /**
-     * 构造函数
-     *
-     * @param   id    Canvas对象ID
-     */
-    constructor(id, scene) {
-            this.canvasView = document.getElementById(id)
-            this.canvas = this.canvasView.getContext('2d')
-            this[bindEvent](this.canvasView)
-            this.scene = scene
-            this.pos = new SPoint(10, 0)
-            this.scale = 1
-            this.minScale = 0.004
-            this.maxScale = 0.5
-            this._midKeyX = 0
-            this._midKeyY = 0
-            this.wheelZoom = 1.05
-
-            window.requestAnimationFrame(this.onDraw.bind(this))
-        } // Function constructor()
-
-    /**
-     * 绑定canvas事件
-     *
-     * @param   canvas      canvas对象
-     * @private
-     */
-    [bindEvent](canvasView) {
-        canvasView.onclick = this.onClick.bind(this)
-        canvasView.ondblclick = this.onDbClick.bind(this)
-        canvasView.onmousedown = this.onMouseDown.bind(this)
-        canvasView.onmousemove = this.onMouseMove.bind(this)
-        canvasView.onmouseup = this.onMouseUp.bind(this)
-        canvasView.onmousewheel = this.onMouseWheel.bind(this)
-        canvasView.onresize = this.onResize.bind(this)
-    } // Function [bindEvent]()
-
-    /**
-     * 获取canvas的宽度  
-     */
-
-    get width() {
-        return this.canvasView.width
-    }
-
-    get height() {
-        return this.canvasView.height
-    }
-
-    /**
-     * 将场景中的xy坐标转换成视图坐标。
-     *
-     * @param   x       场景中的横坐标
-     * @param   y       场景中的纵坐标
-     *
-     * @return  SPoint
-     */
-    mapFromScene(x, y = null) {
-            if (typeof(x) === 'object') { // 如果传入的是SPoint对象
-                return new SPoint(x.x * this.scale + this.pos.x, x.y * this.scale + this.pos.y)
-            }
-
-            return new SPoint(x * this.scale + this.pos.x, y * this.scale + this.pos.y)
-        } // Function mapFromScene()
-
-    /**
-     * 将item中的xy坐标转换成场景坐标。
-     *
-     * @param   x       item中的横坐标
-     * @param   y       item中的纵坐标
-     * @return  SPoint
-     */
-    mapToScene(x, y = null) {
-            if (typeof(x) === 'object') { // 如果传入的是SPoint对象
-                return new SPoint((x.x - this.pos.x) / this.scale, (x.y - this.pos.y) / this.scale)
-            }
-
-            return new SPoint((x - this.pos.x) / this.scale, (y - this.pos.y) / this.scale)
-        } // Function mapToScene()
-
-    /**
-     * 缩放视图时计算视图的位置与缩放比例
-     *
-     * @param   zoom        缩放比例
-     * @param   x0          缩放计算的中心点X坐标
-     * @param   y0          缩放计算的中心点Y坐标
-     */
-    scaleByPoint(zoom, x0, y0) {
-            let z = zoom
-                /**
-                 * 缩放比例在最小比例和最大比例范围内
-                 */
-            if (this.scale * zoom >= this.maxScale) { // 大于最大缩放比例
-                z = this.maxScale / this.scale
-                this.scale = this.maxScale
-            } else if (this.scale * zoom <= this.minScale) { // 小于最小绽放比例
-                z = this.minScale / this.scale
-                this.scale = this.minScale
-            } else {
-                this.scale *= zoom
-            }
-
-            this.pos.x = x0 - (x0 - this.pos.x) * z
-            this.pos.y = y0 - (y0 - this.pos.y) * z
-
-            // EventBus.getDefault().post(SGraphyViewZoomEvent(this, scale))
-            // EventBus.getDefault().post(SGraphyViewMoveEvent(this, pos.x, pos.y))
-            // return
-        } // Function scaleByPoint()
-        // ===================================================================================================================
-        // 事件
-    onDraw() {
-            this.canvas.save()
-            this.canvas.clearRect(0, 0, this.canvasView.width, this.canvasView.height)
-            this.canvas.restore()
-
-            if (this.scene != null) {
-                // 绘制背景
-                this.canvas.save()
-                this.scene.drawBackground(this.canvas)
-                this.canvas.restore()
-
-                // 绘制场景
-                this.canvas.save()
-                this.canvas.translate(this.pos.x, this.pos.y)
-                this.canvas.scale(this.scale, this.scale)
-                this.scene.drawScene(this.canvas)
-                this.canvas.restore()
-
-                // 绘制前景
-                this.canvas.save()
-                this.scene.drawForeground(this.canvas)
-                this.canvas.restore()
-            }
-
-            window.requestAnimationFrame(this.onDraw.bind(this))
-        } // Function onDraw()
-
-    /**
-     * 鼠标单击事件
-     *
-     * @param   e   保存事件参数
-     */
-    onClick(e) {
-            if (this.scene != null) {
-                let se = this[toSceneMotionEvent](e)
-                this.scene.onClick(se)
-            }
-        } // Function onClick()
-
-    /**
-     * 鼠标双击事件
-     *
-     * @param   e   保存事件参数
-     */
-    onDbClick(e) {
-            if (this.scene != null) {
-                let ce = this[toSceneMotionEvent](e)
-                this.scene.onDbClick(ce)
-            }
-        } // Function onDbClick()
-
-    /**
-     * 鼠标按下事件
-     *
-     * @param   e   保存事件参数
-     */
-    onMouseDown(e) {
-            let se = new SMouseEvent(e)
-            if (se.buttons & SMouseEvent.MIDDLE_BUTTON) { // 如果按下中键
-                this._midKeyX = e.x
-                this._midKeyY = e.y
-            }
-
-            if (this.scene != null) {
-                let ce = this[toSceneMotionEvent](e)
-                this.scene.onMouseDown(ce)
-            }
-        } // Function onMouseDown()
-
-    /**
-     * 鼠标移动事件
-     *
-     * @param   e   保存事件参数
-     */
-    onMouseMove(e) {
-            let se = new SMouseEvent(e)
-            if (se.buttons & SMouseEvent.MIDDLE_BUTTON) { // 如果按下中键,则移动视图
-                this.pos.x += e.x - this._midKeyX
-                this.pos.y += e.y - this._midKeyY
-                this._midKeyX = e.x
-                this._midKeyY = e.y
-                return
-            }
-            if (this.scene != null) {
-                let ce = this[toSceneMotionEvent](e)
-                this.scene.onMouseMove(ce)
-            }
-        } // Function onMouseMove()
-
-    /**
-     * 释放鼠标事件
-     *
-     * @param   e   保存事件参数
-     */
-    onMouseUp(e) {
-            if (this.scene != null) {
-                let ce = this[toSceneMotionEvent](e)
-                this.scene.onMouseUp(ce)
-            }
-        } // Function onMouseUp()
-
-    /**
-     * 鼠标滚轮事件
-     *
-     * @param   e   保存事件参数
-     */
-    onMouseWheel(e) {
-            let se = new SMouseEvent(e)
-            if (e.wheelDelta < 0) {
-                this.scaleByPoint(1 / this.wheelZoom, se.x, se.y)
-            } else {
-                this.scaleByPoint(this.wheelZoom, se.x, se.y)
-            }
-        } // Function onMouseWheel()
-
-    /**
-     * View大小发生变化事件
-     *
-     * @param   e   保存事件参数
-     */
-    onResize(e) {} // Function onResize()
-
-    /**
-     * MotionEvent转场景对象MotionEvent
-     *
-     * @param   e       MotionEvent
-     * @return  子对象MotionEvent
-     */
-    [toSceneMotionEvent](e) {
-        let se = new SMouseEvent(e)
-        se.x = (se.x - this.pos.x) / this.scale
-        se.y = (se.y - this.pos.y) / this.scale
-        return se
-    } // Function toSceneMotionEvent()
-} // Class SGraphyView

+ 0 - 53
src/assets/node-templete/SGraphy/SMouseEvent.js

@@ -1,53 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *               iFHS7.
- *              ;BBMBMBMc                  rZMBMBR              BMB
- *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
- *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
- *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
- *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
- *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
- *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
- *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
- *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
- *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
- *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
- *         i0BM: SWKHKGO  MBDv
- *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2018.  斯伯坦机器人世界
- *              ,  XMW  ..
- *                  r                                                                     All rights reserved.
- *
- * ********************************************************************************************************************
- */
-
-/**
- * 鼠标事件
- *
- * @author  Andy
- */
-export default class SMouseEvent {
-  /**
-   * 构造函数
-   *
-   * @param   e       系统鼠标事件
-   */
-  constructor(e) {
-    let bbox          = e.srcElement.getBoundingClientRect()
-    this.type         = e.type
-    this.x            = e.clientX - bbox.left
-    this.y            = e.clientY - bbox.top
-    this.screenX      = e.screenX
-    this.screenY      = e.screenY
-    this.clientX      = e.clientX
-    this.clientY      = e.clientY
-    this.altKey       = e.altKey
-    this.ctrlKey      = e.ctrlKey
-    this.buttons      = e.buttons
-    this.wheelDelta   = e.wheelDelta
-  } // Function constructor()
-} // Class MouseEvent
-
-SMouseEvent.LEFT_BUTTON   = 0x01
-SMouseEvent.RIGHT_BUTTON  = 0x02
-SMouseEvent.MIDDLE_BUTTON = 0x04

+ 0 - 201
src/assets/node-templete/SGraphy/items/SGraphyClockItem.js

@@ -1,201 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *               iFHS7.
- *              ;BBMBMBMc                  rZMBMBR              BMB
- *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
- *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
- *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
- *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
- *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
- *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
- *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
- *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
- *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
- *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
- *         i0BM: SWKHKGO  MBDv
- *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2018.  斯伯坦机器人世界
- *              ,  XMW  ..
- *                  r                                                                     All rights reserved.
- *
- * ********************************************************************************************************************
- */
-
-import SGraphyItem from '../SGraphyItem'
-import SRect from '../types/SRect'
-
-/** 定义符号,用于定义私有成员变晴儿 */
-const drawScale     = Symbol('drawScale')
-const drawScaleText = Symbol('drawScaleText')
-const drawHour      = Symbol('drawHour')
-const drawMinute    = Symbol('drawMinute')
-const drawSecond    = Symbol('drawSecond')
-
-/**
- * SGraphy引擎时钟Item
- *
- * @author  Andy
- */
-export default class SGraphyClockItem extends SGraphyItem {
-  /**
-   * 构造函数
-   *
-   * @param   parent    指向父对象
-   */
-  constructor(width, height, parent = null) {
-    super(parent)
-    this.name = 'ClockItem'
-    this.width = width
-    this.height = height
-    /** 是否显示刻度 */
-    this.isShowScale = true
-    /** 刻度颜色 */
-    this.scaleColor = '#000'
-    /** 刻度文本颜色 */
-    this.textColor = '#000'
-    /** 时针颜色 */
-    this.hourColor = '#000'
-    /** 分针颜色 */
-    this.minuteColor = '#000'
-    /** 秒针颜色 */
-    this.secondColor = '#F00'
-    /** 是否显示钞针 */
-    this.isShowSecond = true
-    /** 是否平滑移动秒针 */
-    this.isSmooth = true
-    /** 边缘宽度 */
-    this.padding = 100.0
-  } // Function constructor()
-
-  /**
-   * Item对象边界区域
-   *
-   * @return  SRect
-   */
-  boundingRect() {
-    return new SRect(0, 0, this.width / 2, this.height / 2)
-  } // Function boundingRect()
-
-  /**
-   * 时钟半径,只读属性
-   *
-   * @return  number
-   */
-  get radius() {
-    return Math.min(this.width, this.height) / 2.0
-  } // getter radius()
-
-  /**
-   * 绘制时钟
-   *
-   * @param   canvas      画布
-   * @param   rect        绘制区域
-   */
-  onDraw(canvas, rect) {
-    canvas.translate(this.width / 2, this.height / 2)
-    canvas.arc(0, 0, this.radius, 0, 2 * Math.PI)
-    let t = new Date()
-
-    this[drawScale](canvas)
-    this[drawHour](canvas, t.getHours(), t.getMinutes(), t.getSeconds())
-    this[drawMinute](canvas, t.getMinutes(), t.getSeconds())
-    this[drawSecond](canvas, t.getSeconds() + t.getMilliseconds() / 1000.0)
-  } // Function onDraw()
-
-  /**
-   * 绘制刻度
-   *
-   * @param   canvas      画布
-   */
-  [drawScale](canvas) {
-    let scaleLength = Math.max(this.radius / 10.0, 2.0)
-    let scaleLength1 = scaleLength * 1.2
-    let strokeWidth = Math.max(this.radius / 100.0, 2.0)
-    let strokeWidth1 = strokeWidth * 2.0
-
-    canvas.save()
-    canvas.strokeStyle = this.scaleColor
-
-    for (let i = 1; i <= 12; i++) {          // 12小时刻度
-      canvas.lineWidth = strokeWidth1
-      canvas.drawLine(0, -this.radius, 0, -this.radius + scaleLength1)
-
-      if (this.radius >= 40) {              // 如果半度大于40显示分钟刻度
-        canvas.rotate(6 * Math.PI / 180)
-        for (let j = 1; j <= 4; j++) {       // 分钟刻度
-          canvas.lineWidth = strokeWidth
-          canvas.drawLine(0, -this.radius, 0, -this.radius + scaleLength)
-          canvas.rotate(6 * Math.PI / 180)
-        }
-      } else {
-        canvas.rotate(30 * Math.PI / 180)
-      }
-    }
-
-    canvas.restore()
-  } // Function drawScale()
-
-  /**
-   * 绘制刻度数字
-   *
-   * @param   canvas      画布
-   */
-  [drawScaleText](canvas) {
-
-  } // Function drawScaleText()
-
-  /**
-   * 绘制时针
-   *
-   * @param   canvas      画布
-   * @param   hour        时
-   * @param   minute      分
-   * @param   second      秒
-   */
-  [drawHour](canvas, hour, minute, second) {
-    canvas.save()
-    canvas.lineCap = 'round'
-    canvas.lineWidth = Math.max(this.radius / 30.0, 4.0)
-    canvas.strokeStyle = this.hourColor
-    canvas.rotate((hour * 30.0 + minute * 30.0 / 60 + second * 30.0 / 60 / 60) * Math.PI / 180)
-    canvas.drawLine(0, this.radius / 10.0, 0, -this.radius / 2.0)
-    canvas.restore()
-  } // Function drawHour()
-
-  /**
-   * 绘制分针
-   *
-   * @param   canvas      画布
-   * @param   minute      分
-   * @param   second      秒
-   */
-  [drawMinute](canvas, minute, second) {
-    canvas.save()
-    canvas.lineCap = 'round'
-    canvas.lineWidth = Math.max(this.radius / 40.0, 4.0)
-    canvas.strokeStyle = this.minuteColor
-    canvas.rotate((minute * 6 + second * 6 / 60.0) * Math.PI / 180.0)
-    canvas.drawLine(0, this.radius / 10.0, 0, -this.radius * 2.0 / 3.0)
-    canvas.restore()
-  } // Function drawMinute()
-
-  /**
-   * 绘制秒针
-   *
-   * @param   canvas      画布
-   * @param   second      秒
-   */
-  [drawSecond](canvas, second) {
-    canvas.save()
-    canvas.lineCap = 'round'
-    canvas.lineWidth = Math.max(this.radius / 100.0, 3.0)
-    canvas.strokeStyle = this.secondColor
-    canvas.rotate(second * 6 * Math.PI / 180)
-    canvas.drawLine(0, this.radius / 5.0, 0, -this.radius + this.radius / 10.0)
-    // canvas.drawCircle(0, 0, this.radius / 30.0)
-    // canvas.drawCircle(0, -this.radius + this.radius / 5.0, this.radius / 60.0)
-    // canvas.strokeStyle = Color.YELLOW
-    // canvas.drawCircle(0, 0, this.radius / 100.0)
-    canvas.restore()
-  } // Function drawSecond()
-} // Class SGraphyClockItem

+ 0 - 58
src/assets/node-templete/SGraphy/items/SGraphyLineItem.js

@@ -1,58 +0,0 @@
-/**
- * 线条
- */
-import SGraphyItem from '../SGraphyItem'
-import SRect from './../types/SRect';
-
-export default class SGraphyLineItem extends SGraphyItem {
-    /**
-     * 构造函数
-     * 
-     * @param startX  线的起始x坐标
-     * @param startY  线的起始y坐标
-     * @param endX    线的终止x坐标
-     * @param endY    线的终止y坐标
-     * @param width   线的宽度
-     * 
-     * @param color  线的颜色
-     * @param isVirtual    是否为虚线
-     */
-    constructor(startX, startY, endX, endY, color, width, isVirtual, parent = null) {
-        super(parent)
-        this.startX = startX
-        this.startY = startY
-        this.endX = endX
-        this.endY = endY
-        this.color = color
-        this.width = width
-        this.isVirtual = isVirtual
-    }
-
-    /**
-     * Item对象边界区域
-     * 
-     * @return SRect
-     */
-    boundingRect() {
-        return new SRect(0, 0, this.width, this.height)
-    }
-
-    /**
-     * 绘制线条
-     * 
-     * @param canvas 画布
-     * @param rect   绘制区域
-     */
-
-    onDraw(canvas, rect) {
-        if (this.isVirtual) {
-            canvas.setLineDash([15, 5])
-        }
-        canvas.lineWidth = this.width || 1
-        canvas.strokeStyle = this.color || '#000'
-        canvas.beginPath();
-        canvas.moveTo(this.startX, this.startY)
-        canvas.lineTo(this.endX, this.endY)
-        canvas.stroke()
-    }
-}

+ 0 - 57
src/assets/node-templete/SGraphy/items/SGraphyPolygonItem.js

@@ -1,57 +0,0 @@
-/**
- * 不规则多边形,元空间
- */
-import SGraphyItem from '../SGraphyItem'
-import SRect from './../types/SRect';
-
-export default class SGraphyPolygonItem extends SGraphyItem {
-    /**
-     * 
-     * 构造函数
-     * 
-     * @param jsonArr  空间线条数组
-     * @param lineWidth    空间线条的宽度
-     * @param color    空间线条的颜色
-     * @param fillColor  空间的填充颜色
-     * 
-     */
-    constructor(jsonArr, lineWidth, color, fillColor, parent = null) {
-            super(parent)
-            this.jsonArr = jsonArr
-            this.lineWidth = lineWidth
-            this.color = color
-            this.fillColor = fillColor
-        } //constructor
-
-    /**
-     * Item的边界区域
-     * 
-     * @return SRect
-     */
-    boundingRect() {
-        return new SRect(0, 0, this.width, this.height)
-    }
-
-    /**
-     * 绘制不规则多边形
-     * 
-     * @param canvas 画布
-     * @param rect   绘制区域
-     */
-    onDraw(canvas, rect) {
-        if (this.jsonArr && this.jsonArr.length) {
-            canvas.beginPath();
-            canvas.lineWidth = this.lineWidth || 1
-            canvas.strokeStyle = this.color || '#000'
-            canvas.fillStyle = this.fillColor || '#fff'
-            canvas.moveTo(this.jsonArr[0].X / 120 * -1, this.jsonArr[0].Y / 120)
-            for (let i = 1; i < this.jsonArr.length - 1; i++) {
-                canvas.lineTo(this.jsonArr[i].X / 120 * -1, this.jsonArr[i].Y / 120)
-            }
-            canvas.lineTo(this.jsonArr[0].X / 120 * -1, this.jsonArr[0].Y / 120)
-            canvas.closePath()
-            canvas.fill()
-            canvas.stroke()
-        }
-    }
-}

+ 0 - 64
src/assets/node-templete/SGraphy/items/SGraphyRectItem.js

@@ -1,64 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *               iFHS7.
- *              ;BBMBMBMc                  rZMBMBR              BMB
- *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
- *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
- *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
- *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
- *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
- *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
- *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
- *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
- *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
- *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
- *         i0BM: SWKHKGO  MBDv
- *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2018.  斯伯坦机器人世界
- *              ,  XMW  ..
- *                  r                                                                     All rights reserved.
- *
- * ********************************************************************************************************************
- */
-
-import SGraphyItem from '../SGraphyItem'
-import SRect from '../types/SRect'
-
-/**
- * SGraphy引擎时钟Item
- *
- * @author  Andy
- */
-export default class SGraphyRectItem extends SGraphyItem {
-  /**
-   * 构造函数
-   */
-  constructor(width, height, parent) {
-    super(parent)
-    this.name = 'RectItem'
-    this.width = width
-    this.height = height
-    this.style = '#f00'
-    this.canMove = true
-  } // Function constructor()
-
-  /**
-   * Item对象边界区域
-   *
-   * @return  SRect
-   */
-  boundingRect() {
-    return new SRect(0, 0, this.width, this.height)
-  } // Function boundingRect()
-
-  /**
-   * 绘制时钟
-   *
-   * @param   canvas      画布
-   * @param   rect        绘制区域
-   */
-  onDraw(canvas, rect) {
-    canvas.fillStyle = this.style
-    canvas.fillRect(0, 0, this.width, this.height)
-  } // Function onDraw()
-} // Class SGraphyRectItem

+ 0 - 61
src/assets/node-templete/SGraphy/items/SGraphyVirtualItem.js

@@ -1,61 +0,0 @@
-/**
- * 线条
- */
-import SGraphyItem from '../SGraphyItem'
-import SRect from './../types/SRect';
-
-export default class SGraphyLineItem extends SGraphyItem {
-    /**
-     * 构造函数
-     * 
-     * @param startX  线的起始x坐标
-     * @param startY  线的起始y坐标
-     * @param endX    线的终止x坐标
-     * @param endY    线的终止y坐标
-     * @param width   线的宽度
-     * 
-     * @param color  线的颜色
-     * @param isVirtual    是否为虚线
-     * 
-     * @param canMove  移动
-     */
-    constructor(startX, startY, endX, endY, color, width, isVirtual, canMove, parent = null) {
-        super(parent)
-        this.startX = startX
-        this.startY = startY
-        this.endX = endX
-        this.endY = endY
-        this.color = color
-        this.width = width
-        this.isVirtual = isVirtual
-        this.canMove = canMove
-    }
-
-    /**
-     * Item对象边界区域
-     * 
-     * @return SRect
-     */
-    boundingRect() {
-        return new SRect(0, 0, this.width, this.height)
-    }
-
-    /**
-     * 绘制线条
-     * 
-     * @param canvas 画布
-     * @param rect   绘制区域
-     */
-
-    onDraw(canvas, rect) {
-        if (this.isVirtual) {
-            canvas.setLineDash([15, 5])
-        }
-        canvas.lineWidth = this.width || 1
-        canvas.strokeStyle = this.color || '#000'
-        canvas.beginPath();
-        canvas.moveTo(this.startX, this.startY)
-        canvas.lineTo(this.endX, this.endY)
-        canvas.stroke()
-    }
-}

+ 0 - 40
src/assets/node-templete/SGraphy/types/SPoint.js

@@ -1,40 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *               iFHS7.
- *              ;BBMBMBMc                  rZMBMBR              BMB
- *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
- *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
- *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
- *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
- *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
- *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
- *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
- *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
- *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
- *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
- *         i0BM: SWKHKGO  MBDv
- *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2018.  斯伯坦机器人世界
- *              ,  XMW  ..
- *                  r                                                                     All rights reserved.
- *
- * ********************************************************************************************************************
- */
-
-/**
- * 坐标点
- *
- * @author  Andy
- */
-export default class SPoint {
-  /**
-   * 构造函数
-   *
-   * @param   x     X坐标
-   * @param   y     Y坐标
-   */
-  constructor(x, y) {
-    this.x = x
-    this.y = y
-  } // constructor
-} // Class SPoint

+ 0 - 169
src/assets/node-templete/SGraphy/types/SRect.js

@@ -1,169 +0,0 @@
-/*
- * ********************************************************************************************************************
- *
- *               iFHS7.
- *              ;BBMBMBMc                  rZMBMBR              BMB
- *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
- *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
- *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
- *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
- *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
- *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
- *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
- *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
- *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
- *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
- *         i0BM: SWKHKGO  MBDv
- *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2018.  斯伯坦机器人世界
- *              ,  XMW  ..
- *                  r                                                                     All rights reserved.
- *
- * ********************************************************************************************************************
- */
-
-/**
- * 矩形
- *
- * @author  Andy
- */
-export default class SRect {
-  /**
-   * 构造函数
-   *
-   * @param   x       X坐标
-   * @param   y       Y坐标
-   * @param   width   宽度
-   * @param   height  高度
-   */
-  constructor(x = 0, y = 0, width = 0, height = 0) {
-    this._x = x
-    this._y = y
-    this._width = Math.max(width, 0)
-    this._height = Math.max(height, 0)
-  } // constructor
-
-  /**
-   * left属性
-   */
-  get left() {
-    return this._x
-  }
-  set left(value) {
-    this._x = value
-  }
-
-  /**
-   * right属性
-   */
-  get right() {
-    return this._x + this._width
-  }
-  set right(value) {
-    this._width = Math.max(value - this._x, 0)
-  }
-
-  /**
-   * top属性
-   */
-  get top() {
-    return this._y
-  }
-  set top(value) {
-    this._y = value
-  }
-
-  /**
-   * top属性
-   */
-  get bottom() {
-    return this._y + this._height
-  }
-  set bottom(value) {
-    this._height = Math.max(value - this._y, 0)
-  }
-
-  /**
-   * x属性
-   *
-   * @return {*}
-   */
-  get x() {
-    return this._x
-  }
-  set x(value) {
-    this._x = value
-  }
-
-  /**
-   * x属性
-   *
-   * @return {*}
-   */
-  get y() {
-    return this._y
-  }
-  set y(value) {
-    this._y = value
-  }
-
-  /**
-   * width 属性
-   *
-   * @return {number}
-   */
-  get width() {
-    return this._width
-  }
-  set width(value) {
-    this._width = Math.max(value, 0)
-  }
-
-  /**
-   * height 属性
-   * @return {number}
-   */
-  get height() {
-    return this._height
-  }
-  set height(value) {
-    this._height = Math.max(value, 0)
-  }
-
-  /**
-   * 判断矩形空间是否包含点x,y
-   *
-   * @param   x       横坐标(当前item)
-   * @param   y       纵坐标(当前item)
-   * @return  boolean
-   */
-  contains(x, y) {
-    return (x >= this.x && x <= this.right) && (y >= this.top && y <= this.bottom)
-  } // Function contains()
-
-  /**
-   * 调整Rect位置
-   *
-   * @param x
-   * @param y
-   * @return  SRect
-   */
-  adjusted(x, y = null) {
-    if (typeof (x) === 'object') {     // 如果传入的是SPoint对象
-      return new SRect(this.x + x.x, this.y + x.y, this.width, this.height)
-    }
-
-    return new SRect(this.x + x, this.y + y, this.width, this.height)
-  } // Function adjusted()
-
-  /**
-   * 合并rect
-   *
-   * @param   rect
-   */
-  union(rect) {
-    this.left = Math.min(this.left, rect.left)
-    this.top = Math.min(this.top, rect.top)
-    this.right = Math.max(this.right, rect.right)
-    this.bottom = Math.max(this.bottom, rect.bottom)
-  } // Function union()
-} // Class SRect

+ 0 - 9
src/assets/node-templete/index.js

@@ -1,9 +0,0 @@
-import SGraphyView from './SGraphy/SGraphyView'
-import SGraphyScene from './SGraphy/SGraphyScene'
-import SGraphyClockItem from './SGraphy/items/SGraphyClockItem'
-import SGraphyRectItem from './SGraphy/items/SGraphyRectItem'
-// import SGraphyImageItem from './SGraphy/items/SGraphyImageItem'
-import SGraphyLineItem from './SGraphy/items/SGraphyLineItem'
-import SGraphyPolygonItem from './SGraphy/items/SGraphyPolygonItem'
-
-export { SGraphyView, SGraphyScene, SGraphyClockItem, SGraphyRectItem, SGraphyLineItem, SGraphyPolygonItem }

File diff suppressed because it is too large
+ 0 - 1365
src/components/business_space/graphy/business.vue


+ 1 - 1
src/components/ledger/lib/bimDialog.vue

@@ -33,7 +33,7 @@ import noAllDataFloor from './noAllDataFloor'
 import { FloorView, LocationPointScene } from '@saga-web/cad-engine/lib'
 import { SPoint } from '@saga-web/draw/lib'
 import { updateEquip } from '@/api/scan/request'
-import { SGraphyItem } from '@saga-web/graphy/lib'
+import { SGraphItem } from '@saga-web/graph/lib'
 
 export default {
   components: {

+ 1 - 1
src/components/ready/buildfloor/formItems.vue

@@ -74,7 +74,7 @@
             v-model="form[item.path]">
             <template slot="append" v-if="item.unit">{{ item.unit }}</template>
           </el-input>
-          <el-input v-model="form[item.path]" v-else disabled title="暂不支持"></el-input>
+          <el-input v-model="form[item.path]" v-else disabled title="暂不支持" :placeholder="item.inputMode?'':'字典无输入类型'"></el-input>
         </el-form-item>
       </div>
     </el-form>

+ 1 - 1
src/views/business_space/dataUtil/checkJsonUtil.vue

@@ -49,7 +49,7 @@
 </template>
 <script>
 
-import { SGraphyScene } from "@saga-web/graphy/lib/";
+import { SGraphScene } from "@saga-web/graph/lib/";
 import { DivideFloorScene, LocationPointScene } from "@saga-web/cad-engine/lib";
 import { FloorView } from "@saga-web/cad-engine/lib/FloorView";
 export default {

+ 1 - 1
src/views/data_admin/buildGraphy/graphyCanvas-copy.vue

@@ -27,7 +27,7 @@ import { mapGetters, mapActions } from "vuex";
 import {
   updateLocationPoint, //更新点位标签
 } from "@/api/scan/request";
-import { SGraphyView } from "@saga-web/graphy/lib";
+import { SGraphView } from "@saga-web/graph/lib";
 import { LocationPointScene, MarkerItem, SpaceItem } from "@saga-web/cad-engine/lib";
 import { SPoint } from "@saga-web/draw/lib";
 

+ 0 - 59
src/views/data_admin/buildGraphy/utils/LocationPointScene.js

@@ -1,59 +0,0 @@
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = function (d, b) {
-        extendStatics = Object.setPrototypeOf ||
-            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-        return extendStatics(d, b);
-    };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
-import { mainScene } from "@/assets/graphy";
-import { MarkerItem } from './MarkerItem.js';
-/**
- * 位置标签绘制旗子
- *
- * @author haojianlong
- */
-var LocationPointScene = /** @class */ (function (_super) {
-    __extends(LocationPointScene, _super);
-    /**
-     * 构造函数
-     *
-     * @param data
-     */
-    function LocationPointScene(data) {
-        return _super.call(this, data) || this;
-    }
-    /**
-     * 将旗子添加到列表中
-     *
-     * @param flagList 旗子list
-     */
-    LocationPointScene.prototype.addFlagList = function (flagList) {
-        var _this = this;
-        if (flagList && flagList.length) {
-            flagList.map(function (t) {
-                var flag = new MarkerItem(null, t.id, t.name);
-                flag.moveTo(t.X, t.Y);
-                flag.zOrder = 9999999;
-                flag.connect('click', _this, _this.flagClick);
-                _this.addItem(flag);
-            });
-        }
-    };
-    /**
-     * @param item  点击的旗子item
-     * @param event 点击的事件
-     */
-    LocationPointScene.prototype.flagClick = function (item, event) {
-        console.log(this.data);
-        console.log(arguments);
-        alert(1);
-    };
-    return LocationPointScene;
-}(mainScene));
-export { LocationPointScene };

+ 0 - 49
src/views/data_admin/buildGraphy/utils/LocationPointScene.ts

@@ -1,49 +0,0 @@
-import { mainScene } from "@/assets/graphy";
-import { MarkerItem } from './MarkerItem.js'
-import { SGraphyScene, SMouseEvent } from "@sybotan-web/graphy";
-import { dataItemPath, dataItem, dataSpaceItem, dataInterface, PolygonItemInterface, ImgItemInterface } from '@/assets/graphy/SGraphy/dataType.js'   //传入参数的参数接口类型
-
-/**
- * 位置标签绘制旗子
- * 
- * @author haojianlong
- */
-export class LocationPointScene extends mainScene {
-  /** 
-   * 构造函数 
-   * 
-   * @param data
-   */
-  constructor(data: dataInterface | null) {
-    super(data)
-  }
-
-  /**
-   * 将旗子添加到列表中
-   * 
-   * @param flagList 旗子list
-   */
-  addFlagList(flagList: ImgItemInterface[]): void {
-    if (flagList && flagList.length) {
-      flagList.map(t => {
-        let flag = new MarkerItem(null, t.id, t.name);
-        flag.moveTo(t.X, t.Y);
-        flag.zOrder = 9999999;
-        flag.connect('click', this, this.flagClick)
-        this.addItem(flag);
-      })
-    }
-  }
-
-  /**
-   * @param item  点击的旗子item
-   * @param event 点击的事件
-   */
-  flagClick(item: MarkerItem, event: SMouseEvent) {
-    console.log(this.data)
-    console.log(arguments)
-    alert(1)
-  }
-
-
-}

File diff suppressed because it is too large
+ 0 - 71
src/views/data_admin/buildGraphy/utils/MarkerItem.js


File diff suppressed because it is too large
+ 0 - 73
src/views/data_admin/buildGraphy/utils/MarkerItem.ts