Browse Source

Merge branch 'graphEq'

shaun-sheep 4 years ago
parent
commit
fef1fc3eae
87 changed files with 1650 additions and 8727 deletions
  1. 1 1
      config/dev.env.js
  2. 5 5
      package.json
  3. 5 0
      src/api/model/file.js
  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 0
      src/components/business_space/newGraphy/graphy.vue
  66. 21 22
      src/components/data_admin/buildTask/detail/assetsDetail.vue
  67. 1 0
      src/components/data_admin/buildTask/detail/deviceDetail.vue
  68. 2 2
      src/components/ledger/details/detail/exhibitionEnergy.vue
  69. 2 1
      src/components/ledger/details/detail/exhibitionEnergyO.vue
  70. 10 0
      src/components/ledger/handsontables/device.vue
  71. 31 6
      src/components/ledger/lib/bimDialog.vue
  72. 15 5
      src/components/ledger/lib/floorCascader.vue
  73. 31 0
      src/components/ready/buildfloor/backTips.vue
  74. 58 0
      src/components/ready/buildfloor/setScaleDialog.vue
  75. 12 0
      src/router/system.js
  76. 1 1
      src/views/business_space/dataUtil/checkJsonUtil.vue
  77. 3 3
      src/views/data_admin/buildGraphy/graphyCanvas-copy.vue
  78. 0 59
      src/views/data_admin/buildGraphy/utils/LocationPointScene.js
  79. 0 49
      src/views/data_admin/buildGraphy/utils/LocationPointScene.ts
  80. 0 71
      src/views/data_admin/buildGraphy/utils/MarkerItem.js
  81. 0 73
      src/views/data_admin/buildGraphy/utils/MarkerItem.ts
  82. 543 0
      src/views/ledger/facility/batchPoint.vue
  83. 518 508
      src/views/ledger/facility/details/index.vue
  84. 8 9
      src/views/ready/buildfloor/drawGraphy/checkGraphy.vue
  85. 57 27
      src/views/ready/buildfloor/drawGraphy/drawFloor.vue
  86. 3 18
      src/views/ready/buildfloor/index.vue
  87. 322 20
      src/views/ready/buildfloor/repetitionGraphy.vue

+ 1 - 1
config/dev.env.js

@@ -11,7 +11,7 @@ module.exports = merge(prodEnv, {
   // MQTT_SERVICE: '"ws://172.16.42.210:61614/stomp/"' //MQ测试环境地址
   SSO_SERVER: '"http://sso.sagacloud.cn"',  //正式环境
   BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址
-  MQTT_SERVICE: '"ws://adm.sagacloud.cn/stomp/"' //MQ正式环境地址
+ MQTT_SERVICE: '"ws://adm.sagacloud.cn/stomp/"' //MQ正式环境地址
 })
 
 

+ 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",

+ 5 - 0
src/api/model/file.js

@@ -344,4 +344,9 @@ export function modelPathControl(param, success) {
 export function unassignQuery(param, success) {
     let url = `${revitUrl}/task/query`;
     httputils.postJson(url, param, success)
+}
+
+// 根据条件查询统计数量
+export function countModel(params, success) {
+    return httputils.postJson(`${baseUrl}/model-file/count`, params, success)
 }

+ 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 - 0
src/components/business_space/newGraphy/graphy.vue

@@ -363,6 +363,7 @@
       that.scene = new DivideFloorScene();
       that.canvasLoading = true;
       if (this.FloorMap.split('.')[1].toString() == 'png' || this.FloorMap.split('.')[1].toString() == 'jpg') {
+        // 平面图创建业务空间时再改 增加图片偏移量及缩放比例
         that.scene.loadImg(`/image-service/common/image_get?systemId=dataPlatform&key=${this.FloorMap}`, res => {
           this.getGraphtSuc(res)
         })

+ 21 - 22
src/components/data_admin/buildTask/detail/assetsDetail.vue

@@ -14,6 +14,7 @@
           <el-form-item label="资产本地名称:">{{ detail.EquipLocalName || '--' }}</el-form-item>
           <el-form-item label="资产本地编码:">{{ detail.EquipLocalID || '--' }}</el-form-item>
           <el-form-item label="设计图纸中编码:">{{ detail.CADID || '--' }}</el-form-item>
+          <el-form-item label="BIMID:" :title="detail.BIMID">{{ detail.BIMID || '--' }}</el-form-item>
           <el-form-item label="安装位置:">{{ detail.InstallLocation || '--' }}</el-form-item>
           <el-form-item label="生产厂家:">{{ detail.Manufacturer || '--' }}</el-form-item>
           <el-form-item label="型号:">{{ detail.Specification || '--' }}</el-form-item>
@@ -92,29 +93,27 @@
 </template>
 
 <script>
-import { } from "@/api/scan/request"
-import { mapGetters } from "vuex"
-export default {
-  components: {
+  import {mapGetters} from "vuex"
 
-  },
-  created() {
-    let {ConfirmTime, PositivePhotoTime, QrCodeTime, NameplateTime, SidePhotoTime, VideoTime, EquipProblemTime, EquipProblem, TaskPicList} = this.detail;
-    let arr = []
-    QrCodeTime && arr.push({
-      timestamp: QrCodeTime,
-      time: new Date(QrCodeTime).getTime(),
-      content: '黏贴二维码',
-      imgs: TaskPicList.length && TaskPicList.filter(i => i.Name.includes('带二维码的设备近景照片'))
-    })
-    PositivePhotoTime && arr.push({
-      timestamp: PositivePhotoTime,
-      time: new Date(PositivePhotoTime).getTime(),
-      content: '拍摄正面照片',
-      imgs: TaskPicList.length && TaskPicList.filter(i => i.Name.includes('设备正面照片'))
-    })
-    NameplateTime && arr.push({
-      timestamp: NameplateTime,
+  export default {
+    components: {},
+    created() {
+      let {ConfirmTime, PositivePhotoTime, QrCodeTime, NameplateTime, SidePhotoTime, VideoTime, EquipProblemTime, EquipProblem, TaskPicList} = this.detail;
+      let arr = []
+      QrCodeTime && arr.push({
+        timestamp: QrCodeTime,
+        time: new Date(QrCodeTime).getTime(),
+        content: '黏贴二维码',
+        imgs: TaskPicList.length && TaskPicList.filter(i => i.Name.includes('带二维码的设备近景照片'))
+      })
+      PositivePhotoTime && arr.push({
+        timestamp: PositivePhotoTime,
+        time: new Date(PositivePhotoTime).getTime(),
+        content: '拍摄正面照片',
+        imgs: TaskPicList.length && TaskPicList.filter(i => i.Name.includes('设备正面照片'))
+      })
+      NameplateTime && arr.push({
+        timestamp: NameplateTime,
       time: new Date(NameplateTime).getTime(),
       content: '拍摄铭牌照片',
       imgs: TaskPicList.length && TaskPicList.filter(i => i.Name.includes('铭牌照片'))

+ 1 - 0
src/components/data_admin/buildTask/detail/deviceDetail.vue

@@ -16,6 +16,7 @@
           <el-form-item label="设备本地名称:">{{ detail.EquipLocalName || '--' }}</el-form-item>
           <el-form-item label="设备本地编码:">{{ detail.EquipLocalID || '--' }}</el-form-item>
           <el-form-item label="设计图纸中编码:">{{ detail.CADID || '--' }}</el-form-item>
+          <el-form-item label="BIMID:" :title="detail.BIMID">{{ detail.BIMID || '--' }}</el-form-item>
           <el-form-item label="安装位置:">{{ detail.InstallLocation || '--' }}</el-form-item>
           <el-form-item label="生产厂家:">{{ detail.Manufacturer || '--' }}</el-form-item>
           <el-form-item label="型号:">{{ detail.Specification || '--' }}</el-form-item>

+ 2 - 2
src/components/ledger/details/detail/exhibitionEnergy.vue

@@ -6,7 +6,7 @@
         <div class="table-dynamic" v-for="(value,keys,index) in val.paths">
             <div class="table-title"> {{value.InfoPointName}}:</div>
           <p :style="{'color':value.value? '' :'#F56C6C'}">{{value.value? `表号功能号:${value.value} `:'未维护'}}</p>
-          <p v-if="value.data">{{value.data}}{{value.Unit}}</p>
+          <p v-if="value.data !== ''">{{value.data !== '' ? value.data :'--'}} {{value.Unit}}</p>
 <!--          <p v-else-if="value.error">{{value.error}}</p>-->
           <el-popover
             v-else-if="value.error"
@@ -71,7 +71,7 @@
       float: left;
       max-width: 200px;
       width: 100px;
-      height: 85px;
+      height: 60px;
     }
   }
 </style>

+ 2 - 1
src/components/ledger/details/detail/exhibitionEnergyO.vue

@@ -41,6 +41,7 @@
     }
 
     .table-dynamic {
+      overflow: hidden;
       height: 85px;
       width: 100%;
       margin: 5px 0;
@@ -52,7 +53,7 @@
       float: left;
       max-width: 200px;
       width: 100px;
-      height: 85px;
+      height: 95px;
     }
   }
 </style>

+ 10 - 0
src/components/ledger/handsontables/device.vue

@@ -16,6 +16,7 @@
             <!-- <el-button size="small" style='width: 80px;' @click="download" icon="iconfont icon-xiazai">下载</el-button> -->
             <el-button size='small' style='width: 80px;' @click='addDevice'>添加设备</el-button>
             <el-button size='small' @click='Batch' v-show='!onlyRead' :disabled='!(tableData && tableData.length)'>批量维护信息点</el-button>
+            <el-button size='small' @click='handleBatchEquipPoint' v-show='true'>批量维护设备位置</el-button>
             <el-button size='small' style='width: 80px;' @click='reset'>刷新</el-button>
             <el-button size='small' style='width: 80px;' v-show='!onlyRead' @click='undo'>撤销</el-button>
         </div>
@@ -1436,6 +1437,15 @@
             this.firmDataType = 'dialog'
             this.$refs.batchDialogs.batchDialog = true
         },
+        // 批量维护设备位置
+        handleBatchEquipPoint() {
+            let query = {};
+            // 跳转批量维护设备位置页面
+            this.$router.push({
+                name: "BatchPointAssets",
+                params: query
+            })
+        },
         upDataDevice(type, data1, data2) {
             let param = { Content: data1 }
             let param1 = { Content: data2 }

+ 31 - 6
src/components/ledger/lib/bimDialog.vue

@@ -32,7 +32,8 @@
   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'
+  import { SMathUtil } from "@saga-web/cad-engine/lib/utils/SMathUtil"
 
   export default {
     components: {
@@ -67,7 +68,11 @@
             floorToMap: {},
         }
     },
-    created() {},
+    watch:{
+      bimcode:function(n,o){
+        this.init()
+      }
+    },
     mounted() {
         console.log(this.bimcodeobj)
         this.init()
@@ -111,9 +116,20 @@
                     that.getGraphtSuc(res)
                 })
             } else if (type == 3) {
+                let x = 0;
+                let y = 0;
+                let scale = 1;
+                if (this.floorData && this.floorData.Properties) {
+                  x = this.floorData.Properties.X;
+                  y = this.floorData.Properties.Y;
+                  const pro = this.floorData.Properties;
+                  const dis = SMathUtil.pointDistance(pro.Line[0].x, pro.Line[0].y, pro.Line[1].x, pro.Line[1].y)
+                  const proText = pro.Text.substring(0, pro.Text.length - 3);
+                  scale = proText / dis;
+                }
                 that.drawMainScene.loadImg(`/image-service/common/image_get?systemId=dataPlatform&key=${Id}`, (res) => {
                     that.getGraphtSuc(res)
-                })
+                }, x, y, scale)
             }
         },
         // 获取底图成功
@@ -190,8 +206,17 @@
                   FloorId: this.Buildfloor[1],
                   BIMLocation
                 },
-              ],
-              Projection: ['BIMLocation', 'BuildingId', 'FloorId'],
+              ] 
+            }
+            param.Projection = []
+            if(this.Buildfloor[0]){
+                param.Projection .push('BuildingId')
+            }
+            if(this.Buildfloor[1]){
+                param.Projection .push('FloorId')
+            }
+            if(BIMLocation){
+                param.Projection .push('BIMLocation')
             }
             updateEquip(param, (res) => {
               if (res.Result == 'success') {
@@ -219,7 +244,7 @@
       },
       // canvas点击事件
       canvasClick(item, event) {
-        if (item instanceof SGraphyItem) {
+        if (item instanceof SGraphItem) {
           this.clearMark()
           let obj = {
             X: event[0].x,

+ 15 - 5
src/components/ledger/lib/floorCascader.vue

@@ -1,7 +1,7 @@
 <template>
     <div id="buildFloor">
         <span class="buildFloor">建筑楼层</span>
-        <el-cascader placeholder="请选择建筑楼层" :options="options" v-model="value" filterable size="small" :style="isWidth ? '' : 'width:160px;'" @change="changeCascader"></el-cascader>
+        <el-cascader ref="floorCascader" placeholder="请选择建筑楼层" :options="options" v-model="value" filterable size="small" :style="isWidth ? '' : 'width:160px;'" @change="changeCascader"></el-cascader>
     </div>
 </template>
 <script>
@@ -77,7 +77,10 @@
                         "BuildID",
                         "FloorID",
                         "FloorLocalName",
-                        "FloorSequenceID"
+                        "FloorSequenceID",
+                        "StructureInfo",
+                        "Outline",
+                        "Properties"
                     ]
                 }
                 let promise1 = new Promise((resolve, reject) => {
@@ -112,7 +115,10 @@
                                     build.children.push({
                                         value: floor.FloorID,
                                         label: floor.FloorLocalName,
-                                        FloorSequenceID: floor.FloorSequenceID
+                                        FloorSequenceID: floor.FloorSequenceID,
+                                        StructureInfo: floor.StructureInfo || {},
+                                        Outline: floor.Outline || null,
+                                        Properties: floor.Properties || null
                                     })
                                 } else {
                                     build.children = []
@@ -125,7 +131,10 @@
                                     },{
                                         value: floor.FloorID,
                                         label: floor.FloorLocalName,
-                                        FloorSequenceID: floor.FloorSequenceID
+                                        FloorSequenceID: floor.FloorSequenceID,
+                                        StructureInfo: floor.StructureInfo || {},
+                                        Outline: floor.Outline || null,
+                                        Properties: floor.Properties || null
                                     })
                                 }
                             }
@@ -136,7 +145,8 @@
             },
             //改变item
             changeCascader(value) {
-                this.$emit("change", value)
+                let node = this.$refs.floorCascader.getCheckedNodes();
+                this.$emit("change", value, node[0].data);
             }
         }
     };

+ 31 - 0
src/components/ready/buildfloor/backTips.vue

@@ -0,0 +1,31 @@
+<template>
+  <el-dialog title="提示" :visible.sync="dialogVis" width="500px" id="tipsDialog" :close-on-click-modal='false'>
+    <el-row>
+      <div style="line-height:32px;">上传图片未保存,退出后上传图片将失效。是否确认退出?</div>
+    </el-row>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="dialogVis=false">取消</el-button>
+      <el-button size="small" type="primary" @click="confirm">确认</el-button>
+    </span>
+  </el-dialog>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      dialogVis: false,
+      scaleInput: '',
+      item: '', // 当前修改的item
+    }
+  },
+  methods: {
+    showDialog(v) {
+      this.dialogVis = true
+    },
+    confirm() {
+      this.dialogVis = false;
+      this.$emit('back');
+    }
+  }
+}
+</script>

+ 58 - 0
src/components/ready/buildfloor/setScaleDialog.vue

@@ -0,0 +1,58 @@
+<template>
+  <el-dialog title="设定比例尺" :visible.sync="dialogVis" width="500px" id="scaleDialog" :close-on-click-modal='false'>
+    <el-row>
+      <div style="line-height:32px;">设定比例尺长度 : </div>
+      <div style="width:70%">
+        <el-input-number v-model="scaleInput" controls-position="right" :min="0"></el-input-number> mm
+      </div>
+    </el-row>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="dialogVis=false">取消</el-button>
+      <el-button size="small" type="primary" @click="confirm">确认</el-button>
+    </span>
+  </el-dialog>
+</template>
+<script>
+import { createRelationInFloor } from "@/api/scan/request";
+export default {
+  data() {
+    return {
+      dialogVis: false,
+      scaleInput: '',
+      item: '', // 当前修改的item
+    }
+  },
+  methods: {
+    showDialog(v) {
+      this.dialogVis = true
+      this.item = v;
+      this.scaleInput = v.text.substring(0, v.text.length - 3);
+    },
+    confirm() {
+      this.item.text = this.scaleInput + ' mm';
+      this.item.update()
+      this.$emit('textChange', this.scaleInput)
+      this.dialogVis = false
+    }
+  }
+}
+</script>
+<style lang="less" scoped>
+#scaleDialog {
+  .el-row{
+    height: 50px;
+    max-height: 200px;
+    overflow-y: auto;
+    overflow-x: hidden;
+  }
+  .el-row > div {
+    float: left;
+  }
+  .el-row > div + div {
+    margin-left: 10px;
+  }
+  /deep/ .el-input__inner {
+    vertical-align: baseline;
+  }
+}
+</style>

+ 12 - 0
src/router/system.js

@@ -59,6 +59,7 @@ import propertyLedger from '@/views/ledger/property'
 import spacelist from '@/views/ledger/spacelist' //业务空间台账
 import addPropertys from '@/views/ledger/property/addpropertys' //根据未关联资产的设备或部件批量创建设备
 import batchlinkAssets from '@/views/ledger/facility/batchlink' //批量关联资产
+import batchPointAssets from '@/views/ledger/facility/batchPoint' //批量维护设备位置
 import cenotelist from '@/views/ledger/cenotelist' //竖井清单
 import cenoteadd from '@/views/ledger/cenotelist/cenoteadd' //添加竖井
 import spaceadd from '@/views/ledger/spacelist/spaceadd' //添加业务空间
@@ -413,6 +414,17 @@ export default [{
               }, {label: '批量关联资产'}]
             }
           },
+          {
+            path: 'batchPointAssets',
+            name: 'BatchPointAssets',
+            component: batchPointAssets,
+            meta: {keepAlive: false,
+              breadcrumbs: [{label: '台账管理', path: '/ledger/facility'}, {
+                label: '设备台账',
+                path: '/ledger/facility'
+              }, {label: '批量维护设备位置'}]
+            }
+          },
             {
                 path: 'property',
                 name: 'propertyLedger',

+ 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 {

+ 3 - 3
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";
 
@@ -144,7 +144,7 @@ export default {
         this.view.scene.root.children = [];
         this.view = null;
       }
-      this.view = new SGraphyView("canvas");
+      this.view = new SGraphView("canvas");
     },
     // 定位
     locationGraphy(point) {
@@ -218,7 +218,7 @@ export default {
         this.view.scene = null;
         return
       }
-      this.view = new SGraphyView('canvas')
+      this.view = new SGraphView('canvas')
     },
     // 清除默认左右键事件
     disableRightButton() {

+ 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


+ 543 - 0
src/views/ledger/facility/batchPoint.vue

@@ -0,0 +1,543 @@
+<template>
+  	<div id="manageTenantZone">
+		<el-row style="margin:5px 0 0 0;">
+			<el-button style="float:left;" size="small" type="default" icon="el-icon-back" @click="goback"></el-button>
+			<floor-cascader @change="changeFloor"></floor-cascader>
+			<my-cascader ref="cascader" @change="changeDevice"></my-cascader>
+			<!-- <el-button style="float:right;margin-top:1px;">取消</el-button> -->
+			<el-button @click="handleClickSave" style="float:right;margin-top:1px;margin-right:10px;">保存</el-button>
+		</el-row>
+		<el-row class="main-container">
+			<el-row class="main-container-header">
+				<el-select v-model="isPoint" @change="handleChangeIspoint" placeholder="请选择" style="width: 100px;margin-left: 10px;">
+					<el-option v-for="item in isPointOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
+				</el-select>
+				<el-input
+					style="width:250px;margin-left: 10px;"
+					placeholder="请输入设备标识关键字"
+					clearable
+					suffix-icon="el-icon-search"
+					@change="handleChangeKeyword"
+					v-model="keyword"
+				></el-input>
+			</el-row>
+			<el-row class="main-container-box">
+				<el-col :span="3" class="container-box-left">
+					<el-select v-model="showName" placeholder="请选择" style="width: 100%;">
+						<el-option v-for="item in showNameOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
+					</el-select>
+					<div class="equip-list">
+						<el-scrollbar style="height:100%;" v-show="equipList.length">
+							<ul v-infinite-scroll="getEquipData" infinite-scroll-disabled="disabled">
+								<li class="equip-item"
+                                    v-for="item in equipList"
+                                    :class="{'equip-item-selected': item.selected}"
+                                    :key="item.EquipID"
+                                    :title="item[showName]"
+                                    @click="handleSelectIcon(item)"
+                                >
+									<p class="equip-item-text">{{item[showName] || '--'}}</p>
+									<i v-if="item.BIMLocation" class="iconfont icon-hook equip-item-icon" style="color: #67C23A;"></i>
+									<i v-else class="iconfont icon-cross equip-item-icon" style="color: #F56C6C;"></i>
+								</li>
+								<p style="text-align: center;" v-if="loading">加载中...</p>
+								<p style="text-align: center;" v-if="noMore">没有更多了</p>
+							</ul>
+						</el-scrollbar>
+						<div v-show="!equipList.length" class="no-data">
+							<div class="position-icon">
+								<i class="icon-wushuju iconfont"></i>
+								数据暂无
+							</div>
+						</div>
+					</div>
+				</el-col>
+				<el-col id="canvasBox" class="container-box-right" :span="21" v-loading="canvasLoading">
+					<div v-show="showCanvas" style="height: 100%;">
+						<canvas :height="cadHeight" :width="cadWidth" id="floorCanvas" ref="graphy"></canvas>
+					</div>
+					<div class="no-data" v-show="!showCanvas">
+						<div class="position-icon">
+							<i class="icon-wushuju iconfont"></i>
+							数据暂无
+						</div>
+					</div>
+				</el-col>
+			</el-row>
+		</el-row>
+        <el-popover ref='popover' placement='right' trigger='manual' v-model='visible' width='400'>
+            <div style="text-align: right;margin-bottom: 10px;">
+                <span style="float: left;">设定Z轴高度</span>
+                <el-link icon="el-icon-close" :underline="false" @click="visible = false"></el-link>
+            </div>
+            <el-row>
+                <p>距地面高度:{{equipZ}}m</p>
+            </el-row>
+            <div style="padding: 10px 15px;">
+                <el-slider v-model="equipZ" :max="maxHeight" :step="0.0001" show-input></el-slider>
+            </div>
+            <el-row style="text-align: right;">
+                <el-button type="primary" size="mini" @click="visible = false">取消</el-button>
+                <el-button type="primary" size="mini" @click="handleUpdateZ">确认</el-button>
+            </el-row>
+        </el-popover>
+        <span class='popStyle' :style='popoverPosition' v-popover:popover></span>
+  	</div>
+</template>
+<script>
+import floorCascader from "@/components/ledger/lib/floorCascader";
+import myCascader from "@/components/ledger/lib/cascader";
+import { queryEquip, updateEquip } from '@/api/scan/request';
+import { LocationPointScene, FloorView, Opt, SpaceItem, ZoneItem } from "@saga-web/cad-engine/lib";
+import { SPoint } from "@saga-web/draw";
+import { mapGetters } from "vuex";
+import { SMathUtil } from "@saga-web/cad-engine/lib/utils/SMathUtil"
+export default {
+  components: {
+    floorCascader,
+    myCascader
+  },
+  data() {
+    return {
+        visible: false,
+        equipZ: 0,
+        maxHeight: 99,
+        popoverPosition: {
+            top: 0,
+            left: 0,
+        },
+        selectedIcon: null,
+		buildId: "", //建筑Id
+		floorId: "", //楼层Id
+		floorMap: "", //楼层平面图地址
+		floorOutline: null, //楼层平面图蒙版地址
+		classCode: "", //设备类别
+		isPoint: "all", //是否有坐标(全部-all、有坐标-yes、无坐标-no)
+		keyword: "", //设备标识关键字
+		showName: "EquipLocalName", //显示名称
+		isIndeterminate: false, //全选样式显示
+		checkAll: false, //是否全选
+		checkedEquip: [], //选中的设备
+		cadWidth: 800,
+		cadHeight: 800,
+		view: "",
+      	scene: null,
+		showCanvas: false, //是否有底图数据
+		canvasLoading: false,
+		isPointOptions: [{
+          value: "all",
+          label: "全部"
+        }, {
+          value: "yes",
+          label: "有坐标"
+        }, {
+          value: "no",
+          label: "无坐标"
+		}],
+		showNameOptions: [{
+          value: "EquipLocalName",
+          label: "显示设备本地名称"
+        }, {
+          value: "EquipLocalID",
+          label: "显示设备本地编码"
+        }, {
+          value: "CADID",
+          label: "显示图纸编码"
+		}],
+		equipList: [],
+		loading: false,
+		pageNumber: 1,
+		pageSize: 50,
+        total: 0,
+        isChange: false //平面图设备是否更改
+	};
+  },
+  computed: {
+	...mapGetters("layout", ["projectId", "projects"]),
+	noMore () {
+		return this.equipList.length >= this.total
+	},
+	disabled () {
+		return this.loading || this.noMore
+	}
+  },
+  created() {},
+  mounted() {
+    this.cadWidth = document.getElementById('canvasBox').offsetWidth;
+    this.cadHeight = document.getElementById('canvasBox').offsetHeight;
+    // 添加监听点击事件,处理popover显隐
+    window.addEventListener('click', this.handlePopover, false)
+    this.$once('hook:beforeDestroy', () => {
+        window.removeEventListener('click', this.handlePopover)
+    })
+  },
+  methods: {
+    // 返回
+    goback() {
+        this.confirm(() => {
+            this.$router.push({ name: "facilityLedger" });
+        })
+    },
+    // 二次确认
+    confirm(callback) {
+        if (this.isChange) {
+            this.$confirm('平面图数据未保存,此操作将不会保存修改数据!', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                callback();
+            });
+        } else {
+            callback();
+        }
+    },
+    // 点击列表设备
+    handleSelectIcon(equip) {
+        // 选中样式处理
+        this.equipList.forEach(item => {
+            if (equip.EquipID === item.EquipID) {
+                item.selected = true;
+            } else {
+                item.selected = false;
+            }
+        })
+        // 关联平面图设备选中
+        if (this.scene) {
+            this.scene.iconList.forEach(item => {
+                if (item.data.id === equip.EquipID) {
+                    this.scene.selectContainer.setItem(item);
+                }
+            })
+        }
+    },
+    handleClickIcon(item, events) {
+        const e = events[0];
+        this.selectedIcon = item;
+        if (item.data.Z) {
+            this.equipZ = (item.data.Z / 1000);
+        } else {
+            this.equipZ = 0;
+        }
+        this.visible = false
+        this.$nextTick(() =>{
+            this.popoverPosition.top = `${e.clientY}px`;
+            this.popoverPosition.left = `${e.clientX}px`;
+            this.visible = true;
+        })
+    },
+    // 修改设备Z坐标
+    handleUpdateZ() {
+        if (this.selectedIcon.data.Z !== this.equipZ * 1000) {
+            this.selectedIcon.data.Z = this.equipZ * 1000;
+            this.isChange = true;
+            this.visible = false;
+        }
+    },
+    listChange(item, ev) {
+        if (!ev[0].length) {
+            this.visible = false;
+            this.selectedIcon = null;
+        }
+    },
+    /**
+     * @description 处理popover显隐
+     * 当点击位置不在canvas内部时 ( 如点击 页面空白,图例,楼层,设备设施左侧列表项时),将visible置为false,隐藏popover
+     */
+    handlePopover(e) {
+        this.$nextTick(() => {
+            if (!this.$refs.graphy.contains(e.target)) {
+                this.visible = false
+            }
+        })
+    },
+	//获取所以主体数据---用于维护信息
+	getEquipData() {
+		if (this.classCode && this.floorId && (this.floorId != "noKnow" || this.floorId != "all")) {
+			this.loading = true;
+			let params = {
+				Filters: `category='${this.classCode}'`,
+				PageSize: this.pageSize,
+				Orders: 'createTime desc, EquipID desc',
+				PageNumber: this.pageNumber,
+				Projection: ['Category', 'EquipLocalName', 'EquipLocalID', 'EquipID', 'BIMID', 'CADID', 'LocationJson', 'BIMLocation'],
+			}
+			if (this.buildId == 'noKnow') {
+				params.Filters += `;buildingId isNull`
+			} else if (this.buildId && this.buildId != 'all') {
+				params.Filters += `;buildingId='${this.buildId}'`
+			}
+
+			if (this.floorId == 'noKnow') {
+				params.Filters += `;floorId isNull`
+			} else if (this.floorId && this.floorId != 'all') {
+				params.Filters += `;floorId='${this.floorId}'`
+			}
+
+			if (this.isPoint == "yes") {
+				params.Filters += `;not BIMLocation isNull`
+			} else if (this.isPoint == "no") {
+				params.Filters += `;BIMLocation isNull`
+			}
+
+			if (this.keyword) {
+				params.Filters += `;EquipLocalName contain'${this.keyword}' or EquipLocalID contain '${this.keyword}' or CADID contain '${this.keyword}'`
+			}
+
+			queryEquip(params, (res) => {
+				this.equipList = this.equipList.concat(res.Content.map(item => {item.selected = false; return item;}));
+				if (this.view && this.view.scene) {
+					res.Content.forEach(item =>{
+						if (item.LocationJson && item.LocationJson.X && item.LocationJson.Y) {
+                            this.scene.addIconText({
+                                id: item.EquipID,
+                                X: item.LocationJson.X, 
+                                Y: -item.LocationJson.Y, 
+                                Z: item.LocationJson.Z,
+                                text: [`${item.EquipLocalName || '--'}\n${item.EquipLocalID || '--'}\n${item.LocationJson.Y || '--'}`]
+                            });
+						}
+                    });
+                    this.scene.iconMove(this, this.iconMove);
+                    this.scene.iconClick(this, this.handleClickIcon);
+					this.view.update();
+				}
+				this.total = res.Total;
+				if (!this.noMore) { //判断是否有更多数据
+					this.pageNumber++;
+				}
+				this.loading = false;
+			})
+		}
+    },
+    //设备移动回调
+    iconMove(item) {
+        this.isChange = true;
+    },
+	//初始化条件并查询设备
+	initParams() {
+		this.pageNumber = 1;
+		this.total = 0;
+		this.equipList = [];
+        this.clearIcon();
+        if (this.view) {
+            this.view.update();
+        }
+		this.getEquipData();
+	},
+    //修改楼层
+    changeFloor(value, data) {
+        this.floorData = data;
+		this.showCanvas = false;
+		this.clearGraphy();
+		if (value[0]) {
+			this.buildId = value[0];
+		}
+		if (value[1]) {
+			this.floorId = value[1];
+		} else {
+			this.floorId = "";
+		}
+		if (data.StructureInfo && data.StructureInfo.FloorMap) {
+			this.floorMap = data.StructureInfo.FloorMap;
+			this.showCanvas = true;
+			this.getGraphy();
+		} else {
+			this.initParams();
+			this.floorMap = "";
+        }
+        if (data.StructureInfo && data.StructureInfo.Height) {
+            this.maxHeight = data.StructureInfo.Height;
+        } else {
+            this.maxHeight = 99;
+        }
+		if (data.Outline && data.Outline.length) {
+			this.floorOutline = data.Outline;
+		} else {
+			this.floorOutline = null;
+		}
+	},
+    //修改设备族
+    changeDevice(value) {
+		if (value.code) {
+			this.classCode = value.code;
+		} else {
+			this.classCode = "";
+		}
+		this.initParams();
+	},
+	//切换是否有坐标
+	handleChangeIspoint() {
+		this.initParams();
+	},
+	//检索关键字
+	handleChangeKeyword() {
+		this.initParams();
+    },
+    // 保存数据
+    handleClickSave() {
+        if (this.scene && this.scene.iconList.length) {
+            let param = {Content: []}
+            this.scene.iconList.map((item) => {
+                if (item.data.id && item.data.Z) {
+                    param.Content.push({
+                        EquipID: item.data.id,
+                        BIMLocation: `${item.x},${-item.y},${item.data.Z}`
+                    })
+                }
+            })
+            updateEquip(param, () => {
+                this.$message({message: '保存成功!', type: 'success'});
+            })
+        }
+    },
+	// 获取底图
+    getGraphy() {
+      this.scene = new LocationPointScene();
+      this.scene.selectContainer.connect('listChange', this, this.listChange)
+	  this.canvasLoading = true;
+      if (this.floorMap.split('.')[1].toString() == 'png' || this.floorMap.split('.')[1].toString() == 'jpg') {
+        let x = 0;
+        let y = 0;
+        let scale = 1;
+        if (this.floorData && this.floorData.Properties) {
+            x = this.floorData.Properties.X;
+            y = this.floorData.Properties.Y;
+            const pro = this.floorData.Properties;
+            const dis = SMathUtil.pointDistance(pro.Line[0].x, pro.Line[0].y, pro.Line[1].x, pro.Line[1].y)
+            const proText = pro.Text.substring(0, pro.Text.length - 3);
+            scale = proText / dis;
+        }
+        this.scene.loadImg(`/image-service/common/image_get?systemId=dataPlatform&key=${this.floorMap}`, res => {
+          this.getGraphtSuc(res)
+        }, x, y, scale)
+      } else {
+        this.scene.loadUrl(`/image-service/common/file_get?systemId=revit&key=${this.floorMap}`).then(res => {
+          this.getGraphtSuc(res)
+        })
+      }
+	},
+	getGraphtSuc(res) {
+	  this.initParams();
+      this.canvasLoading = false;
+      if (res == 'error') {
+        this.FloorMap = '';
+        this.$message.warning('数据解析异常');
+        return;
+      }
+      this.view.scene = this.scene;
+      // 蒙版
+      if (this.floorOutline) {
+        let newArr = this.floorOutline.map(t => {
+          return new SPoint(t.X, t.Y);
+        })
+        this.scene.addSceneMark(newArr)
+      }
+	  this.scene.isSpaceSelectable = false;
+	  this.view.fitSceneToView();
+    //   this.view.minScale = this.view.scale;
+    //   if (this.$refs.canvasFun) {
+    //     this.$refs.canvasFun.everyScale = this.view.scale;
+	//   }
+    },
+	//清空平面图
+    clearGraphy() {
+      if (this.view) {
+        this.view.scene = null;
+        return
+	  }
+      this.view = new FloorView("floorCanvas");
+	},
+	//清空标记
+	clearIcon() {
+        if (this.scene)
+        this.scene.clearIcon();
+	},
+  },
+  watch: {
+    projectId() {
+      this.$router.push({ name: "facilityLedger" });
+    }
+  }
+};
+</script>
+<style lang="less" scoped>
+@normal-border-color: #e4e4e4;
+@normal-border-active-color: #e8e8e8;
+#manageTenantZone {
+  position: relative;
+  height: 100%;
+  .main-container {
+    margin-top: 10px;
+    background: #fff;
+    border: 1px solid @normal-border-color;
+    height: calc(100% - 53px);
+	overflow: hidden;
+	.main-container-header {
+		padding: 10px 0;
+		border-bottom: 1px solid @normal-border-color;
+	}
+	.main-container-box {
+		height: calc(100% - 53px);
+		.container-box-left {
+			height: 100%;
+			border-right: 1px solid @normal-border-color;
+			/deep/ .el-input__inner {
+				border: none;
+				border-bottom: 1px solid #DCDFE6;
+				border-radius: 0;
+			}
+			.equip-list {
+				height: calc(100% - 32px);
+				/deep/ .el-scrollbar__wrap {
+					overflow-x: hidden;
+				}
+				.equip-item {
+					padding-left: 15px;
+					padding-right: 10px;
+					width: 100%;
+					height: 32px;
+					line-height: 32px;
+					box-sizing: border-box;
+					cursor: pointer;
+					.equip-item-text {
+						display: inline-block;
+						width: calc(100% - 20px);
+						overflow: hidden;
+						white-space: nowrap;
+						text-overflow: ellipsis;
+					}
+					.equip-item-icon {
+						float: right;
+					}
+                }
+                .equip-item-selected {
+                    background-color: #f5f7fa;
+                }
+				.equip-item:hover {
+					background-color: #f5f7fa;
+				}
+			}
+		}
+		.container-box-right {
+			height: 100%;
+		}
+	}
+  }
+  .popStyle {
+    position: fixed;
+  }
+}
+.no-data {
+	height: 100%;
+	text-align: center;
+	box-sizing: border-box;
+	position: relative;
+	.position-icon {
+		position: absolute;
+		top: 50%;
+		left: 50%;
+		transform: translate(-50%, -50%);
+	}
+}
+</style>

File diff suppressed because it is too large
+ 518 - 508
src/views/ledger/facility/details/index.vue


+ 8 - 9
src/views/ready/buildfloor/drawGraphy/checkGraphy.vue

@@ -1,5 +1,5 @@
 <template>
-    <el-dialog id='checkGraphy' title='添加平面图' :visible.sync='checkGraphyVisible' width='900px' @close='handleClose'>
+    <el-dialog id='checkGraphy' title='添加平面图' :visible.sync='checkGraphyVisible' width='500px' @close='handleClose'>
         <div class='bodys'>
             <el-cascader
                 :options='options'
@@ -10,17 +10,16 @@
                 placeholder='请选择模型文件'
                 v-model='casVal'
             ></el-cascader>
-            <span>
-                &nbsp;&nbsp;或&nbsp;&nbsp;
+            <!-- <span v-else>
                 <el-upload class='upload-demo' action='string' :http-request='uploadAndSubmit' :show-file-list='false'>
                     <el-button type>上传图片</el-button>
                 </el-upload>
                 <span>(支持jpg,png格式)</span>
-            </span>
+            </span> -->
             <!-- 展示框 -->
-            <div class='showBox'>
+            <!-- <div class='showBox'>
                 <drawFloor ref='drawFloorDialog' :showTools='false' :id='0' :dialog='true'></drawFloor>
-            </div>
+            </div> -->
         </div>
         <span slot='footer' class='dialog-footer'>
             <el-button @click='handleClose'>取 消</el-button>
@@ -67,7 +66,7 @@ export default {
         handleClose() {
             this.checkGraphyVisible = false
             this.casVal = []
-            this.$refs.drawFloorDialog.clearGraphy()
+            // this.$refs.drawFloorDialog.clearGraphy()
         },
         //上传图片
         uploadAndSubmit(item) {
@@ -98,7 +97,7 @@ export default {
                             if (xhr.status == 200) {
                                 vm.key = uploadKey + '.' + type
                                 vm.jsonKey = ''
-                                vm.$refs.drawFloorDialog.initGraphy(vm.key, 3)
+                                // vm.$refs.drawFloorDialog.initGraphy(vm.key, 3)
                                 //vm.$emit("getKey", file.uid + '.' + type, vm.keyName);
                             }
                         }
@@ -144,7 +143,7 @@ export default {
         },
         // 点击多级联动
         handleChange(val) {
-            this.$refs.drawFloorDialog.initGraphy(val[1], 1)
+            // this.$refs.drawFloorDialog.initGraphy(val[1], 1)
             this.jsonKey = val[1]
             this.key = ''
         },

+ 57 - 27
src/views/ready/buildfloor/drawGraphy/drawFloor.vue

@@ -2,7 +2,7 @@
   <div :id="`drawFloor${id}`" class="drawFloor" v-loading="canvasLoading">
     <canvas :id="`floorCanvas${id}`" :width="cadWidth" :height="cadHeight" ref="canvas" tabindex="0"></canvas>
     <div class="operate" v-if="showTools">
-      <canvasFun @fit="fit" @savePng="savePng" @saveSvg="saveSvg" @divide="divide" @clearDivide="clearDivide" @undo="undo" @redo="redo" @scale="scale"
+      <canvasFun @fit="fit" @savePng="savePng" @saveSvg="saveSvg" @divide="divide" @clearDivide="clearDivide" @scale="scale"
         @changeAbsorb="changeAbsorb" :config="config" ref="canvasFun" @saveJson="saveJson"></canvasFun>
     </div>
   </div>
@@ -12,7 +12,8 @@
 import { DivideFloorScene, FloorView, Opt } from "@saga-web/cad-engine/lib"
 import { SColor, SPoint } from "@saga-web/draw/lib";
 import canvasFun from "@/components/business_space/newGraphy/canvasFun"
-import { floorQueryOutline } from "@/api/scan/request";
+import { floorQueryOutline, floorQueryAndSign } from "@/api/scan/request";
+import { EditLineItem } from "@saga-web/cad-engine"
 import { mapGetters } from "vuex";
 export default {
   components: {
@@ -26,7 +27,6 @@ export default {
       cadWidth: 800,
       cadHeight: 600,
       canvasLoading: false,
-      modelId: '',
       FloorID: '',
       Outline: [],
       floorData: {},
@@ -34,7 +34,10 @@ export default {
         isEdit: false,
         divide: true
       },
-      shadeList: []
+      shadeList: [],
+      type: 1, // 当前图展示类型
+      scaleItem: null, // 比例尺item
+      urlModelId: '', // url中传入的modelid
     };
   },
   props: {
@@ -62,6 +65,7 @@ export default {
   },
   created() {
     this.FloorID = this.$route.query.FloorID;
+    this.urlModelId = this.$route.query.modelId
     Opt.sceneMarkColor = new SColor('#00000080');
     if (!this.dialog) {
       this.init();
@@ -80,8 +84,9 @@ export default {
     initGraphy(Id, type) {
       // type=1 => id:模型id
       // type=2 => id:floormap
+      // type=3 => id:图片的key
       let that = this;
-      that.modelId = Id;
+      that.type = type;
       that.clearGraphy()
       that.drawMainScene = new DivideFloorScene();
       that.canvasLoading = true;
@@ -89,17 +94,15 @@ export default {
         that.drawMainScene.getFloorData('/modelapi/base-graph/query', { ModelId: Id }).then(res => {
           that.getGraphtSuc(res)
         })
-      } else if(type==2){
+      } else if (type == 2) {
         that.drawMainScene.loadUrl(`/image-service/common/file_get?systemId=revit&key=${Id}`).then(res => {
           that.getGraphtSuc(res)
         })
-      }else if(type==3){
-        that.drawMainScene.loadImg(`/image-service/common/image_get?systemId=dataPlatform&key=${Id}`, res=>{
-        // fdfd
+      } else if (type == 3) {
+        that.drawMainScene.loadImg(`/image-service/common/image_get?systemId=dataPlatform&key=${Id}`, res => {
           that.getGraphtSuc(res)
-      })
+        })
       }
-
     },
     // 获取底图成功
     getGraphtSuc(res) {
@@ -118,6 +121,18 @@ export default {
       this.view.fitSceneToView();
       this.drawMainScene.isSpaceSelectable = false;
 
+      if (this.type == 3) {
+        this.addScaleItem(this.floorData.Properties)
+        this.$emit('getGraphSuc');
+        if (this.floorData.Properties) {
+          const x = this.floorData.Properties.X;
+          const y = this.floorData.Properties.Y;
+          if (x != 0 || y != 0) {
+            this.drawMainScene.imgList[0].moveTo(x, y);
+          }
+        }
+      }
+
       if (this.$refs.canvasFun) {
         this.view.minScale = this.view.scale;
         this.$refs.canvasFun.everyScale = this.view.scale;
@@ -134,16 +149,25 @@ export default {
       let pa = {
         Filters: `FloorID='${this.FloorID}'`
       }
-      floorQueryOutline(pa, res => {
-        this.floorData = res.Content[0];
-        this.getOtherFloorOutLine();
-        let floorMap = this.floorData.StructureInfo.FloorMap
-        if(floorMap.split('.')[1].toString() == 'png' || floorMap.split('.')[1].toString() == 'jpg'){
-           this.initGraphy(floorMap, 3)
-        }else{
-           this.initGraphy(floorMap, 2)
-        }
-      })
+      const temp = this.urlModelId.split('.')[1]
+      if (temp == 'png' || temp == 'jpg') { //底图为图片且已经绑定过图片
+        floorQueryAndSign(pa, res => {
+          this.floorData = res.Content[0];
+          if (this.floorData.StructureInfo && this.floorData.StructureInfo.FloorMap) {
+            let floorMap = this.floorData.StructureInfo.FloorMap
+            this.initGraphy(floorMap, 3)
+          }
+        })
+      } else {
+        floorQueryOutline(pa, res => {
+          this.floorData = res.Content[0];
+          if (this.floorData.StructureInfo && this.floorData.StructureInfo.FloorMap) {
+            this.getOtherFloorOutLine();
+            let floorMap = this.floorData.StructureInfo.FloorMap
+            this.initGraphy(floorMap, 2)
+          }
+        })
+      }
     },
     // 获取绑定该模型id的其他楼层轮廓线
     getOtherFloorOutLine() {
@@ -165,6 +189,18 @@ export default {
         this.$emit('changeSign', res.Content.length > 1);
       });
     },
+    // 添加比例尺item 当楼层图为图片类型时 回显比例尺
+    addScaleItem(data) {
+      this.scaleItem = new EditLineItem(null)
+      this.scaleItem.strokeColor = SColor.Red;
+      this.drawMainScene.addItem(this.scaleItem)
+      if (data && data.Line && data.Line.length == 2) {
+        this.scaleItem.line = data.Line;
+        this.scaleItem.text = data.Text;
+        // todo
+        this.scaleItem.pointChange();
+      }
+    },
     // 清空平面图
     clearGraphy() {
       if (this.view) {
@@ -207,12 +243,6 @@ export default {
     changeAbsorb(isAbsorbing) {
       this.drawMainScene.isAbsorbing = isAbsorbing;
     },
-    // 撤销
-    undo() {
-
-    },
-    // 反撤销
-    redo() { },
     // 缩放
     scale(val) {
       if (!this.view) {

+ 3 - 18
src/views/ready/buildfloor/index.vue

@@ -121,8 +121,6 @@
     </el-dialog>
     <!-- 添加贯通关系弹窗 -->
     <addConnectivity @refresh="refresh" ref="addConnectivity"/>
-    <!-- 查看图片弹窗 -->
-    <checkGraphy :alreadyRelatedModel='alreadyRelatedModel' @refresh="bindRefresh" ref="checkGraphy"></checkGraphy>
   </div>
 
 </template>
@@ -132,7 +130,6 @@
   import addBuild from "@/components/ready/buildfloor/addBuild";
   import {mapGetters} from "vuex";
   import addConnectivity from "@/components/ready/buildfloor/addConnectivity";
-  import checkGraphy from "./drawGraphy/checkGraphy"; //查看图片
   import tools from "@/utils/buildfloor/tools";
   import {
     buildingQueryAndCount,
@@ -150,7 +147,6 @@
       addFloor,
       addBuild,
       addConnectivity,
-      checkGraphy
     },
     data() {
       return {
@@ -178,7 +174,6 @@
         curBuildName: "", //当前选中建筑的名称
         curFloorId: "", //当前选中的楼层id
         modelId: "",
-        alreadyRelatedModel: [],
         // currentType: 'add'
         buildMessage: {},
         selectedBuildIndex: 0
@@ -349,15 +344,8 @@
         floorQueryAndSign(floorParam, res => {
           this.tableData = res.Content;
           this.page.total = res.Total;
-          this.alreadyRelatedModel = res.Content.map(t => {
-            return t.ModelId
-          }).filter(t => t);
         });
       },
-      // 绑定图以后刷新
-      bindRefresh() {
-        this.init();
-      },
       // 创建楼层成功-修改关系成功
       refresh() {
         this.getFloorTableData();
@@ -406,17 +394,14 @@
       // 查看平面图
       checkDrawImg(row, index) {
         if (3 == index) {
-          this.$refs.checkGraphy.showDialog(row);
           this.modelId = "";
         } else if(index ==1){
-            this.modelId = row.StructureInfo.FloorMap
-            let pa = {modelId: this.modelId, FloorID: row.FloorID, BuildID: row.BuildID, BuildName: this.curBuildName};
-            this.$router.push({name: "repetitionGraphy", query: pa});
+          this.modelId = row.StructureInfo.FloorMap
         } else {
           this.modelId = row.ModelId;
-          let pa = {modelId: this.modelId, FloorID: row.FloorID, BuildID: row.BuildID, BuildName: this.curBuildName};
-          this.$router.push({name: "repetitionGraphy", query: pa});
         }
+        let pa = {modelId: this.modelId, FloorID: row.FloorID, BuildID: row.BuildID, BuildName: this.curBuildName};
+        this.$router.push({name: "repetitionGraphy", query: pa});
       },
       //  查询建筑信息
       handleBuildQuery() {

+ 322 - 20
src/views/ready/buildfloor/repetitionGraphy.vue

@@ -3,38 +3,102 @@
     <div id='repetitionGraphy'>
         <div class='buttons'>
             <el-button icon='el-icon-back' size='mini' @click='backRouter'></el-button>
-            <el-button v-if='!isEdit' size='mini' @click='changeGraphy'>替换平面图</el-button>
-            <el-button v-if='(sign||otherSign)&&!isEdit' size='mini' @click='editGraphy'>编辑平面图</el-button>
-            <el-button v-if='isEdit' size='mini' @click='cancel'>取消</el-button>
-            <el-button v-if='isEdit' size='mini' @click='confirm' type='primary'>确认</el-button>
+            <template v-if="!!hasModel">
+                <el-upload class='upload-demo' action='string' :http-request='uploadAndSubmit' :show-file-list='false' v-if="step==-1">
+                    <el-button size="mini">{{hasGraph?'替换平面图图片':'上传平面图图片'}}</el-button>
+                </el-upload>
+                <el-button style='float:right;' size='mini' type='primary' v-if="step==0" @click="nextStep" :disabled="nextStepBtnDisable">下一步</el-button>
+                <el-button style='float:right;' size='mini' type='primary' v-if="step==1" @click="nextStep">保存</el-button>
+                <el-button style='float:right;' size='mini' v-if="step==1" @click="lastStep">上一步</el-button>
+            </template>
+            <template v-else>
+                <el-button v-if='!isEdit' size='mini' @click='changeGraphy'>{{hasGraph?'替换模型文件':'关联模型文件'}}</el-button>
+                <el-button v-if='(sign||otherSign)&&!isEdit' size='mini' @click='editGraphy'>编辑平面图</el-button>
+                <el-button v-if='isEdit' size='mini' @click='cancel'>取消</el-button>
+                <el-button v-if='isEdit' size='mini' @click='confirm' type='primary'>确认</el-button>
+            </template>
             <span style='float:right;' v-if='file.FolderName'>当前对应的模型文件:{{file.FolderName}} - {{file.FloorName}}</span>
         </div>
         <!-- 展示图片 -->
         <div class='drawImg'>
-            <drawFloor ref='drawFloor' :isEdit='isEdit' :showTools='true' :id='1' @changeSign='changeSign'></drawFloor>
+            <div style="width: 100%;height: 100%;position: relative;" v-if="hasGraph">
+                <drawFloor ref='drawFloor' :isEdit='isEdit' :showTools='true' :id='1' @changeSign='changeSign' @getGraphSuc="getGraphSuc"></drawFloor>
+                <div class="stepContainer" v-if="step>-1">
+                    <el-steps :active="step" align-center finish-status="success" process-status="process">
+                        <el-step title="设定比例尺" :description="stepDes[0]"></el-step>
+                        <el-step title="楼层对齐" :description="stepDes[1]"></el-step>
+                    </el-steps>
+                </div>
+                <ul class="floorList" v-if="step==1">
+                    <template v-if="floorList.length > 1">
+                        <li style="border-bottom:1px solid #ccc;text-align: center;padding: 0">选择对齐楼层</li>
+                        <li v-for="t in floorList" :key="t.FloorID">
+                            <el-radio v-model="floorRadio" :label="t" @change="changeFloor" :disabled="t.FloorID == FloorID">{{t.FloorLocalID || t.FloorLocalName}}</el-radio>
+                        </li>
+                    </template>
+                    <template v-else>
+                        <li style="text-align: center;padding: 0">
+                            暂无对齐楼层
+                        </li>
+                    </template>
+                </ul>
+            </div>
+            <div style="width: 100%;height: 100%" v-else>
+                <div class="center" style="padding-top: 300px">
+                    <i class="icon-wushuju iconfont"></i>暂无平面图
+                </div>
+            </div>
         </div>
         <!-- 查看图片弹窗 -->
         <checkGraphy ref='checkGraphy' @refresh='refresh' :alreadyRelatedModel='alreadyRelatedModel'></checkGraphy>
+        <!-- 设定比例尺弹窗 -->
+        <setScaleDialog ref="setScaleDialog" @textChange="scaleTextChange"></setScaleDialog>
+        <!-- 退出时弹窗提示 -->
+        <backTips ref='backTips' @back="runBack"></backTips>
     </div>
 </template>
 <script>
 import drawFloor from './drawGraphy/drawFloor'
 import checkGraphy from './drawGraphy/checkGraphy' //查看图片
-import { floorUpdateOutline, floorQueryAndSign } from '@/api/scan/request'
-import { getFileNameById } from '@/api/model/file'
+import setScaleDialog from '@/components/ready/buildfloor/setScaleDialog'
+import backTips from '@/components/ready/buildfloor/backTips'
+import { floorUpdateOutline, floorQueryAndSign, manageUpdateFloor } from '@/api/scan/request'
+import { getFileNameById, countModel } from '@/api/model/file'
+import { EditLineItem, SItemStatus, SImageShowType, IconTextItem} from "@saga-web/cad-engine"
+import { SColor } from "@saga-web/draw"
+import { SImageItem } from '@saga-web/graph/lib'
+import { SMathUtil } from "@saga-web/cad-engine/lib/utils/SMathUtil"
 export default {
     components: {
         drawFloor,
         checkGraphy,
+        setScaleDialog,
+        backTips
     },
     data() {
         return {
             modelId: '', //
             isEdit: false, // 是否编辑模式
+            FloorID: '',
             file: {},
             alreadyRelatedModel: [],
             sign: false,
             otherSign: false,
+            hasGraph: false, // 当前楼层是否有平面图
+            hasModel: false, // 项目中时候有模型文件
+            step: -1, // 当前处于第几步 同时为比例尺item判断是否创建的可编辑的依据;能否返回上页的依据
+            key: '', // 当楼层图为图片时图的key
+            stepDes: [
+                '请在图上点击两点绘制线段并标记实际长度',
+                '请移动图片与其他楼层对齐'
+            ], // 描述文字
+            floorList: [], // 当前建筑下所有楼层
+            floorRadio: '', // 当前选中的楼层对象
+            imgService: `/image-service/common/image_get?systemId=dataPlatform&key=`,
+            curImgItem: null, // 对齐的楼层图片
+            scaleItem: null, // 比例尺item
+            baseImgItem: null, // 当前楼层图的图片
+            nextStepBtnDisable: true, // 比例尺item创建标识
         }
     },
     created() {
@@ -42,12 +106,16 @@ export default {
         this.FloorID = this.$route.query.FloorID
         this.BuildID = this.$route.query.BuildID
         this.BuildName = this.$route.query.BuildName
-        if (this.modelId.split('.')[1].toString() == 'png' || this.modelId.split('.')[1].toString() == 'jpg') {
-          return
-        }else{
-           this.init()
+        if (this.modelId != '') {
+            this.hasGraph = true;
+            const temp = this.modelId.split('.');
+            if (temp[1] == 'png' || temp[1] == 'jpg') {
+                // return
+            } else {
+                this.init()
+            }
         }
-       
+        this.getCountModel()
     },
     mounted() {},
     methods: {
@@ -57,11 +125,19 @@ export default {
         },
         // 返回路由
         backRouter() {
+            // 底图为图片  上传完图片后未保存
+            if (this.step > -1) {
+                this.$refs.backTips.showDialog();
+            } else {
+                this.runBack()
+            }
+        },
+        runBack() {
             this.$router.push({ name: 'buildFloor' })
         },
         // 替换模型文件
         changeGraphy() {
-            this.$refs.checkGraphy.showDialog({ FloorID: this.FloorID, BuildID: this.BuildID })
+            this.$refs.checkGraphy.showDialog({ FloorID: this.FloorID, BuildID: this.BuildID }) 
         },
         // 确认保存
         confirm() {
@@ -106,7 +182,12 @@ export default {
         // 替换模型文件成功
         refresh(modelId) {
             this.modelId = modelId
-            this.getFileName(this.modelId)
+            this.hasGraph = true;
+            const temp = this.modelId.split('.');
+            if (temp[1] && temp[1] != 'png' && temp[1] != 'jpg') {
+                this.key = '';
+                this.getFileName(this.modelId)
+            }
         },
         // 获取文件夹名称
         getFileName(modelId) {
@@ -123,8 +204,12 @@ export default {
             let floorParam = {
                 PageSize: 1000,
                 Filters: `BuildID='${this.BuildID}'`,
+                Orders: 'FloorSequenceID desc'
             }
             floorQueryAndSign(floorParam, (res) => {
+                this.floorList = res.Content;
+                // todo
+                this.floorRadio = res.Content[0];
                 this.alreadyRelatedModel = res.Content.map((t) => {
                     if (t.FloorID != this.FloorID) return t.ModelId
                     this.sign = t.Sign > 0
@@ -136,15 +221,203 @@ export default {
         changeSign(flag) {
             this.otherSign = flag
         },
+        // 统计项目下是否有模型文件
+        getCountModel(){
+            countModel({}, res => {
+                this.hasModel = res.Count > 0
+            })
+        },
+        //上传图片
+        uploadAndSubmit(item) {
+            let file = item.file
+            let reader = new FileReader()
+            let vm = this
+            let fileType = file.name.split('.')
+            let type = fileType[fileType.length - 1]
+            let uploadKey = file.uid
+            reader.onloadend = function () {
+                // 这个事件在读取结束后,无论成功或者失败都会触发
+                if (reader.error) {
+                } else {
+                    // document.getElementById("bytesRead").textContent = file.size;
+                    // 构造 XMLHttpRequest 对象,发送文件 Binary 数据
+                    var xhr = new XMLHttpRequest()
+                    xhr.open(
+                        /* method */ 'POST',
+                        /* target url */
+                        '/image-service/common/image_upload?systemId=dataPlatform&secret=9e0891a7a8c8e885&overwrite=true&key=' + uploadKey + '.' + type
+                        /*, async, default to true */
+                    )
+                    //xhr.overrideMimeType("application/octet-stream");
+                    xhr.send(reader.result)
+                    xhr.onreadystatechange = function () {
+                        if (xhr.readyState == 4) {
+                            if (xhr.status == 200) {
+                                vm.key = uploadKey + '.' + type
+                                // 将图片展示
+                                vm.refresh(uploadKey + '.' + type)
+                                // 设置步骤为第一步
+                                vm.step = 0;
+                            }
+                        }
+                    }
+                }
+            }
+            reader.readAsArrayBuffer(file)
+        },
+        // 更新楼层key 为图片,同时更新比例尺
+        updateFloorKey(){
+            const scaleItem = this.$refs.drawFloor.scaleItem;
+            // 比例尺坐标处理,当底图被对齐操作后,需要跟随底图改变坐标
+            const line = scaleItem.line.map(t => {
+                return { x: t.x + this.baseImgItem.x, y: t.y + this.baseImgItem.y }
+            })
+            let Param = {
+                Content: [{
+                    FloorId: this.FloorID,
+                    StructureInfo: { FloorMap: this.key },
+                    Properties: {
+                        X: this.baseImgItem.x, 
+                        Y: this.baseImgItem.y,
+                        Line: line,
+                        Text: scaleItem.text
+                    }
+                }],
+                Projection: ['StructureInfo', 'Properties'],
+            }
+            manageUpdateFloor(Param, (res) => {
+                this.$message.success('更新成功')
+                this.step = -1;
+                this.baseImgItem.globalAlpha = 1
+                this.removeLast()
+                this.$refs.drawFloor.fit()
+            })
+        },
+        // 根据modelid初始化
+        initFromModelId(id){
+            if (id.split('.')[1] == 'png' || id.split('.')[1] == 'jpg') {
+                this.$refs.drawFloor.initGraphy(id, 3)
+            } else {
+                this.$refs.drawFloor.initGraphy(id, 1)
+            }
+        },
+        // 上一步
+        lastStep() {
+            this.step = 0;
+            this.$refs.drawFloor.scaleItem.show()
+            this.baseImgItem.globalAlpha = 1
+            this.removeLast()
+        },
+        // 下一步||保存
+        nextStep() {
+            this.baseImgItem = this.$refs.drawFloor.drawMainScene.imgList[0]
+            this.baseImgItem.globalAlpha = 0.2
+            this.baseImgItem.moveable = true;
+            // 下一步
+            if (this.step == 0) {
+                this.step = 1;
+                this.$refs.drawFloor.scaleItem.hide();
+                // 获取楼层列表
+                this.getFloorData()
+            } else if (this.step == 1) {
+                // 保存
+                this.updateFloorKey();
+            }
+        },
+        // 加载图成功 仅在底图为图片时返回成功
+        getGraphSuc() {
+            const scaleItem = this.$refs.drawFloor.scaleItem
+            if (this.step == 0) {
+                scaleItem.status = SItemStatus.Create;
+                this.$refs.drawFloor.drawMainScene.grabItem = scaleItem;
+                scaleItem.connect('changText', this, this.changeText)
+                scaleItem.moveable = true;
+                this.clearScaleData(scaleItem);
+            } else if (this.step == -1) {
+                scaleItem.status = SItemStatus.Normal;
+            }
+        },
+        // 修改比例尺文字
+        changeText(t, e) {
+            this.$refs.setScaleDialog.showDialog(t)
+        },
+        // 文本修改
+        scaleTextChange(v) {
+            if (v > 0) {
+                this.nextStepBtnDisable = false
+            }
+        },
+        // 第二部楼层修改
+        changeFloor(v) {
+            // v->当前改为的楼层对象
+            this.removeLast();
+            if (v.StructureInfo && v.StructureInfo.FloorMap) {
+                const url = this.imgService + v.StructureInfo.FloorMap
+                this.curImgItem = new SImageItem(null, url);
+                this.curImgItem.globalAlpha = 0.2;
+                this.curImgItem.showType = SImageShowType.AutoFit;
+                if (v.Properties) {
+                    try {
+                        // 计算两个比例尺差距
+                        const scaleItem = this.$refs.drawFloor.scaleItem
+                        const r = this.calScaleGap(v.Properties, scaleItem);
+                        if (r != 1) {
+                            this.$message.warning('比例尺相差较大,可以返回上一步修改比例尺')
+                        }
+                        this.curImgItem.showType == SImageShowType.Full;
+                        this.curImgItem.moveTo(v.Properties.X, v.Properties.Y);
+                        // this.curImgItem.width = v.Properties.width;
+                        // this.curImgItem.height = v.Properties.height;
+                    } catch (err) {
+                        console.log(err);
+                    }
+                }
+                this.$refs.drawFloor.drawMainScene.addItem(this.curImgItem);
+                this.$refs.drawFloor.fit()
+            }
+        },
+        // 清除上一张底图
+        removeLast() {
+            if (this.curImgItem) {
+                this.$refs.drawFloor.drawMainScene.removeItem(this.curImgItem);
+                this.curImgItem = null;
+                this.$refs.drawFloor.view.update()
+            }
+        },
+        // 清空比例尺数据
+        clearScaleData(scaleItem) {
+            scaleItem.line = [];
+            scaleItem.pointChange();
+            scaleItem.text = '0 mm';
+        },
+        // 计算两个比例尺差距
+        calScaleGap(pro, item) {
+            // pro -> 楼层的properties
+            // item -> 当前的比例尺item
+            let result = 1
+            if (pro.Line.length && pro.Text) {
+                try {
+                    const proDis = SMathUtil.pointDistance(pro.Line[0].x, pro.Line[0].y, pro.Line[1].x, pro.Line[1].y)
+                    const proText = pro.Text.substring(0, pro.Text.length - 3);
+                    const proScale = proDis / proText;
+                    const itemDis = SMathUtil.pointDistance(item.line[0].x, item.line[0].y, item.line[1].x, item.line[1].y)
+                    const itemText = item.text.substring(0, item.text.length - 3);
+                    const itemScale = itemDis / itemText;
+                    result = (proScale / itemScale).toFixed()
+                } catch (err) {
+                    console.log(err);
+                }
+            }
+            return result;
+        }
     },
     watch: {
         modelId(n, o) {
-            if (o && n != o) {
-                console.log(n.split('.')[1])
-                if (n.split('.')[1].toString() == 'png' || n.split('.')[1].toString() == 'jpg') {
-                    this.$refs.drawFloor.initGraphy(n, 3)
-                } else {
-                    this.$refs.drawFloor.initGraphy(n, 1)
+            if (n != o) {
+                if (n) {
+                    this.$nextTick(()=>{
+                        this.initFromModelId(n)
+                    })
                 }
             }
         },
@@ -164,5 +437,34 @@ export default {
         margin-top: 10px;
         height: calc(100% - 40px);
     }
+    .upload-demo {
+        display: inline-block;
+    }
+    .stepContainer {
+        width: 100%;
+        position: absolute;
+        top: 0;
+        left: 50%;
+        margin-left: -50%;
+        z-index: 9;
+        background-color: #fff;
+    }
+    .floorList {
+        position: absolute;
+        width: 100px;
+        max-height: 250px;
+        overflow-x: hidden;
+        overflow-y: auto;
+        left: 40px;
+        top: 200px;
+        z-index: 10;
+        background: #fff;
+        border: 1px solid #ccc;
+        li {
+            box-sizing: border-box;
+            padding: 0 10px;
+            width: 100%;
+        }
+    }
 }
 </style>