xushiting 2 years ago
parent
commit
cebbf54486

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

@@ -51,49 +51,49 @@ export default class UIControl {
         elementService.hideAll()
         //正在添加tag的时候,需要先删除
         const eventName = stateService.getEventName()
-        if (eventName == LayerEvents.AddTag) {
-            let item = stateService.getDraggingItem()
-            if (item && item.type == VectorType.Tag) {
-                floorplanService.deleteTag(item.vectorId)
-            }
-        }
-        stateService.clearItems()
-        if (this.selectUI == UIEvents.Wall || this.selectUI == UIEvents.OutWall) {
+        // if (eventName == LayerEvents.AddTag) {
+        //     let item = stateService.getDraggingItem()
+        //     if (item && item.type == VectorType.Tag) {
+        //         floorplanService.deleteTag(item.vectorId)
+        //     }
+        // }
+        // stateService.clearItems()
+        if (this.selectUI == UIEvents.Wall) 
+        {
             stateService.setEventName(LayerEvents.AddWall)
-        } else if (
-            this.selectUI == UIEvents.SingleDoor ||
-            this.selectUI == UIEvents.DoubleDoor ||
-            this.selectUI == UIEvents.SlideDoor ||
-            this.selectUI == UIEvents.SingleWindow ||
-            this.selectUI == UIEvents.BayWindow ||
-            this.selectUI == UIEvents.FrenchWindow ||
-            this.selectUI == UIEvents.Pass
-        ) {
-            stateService.setEventName(LayerEvents.AddSymbol)
-        } else if (this.selectUI == UIEvents.Tag) {
+        } 
+        else if (this.selectUI == UIEvents.Table ) 
+        {
+            stateService.setEventName(LayerEvents.Table)
+        } 
+        else if (this.selectUI == UIEvents.Rectangle ) 
+        {
+            stateService.setEventName(LayerEvents.Rectangle)
+        } 
+        else if (this.selectUI == UIEvents.Circle ) 
+        {
+            stateService.setEventName(LayerEvents.Circle)
+        } 
+        else if (this.selectUI == UIEvents.Arrow ) 
+        {
+            stateService.setEventName(LayerEvents.Arrow)
+        }
+        else if (this.selectUI == UIEvents.Icon ) 
+        {
+            stateService.setEventName(LayerEvents.Icon)
+        }  
+        else if (this.selectUI == UIEvents.Tag) 
+        {
             stateService.setEventName(LayerEvents.AddTag)
-        } else if (
-            this.selectUI == UIEvents.TV ||
-            this.selectUI == UIEvents.CombinationSofa ||
-            this.selectUI == UIEvents.SingleSofa ||
-            this.selectUI == UIEvents.TeaTable ||
-            this.selectUI == UIEvents.Carpet ||
-            this.selectUI == UIEvents.Plant ||
-            this.selectUI == UIEvents.DiningTable ||
-            this.selectUI == UIEvents.DoubleBed ||
-            this.selectUI == UIEvents.SingleBed ||
-            this.selectUI == UIEvents.Wardrobe ||
-            this.selectUI == UIEvents.Dresser ||
-            this.selectUI == UIEvents.BedsideCupboard ||
-            this.selectUI == UIEvents.Pillow ||
-            this.selectUI == UIEvents.GasStove ||
-            this.selectUI == UIEvents.Cupboard ||
-            this.selectUI == UIEvents.Bathtub ||
-            this.selectUI == UIEvents.Closestool ||
-            this.selectUI == UIEvents.Washstand ||
-            this.selectUI == UIEvents.Desk ||
-            this.selectUI == UIEvents.BalconyChair ||
-            this.selectUI == UIEvents.Elevator
+        } 
+        else if (
+            this.selectUI == UIEvents.Cigaret ||
+            this.selectUI == UIEvents.FirePoint ||
+            this.selectUI == UIEvents.FootPrint ||
+            this.selectUI == UIEvents.ShoePrint ||
+            this.selectUI == UIEvents.FingerPrint ||
+            this.selectUI == UIEvents.DeadBody ||
+            this.selectUI == UIEvents.BloodStain 
         ) {
             stateService.setEventName(LayerEvents.AddSign)
         }
@@ -110,7 +110,7 @@ export default class UIControl {
         let item = stateService.getFocusItem()
         switch (name) {
             case 'remove':
-                if (type == VectorType.Wall || type == 'OutWall') {
+                if (type == VectorType.Wall) {
                     floorplanService.deleteWall(item.vectorId)
                 } else if (type == VectorType.Tag) {
                     floorplanService.deleteTag(item.vectorId)

+ 1 - 1
src/views/draw-file/board/editCAD/Geometry/Rectangle.js

@@ -4,7 +4,7 @@ import Geometry from './Geometry.js'
 export default class Rectangle extends Geometry {
     constructor(position, vectorId, floor) {
         super()
-        this.start = position
+        this.position = position          //中心点
         this.points = []
         this.floor = floor?floor:0
         this.geoType = VectorType.Rectangle

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

@@ -1,5 +1,6 @@
 const LayerEvents = {
     PanBackGround: 'panBackGround', //拖拽背景
+    
     AddWall: 'addWall', //开始添加墙
     AddingWall: 'addingWall', //添加墙进行中
     MoveWall: 'moveWall', //拖拽墙面
@@ -8,6 +9,18 @@ const LayerEvents = {
     AddTag: 'addTag',
     MoveTag: 'moveTag',
 
+    AddRectangle: 'addRectangle',
+    MoveRectangle: 'moveRectangle',
+
+    AddCircle: 'addCircle',
+    MoveCircle: 'moveCircle',
+
+    AddArrow: 'addArrow',
+    MoveArrow: 'moveArrow',
+
+    AddIcon: 'addIcon',
+    MoveIcon: 'moveIcon',
+
     AddSign: 'addSign',
     MoveSign: 'moveSign',
 }