xushiting 2 年 前
コミット
a6b5b1e7f4

+ 0 - 2
src/views/draw-file/board/editCAD/Controls/AddWall.js

@@ -5,7 +5,6 @@ import { floorplanService } from '../Service/FloorplanService'
 import { elementService } from '../Service/ElementService'
 import { wallService } from '../Service/WallService'
 import { stateService } from '../Service/StateService'
-import { symbolService } from '../Service/SymbolService'
 import VectorType from '../enum/VectorType'
 
 export default class AddWall {
@@ -211,7 +210,6 @@ export default class AddWall {
                     floorplanService.deletePoint(splitPointId)
                     continue
                 }
-                symbolService.reBelongForSplitWall(wallId, wallId, newWallId)
                 splitPointIds.push(splitPointId)
             }
             //首尾没有吸附的情况

+ 0 - 14
src/views/draw-file/board/editCAD/Controls/MoveWall.js

@@ -3,7 +3,6 @@ import { floorplanService } from '../Service/FloorplanService'
 import Constant from '../Constant'
 import { mathUtil } from '../MathUtil'
 import { elementService } from '../Service/ElementService'
-import { symbolService } from '../Service/SymbolService'
 import { coordinate } from '../Coordinate'
 
 export default class MoveWall {
@@ -133,8 +132,6 @@ export default class MoveWall {
                 point.setPosition(position)
             }
         }
-
-        symbolService.updateSymbolsPositionsForWallCorner(pointId)
         return true
     }
 
@@ -334,17 +331,6 @@ export default class MoveWall {
             // console.log(271)
             return MoveState
         }
-        // 更新symbols
-        symbolService.updateSymbolsPositionsForWall(wallId)
-        // 更新邻居墙的symbols
-        startPoint = floorplanService.getPoint(wall.start)
-        endPoint = floorplanService.getPoint(wall.end)
-        for (const key in startPoint.parent) {
-            symbolService.updateSymbolsPositionsForNeighWall(key)
-        }
-        for (const key in endPoint.parent) {
-            symbolService.updateSymbolsPositionsForNeighWall(key)
-        }
 
         if (MoveState == 1) {
             this.moveFlag = true

+ 4 - 223
src/views/draw-file/board/editCAD/Controls/UIControl.js

@@ -2,19 +2,15 @@ import { coordinate } from '../Coordinate.js'
 import LayerEvents from '../enum/LayerEvents.js'
 import UIEvents from '../enum/UIEvents.js'
 import VectorType from '../enum/VectorType.js'
-import SymbolEvents from '../enum/SymbolEvents.js'
 import { stateService } from '../Service/StateService.js'
-import { measureService } from '../Service/MeasureService.js'
 import { floorplanService } from '../Service/FloorplanService.js'
 import { historyService } from '../Service/HistoryService.js'
-import { symbolService } from '../Service/SymbolService.js'
 import { componentService } from '../Service/ComponentService.js'
 import { elementService } from '../Service/ElementService'
 import { mathUtil } from '../MathUtil.js'
 import { wallService } from '../Service/WallService.js'
 import { tagService } from '../Service/TagService.js'
 import Constant from '../Constant'
-import { roomsUtil } from '../Room/RoomsUtil.js'
 import { addWall } from '../Controls/AddWall'
 import { floorplanData } from '../FloorplanData.js'
 import { furnitureService } from '../Service/FurnitureService.js'
@@ -22,21 +18,19 @@ import { furnitureService } from '../Service/FurnitureService.js'
 export default class UIControl {
     constructor(layer) {
         this.layer = layer
-        this.showTexture = true
     }
 
     /**
      * 获取选中要添加的UI
      */
     get selectUI() {
-        return this.layer.$xui.selectName
+
     }
 
     /**
      * 设置选中要添加的UI
      */
     set selectUI(value) {
-        this.layer.$xui.selectName = value
         this.layer.updateEventNameForSelectUI()
     }
 
@@ -44,69 +38,25 @@ export default class UIControl {
      * 获取选中要操作的UI
      */
     get currentUI() {
-        return this.layer.$xui.currentName
     }
 
     /**
      * 设置选中要操作的UI
      */
     set currentUI(value) {
-        if (value === null) {
-            this.layer.$xui.hideProps()
-        } else {
-            this.layer.$xui.showProps(value)
-        }
+
     }
 
     /**
      * 获取当前楼层Id
      */
     get currentFloor() {
-        return this.layer.$xui.currentFloor
     }
 
     /**
      * 设置当前楼层Id
      */
     set currentFloor(value) {
-        if (!this.layer.display) {
-            return
-        }
-        if (this.layer.app.store.getValue('flooruser').type == 'image') {
-        } else {
-            //需要补上3d的模型
-            floorplanService.setCurrentFloor(value)
-            this.layer.initPanos(floorplanService.currentFloor)
-            measureService.update()
-            historyService.clearHistoryRecord()
-            this.layer.$xui.toolbar.recall = false
-            this.layer.$xui.toolbar.recover = false
-            setTimeout(
-                function () {
-                    this.layer.renderer.autoRedraw()
-                }.bind(this),
-                50
-            )
-        }
-    }
-
-    /**
-     * 获取当前楼层Id
-     */
-    get currentUnit() {
-        return this.layer.$xui.currentUnit
-    }
-
-    /**
-     * 设置当前测量单位
-     */
-    set currentUnit(value) {
-        //this.layer.$xui.hideProps()
-        this.layer.uiControl.currentUI = null
-        measureService.unit = value //测量单位
-        tagService.convertUnit(value)
-        this.layer.history.save()
-        this.layer.renderer.autoRedraw()
     }
 
     /**
@@ -123,8 +73,6 @@ export default class UIControl {
             case 'remove':
                 if (type == VectorType.Wall || type == 'OutWall') {
                     floorplanService.deleteWall(item.vectorId)
-                } else if (symbolService.isSymbol(type)) {
-                    symbolService.deleteSymbol(item.vectorId)
                 } else if (componentService.isComponent(type)) {
                     floorplanService.deleteComponent(item.vectorId)
                 } else if (type == VectorType.Tag) {
@@ -143,49 +91,6 @@ export default class UIControl {
                 //this.layer.history.save()
                 this.layer.renderer.autoRedraw()
                 break
-            case 'rotate':
-                if (symbolService.isSymbol(type)) {
-                    let symbol = floorplanService.getSymbol(item.vectorId)
-                    if (type == VectorType.SingleDoor) {
-                        if (symbol.openSide == SymbolEvents.Left) {
-                            if (mathUtil.isClockwise(symbol.points2d)) {
-                                symbol.openSide = SymbolEvents.Right
-                            } else {
-                                let temp = symbol.endPoint
-                                symbol.endPoint = symbol.startPoint
-                                symbol.startPoint = temp
-                                symbol.openSide = SymbolEvents.Right
-                            }
-                        } else if (symbol.openSide == SymbolEvents.Right) {
-                            if (mathUtil.isClockwise(symbol.points2d)) {
-                                symbol.openSide = SymbolEvents.Left
-                            } else {
-                                let temp = symbol.endPoint
-                                symbol.endPoint = symbol.startPoint
-                                symbol.startPoint = temp
-                                // let temp = {x:symbol.endPoint.x,y:symbol.endPoint.y}
-                                // mathUtil.clonePoint(symbol.endPoint,symbol.startPoint)
-                                // mathUtil.clonePoint(symbol.startPoint,temp)
-                                symbol.openSide = SymbolEvents.Left
-                                // symbol.setPoints2d()
-                            }
-                        }
-                    } else if (type == VectorType.DoubleDoor || type == VectorType.BayWindow) {
-                        if (symbol.openSide == SymbolEvents.Left) {
-                            symbol.openSide = SymbolEvents.Right
-                        } else if (symbol.openSide == SymbolEvents.Right) {
-                            symbol.openSide = SymbolEvents.Left
-                        }
-                    } else {
-                        let temp = symbol.endPoint
-                        symbol.endPoint = symbol.startPoint
-                        symbol.startPoint = temp
-                    }
-                    symbol.setPoints2d()
-                    //this.layer.history.save()
-                    this.layer.renderer.autoRedraw()
-                }
-                break
             case 'angle':
                 if (componentService.isComponent(type)) {
                     let component = floorplanService.getComponent(item.vectorId)
@@ -203,19 +108,7 @@ export default class UIControl {
                 }
                 break
             case 'width':
-                if (symbolService.isSymbol(type)) {
-                    const newStartEnd = symbolService.updateSymbolForLen(item.vectorId, value)
-                    if (newStartEnd.block) {
-                        let symbol = floorplanService.getSymbol(item.vectorId)
-                        console.log('长度阻止:' + mathUtil.getDistance(symbol.startPoint, symbol.endPoint))
-                        this.layer.$xui.currentAttributes = {
-                            limit: mathUtil.getDistance(symbol.startPoint, symbol.endPoint),
-                            type: item.type,
-                            name: 'width',
-                            width: mathUtil.getDistance(symbol.startPoint, symbol.endPoint),
-                        }
-                    }
-                } else if (componentService.isComponent(type)) {
+                if (componentService.isComponent(type)) {
                     let component = floorplanService.getComponent(item.vectorId)
                     component.sideWidth = value
                     component.setPoints2d()
@@ -292,7 +185,6 @@ export default class UIControl {
                 if (type == VectorType.Tag) {
                     let tag = floorplanService.getTag(item.vectorId)
                     tag.setDes(value)
-                    tag.setUnit(measureService.unit)
                     //this.layer.history.save()
                     this.layer.renderer.autoRedraw()
                 }
@@ -301,16 +193,6 @@ export default class UIControl {
                 if (type == 'compass') {
                     floorplanService.setCompass(0)
                     return
-                } else if (symbolService.isSymbol(type)) {
-                    let len = symbolService.getDefaultSymbolLen(type)
-                    const newStartEnd = symbolService.updateSymbolForLen(item.vectorId, len)
-                    if (!newStartEnd.block) {
-                        this.layer.$xui.currentAttributes = {
-                            type: item.type,
-                            name: 'width',
-                            width: mathUtil.getFixed(mathUtil.getDistance(newStartEnd.start, newStartEnd.end), 2),
-                        }
-                    }
                 } else if (componentService.isComponent(type)) {
                     let component = floorplanService.getComponent(item.vectorId)
                     component.sideWidth = componentService.sideWidth
@@ -398,23 +280,7 @@ export default class UIControl {
         if (item == null) {
             item = stateService.getDraggingItem()
         }
-        if (symbolService.isSymbol(item.type)) {
-            let symbol = floorplanService.getSymbol(item.vectorId)
-            let width = mathUtil.getDistance(symbol.startPoint, symbol.endPoint)
-            width = mathUtil.getFixed(width, 2)
-            if (item.type == VectorType.SingleDoor || item.type == VectorType.DoubleDoor || item.type == VectorType.SlideDoor) {
-                this.layer.$xui.currentAttributes = {
-                    name: item.type,
-                    width: width,
-                    enter: symbol.enter ? symbol.enter : null,
-                }
-            } else {
-                this.layer.$xui.currentAttributes = {
-                    name: item.type,
-                    width: width,
-                }
-            }
-        } else if (componentService.isComponent(item.type)) {
+        if (componentService.isComponent(item.type)) {
             let component = floorplanService.getComponent(item.vectorId)
             let sideWidth = component.sideWidth
             let sideThickness = component.sideThickness
@@ -438,15 +304,6 @@ export default class UIControl {
                 important: wall.important || wall.out,
                 wallType: wall.out ? 'OutWall' : item.type,
             }
-            // if (wall.important || wall.out) {
-            //     this.layer.$xui.currentAttributes = {
-            //         name: 'OutWall',
-            //     }
-            // } else {
-            //     this.layer.$xui.currentAttributes = {
-            //         name: item.type,
-            //     }
-            // }
         } else if (furnitureService.isFurniture(item.type)) {
             let furniture = floorplanService.getFurniture(item.vectorId)
             let scale = furniture.scale
@@ -462,24 +319,6 @@ export default class UIControl {
         this.selectUI = null
     }
 
-    getSymbolTypeForUI() {
-        if (this.selectUI == UIEvents.SingleDoor) {
-            return VectorType.SingleDoor
-        } else if (this.selectUI == UIEvents.DoubleDoor) {
-            return VectorType.DoubleDoor
-        } else if (this.selectUI == UIEvents.SlideDoor) {
-            return VectorType.SlideDoor
-        } else if (this.selectUI == UIEvents.SingleWindow) {
-            return VectorType.SingleWindow
-        } else if (this.selectUI == UIEvents.BayWindow) {
-            return VectorType.BayWindow
-        } else if (this.selectUI == UIEvents.FrenchWindow) {
-            return VectorType.FrenchWindow
-        } else if (this.selectUI == UIEvents.Pass) {
-            return VectorType.Pass
-        }
-    }
-
     getComponentTypeForUI() {
         if (this.selectUI == UIEvents.Beam) {
             return VectorType.Beam
@@ -541,18 +380,8 @@ export default class UIControl {
         return new Promise(resolve => {
             this.menu_flex()
             stateService.clearItems()
-            roomsUtil.start()
-
-            measureService.updateRegion(true)
-            measureService.update()
-
             let canvas = this.layer.canvas
 
-            // canvas.width = Constant.cadImg_Width
-            // canvas.height = Constant.cadImg_Height
-            // coordinate.width = Constant.cadImg_Width / Constant.ratio
-            // coordinate.height = Constant.cadImg_Height / Constant.ratio
-
             canvas.width = window.innerWidth * Constant.ratio
             canvas.height = window.innerHeight * Constant.ratio
             coordinate.width = window.innerWidth
@@ -569,20 +398,6 @@ export default class UIControl {
                     if (subFloor == 1) {
                         this.downloadCadImg(canvas, 'floorPlan.jpg')
                     } else {
-                        /*
-                        this.downloadCadImg(canvas, 'floorPlan_' + (floorplanService.getCurrentFloor() + 1) + '.jpg')
-                        let currentFloor = floorplanService.getCurrentFloor()
-                        for (let i = 0; i < subFloor; ++i) {
-                            if (i == currentFloor) {
-                                continue
-                            } else {
-                                this.currentFloor = i
-                                this.layer.renderer.autoRedrawForDownLoadImg(styleType)
-                                this.downloadCadImg(canvas, 'floorPlan_' + (i + 1) + '.jpg')
-                            }
-                        }
-                        this.currentFloor = currentFloor
-                        */
                         let currentFloor = floorplanService.getCurrentFloor()
                         this.layer.app.store.getValue('floorcad').floors.forEach((floor, index) => {
                             this.currentFloor = index
@@ -673,45 +488,18 @@ export default class UIControl {
 
     //撤销
     menu_revoke() {
-        // this.layer.history.goPreState()
-        // this.layer.renderer.autoRedraw()
-
-        // const historyState = historyService.getHistoryState()
-        // if (historyState.pre) {
-        //     this.layer.$xui.toolbar.recall = true
-        // } else {
-        //     this.layer.$xui.toolbar.recall = false
-        // }
-        // this.layer.$xui.toolbar.recover = true
         this.layer.revokeHistory()
     }
 
     //恢复
     menu_recovery() {
-        // this.layer.history.goNextState()
-        // this.layer.renderer.autoRedraw()
-
-        // const historyState = historyService.getHistoryState()
-        // if (historyState.next) {
-        //     this.layer.$xui.toolbar.recover = true
-        // } else {
-        //     this.layer.$xui.toolbar.recover = false
-        // }
-        // this.layer.$xui.toolbar.recall = true
         this.layer.recoveryHistory()
     }
 
     menu_default() {
         historyService.clearHistoryRecord()
         floorplanService.setAngle(0)
-        this.layer.app.store.getValue('metadata').floorPlanUser = 0
-        this.layer.app.store.getValue('metadata').floorPlanAngle = 0
-        this.menu_flex(true)
         this.layer.load.loadFloorJson(true).then(() => {
-            this.layer.app.core.get('Player').model.floorplanCadImg.updatePlanes()
-            this.layer.render()
-            this.layer.app.MinMap.reload()
-            this.layer.app.core.get('Player').labelManager.reset()
         })
     }
 
@@ -731,11 +519,6 @@ export default class UIControl {
         this.layer.renderer.autoRedraw()
     }
 
-    menu_panos(value) {
-        this.layer.renderer.displayPanos = value
-        this.layer.renderer.autoRedraw()
-    }
-
     menu_rotate() {
         coordinate.reSet()
         let angle = floorplanService.getAngle()
@@ -757,8 +540,6 @@ export default class UIControl {
         //修改cad数据
         coordinate.updateForRotate()
         this.layer.initPanos(floorplanService.getCurrentFloor())
-        //修改测量线
-        measureService.update()
         this.layer.history.save()
         this.layer.renderer.autoRedraw()
     }

+ 71 - 0
src/views/draw-file/board/editCAD/Geometry/Geometry.js

@@ -0,0 +1,71 @@
+import { floorplanService } from '../Service/FloorplanService'
+import { mathUtil } from '../MathUtil.js'
+import SymbolEvents from '../enum/SymbolEvents.js'
+
+export default class Geometry {
+    constructor() {
+        this.len = null
+    }
+
+    setId(vectorId) {
+        if (vectorId == null || typeof vectorId === 'undefined') {
+            vectorId = floorplanService.getCurrentId()
+            floorplanService.updateCurrentId()
+            this.vectorId = this.geoType + vectorId
+        } else {
+            this.vectorId = vectorId
+        }
+    }
+
+    setSymbolPosition(position, dir) {
+        if (dir == 'start') {
+            mathUtil.clonePoint(this.startPoint, position)
+        } else if (dir == 'end') {
+            mathUtil.clonePoint(this.endPoint, position)
+        }
+    }
+
+    setSymbolParent(wallId) {
+        this.parent = wallId
+    }
+
+    setPointParent(wallId, dir) {
+        if (this.parent == null) {
+            this.parent = {}
+        }
+
+        this.parent[wallId] = dir
+    }
+
+    setOpenSide(point) {
+        const points = []
+        points.push(this.startPoint)
+        points.push(this.endPoint)
+        points.push(point)
+
+        let openSide = null
+        // 逆时针
+        if (mathUtil.isClockwise(points)) {
+            openSide = SymbolEvents.Left
+        } else {
+            openSide = SymbolEvents.Right
+        }
+        this.openSide = openSide
+    }
+
+    // ptSrc: 圆上某点(初始点);
+    // ptRotationCenter: 圆心点;
+    // angle: 旋转角度°  -- [angle * M_PI / 180]:将角度换算为弧度
+    // 【注意】angle 逆时针为正,顺时针为负
+    rotatePoint(ptSrc, ptRotationCenter, angle) {
+        angle = -1 * angle //设计是逆时针为负,顺时针为正
+        var a = ptRotationCenter.x
+        var b = ptRotationCenter.y
+        var x0 = ptSrc.x
+        var y0 = ptSrc.y
+        var rx = a + (x0 - a) * Math.cos((angle * Math.PI) / 180) - (y0 - b) * Math.sin((angle * Math.PI) / 180)
+        var ry = b + (x0 - a) * Math.sin((angle * Math.PI) / 180) + (y0 - b) * Math.cos((angle * Math.PI) / 180)
+        var json = { x: rx, y: ry }
+        return json
+    }
+}

+ 0 - 1
src/views/draw-file/board/editCAD/History/Change.js

@@ -2,7 +2,6 @@ import { floorplanService } from '../Service/FloorplanService'
 import { elementService } from '../Service/ElementService'
 import { wallService } from '../Service/WallService'
 import { historyUtil } from './HistoryUtil'
-import { symbolService } from '../Service/SymbolService'
 import HistoryEvents from '../enum/HistoryEvents'
 import { coordinate } from '../Coordinate'
 

+ 0 - 40
src/views/draw-file/board/editCAD/History/History.js

@@ -3,14 +3,12 @@ import { elementService } from '../Service/ElementService'
 import { wallService } from '../Service/WallService'
 import { historyUtil } from './HistoryUtil'
 import { change } from './Change'
-import { symbolService } from '../Service/SymbolService'
 import { stateService } from '../Service/StateService'
 import HistoryEvents from '../enum/HistoryEvents'
 import { componentService } from '../Service/ComponentService'
 import { historyService } from '../Service/HistoryService'
 import { tagService } from '../Service/TagService'
 import { coordinate } from '../Coordinate'
-import { measureService } from '../Service/MeasureService'
 import { furnitureService } from '../Service/FurnitureService'
 
 export default class History {
@@ -35,7 +33,6 @@ export default class History {
         if (!flag) {
             return
         }
-        measureService.update()
         historyService.addHistoryRecord(change.elements)
         change.saveCurrentInfo()
         this.setState()
@@ -130,14 +127,11 @@ export default class History {
             if (!flag) {
                 this.goPreForPoints(item.points)
                 this.goPreForWalls(item.walls)
-                // 必须在墙的后面,因为删除带symbol的墙的时候,撤销时,必须是先有墙才有symbol
-                this.goPreForSymbols(item.symbols)
                 this.goPreForComponents(item.components)
                 this.goPreForTags(item.tags)
                 this.goPreForFurnitures(item.furnitures)
             }
 
-            measureService.update()
             historyService.undoHistoryRecord()
             change.saveCurrentInfo()
             this.setState()
@@ -188,22 +182,6 @@ export default class History {
         }
     }
 
-    goPreForSymbols(itemForSymbols) {
-        for (let i = 0; i < itemForSymbols.length; ++i) {
-            const item = itemForSymbols[i]
-            if (item.handle == HistoryEvents.AddSymbol) {
-                symbolService.deleteSymbol(item.symbol.id)
-            } else if (item.handle == HistoryEvents.DeleteSymbol) {
-                let newSymbol = symbolService.createSymbol(item.symbol.start, item.symbol.end, item.symbol.type, item.symbol.parent, item.symbol.id)
-                historyUtil.assignSymbolFromSymbol(newSymbol, item.symbol)
-            } else if (item.handle == HistoryEvents.ModifySymbol) {
-                const preSymbol = item.preSymbol
-                let currentSymbol = floorplanService.getSymbol(item.curSymbol.id)
-                historyUtil.assignSymbolFromSymbol(currentSymbol, preSymbol)
-            }
-        }
-    }
-
     goPreForComponents(itemForComponents) {
         for (let i = 0; i < itemForComponents.length; ++i) {
             const item = itemForComponents[i]
@@ -304,22 +282,6 @@ export default class History {
         }
     }
 
-    goNextForSymbols(itemForSymbols) {
-        for (let i = 0; i < itemForSymbols.length; ++i) {
-            const item = itemForSymbols[i]
-            if (item.handle == HistoryEvents.AddSymbol) {
-                let newSymbol = symbolService.createSymbol(item.symbol.start, item.symbol.end, item.symbol.type, item.symbol.parent, item.symbol.id)
-                historyUtil.assignSymbolFromSymbol(newSymbol, item.symbol)
-            } else if (item.handle == HistoryEvents.DeleteSymbol) {
-                symbolService.deleteSymbol(item.symbol.id)
-            } else if (item.handle == HistoryEvents.ModifySymbol) {
-                const currentSymbol = item.curSymbol
-                let preSymbol = floorplanService.getSymbol(item.curSymbol.id)
-                historyUtil.assignSymbolFromSymbol(preSymbol, currentSymbol)
-            }
-        }
-    }
-
     goNextForComponents(itemForComponents) {
         for (let i = 0; i < itemForComponents.length; ++i) {
             const item = itemForComponents[i]
@@ -404,12 +366,10 @@ export default class History {
             if (!flag) {
                 this.goNextForPoints(item.points)
                 this.goNextForWalls(item.walls)
-                this.goNextForSymbols(item.symbols)
                 this.goNextForComponents(item.components)
                 this.goNextForTags(item.tags)
                 this.goNextForFurnitures(item.furnitures)
             }
-            measureService.update()
             change.saveCurrentInfo()
             this.setState()
 

+ 1 - 12
src/views/draw-file/board/editCAD/History/HistoryUtil.js

@@ -2,7 +2,6 @@ import { mathUtil } from '../MathUtil'
 import { componentService } from '../Service/ComponentService'
 import { floorplanService } from '../Service/FloorplanService'
 import { furnitureService } from '../Service/FurnitureService'
-import { symbolService } from '../Service/SymbolService'
 import { tagService } from '../Service/TagService'
 import { wallService } from '../Service/WallService'
 
@@ -77,17 +76,7 @@ export default class HistoryUtil {
         pointInfo.parent = JSON.parse(JSON.stringify(point2.parent))
         wallService.setPointInfo(pointInfo)
     }
-    assignSymbolFromSymbol(symbol1, symbol2) {
-        const symbolInfo = {}
-        symbolInfo.vectorId = symbol1.vectorId
-        symbolInfo.openSide = symbol2.openSide
-        symbolInfo.start = JSON.parse(JSON.stringify(symbol2.start))
-        symbolInfo.end = JSON.parse(JSON.stringify(symbol2.end))
-        symbolInfo.points2d = JSON.parse(JSON.stringify(symbol2.points))
-        symbolInfo.enter = symbol2.enter
-        symbolInfo.parent = symbol2.parent
-        symbolService.setSymbolInfo(symbolInfo)
-    }
+
     assignComponentFromComponent(component1, component2) {
         const componentInfo = {}
         componentInfo.vectorId = component1.vectorId

+ 0 - 74
src/views/draw-file/board/editCAD/Layer.js

@@ -1,14 +1,11 @@
 import Load from './Load'
 import { stateService } from './Service/StateService'
-import { symbolService } from './Service/SymbolService'
 import { elementService } from './Service/ElementService'
 import { floorplanService } from './Service/FloorplanService'
-import { measureService } from './Service/MeasureService'
 import { tagService } from './Service/TagService'
 import { historyService } from './Service/HistoryService'
 
 import UIControl from './Controls/UIControl'
-import { moveSymbol } from './Controls/MoveSymbol'
 import { moveComponent } from './Controls/MoveComponent'
 import { moveTag } from './Controls/MoveTag'
 import { addWall } from './Controls/AddWall'
@@ -28,9 +25,6 @@ import { mathUtil } from './MathUtil'
 import { wallService } from './Service/WallService'
 import { componentService } from './Service/ComponentService'
 import History from './History/History'
-import sync from './sync'
-import { roomsUtil } from './Room/RoomsUtil'
-import { roomService } from './Service/RoomService'
 import { compassService } from './Service/CompassService'
 import { furnitureService } from './Service/FurnitureService'
 
@@ -263,41 +257,6 @@ export default class Layer {
                 }
                 needAutoRedraw = true
                 break
-            case LayerEvents.AddSymbol:
-                listenLayer.start(position)
-                //最近的墙
-                if (listenLayer.wallInfo.wallId) {
-                    needAutoRedraw = true
-                    if (draggingItem == null) {
-                        const symbolType = this.uiControl.getSymbolTypeForUI()
-                        let symbolId = symbolService.addSymbol(position, symbolType, listenLayer.wallInfo.wallId)
-                        if (symbolId) {
-                            stateService.setSelectItem(symbolId, symbolType, SelectState.All)
-                            stateService.setDraggingItem(stateService.selectItem)
-                            let symbol = floorplanService.getSymbol(symbolId)
-                            symbol.len = mathUtil.getDistance(symbol.startPoint, symbol.endPoint)
-                        }
-                    } else {
-                        moveSymbol.moveFullSymbol(position, draggingItem.vectorId, listenLayer.wallInfo.wallId)
-                    }
-                } else {
-                    needAutoRedraw = false
-                }
-                break
-            case LayerEvents.MoveSymbol:
-                listenLayer.start(position)
-                needAutoRedraw = true
-                if (draggingItem != null && symbolService.isSymbol(draggingItem.type)) {
-                    moveSymbol.moveFullSymbol(position, draggingItem.vectorId, listenLayer.wallInfo.wallId)
-                }
-                break
-            case LayerEvents.MoveSymbolPoint:
-                needAutoRedraw = true
-                if (draggingItem != null && symbolService.isSymbol(draggingItem.type)) {
-                    //移动symbol的端点
-                    moveSymbol.moveSymbolPoint(position, draggingItem.vectorId, draggingItem.selectIndex)
-                }
-                break
             case LayerEvents.AddComponent:
                 needAutoRedraw = true
                 if (draggingItem == null) {
@@ -421,7 +380,6 @@ export default class Layer {
                         wallService.moveTo(draggingItem.vectorId, listenLayer.modifyPoint.linkedPointId)
                     } else if (listenLayer.modifyPoint && (listenLayer.modifyPoint.linkedPointIdX || listenLayer.modifyPoint.linkedPointIdY)) {
                         mathUtil.clonePoint(point, listenLayer.modifyPoint)
-                        symbolService.updateSymbolsPositionsForWallCorner(draggingItem.vectorId)
                     } else if (listenLayer.modifyPoint && listenLayer.modifyPoint.hasOwnProperty('linkedWallId')) {
                         point = wallService.createPoint(listenLayer.modifyPoint.x, listenLayer.modifyPoint.y)
                         wallService.splitWall(listenLayer.modifyPoint.linkedWallId, point.vectorId, 'start')
@@ -475,26 +433,6 @@ export default class Layer {
                 this.uiControl.currentUI = focusItem.type
                 this.history.save()
                 break
-            case LayerEvents.MoveSymbol:
-                symbol = floorplanService.getSymbol(draggingItem.vectorId)
-                needAutoRedraw = true
-                if (focusItem != null && symbolService.isSymbol(focusItem.type)) {
-                    this.uiControl.currentUI = focusItem.type
-                    this.history.save()
-                } else if (symbol) {
-                    symbol.len = null
-                    this.history.save()
-                }
-                break
-            case LayerEvents.MoveSymbolPoint:
-                needAutoRedraw = true
-                if (focusItem != null && symbolService.isSymbol(focusItem.type)) {
-                    this.uiControl.currentUI = focusItem.type
-                    this.history.save()
-                } else {
-                    this.history.save()
-                }
-                break
             case LayerEvents.AddComponent:
                 focusItem = {
                     vectorId: draggingItem.vectorId,
@@ -686,15 +624,6 @@ export default class Layer {
                     stateService.setEventName(LayerEvents.MoveWall)
                 } else if (selectItem.type == VectorType.WallCorner) {
                     stateService.setEventName(LayerEvents.MoveWallPoint)
-                } else if (symbolService.isSymbol(selectItem.type)) {
-                    if (selectItem.selectIndex == SelectState.All || selectItem.selectIndex == SelectState.Select) {
-                        stateService.setEventName(LayerEvents.MoveSymbol)
-                        //需要保留当前的长度
-                        const symbol = floorplanService.getSymbol(selectItem.vectorId)
-                        symbol.len = mathUtil.getDistance(symbol.startPoint, symbol.endPoint)
-                    } else if (selectItem.selectIndex == SelectState.Start || selectItem.selectIndex == SelectState.End) {
-                        stateService.setEventName(LayerEvents.MoveSymbolPoint)
-                    }
                 } else if (componentService.isComponent(selectItem.type)) {
                     stateService.setEventName(LayerEvents.MoveComponent)
                 } else if (selectItem.type == VectorType.Tag) {
@@ -727,7 +656,6 @@ export default class Layer {
             const draggingItem = stateService.getDraggingItem()
             if (eventName == LayerEvents.AddSymbol) {
                 if (draggingItem && draggingItem.vectorId) {
-                    symbolService.deleteSymbol(draggingItem.vectorId)
                     stateService.clearDraggingItem()
                 }
             } else if (eventName == LayerEvents.AddComponent) {
@@ -779,8 +707,6 @@ export default class Layer {
         if (item) {
             if (item.type == VectorType.Wall) {
                 floorplanService.deleteWall(item.vectorId)
-            } else if (symbolService.isSymbol(item.type)) {
-                symbolService.deleteSymbol(item.vectorId)
             } else if (componentService.isComponent(item.type)) {
                 floorplanService.deleteComponent(item.vectorId)
             } else if (item.type == VectorType.Tag) {

+ 0 - 8
src/views/draw-file/board/editCAD/Load.js

@@ -1,6 +1,5 @@
 import { floorplanService } from './Service/FloorplanService.js'
 import { wallService } from './Service/WallService.js'
-import { symbolService } from './Service/SymbolService.js'
 import { componentService } from './Service/ComponentService.js'
 import { tagService } from './Service/TagService'
 import { furnitureService } from './Service/FurnitureService'
@@ -31,13 +30,6 @@ export default class Load {
                 wall.setChildren(floor.walls[key].children)
             }
 
-            for (let key in floor.symbols) {
-                let symbol = symbolService.createSymbol(floor.symbols[key].startPoint, floor.symbols[key].endPoint, floor.symbols[key].geoType, floor.symbols[key].parent, floor.symbols[key].vectorId)
-                symbol.openSide = floor.symbols[key].openSide
-                symbol.enter = floor.symbols[key].enter
-                symbol.points2d = JSON.parse(JSON.stringify(floor.symbols[key].points2d))
-            }
-
             for (let key in floor.components) {
                 let component = componentService.createComponent(floor.components[key].center, floor.components[key].geoType, floor.components[key].vectorId)
                 component.angle = floor.components[key].angle

+ 0 - 550
src/views/draw-file/board/editCAD/Renderer/Draw.js

@@ -1,7 +1,5 @@
 import { floorplanService } from '../Service/FloorplanService.js'
 import { stateService } from '../Service/StateService.js'
-import { measureService } from '../Service/MeasureService'
-import { symbolService } from '../Service/SymbolService'
 import { coordinate } from '../Coordinate.js'
 import Style from '../Style.js'
 import VectorType from '../enum/VectorType.js'
@@ -9,9 +7,7 @@ import SelectState from '../enum/SelectState.js'
 import { mathUtil } from '../MathUtil.js'
 import ElementEvents from '../enum/ElementEvents.js'
 import Constant from '../Constant.js'
-import { roomService } from '../Service/RoomService.js'
 import { compassService } from '../Service/CompassService'
-import { uoMService } from '../Service/UoMService'
 import { furnitureService } from '../Service/FurnitureService.js'
 export default class Draw {
     constructor() {
@@ -241,109 +237,6 @@ export default class Draw {
         // this.drawText({ x: vector.x, y: vector.y }, vector.vectorId)
     }
 
-    drawSelectSymbolPoint() {
-        const selectItem = stateService.getSelectItem()
-        const draggingItem = stateService.getDraggingItem()
-        const focusItem = stateService.getFocusItem()
-        let symbol = null
-        let point = null
-        let radius = null
-
-        this.context.save()
-        if (selectItem && selectItem.selectIndex && selectItem.selectIndex != SelectState.All && symbolService.isSymbol(selectItem.type)) {
-            symbol = floorplanService.getSymbol(selectItem.vectorId)
-            if (selectItem.selectIndex == SelectState.Start) {
-                point = coordinate.getScreenXY({ x: symbol.startPoint.x, y: symbol.startPoint.y })
-            } else if (selectItem.selectIndex == SelectState.End) {
-                point = coordinate.getScreenXY({ x: symbol.endPoint.x, y: symbol.endPoint.y })
-            }
-            this.context.lineWidth = Style.Select.Point.lineWidth * coordinate.ratio
-            this.context.strokeStyle = Style.Select.Point.strokeStyle
-            this.context.fillStyle = Style.Select.Point.fillStyle
-            radius = Style.Select.Point.radius
-        } else if (draggingItem && draggingItem.selectIndex && draggingItem.selectIndex != SelectState.All && symbolService.isSymbol(draggingItem.type)) {
-            symbol = floorplanService.getSymbol(draggingItem.vectorId)
-            if (draggingItem.selectIndex == SelectState.Start) {
-                point = coordinate.getScreenXY({ x: symbol.startPoint.x, y: symbol.startPoint.y })
-            } else if (draggingItem.selectIndex == SelectState.End) {
-                point = coordinate.getScreenXY({ x: symbol.endPoint.x, y: symbol.endPoint.y })
-            }
-            this.context.lineWidth = Style.Select.Point.lineWidth * coordinate.ratio
-            this.context.strokeStyle = Style.Select.Point.strokeStyle
-            this.context.fillStyle = Style.Select.Point.fillStyle
-            radius = Style.Select.Point.radius
-        }
-
-        if (focusItem && focusItem.selectIndex && focusItem.selectIndex != SelectState.All && symbolService.isSymbol(focusItem.type)) {
-            symbol = floorplanService.getSymbol(focusItem.vectorId)
-            if (focusItem.selectIndex == SelectState.Start) {
-                point = coordinate.getScreenXY({ x: symbol.startPoint.x, y: symbol.startPoint.y })
-            } else if (focusItem.selectIndex == SelectState.End) {
-                point = coordinate.getScreenXY({ x: symbol.endPoint.x, y: symbol.endPoint.y })
-            }
-            this.context.lineWidth = Style.Focus.Point.lineWidth * coordinate.ratio
-            this.context.strokeStyle = Style.Focus.Point.strokeStyle
-            this.context.fillStyle = Style.Focus.Point.fillStyle
-            radius = Style.Focus.Point.radius
-        }
-
-        if (point != null && radius != null) {
-            this.context.beginPath()
-            this.context.arc(point.x, point.y, radius * coordinate.ratio, 0, Math.PI * 2, true)
-            this.context.stroke()
-            this.context.fill()
-        }
-
-        this.context.restore()
-    }
-
-    drawSymbolPoint(symbol) {
-        //const pt = coordinate.getScreenXY({ x: position.x, y: position.y })
-        const startPoint = coordinate.getScreenXY({ x: symbol.startPoint.x, y: symbol.startPoint.y })
-        const endPoint = coordinate.getScreenXY({ x: symbol.endPoint.x, y: symbol.endPoint.y })
-        const radius = Style.Point.radius
-
-        this.context.save()
-        this.context.lineWidth = Style.Point.lineWidth * coordinate.ratio
-        this.context.strokeStyle = Style.Point.strokeStyle
-        this.context.fillStyle = Style.Point.fillStyle
-
-        // const selectItem = stateService.getSelectItem()
-        // const draggingItem = stateService.getDraggingItem()
-        // const focusItem = stateService.getFocusItem()
-
-        // if (selectItem && symbol.vectorId == selectItem.vectorId) {
-        //     this.context.lineWidth = Style.Select.Point.lineWidth * coordinate.ratio
-        //     this.context.strokeStyle = Style.Select.Point.strokeStyle
-        //     this.context.fillStyle = Style.Select.Point.fillStyle
-        //     radius = Style.Select.Point.radius
-        // } else if (draggingItem && symbol.vectorId == draggingItem.vectorId) {
-        //     this.context.lineWidth = Style.Select.Point.lineWidth * coordinate.ratio
-        //     this.context.strokeStyle = Style.Select.Point.strokeStyle
-        //     this.context.fillStyle = Style.Select.Point.fillStyle
-        //     radius = Style.Select.Point.radius
-        // }
-
-        // if (focusItem && symbol.vectorId == focusItem.vectorId) {
-        //     this.context.lineWidth = Style.Focus.Point.lineWidth * coordinate.ratio
-        //     this.context.strokeStyle = Style.Focus.Point.strokeStyle
-        //     this.context.fillStyle = Style.Focus.Point.fillStyle
-        //     radius = Style.Focus.Point.radius
-        // }
-
-        this.context.beginPath()
-        this.context.arc(startPoint.x, startPoint.y, radius * coordinate.ratio, 0, Math.PI * 2, true)
-        this.context.stroke()
-        this.context.fill()
-
-        this.context.beginPath()
-        this.context.arc(endPoint.x, endPoint.y, radius * coordinate.ratio, 0, Math.PI * 2, true)
-        this.context.stroke()
-        this.context.fill()
-
-        this.context.restore()
-    }
-
     // 文字
     drawText(position, txt, screenCoord, angle) {
         this.context.save()
@@ -1219,36 +1112,8 @@ export default class Draw {
 
             if (fontStart1.newpoint1.x < fontStart1.newpoint2.x) {
                 this.context.fillText(title, fontStart1.newpoint1.x, fontStart1.newpoint1.y)
-
-                if (geometry.des) {
-                    if (measureService.unit == 'ft' && geometry.unit == 'm') {
-                        let area = uoMService.convert(geometry.des, 'area', void 0, 'imperial', 0.01, false)
-                        this.context.fillText(parseFloat(area.replace(',', '')).toFixed(2), fontStart2.newpoint1.x + fontSize / 1.5, fontStart2.newpoint1.y)
-                    } else if (measureService.unit == 'm' && geometry.unit == 'ft') {
-                        let area = uoMService.convertBack(geometry.des, 'area', 7, 'imperial', 0.01, false)
-                        this.context.fillText(parseFloat(area.replace(',', '')).toFixed(2), fontStart2.newpoint1.x + fontSize / 1.5, fontStart2.newpoint1.y)
-                    } else if (geometry.unit == 'm') {
-                        this.context.fillText(parseFloat(geometry.des).toFixed(2) + 'm²', fontStart2.newpoint1.x, fontStart2.newpoint1.y)
-                    } else if (geometry.unit == 'ft') {
-                        this.context.fillText(parseFloat(geometry.des.replace(',', '')).toFixed(2) + 'ft²', fontStart2.newpoint1.x, fontStart2.newpoint1.y)
-                    }
-                }
             } else {
                 this.context.fillText(title, fontStart1.newpoint2.x, fontStart1.newpoint2.y)
-
-                if (geometry.des) {
-                    if (measureService.unit == 'ft' && geometry.unit == 'm') {
-                        let area = uoMService.convert(geometry.des, 'area', void 0, 'imperial', 0.01, false)
-                        this.context.fillText(parseFloat(area.replace(',', '')).toFixed(2), fontStart2.newpoint2.x + fontSize / 1.5, fontStart2.newpoint2.y)
-                    } else if (measureService.unit == 'm' && geometry.unit == 'ft') {
-                        let area = uoMService.convertBack(geometry.des, 'area', 7, 'imperial', 0.01, false)
-                        this.context.fillText(parseFloat(area.replace(',', '')).toFixed(2), fontStart2.newpoint2.x + fontSize / 1.5, fontStart2.newpoint2.y)
-                    } else if (geometry.unit == 'm') {
-                        this.context.fillText(parseFloat(geometry.des).toFixed(2) + 'm²', fontStart2.newpoint2.x, fontStart2.newpoint2.y)
-                    } else if (geometry.unit == 'ft') {
-                        this.context.fillText(parseFloat(geometry.des.replace(',', '')).toFixed(2) + 'ft²', fontStart2.newpoint2.x, fontStart2.newpoint2.y)
-                    }
-                }
             }
         }
 
@@ -1376,421 +1241,6 @@ export default class Draw {
         this.context.restore()
     }
 
-    //由多个点构成,里面的坐标都已经是屏幕坐标
-    drawMeasure(points, dir, styleType) {
-        this.context.save()
-        this.context.strokeStyle = Style.Measure.strokeStyle
-        this.context.lineWidth = Style.Measure.lineWidth * coordinate.ratio
-
-        if (styleType) {
-            if (styleType == 'style-1') {
-                this.context.lineWidth = Style.DownLoad.style1.Measure.lineWidth * coordinate.ratio
-                this.context.strokeStyle = Style.DownLoad.style1.Measure.strokeStyle
-            } else if (styleType == 'style-2') {
-                this.context.lineWidth = Style.DownLoad.style1.Measure.lineWidth * coordinate.ratio
-                this.context.strokeStyle = Style.DownLoad.style1.Measure.strokeStyle
-            } else if (styleType == 'style-3') {
-                this.context.lineWidth = Style.DownLoad.style1.Measure.lineWidth * coordinate.ratio
-                this.context.strokeStyle = Style.DownLoad.style1.Measure.strokeStyle
-            } else if (styleType == 'style-4') {
-                this.context.lineWidth = Style.DownLoad.style1.Measure.lineWidth * coordinate.ratio
-                this.context.strokeStyle = Style.DownLoad.style1.Measure.strokeStyle
-            }
-        }
-
-        for (let i = 0; i < points.length - 1; ++i) {
-            let start = coordinate.getScreenXY(points[i])
-            let end = coordinate.getScreenXY(points[i + 1])
-
-            let angle = 0
-            if (dir == 'top') {
-                start.y = measureService.region.top * coordinate.ratio
-                end.y = measureService.region.top * coordinate.ratio
-            } else if (dir == 'bottom') {
-                start.y = measureService.region.bottom * coordinate.ratio
-                end.y = measureService.region.bottom * coordinate.ratio
-            } else if (dir == 'left') {
-                start.x = measureService.region.left * coordinate.ratio
-                end.x = measureService.region.left * coordinate.ratio
-                angle = (-90 / 180) * Math.PI
-            } else if (dir == 'right') {
-                start.x = measureService.region.right * coordinate.ratio
-                end.x = measureService.region.right * coordinate.ratio
-                angle = (90 / 180) * Math.PI
-            }
-
-            let line = mathUtil.createLine1(start, end)
-            if (line == null) {
-                continue
-            }
-            let lines = mathUtil.getParallelLineForDistance(line, 6 * coordinate.ratio)
-
-            let start1 = mathUtil.getJoinLinePoint(start, lines.line1)
-            let end1 = mathUtil.getJoinLinePoint(end, lines.line1)
-            let start2 = mathUtil.getJoinLinePoint(start, lines.line2)
-            let end2 = mathUtil.getJoinLinePoint(end, lines.line2)
-
-            this.context.beginPath()
-            this.context.moveTo(start1.x, start1.y)
-            this.context.lineTo(start2.x, start2.y)
-            this.context.stroke()
-
-            this.context.beginPath()
-            this.context.moveTo(end1.x, end1.y)
-            this.context.lineTo(end2.x, end2.y)
-            this.context.stroke()
-
-            let mid = {
-                x: (start.x + end.x) / 2,
-                y: (start.y + end.y) / 2,
-            }
-
-            let vLine = mathUtil.getVerticalLine(line, mid)
-            lines = mathUtil.getParallelLineForDistance(vLine, 22 * coordinate.ratio)
-            let join1 = mathUtil.getIntersectionPoint(line, lines.line1)
-            let join2 = mathUtil.getIntersectionPoint(line, lines.line2)
-
-            if (mathUtil.getDistance(start, join1) < mathUtil.getDistance(start, mid)) {
-                let measureValue = mathUtil.getDistance(points[i], points[i + 1])
-                if (measureService.unit == 'ft') {
-                    measureValue = ' ' + uoMService.convert(measureValue, 'distance', void 0, 'imperial', 0.01, true) + ' '
-                    //measureValue = mathUtil.getFixed(measureValue / measureService.ftUnit, 2) + 'ft'
-                } else {
-                    measureValue = mathUtil.getFixed(measureValue, 2) + 'm'
-                }
-
-                if (mathUtil.getDistance(start, end) > this.context.measureText(measureValue).width) {
-                    this.context.beginPath()
-                    this.context.moveTo(start.x, start.y)
-                    this.context.lineTo(join1.x, join1.y)
-                    this.context.stroke()
-
-                    this.context.beginPath()
-                    this.context.moveTo(join2.x, join2.y)
-                    this.context.lineTo(end.x, end.y)
-                    this.context.stroke()
-
-                    this.context.save()
-                    if (coordinate.ratio == Constant.ratio) {
-                        this.context.font = '36px Microsoft YaHei'
-                    } else {
-                        this.context.font = '12px Microsoft YaHei'
-                    }
-                    if (styleType == 'style-1' || styleType == 'style-3') {
-                        this.context.fillStyle = '#000000'
-                        this.context.strokeStyle = '#000000'
-                    } else {
-                        this.context.fillStyle = '#FFFFFF'
-                        this.context.strokeStyle = '#FFFFFF'
-                    }
-                    this.context.textAlign = 'center'
-                    this.context.textBaseline = 'middle'
-                    this.context.miterLimit = 10
-                    this.context.direction = 'ltr'
-
-                    if (angle) {
-                        this.context.translate(mid.x, mid.y)
-                        this.context.rotate(angle)
-                        this.context.fillText(measureValue, 0, 0)
-                    } else {
-                        this.context.fillText(measureValue, mid.x, mid.y)
-                    }
-                    this.context.restore()
-                } else {
-                    this.context.beginPath()
-                    this.context.moveTo(start.x, start.y)
-                    this.context.lineTo(end.x, end.y)
-                    this.context.stroke()
-                }
-            } else {
-                let measureValue = mathUtil.getDistance(points[i], points[i + 1])
-                if (measureService.unit == 'ft') {
-                    //measureValue = mathUtil.getFixed(measureValue / measureService.ftUnit, 2) + 'ft'
-                    measureValue = ' ' + uoMService.convert(measureValue, 'distance', void 0, 'imperial', 0.01, true) + ' '
-                } else {
-                    measureValue = mathUtil.getFixed(measureValue, 2) + 'm'
-                }
-
-                if (mathUtil.getDistance(start, end) > this.context.measureText(measureValue).width) {
-                    this.context.beginPath()
-                    this.context.moveTo(start.x, start.y)
-                    this.context.lineTo(join2.x, join2.y)
-                    this.context.stroke()
-
-                    this.context.beginPath()
-                    this.context.moveTo(join1.x, join1.y)
-                    this.context.lineTo(end.x, end.y)
-                    this.context.stroke()
-
-                    this.context.save()
-                    if (coordinate.ratio == Constant.ratio) {
-                        this.context.font = '36px Microsoft YaHei'
-                    } else {
-                        this.context.font = '12px Microsoft YaHei'
-                    }
-                    if (styleType == 'style-1' || styleType == 'style-3') {
-                        this.context.fillStyle = '#000000'
-                        this.context.strokeStyle = '#000000'
-                    } else {
-                        this.context.fillStyle = '#FFFFFF'
-                        this.context.strokeStyle = '#FFFFFF'
-                    }
-                    this.context.textAlign = 'center'
-                    this.context.textBaseline = 'middle'
-                    this.context.miterLimit = 10
-                    this.context.direction = 'ltr'
-
-                    if (angle) {
-                        this.context.translate(mid.x, mid.y)
-                        this.context.rotate(angle)
-                        this.context.fillText(measureValue, 0, 0)
-                    } else {
-                        this.context.fillText(measureValue, mid.x, mid.y)
-                    }
-                    this.context.restore()
-                } else {
-                    this.context.beginPath()
-                    this.context.moveTo(start.x, start.y)
-                    this.context.lineTo(end.x, end.y)
-                    this.context.stroke()
-                }
-            }
-        }
-        this.context.restore()
-    }
-
-    drawMeasureTxt(startPoint, endPoint) {
-        const _startPoint = coordinate.getScreenXY(startPoint)
-        const _endPoint = coordinate.getScreenXY(endPoint)
-
-        const measureInterval = 10
-        const line = mathUtil.createLine1(_startPoint, _endPoint)
-        if (line == null) {
-            return
-        }
-        let mid = { x: (_startPoint.x + _endPoint.x) / 2, y: (_startPoint.y + _endPoint.y) / 2 }
-        const lines = mathUtil.getParallelLineForDistance(line, measureInterval)
-        let pLine = null
-        let mid1 = mathUtil.getJoinLinePoint(mid, lines.line1)
-        let mid2 = mathUtil.getJoinLinePoint(mid, lines.line2)
-        if (mid.y < mid1.y) {
-            mathUtil.clonePoint(mid, mid2)
-            pLine = lines.line2
-        } else {
-            mathUtil.clonePoint(mid, mid1)
-            pLine = lines.line1
-        }
-
-        let measureDistance = mathUtil.getDistance(startPoint, endPoint)
-
-        if (measureService.unit == 'ft') {
-            //measureDistance = mathUtil.getFixed(measureDistance / measureService.ftUnit, 2) + 'ft'
-            measureDistance = ' ' + uoMService.convert(measureDistance, 'distance', void 0, 'imperial', 0.01, true) + ' '
-        } else {
-            measureDistance = mathUtil.getFixed(measureDistance, 2) + 'm'
-        }
-
-        const fontWidth = this.context.measureText(measureDistance).width
-        let vLine = mathUtil.getLineForPoint(line, mid)
-        const vLines = mathUtil.getParallelLineForDistance(vLine, fontWidth / 2)
-        let startJoin = mathUtil.getIntersectionPoint(vLines.line1, pLine)
-        startJoin = {
-            x: Math.round(startJoin.x),
-            y: Math.round(startJoin.y),
-        }
-        let endJoin = mathUtil.getIntersectionPoint(vLines.line2, pLine)
-        endJoin = {
-            x: Math.round(endJoin.x),
-            y: Math.round(endJoin.y),
-        }
-
-        if (startJoin.x < endJoin.x) {
-            mathUtil.clonePoint(mid, startJoin)
-        } else if (startJoin.x > endJoin.x) {
-            mathUtil.clonePoint(mid, endJoin)
-        } else if (startJoin.y < endJoin.y) {
-            mathUtil.clonePoint(mid, startJoin)
-        } else {
-            mathUtil.clonePoint(mid, endJoin)
-        }
-
-        //const fontStart = mathUtil.getDisPointsLine(line, mid, fontWidth / 2, fontWidth / 2)
-        // let a1, a2
-        let angle = null
-        if (typeof line.a !== 'undefined') {
-            angle = Math.atan(line.a)
-        } else if (line.hasOwnProperty('x')) {
-            angle = Math.PI / 2
-        } else {
-            angle = 0
-        }
-
-        this.context.save()
-        this.context.fillStyle = Style.Measure.txt
-        this.context.translate(mid.x, mid.y)
-        this.context.rotate(angle)
-        this.context.fillText(measureDistance, 0, 0)
-        /*
-        if (fontStart.newpoint1.x > fontStart.newpoint2.x) {
-            this.context.translate(mid.x, mid.y)
-            this.context.rotate(angle)
-            //this.context.strokeText(measureDistance, 0, 0);
-            this.context.fillText(measureDistance, 0, 0)
-            // a1 = fontStart.newpoint2
-            // a2 = fontStart.newpoint1
-        } else if (fontStart.newpoint1.x < fontStart.newpoint2.x) {
-            this.context.translate(mid.x, mid.y)
-            this.context.rotate(angle)
-            //this.context.strokeText(measureDistance, 0, 0);
-            this.context.fillText(measureDistance, 0, 0)
-            // a1 = fontStart.newpoint1
-            // a2 = fontStart.newpoint2
-        } else if (fontStart.newpoint1.y < fontStart.newpoint2.y) {
-            this.context.translate(mid.x, mid.y)
-            this.context.rotate(angle)
-            //this.context.strokeText(measureDistance, 0, 0);
-            this.context.fillText(measureDistance, 0, 0)
-            // a2 = fontStart.newpoint2
-            // a1 = fontStart.newpoint1
-        } else {
-            this.context.translate(mid.x, mid.y)
-            this.context.rotate(angle)
-            //this.context.strokeText(measureDistance, 0, 0);
-            this.context.fillText(measureDistance, 0, 0)
-            // a2 = fontStart.newpoint1
-            // a1 = fontStart.newpoint2
-        }
-        */
-
-        this.context.restore()
-    }
-
-    drawEntranceDoor(symbol) {
-        this.context.save()
-        const img = symbolService.getEnterImg()
-        let mid = {
-            x: (symbol.startPoint.x + symbol.endPoint.x) / 2,
-            y: (symbol.startPoint.y + symbol.endPoint.y) / 2,
-        }
-        const line = mathUtil.createLine1(symbol.startPoint, symbol.endPoint)
-        const vLine = mathUtil.getLineForPoint(line, mid)
-        let lines = null
-        let position = null
-
-        let join1, join2
-        //方向相同的时候,指向symbol的中点
-        if (symbol.enter == 'default') {
-            //lines = mathUtil.getParallelLineForDistance(line, ((img.height / 2 / coordinate.res) * Constant.defaultZoom) / coordinate.zoom)
-            //lines = mathUtil.getParallelLineForDistance(line, img.height / 2 / coordinate.res)
-            lines = mathUtil.getParallelLineForDistance(line, 0.02)
-        }
-        //不同的时候,离中点有一定距离
-        else if (symbol.enter == 'reverse') {
-            //lines = mathUtil.getParallelLineForDistance(line, ((img.height / 2 / coordinate.res) * Constant.defaultZoom) / coordinate.zoom + mathUtil.getDistance(symbol.startPoint, symbol.endPoint))
-            //lines = mathUtil.getParallelLineForDistance(line, img.height / 2 / coordinate.res + mathUtil.getDistance(symbol.startPoint, symbol.endPoint))
-            lines = mathUtil.getParallelLineForDistance(line, 0.02 + mathUtil.getDistance(symbol.startPoint, symbol.endPoint))
-        }
-        join1 = mathUtil.getIntersectionPoint(lines.line1, vLine)
-        join2 = mathUtil.getIntersectionPoint(lines.line2, vLine)
-
-        let angle = mathUtil.Angle(
-            symbol.startPoint,
-            {
-                x: symbol.startPoint.x + 1,
-                y: symbol.startPoint.y,
-            },
-            symbol.endPoint
-        )
-
-        if (mathUtil.isClockwise([symbol.startPoint, symbol.endPoint, join2])) {
-            //LEFT
-            if (symbol.openSide == 'LEFT') {
-                if (symbol.enter == 'default') {
-                    position = join1
-                } else {
-                    position = join2
-                }
-            } else {
-                if (symbol.enter == 'default') {
-                    position = join2
-                } else {
-                    position = join1
-                }
-            }
-        } else if (mathUtil.isClockwise([symbol.startPoint, symbol.endPoint, join1])) {
-            //LEFT
-            if (symbol.openSide == 'LEFT') {
-                if (symbol.enter == 'default') {
-                    position = join2
-                } else {
-                    position = join1
-                }
-            } else {
-                if (symbol.enter == 'default') {
-                    position = join1
-                } else {
-                    position = join2
-                }
-            }
-        }
-
-        if (!mathUtil.isClockwise([symbol.startPoint, symbol.endPoint, position])) {
-            angle = Math.PI + angle
-        }
-
-        //门/窗的中心点
-        //position = coordinate.getScreenXY(mid)
-        //入户门图片的起点坐标
-        position = coordinate.getScreenXY(position)
-
-        this.context.translate(position.x, position.y)
-        console.log('截图:' + JSON.stringify(position))
-        if (symbol.startPoint.y <= symbol.endPoint.y) {
-            this.context.rotate(-angle)
-        } else {
-            this.context.rotate(angle)
-        }
-
-        let symbolLen = mathUtil.getDistance(symbol.startPoint, symbol.endPoint) * coordinate.res * 1.5
-        // let symbolLen = img.height
-        this.context.scale(
-            ((coordinate.zoom / Constant.defaultZoom) * coordinate.ratio * symbolLen) / img.height,
-            ((coordinate.zoom / Constant.defaultZoom) * coordinate.ratio * symbolLen) / img.height
-        )
-        this.context.drawImage(img, -img.width / 2, -img.height - 10)
-        this.context.restore()
-    }
-
-    // 房间要有背景颜色
-    drawRoomBackGround(room, img) {
-        this.context.save()
-        let isFill = false
-        if (img) {
-            this.context.fillStyle = this.context.createPattern(img, 'repeat')
-            isFill = true
-        } else {
-            return
-        }
-        let finalPoints = []
-        for (let k = 0; k < room.wallPointIDs.length; ++k) {
-            let point = floorplanService.getPoint(room.wallPointIDs[k])
-            point = coordinate.getScreenXY(point)
-            finalPoints.push(point)
-        }
-
-        this.context.beginPath()
-        this.context.moveTo(finalPoints[0].x, finalPoints[0].y)
-        for (let i = 0; i < finalPoints.length; ++i) {
-            this.context.lineTo(finalPoints[i].x, finalPoints[i].y)
-        }
-
-        this.context.closePath()
-        if (isFill) {
-            this.context.fill()
-        }
-        this.context.restore()
-    }
-
     drawCompass(styleType) {
         const padTop = 160
         const padRight = 310

+ 0 - 22
src/views/draw-file/board/editCAD/Renderer/Render.js

@@ -1,11 +1,8 @@
 import VectorType from '../enum/VectorType.js'
 import { floorplanService } from '../Service/FloorplanService.js'
 import { elementService } from '../Service/ElementService.js'
-import { measureService } from '../Service/MeasureService'
 import { coordinate } from '../Coordinate.js'
 import { draw } from './Draw.js'
-import { roomService } from '../Service/RoomService.js'
-import { roomsUtil } from '../Room/RoomsUtil.js'
 import { floorplanData } from '../FloorplanData.js'
 import { furnitureService } from '../Service/FurnitureService.js'
 
@@ -132,14 +129,6 @@ export default class Render {
         }
     }
 
-    redrawMeasures(styleType) {
-        //
-        draw.drawMeasure(measureService.measureLines.top, 'top', styleType)
-        draw.drawMeasure(measureService.measureLines.bottom, 'bottom', styleType)
-        draw.drawMeasure(measureService.measureLines.left, 'left', styleType)
-        draw.drawMeasure(measureService.measureLines.right, 'right', styleType)
-    }
-
     redrawRooms(floor) {
         let rooms = roomService.getRooms(floor)
         for (let i = 0; i < rooms.length; ++i) {
@@ -211,16 +200,6 @@ export default class Render {
         }
 
         this.redrawElements()
-        this.redrawMeasures()
-
-        // let _rooms = floorplanService.getRooms()
-        // if(_rooms.length == 0){
-        //     roomsUtil.start()
-        // }
-        // let rooms = floorplanService.getRooms()
-        // for (let i = 0; i < rooms.length; ++i) {
-        //     draw.drawText(rooms[i].center, rooms[i].roomId, false, 0)
-        // }
     }
 
     autoRedrawForImg() {
@@ -313,7 +292,6 @@ export default class Render {
             this.drawGeometry(tags[key], styleType)
         }
 
-        this.redrawMeasures(styleType)
         draw.drawCompass(styleType)
     }
 

+ 0 - 12
src/views/draw-file/board/editCAD/Service/ComponentService.js

@@ -1,7 +1,5 @@
 import VectorType from '../enum/VectorType.js'
 import Beam from '../Geometry/Beam.js'
-import Flue from '../Geometry/Flue.js'
-import Corridor from '../Geometry/Corridor.js'
 import { floorplanService } from './FloorplanService'
 
 export class ComponentService {
@@ -17,12 +15,6 @@ export class ComponentService {
             case VectorType.Beam:
                 component = new Beam(position, vectorId)
                 break
-            case VectorType.Flue:
-                component = new Flue(position, vectorId)
-                break
-            case VectorType.Corridor:
-                component = new Corridor(position, vectorId)
-                break
         }
 
         component.setPoints2d()
@@ -34,10 +26,6 @@ export class ComponentService {
         switch (geoType) {
             case VectorType.Beam:
                 return true
-            case VectorType.Flue:
-                return true
-            case VectorType.Corridor:
-                return true
         }
         return false
     }

+ 1 - 8
src/views/draw-file/board/editCAD/Service/StateService.js

@@ -1,6 +1,5 @@
 import VectorType from '../enum/VectorType.js'
 import SelectState from '../enum/SelectState.js'
-import { symbolService } from './SymbolService.js'
 import { componentService } from './ComponentService.js'
 import { furnitureService } from './FurnitureService.js'
 
@@ -30,13 +29,7 @@ export default class StateService {
         this.selectItem.vectorId = vectorId
         this.selectItem.type = type
 
-        if (symbolService.isSymbol(type)) {
-            if (state == SelectState.Select) {
-                this.selectItem.selectIndex = SelectState.All
-            } else {
-                this.selectItem.selectIndex = state
-            }
-        } else if (componentService.isComponent(type)) {
+        if (componentService.isComponent(type)) {
             if (state == SelectState.Select) {
                 this.selectItem.selectIndex = SelectState.All
             }

+ 0 - 928
src/views/draw-file/board/editCAD/Service/SymbolService.js

@@ -1,928 +0,0 @@
-import { mathUtil } from '../MathUtil.js'
-import SingleDoor from '../Geometry/SingleDoor.js'
-import DoubleDoor from '../Geometry/DoubleDoor.js'
-import SlideDoor from '../Geometry/SlideDoor.js'
-import SingleWindow from '../Geometry/SingleWindow.js'
-import FrenchWindow from '../Geometry/FrenchWindow.js'
-import BayWindow from '../Geometry/BayWindow.js'
-import Pass from '../Geometry/Pass.js'
-import { coordinate } from '../Coordinate'
-import { floorplanService } from './FloorplanService'
-import { wallService } from './WallService.js'
-import VectorType from '../enum/VectorType.js'
-
-import Constant from '../Constant'
-
-export class SymbolService {
-    constructor() {
-        this.enterImg = null
-    }
-
-    // 新建symbol
-    createSymbol(start, end, geoType, parent, symbolId) {
-        let symbol = null
-        switch (geoType) {
-            case VectorType.BayWindow:
-                symbol = new BayWindow(start, end, symbolId)
-                break
-            case VectorType.FrenchWindow:
-                symbol = new FrenchWindow(start, end, symbolId)
-                break
-            case VectorType.SingleDoor:
-                symbol = new SingleDoor(start, end, symbolId)
-                break
-            case VectorType.DoubleDoor:
-                symbol = new DoubleDoor(start, end, symbolId)
-                break
-            case VectorType.SlideDoor:
-                symbol = new SlideDoor(start, end, symbolId)
-                break
-            case VectorType.SingleWindow:
-                symbol = new SingleWindow(start, end, symbolId)
-                break
-            case VectorType.Pass:
-                symbol = new Pass(start, end, symbolId)
-                break
-        }
-        if (symbol != null) {
-            symbol.setSymbolParent(parent)
-            symbol.setPoints2d()
-            floorplanService.addSymbol(symbol)
-        }
-        if (parent) {
-            const wall = floorplanService.getWall(parent)
-            wallService.addChildren(wall, symbol.vectorId)
-        }
-
-        return symbol
-    }
-
-    addSymbol(position, symbolType, wallId) {
-        const symbolLen = this.getDefaultSymbolLen(symbolType)
-        const wall = floorplanService.getWall(wallId)
-        const wallLine = wallService.getLine(wall)
-        position = mathUtil.getJoinLinePoint(position, wallLine)
-        // const twoParallels = mathUtil.getParallelLineForDistance(vSymbolLine, symbolLen / 2)
-        // const point1 = mathUtil.getIntersectionPoint(twoParallels.line1, wallLine)
-        // const point2 = mathUtil.getIntersectionPoint(twoParallels.line2, wallLine)
-        // 不能超出墙的范围
-        // const newPositions = this.getNewForContainSymbols(point1, point2, wallId)
-        // if (wallService.isContain(wall, point1) && wallService.isContain(wall, point2) && newPositions != null && !newPositions.collision) {
-        //     const symbol = this.createSymbol(point1, point2, symbolType, wallId)
-        //     return symbol.vectorId
-        // }
-
-        const newPositions = this.getNewPosForSymbol(position, wallId, null, symbolLen)
-        if (newPositions.state) {
-            const symbol = this.createSymbol(newPositions.position1, newPositions.position2, symbolType, wallId)
-            return symbol.vectorId
-        }
-        return null
-    }
-
-    isSymbol(geoType) {
-        switch (geoType) {
-            case 'BayWindow':
-                return true
-            case 'FrenchWindow':
-                return true
-            case 'SingleDoor':
-                return true
-            case 'DoubleDoor':
-                return true
-            case 'SlideDoor':
-                return true
-            case 'SingleWindow':
-                return true
-            case 'Pass':
-                return true
-        }
-        return false
-    }
-
-    getDefaultSymbolLen(geoType) {
-        let len = 0
-        switch (geoType) {
-            case 'BayWindow':
-                len = 1.5
-                break
-            case 'FrenchWindow':
-                len = 1.5
-                break
-            case 'SingleDoor':
-                len = 0.8
-                break
-            case 'DoubleDoor':
-                len = 1.5
-                break
-            case 'SlideDoor':
-                len = 1.5
-                break
-            case 'SingleWindow':
-                len = 0.8
-                break
-            case 'Pass':
-                len = 0.8
-                break
-        }
-        return len
-    }
-
-    //从墙上去掉symbol的所属
-    deleteSymbolForWall(wall, symbolId) {
-        if (wall) {
-            let index = wall.children.indexOf(symbolId)
-            if (index > -1) {
-                wall.children.splice(index, 1)
-            }
-            let symbol = floorplanService.getSymbol(symbolId)
-            symbol.parent = null
-        }
-    }
-
-    deleteSymbol(symbolId) {
-        const symbol = floorplanService.getSymbol(symbolId)
-        if (symbol.parent) {
-            let wall = floorplanService.getWall(symbol.parent)
-            this.deleteSymbolForWall(wall, symbolId)
-        }
-        floorplanService.deleteSymbol(symbolId)
-    }
-
-    // 更新symbol的归属
-    changeSymbolForBelong(symbolId, wallId) {
-        const symbol = floorplanService.getSymbol(symbolId)
-        const parentId = symbol.parent
-        const parent = floorplanService.getWall(parentId)
-
-        this.deleteSymbolForWall(parent, symbolId)
-        symbol.setSymbolParent(wallId)
-        let wall = floorplanService.getWall(wallId)
-        wallService.addChildren(wall, symbolId)
-    }
-
-    // 拆分墙的时候,symbol也要相应的改变
-    // wall拆分成wallId1和wallId2,一般情况wallId和wallId1是相同的
-    reBelongForSplitWall(wallId, wallId1, wallId2) {
-        const wall = floorplanService.getWall(wallId)
-        for (let i = 0; i < wall.children.length; ++i) {
-            const symbolId = wall.children[i]
-            if (wallId != wallId1 && this.isContainSymbolForWall(symbolId, wallId1)) {
-                this.changeSymbolForBelong(symbolId, wallId1)
-            } else if (wallId != wallId2 && this.isContainSymbolForWall(symbolId, wallId2)) {
-                this.changeSymbolForBelong(symbolId, wallId2)
-            }
-        }
-    }
-
-    // wallId对应的墙是否包含symbol
-    isContainSymbolForWall(symbolId, wallId) {
-        const wall = floorplanService.getWall(wallId)
-        const symbol = floorplanService.getSymbol(symbolId)
-        const point = { x: (symbol.startPoint.x + symbol.endPoint.x) / 2, y: (symbol.startPoint.y + symbol.endPoint.y) / 2 }
-
-        if (wallService.isContain(wall, point)) {
-            return true
-        }
-    }
-
-    // 更新symbol的归属
-    // 墙可能删除了,也可能合并了等等
-    changeSymbolForBelong(symbolId, wallId) {
-        const symbol = floorplanService.getSymbol(symbolId)
-        const parentId = symbol.parent
-        let parent = floorplanService.getWall(parentId)
-        this.deleteSymbolForWall(parent, symbolId)
-        symbol.setSymbolParent(wallId)
-        let wall = floorplanService.getWall(wallId)
-        wallService.addChildren(wall, symbolId)
-    }
-
-    // 墙角pointId移动的时候,周围的symbol都跟着变化
-    updateSymbolsPositionsForWallCorner(pointId) {
-        const point = floorplanService.getPoint(pointId)
-        const parent = point.parent
-        for (const key in parent) {
-            this.updateSymbolsPositionsForWall(key)
-        }
-    }
-
-    // wallId对应的wall改变的时候,上面的symbol也跟着改变
-    updateSymbolsPositionsForWall(wallId) {
-        const wall = floorplanService.getWall(wallId)
-        const symbolIds = wall.children
-        for (let i = 0; i < symbolIds.length; ++i) {
-            const symbol = floorplanService.getSymbol(symbolIds[i])
-            this.updateSEForChangeWall(symbol)
-        }
-    }
-
-    // 更新Symbold的startPoint,endPoint和points2d,随着wall来
-    updateSEForChangeWall(symbol) {
-        const symbolId = symbol.vectorId
-        //const symbol = floorplanService.getSymbol(symbolId);
-        const wall = floorplanService.getWall(symbol.parent)
-
-        const startPoint = floorplanService.getPoint(wall.start)
-        const endPoint = floorplanService.getPoint(wall.end)
-
-        const line = mathUtil.createLine1(startPoint, endPoint)
-        const newStart = mathUtil.getJoinLinePoint(symbol.startPoint, line)
-        const newEnd = mathUtil.getJoinLinePoint(symbol.endPoint, line)
-
-        const dif = { x: 0, y: 0 }
-        const min = 0.001 //不要超出一点
-        let containFlag = true
-        if (!wallService.isContain(wall, newStart)) {
-            // symbol的start与wall的start挨的近
-            if (mathUtil.getDistance(newStart, startPoint) < mathUtil.getDistance(newStart, endPoint)) {
-                dif.x = startPoint.x - newStart.x
-                dif.y = startPoint.y - newStart.y
-            } else {
-                dif.x = endPoint.x - newStart.x
-                dif.y = endPoint.y - newStart.y
-            }
-            newStart.x += dif.x
-            newStart.y += dif.y
-
-            if (
-                wallService.isContain(wall, {
-                    x: newEnd.x + dif.x,
-                    y: newEnd.y + dif.y,
-                })
-            ) {
-                newEnd.x += dif.x
-                newEnd.y += dif.y
-            }
-
-            containFlag = false
-        } else if (!wallService.isContain(wall, newEnd)) {
-            if (mathUtil.getDistance(newEnd, startPoint) < mathUtil.getDistance(newEnd, endPoint)) {
-                dif.x = startPoint.x - newEnd.x
-                dif.y = startPoint.y - newEnd.y
-            } else {
-                dif.x = endPoint.x - newEnd.x
-                dif.y = endPoint.y - newEnd.y
-            }
-
-            newEnd.x += dif.x
-            newEnd.y += dif.y
-
-            if (
-                wallService.isContain(wall, {
-                    x: newStart.x + dif.x,
-                    y: newStart.y + dif.y,
-                })
-            ) {
-                newStart.x += dif.x
-                newStart.y += dif.y
-            }
-
-            containFlag = false
-        }
-
-        // 是否与wall上别的symbol部分重合
-        if (!containFlag) {
-            this.updateSEForCollideSymbols(symbolId, newStart, newEnd)
-        } else {
-            this.setPosition(symbol, newStart, 'start')
-            this.setPosition(symbol, newEnd, 'end')
-            symbol.setPoints2d()
-        }
-    }
-
-    //需要考虑碰撞
-    updateSEForCollideSymbols(symbolId, newStart, newEnd) {
-        const symbol = floorplanService.getSymbol(symbolId)
-        // 是否与wall上别的symbol部分重合
-        const newPositions = this.getNewForContainSymbols(newStart, newEnd, symbol.parent, symbolId)
-        // if (newPositions != null) {
-        //     this.setPosition(symbol, newPositions.position1, 'start')
-        //     this.setPosition(symbol, newPositions.position2, 'end')
-        //     symbol.setPoints2d()
-        // }
-
-        // if (mathUtil.getDistance(symbol.startPoint, symbol.endPoint) < Constant.minSymbolLen) {
-        //     this.deleteSymbol(symbolId)
-        // }
-        if (newPositions != null) {
-            if (mathUtil.getDistance(newPositions.position1, newPositions.position2) < Constant.minSymbolLen) {
-                this.deleteSymbol(symbolId)
-            } else {
-                this.setPosition(symbol, newPositions.position1, 'start')
-                this.setPosition(symbol, newPositions.position2, 'end')
-                symbol.setPoints2d()
-            }
-        }
-    }
-
-    //position1, position2表示exceptSymbolId新的坐标
-    getNewForContainSymbols(position1, position2, wallId, exceptSymbolId) {
-        const min = 0.01
-        const wall = floorplanService.getWall(wallId)
-        let points = []
-        for (let i = 0; i < wall.children.length; ++i) {
-            const symbolId = wall.children[i]
-            if (symbolId == exceptSymbolId) {
-                continue
-            }
-            const symbol = floorplanService.getSymbol(symbolId)
-            points.push({
-                x: symbol.startPoint.x,
-                y: symbol.startPoint.y,
-                index: 1,
-                vectorId: symbolId,
-            })
-            points.push({
-                x: symbol.endPoint.x,
-                y: symbol.endPoint.y,
-                index: 2,
-                vectorId: symbolId,
-            })
-        }
-
-        points.push({
-            x: position1.x,
-            y: position1.y,
-            index: 1,
-            vectorId: exceptSymbolId,
-        })
-        points.push({
-            x: position2.x,
-            y: position2.y,
-            index: 2,
-            vectorId: exceptSymbolId,
-        })
-
-        const startPoint = floorplanService.getPoint(wall.start)
-        points = points.sort(sortNumber.bind(this))
-        function sortNumber(a, b) {
-            return mathUtil.getDistance(startPoint, a) - mathUtil.getDistance(startPoint, b)
-        }
-
-        for (let i = 0; i < points.length - 1; ++i) {
-            if (points[i].vectorId == exceptSymbolId) {
-                if (i == 0 || i == points.length - 2) {
-                    if (mathUtil.getDistance(points[i], points[i + 1]) < Constant.minSymbolLen) {
-                        return null
-                    } else if (points[i + 1].vectorId == exceptSymbolId) {
-                        return {
-                            position1: position1,
-                            position2: { x: points[i + 1].x, y: points[i + 1].y },
-                        }
-                    } else if (points[i + 1].vectorId != exceptSymbolId) {
-                        return {
-                            position1: position1,
-                            position2: { x: points[i + 1].x, y: points[i + 1].y },
-                            collision: true,
-                        }
-                    }
-                }
-                //不在其他symbol内部
-                else if (points[i + 1].vectorId == exceptSymbolId && points[i - 1].vectorId != points[i + 2].vectorId) {
-                    if (mathUtil.getDistance({ x: points[i - 1].x, y: points[i - 1].y }, { x: points[i + 2].x, y: points[i + 2].y }) < Constant.minSymbolLen) {
-                        return null
-                    } else {
-                        return {
-                            position1: { x: points[i - 1].x, y: points[i - 1].y },
-                            position2: { x: points[i + 2].x, y: points[i + 2].y },
-                            //collision: true,
-                        }
-                    }
-                }
-            }
-        }
-        return null
-    }
-
-    getNewPosForSymbol(point, wallId, exceptSymbolId, currentSymbolLen) {
-        const wall = floorplanService.getWall(wallId)
-        const startPoint = floorplanService.getPoint(wall.start)
-        const endPoint = floorplanService.getPoint(wall.end)
-        const wallLine = wallService.getLine(wall)
-        const vSymbolLine = mathUtil.getVerticalLine(wallLine, point)
-        let symbolLen = currentSymbolLen
-        if (exceptSymbolId) {
-            const currentSymbol = floorplanService.getSymbol(exceptSymbolId)
-            symbolLen = currentSymbol.len
-        }
-
-        const twoParallels = mathUtil.getParallelLineForDistance(vSymbolLine, symbolLen / 2)
-        let point1 = mathUtil.getIntersectionPoint(twoParallels.line1, wallLine)
-        let point2 = mathUtil.getIntersectionPoint(twoParallels.line2, wallLine)
-
-        //如果在墙外部,就平移到墙内部
-        if (mathUtil.getDistance(startPoint, endPoint) < symbolLen) {
-            mathUtil.clonePoint(point1, startPoint)
-            mathUtil.clonePoint(point2, endPoint)
-        } else {
-            let dx, dy
-            let _point1 = {}
-            let _point2 = {}
-            if (!wallService.isContain(wall, point1)) {
-                dx = startPoint.x - point1.x
-                dy = startPoint.y - point1.y
-                _point2.x = point2.x + dx
-                _point2.y = point2.y + dy
-                if (!wallService.isContain(wall, _point2)) {
-                    dx = endPoint.x - point1.x
-                    dy = endPoint.y - point1.y
-
-                    point2.x += dx
-                    point2.y += dy
-                    mathUtil.clonePoint(point1, endPoint)
-                } else {
-                    point2.x += dx
-                    point2.y += dy
-                    mathUtil.clonePoint(point1, startPoint)
-                }
-            } else if (!wallService.isContain(wall, point2)) {
-                dx = startPoint.x - point2.x
-                dy = startPoint.y - point2.y
-                _point1.x = point1.x + dx
-                _point1.y = point1.y + dy
-                if (!wallService.isContain(wall, _point1)) {
-                    dx = endPoint.x - point2.x
-                    dy = endPoint.y - point2.y
-
-                    point1.x += dx
-                    point1.y += dy
-                    mathUtil.clonePoint(point2, endPoint)
-                } else {
-                    point1.x += dx
-                    point1.y += dy
-                    mathUtil.clonePoint(point2, startPoint)
-                }
-            }
-        }
-
-        let points = []
-        for (let i = 0; i < wall.children.length; ++i) {
-            const symbolId = wall.children[i]
-            if (symbolId == exceptSymbolId) {
-                continue
-            }
-            const symbol = floorplanService.getSymbol(symbolId)
-            points.push({
-                x: symbol.startPoint.x,
-                y: symbol.startPoint.y,
-                index: 1, //表示start
-                vectorId: symbolId,
-            })
-            points.push({
-                x: symbol.endPoint.x,
-                y: symbol.endPoint.y,
-                index: 2, //表示end
-                vectorId: symbolId,
-            })
-        }
-
-        points.push({
-            x: startPoint.x,
-            y: startPoint.y,
-            index: 1,
-            vectorId: wallId,
-            type: VectorType.Wall,
-        })
-        points.push({
-            x: endPoint.x,
-            y: endPoint.y,
-            index: 2,
-            vectorId: wallId,
-            type: VectorType.Wall,
-        })
-
-        points = points.sort(sortNumber.bind(this))
-        function sortNumber(a, b) {
-            return mathUtil.getDistance(startPoint, a) - mathUtil.getDistance(startPoint, b)
-        }
-
-        let flag = true
-        for (let i = 0; i < points.length - 1; ++i) {
-            if (mathUtil.isContainForSegment(point, points[i], points[i + 1])) {
-                if (mathUtil.getDistance(points[i], points[i + 1]) > symbolLen) {
-                    //完全在一个symbol内部或者symbol内有其他的symbol
-                    if (points[i].vectorId == points[i + 1].vectorId && points[i].type != VectorType.Wall) {
-                        return {
-                            position1: point1,
-                            position2: point2,
-                            collision: true,
-                            state: false,
-                        }
-                    }
-                    //完全在wall内部
-                    else if (points[i].vectorId == points[i + 1].vectorId && points[i].type == VectorType.Wall) {
-                        return {
-                            position1: point1,
-                            position2: point2,
-                            collision: true,
-                            state: true,
-                        }
-                    }
-                    //一端在墙/门/窗外部
-                    else if (!mathUtil.isContainForSegment(point1, points[i], points[i + 1]) || !mathUtil.isContainForSegment(point2, points[i], points[i + 1])) {
-                        return {
-                            position1: point1,
-                            position2: point2,
-                            collision: true,
-                            state: false,
-                        }
-                    }
-                } else if (mathUtil.getDistance(points[i], points[i + 1]) < Constant.minSymbolLen) {
-                    return {
-                        position1: point1,
-                        position2: point2,
-                        collision: true,
-                        state: false,
-                    }
-                }
-                //大于最小距离,小于本来的长度。
-                else if (points[i].vectorId != points[i + 1].vectorId) {
-                    return {
-                        position1: { x: points[i].x, y: points[i].y },
-                        position2: { x: points[i + 1].x, y: points[i + 1].y },
-                        collision: true,
-                        state: true,
-                    }
-                }
-                //完全在一个symbol内部
-                else if (points[i].vectorId == points[i + 1].vectorId && points[i].type != VectorType.Wall) {
-                    return {
-                        position1: point1,
-                        position2: point2,
-                        collision: true,
-                        state: false,
-                    }
-                } else if (points[i].vectorId == points[i + 1].vectorId && points[i].type == VectorType.Wall) {
-                    return {
-                        position1: { x: points[i].x, y: points[i].y },
-                        position2: { x: points[i + 1].x, y: points[i + 1].y },
-                        collision: true,
-                        state: true,
-                    }
-                }
-                flag = false
-            } else if (mathUtil.getDistance(point, points[i]) < Constant.minRealDis) {
-                return {
-                    position1: point1,
-                    position2: point2,
-                    collision: true,
-                    state: false,
-                }
-            }
-        }
-        if (flag) {
-            return {
-                position1: point1,
-                position2: point2,
-                collision: false,
-                state: true,
-            }
-        } else {
-            //console.error(566)
-            return {
-                position1: point1,
-                position2: point2,
-                collision: false,
-                state: true,
-            }
-        }
-        // return {
-        //     position1: point1,
-        //     position2: point2,
-        //     collision: false,
-        //     state: true,
-        // }
-    }
-
-    setPosition(symbol, position, dir) {
-        if (dir == 'start') {
-            mathUtil.clonePoint(symbol.startPoint, position)
-        } else if (dir == 'end') {
-            mathUtil.clonePoint(symbol.endPoint, position)
-        }
-    }
-
-    // 只考虑symbol的端点可能不在墙面上了,这时候要更新
-    // 用在移动墙面的时候,邻居墙的symbols可能要变
-    updateSymbolsPositionsForNeighWall(wallId) {
-        const wall = floorplanService.getWall(wallId)
-        const symbolIds = wall.children
-        for (let i = 0; i < symbolIds.length; ++i) {
-            this.updateSEForWallSize(symbolIds[i])
-        }
-    }
-
-    // 更新symbol的start或者end,一般是symbol的端点在墙外了
-    updateSEForWallSize(symbolId) {
-        const symbol = floorplanService.getSymbol(symbolId)
-        const wall = floorplanService.getWall(symbol.parent)
-        const startPoint = floorplanService.getPoint(wall.start)
-        const endPoint = floorplanService.getPoint(wall.end)
-        const newStart = {
-            x: symbol.startPoint.x,
-            y: symbol.startPoint.y,
-        }
-
-        const newEnd = {
-            x: symbol.endPoint.x,
-            y: symbol.endPoint.y,
-        }
-
-        const dif = { x: 0, y: 0 }
-
-        if (!wallService.isContain(wall, newStart)) {
-            // symbol的start与wall的start挨的近
-            if (mathUtil.getDistance(newStart, startPoint) < mathUtil.getDistance(newStart, endPoint)) {
-                dif.x = startPoint.x - newStart.x
-                dif.y = startPoint.y - newStart.y
-            } else {
-                dif.x = endPoint.x - newStart.x
-                dif.y = endPoint.y - newStart.y
-            }
-
-            newStart.x += dif.x
-            newStart.y += dif.y
-        } else if (!wallService.isContain(wall, newEnd)) {
-            if (mathUtil.getDistance(newEnd, startPoint) < mathUtil.getDistance(newEnd, endPoint)) {
-                dif.x = startPoint.x - newEnd.x
-                dif.y = startPoint.y - newEnd.y
-            } else {
-                dif.x = endPoint.x - newEnd.x
-                dif.y = endPoint.y - newEnd.y
-            }
-
-            newEnd.x += dif.x
-            newEnd.y += dif.y
-        } else {
-            return null
-        }
-        this.updateSEForCollideSymbols(symbolId, newStart, newEnd)
-    }
-
-    updateSymbolForLen(symbolId, len) {
-        const symbol = floorplanService.getSymbol(symbolId)
-        const start = symbol.startPoint
-        const end = symbol.endPoint
-        const line = mathUtil.createLine1(start, end)
-        const midPoint = { x: (start.x + end.x) / 2, y: (start.y + end.y) / 2 }
-        const vertLine = mathUtil.getVerticalLine(line, midPoint)
-
-        const wall = floorplanService.getWall(symbol.parent)
-        const startPoint = floorplanService.getPoint(wall.start)
-        const endPoint = floorplanService.getPoint(wall.end)
-
-        if (len == null || typeof len === 'undefined') {
-            len = mathUtil.getDistance(start, end)
-            const distance = mathUtil.getDistance(startPoint, endPoint)
-            if (len > distance) {
-                len = distance
-            }
-        }
-        const lines = mathUtil.getParallelLineForDistance(vertLine, len / 2)
-
-        const join1 = mathUtil.getIntersectionPoint(lines.line1, line)
-        const join2 = mathUtil.getIntersectionPoint(lines.line2, line)
-
-        const symbolInfo = {}
-        if (mathUtil.getDistance(start, join1) < mathUtil.getDistance(start, join2)) {
-            symbolInfo.start = join1
-            symbolInfo.end = join2
-        } else {
-            symbolInfo.start = join2
-            symbolInfo.end = join1
-        }
-
-        let startFlag = false
-        let endFlag = false
-        let dx, dy
-        const nearestPosition = this.getNearestPosition(symbol.parent, symbolId, true)
-        if (nearestPosition.startPosition != null && mathUtil.PointInSegment(nearestPosition.startPosition, symbolInfo.start, symbolInfo.end)) {
-            // start堵住了,end需要增加
-            //dx = symbolInfo.end.x - symbol.endPoint.x
-            //dy = symbolInfo.end.y - symbol.endPoint.y
-            dx = symbolInfo.start.x - nearestPosition.startPosition.x
-            dy = symbolInfo.start.y - nearestPosition.startPosition.y
-            mathUtil.clonePoint(symbolInfo.start, nearestPosition.startPosition)
-            symbolInfo.end.x -= dx
-            symbolInfo.end.y -= dy
-
-            startFlag = true
-        }
-
-        if (nearestPosition.endPosition != null && mathUtil.PointInSegment(nearestPosition.endPosition, symbolInfo.start, symbolInfo.end)) {
-            // end堵住了,start需要增加
-            dx = symbolInfo.end.x - nearestPosition.endPosition.x
-            dy = symbolInfo.end.y - nearestPosition.endPosition.y
-            mathUtil.clonePoint(symbolInfo.end, nearestPosition.endPosition)
-            if (!startFlag) {
-                symbolInfo.start.x -= dx
-                symbolInfo.start.y -= dy
-                //这时候可能start又超出范围了
-                if (mathUtil.PointInSegment(nearestPosition.startPosition, symbolInfo.start, symbolInfo.end)) {
-                    mathUtil.clonePoint(symbolInfo.start, nearestPosition.startPosition)
-                    startFlag = true
-                }
-            }
-            endFlag = true
-        }
-        symbolInfo.vectorId = symbolId
-        mathUtil.clonePoint(symbol.startPoint, symbolInfo.start)
-        mathUtil.clonePoint(symbol.endPoint, symbolInfo.end)
-        symbol.setPoints2d()
-
-        return {
-            block: startFlag & endFlag,
-            start: symbolInfo.start,
-            end: symbolInfo.end,
-        }
-    }
-
-    getNearestPosition(wallId, symbolId, isExceedWall, position1, position2) {
-        const wall = floorplanService.getWall(wallId)
-        const startPoint = floorplanService.getPoint(wall.start)
-        const endPoint = floorplanService.getPoint(wall.end)
-        const symbolIds = wall.children
-        let symbol = floorplanService.getSymbol(symbolId)
-
-        if (!symbol && !symbolId) {
-            symbol = {}
-            symbol = {
-                struct: {},
-            }
-            symbol.startPoint = position1
-            symbol.endPoint = position2
-        }
-
-        let minSdis = 10000
-        let minEdis = 10000
-        let startPosition = null
-        let endPosition = null
-
-        // 与startPosition同属symbol端点(另一头)
-        let startPosition2 = null
-        // 与endPosition同属symbol端点(另一头)
-        let endPosition2 = null
-
-        for (let i = 0; i < symbolIds.length; ++i) {
-            if (symbolIds[i] == symbolId) {
-                continue
-            }
-
-            const otherSymbol = floorplanService.getSymbol(symbolIds[i])
-
-            const dis1 = mathUtil.getDistance(symbol.startPoint, otherSymbol.startPoint)
-            const dis2 = mathUtil.getDistance(symbol.startPoint, otherSymbol.endPoint)
-            if (minSdis > Math.min(dis1, dis2)) {
-                if (dis1 < dis2) {
-                    startPosition = otherSymbol.startPoint
-                    startPosition2 = otherSymbol.endPoint
-                } else {
-                    startPosition = otherSymbol.endPoint
-                    startPosition2 = otherSymbol.startPoint
-                }
-                if (mathUtil.getDistance(symbol.startPoint, startPosition) > mathUtil.getDistance(symbol.endPoint, startPosition)) {
-                    startPosition = null
-                    startPosition2 = null
-                } else {
-                    minSdis = Math.min(dis1, dis2)
-                }
-            }
-
-            const dis3 = mathUtil.getDistance(symbol.endPoint, otherSymbol.startPoint)
-            const dis4 = mathUtil.getDistance(symbol.endPoint, otherSymbol.endPoint)
-            if (minEdis > Math.min(dis3, dis4)) {
-                if (dis3 < dis4) {
-                    endPosition = otherSymbol.startPoint
-                    endPosition2 = otherSymbol.endPoint
-                } else {
-                    endPosition = otherSymbol.endPoint
-                    endPosition2 = otherSymbol.startPoint
-                }
-                if (mathUtil.getDistance(symbol.endPoint, endPosition) > mathUtil.getDistance(symbol.startPoint, endPosition)) {
-                    endPosition = null
-                    endPosition2 = null
-                } else {
-                    minEdis = Math.min(dis3, dis4)
-                }
-            }
-        }
-
-        if (isExceedWall) {
-            if (startPosition == null) {
-                if (mathUtil.getDistance(startPoint, symbol.startPoint) > mathUtil.getDistance(startPoint, symbol.endPoint)) {
-                    startPosition = endPoint
-                    startPosition2 = endPoint
-                } else {
-                    startPosition = startPoint
-                    startPosition2 = startPoint
-                }
-            }
-
-            if (endPosition == null) {
-                if (mathUtil.getDistance(startPoint, symbol.startPoint) > mathUtil.getDistance(startPoint, symbol.endPoint)) {
-                    endPosition = startPoint
-                    endPosition2 = startPoint
-                } else {
-                    endPosition = endPoint
-                    endPosition2 = endPoint
-                }
-            }
-        }
-        return {
-            startPosition: startPosition,
-            startPosition2: startPosition2,
-            endPosition: endPosition,
-            endPosition2: endPosition2,
-        }
-    }
-
-    // point是目标点,selectState表示start还是end
-    // 只是不允许start和end互换位置
-    moveSymbolSinglePoint(targetPosition, symbolId, selectState) {
-        const symbol = floorplanService.getSymbol(symbolId)
-        const symbolLine = mathUtil.createLine1(symbol.startPoint, symbol.endPoint)
-
-        const vSymbolLine = mathUtil.getVerticalLine(symbolLine, targetPosition)
-        targetPosition = mathUtil.getIntersectionPoint(vSymbolLine, symbolLine)
-
-        const midPoint = {
-            x: (symbol.startPoint.x + symbol.endPoint.x) / 2,
-            y: (symbol.startPoint.y + symbol.endPoint.y) / 2,
-        }
-
-        // 是否超过了wall外
-        const wall = floorplanService.getWall(symbol.parent)
-        const startPoint = floorplanService.getPoint(wall.start)
-        const endPoint = floorplanService.getPoint(wall.end)
-
-        if (selectState == 'start') {
-            // symbol的start和end位置交换了
-            if (!mathUtil.PointInSegment(midPoint, targetPosition, symbol.endPoint)) {
-                return null
-            } else {
-                // start-start
-                if (mathUtil.getDistance(symbol.startPoint, startPoint) < mathUtil.getDistance(symbol.endPoint, startPoint)) {
-                    // 超出了
-                    if (mathUtil.getDistance(targetPosition, midPoint) > mathUtil.getDistance(startPoint, midPoint)) {
-                        mathUtil.clonePoint(targetPosition, startPoint)
-                    }
-                }
-                // start-end
-                else {
-                    // 超出了
-                    if (mathUtil.getDistance(targetPosition, midPoint) > mathUtil.getDistance(endPoint, midPoint)) {
-                        mathUtil.clonePoint(targetPosition, endPoint)
-                    }
-                }
-            }
-        } else if (selectState == 'end') {
-            // symbol的start和end位置交换了
-            if (!mathUtil.PointInSegment(midPoint, targetPosition, symbol.startPoint)) {
-                return null
-            } else {
-                // start-start
-                if (mathUtil.getDistance(symbol.endPoint, endPoint) < mathUtil.getDistance(symbol.startPoint, endPoint)) {
-                    // 超出了
-                    if (mathUtil.getDistance(targetPosition, midPoint) > mathUtil.getDistance(endPoint, midPoint)) {
-                        mathUtil.clonePoint(targetPosition, endPoint)
-                    }
-                }
-                // start-end
-                else {
-                    // 超出了
-                    if (mathUtil.getDistance(targetPosition, midPoint) > mathUtil.getDistance(startPoint, midPoint)) {
-                        mathUtil.clonePoint(targetPosition, startPoint)
-                    }
-                }
-            }
-        }
-
-        return {
-            dir: selectState,
-            position: targetPosition,
-        }
-    }
-
-    setSymbolInfo(symbolInfo) {
-        let symbol = floorplanService.getSymbol(symbolInfo.vectorId)
-        symbol.openSide = symbolInfo.openSide
-        symbol.startPoint = symbolInfo.start
-        symbol.endPoint = symbolInfo.end
-        symbol.points2d = JSON.parse(JSON.stringify(symbolInfo.points2d))
-        symbol.enter = symbolInfo.enter
-        symbol.parent = symbolInfo.parent
-        return symbol
-    }
-
-    setEnterImg(img) {
-        this.enterImg = img
-    }
-
-    getEnterImg() {
-        return this.enterImg
-    }
-}
-
-const symbolService = new SymbolService()
-export { symbolService }

+ 0 - 5
src/views/draw-file/board/editCAD/Service/TagService.js

@@ -1,9 +1,7 @@
 import Tag from '../Geometry/Tag.js'
 import { floorplanService } from './FloorplanService'
 import { floorplanData } from '../FloorplanData'
-import { measureService } from './MeasureService.js'
 import { mathUtil } from '../MathUtil.js'
-import { uoMService } from './UoMService.js'
 
 export default class TagService {
     constructor() {}
@@ -54,13 +52,10 @@ export default class TagService {
                     tag.unit = unit
                     if (unit == 'm') {
                         //平方英尺转平方米
-                        tag.des = uoMService.convertBack(tag.des, 'area', 7, 'imperial', 0.01, false)
                         tag.des = parseFloat(tag.des)
                     } else {
                         //平方米转平方英尺
-                        tag.des = uoMService.convert(tag.des, 'area', 7, 'imperial', 0.01, false)
                         tag.des = tag.des.replace('ft²', '')
-                        //tag.des = parseFloat(tag.des)
                     }
                 }
             }

+ 0 - 4
src/views/draw-file/board/editCAD/enum/LayerEvents.js

@@ -5,10 +5,6 @@ const LayerEvents = {
     MoveWall: 'moveWall', //拖拽墙面
     MoveWallPoint: 'moveWallPoint', //拖拽墙角
 
-    AddSymbol: 'addSymbol', //添加门/窗
-    MoveSymbol: 'moveSymbol', //移动门/窗
-    MoveSymbolPoint: 'moveSymbolPoint', //移动门/窗的端点
-
     AddComponent: 'addComponent',
     MoveComponent: 'moveComponent',
 

+ 0 - 5
src/views/draw-file/board/editCAD/enum/SymbolEvents.js

@@ -1,5 +0,0 @@
-const SymbolEvents = {
-    Left: 'LEFT',
-    Right: 'RIGHT',
-}
-export default SymbolEvents

+ 3 - 3
src/views/draw-file/board/index.js

@@ -3,7 +3,7 @@ import {
   text,
   table
 } from './shape'
-// import Layer from './editCAD/Layer'
+import Layer from './editCAD/Layer'
 
 const createShape = (refs, shapeData) => {
   console.log('创建', shapeData)
@@ -76,8 +76,8 @@ export const create = (store, canvas) => {
     // refs.bus.emit('selectShape', null)
   })
 
-  // const layer = new Layer()
-  // layer.start(canvas, store)
+  const layer = new Layer()
+  layer.start(canvas, store)
   const board = {
     bus: refs.bus,
     el: canvas,