|
@@ -32,7 +32,7 @@ import Constant from './Constant'
|
|
|
import VectorType from './enum/VectorType'
|
|
|
import MathUtil, { mathUtil } from './MathUtil'
|
|
|
import { wallService } from './Service/WallService'
|
|
|
-import History from './History/History'
|
|
|
+import {history} from './History/History.js'
|
|
|
import { signService } from './Service/SignService'
|
|
|
|
|
|
export default class Layer {
|
|
@@ -41,7 +41,7 @@ export default class Layer {
|
|
|
this.load = new Load(this)
|
|
|
this.uiControl = new UIControl(this)
|
|
|
this.renderer = new Render(this)
|
|
|
- this.history = new History(this)
|
|
|
+ //this.history = new History(this)
|
|
|
|
|
|
this.canvas = null;
|
|
|
this.startX = null
|
|
@@ -105,7 +105,7 @@ export default class Layer {
|
|
|
}
|
|
|
if (addWall.canAdd) {
|
|
|
addWall.buildWall()
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
} else {
|
|
|
return
|
|
|
}
|
|
@@ -260,7 +260,7 @@ export default class Layer {
|
|
|
}
|
|
|
// wallId被删除了
|
|
|
else if (moveFlag == 3) {
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
stateService.clearSelectItem()
|
|
|
stateService.clearDraggingItem()
|
|
|
stateService.clearEventName()
|
|
@@ -555,7 +555,7 @@ export default class Layer {
|
|
|
}
|
|
|
//draggingItem.vectorId所在的墙面与其他墙角相交
|
|
|
moveWall.updateForAbsorbWallPoints()
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
}
|
|
|
}
|
|
|
else{
|
|
@@ -571,14 +571,14 @@ export default class Layer {
|
|
|
addWall.clear()
|
|
|
elementService.hideAll()
|
|
|
this.uiControl.clearUI();
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
}
|
|
|
}
|
|
|
break
|
|
|
case LayerEvents.MoveWall:
|
|
|
if(focusItem == null){
|
|
|
needAutoRedraw = true
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
}
|
|
|
else{
|
|
|
this.uiControl.showAttributes(focusItem);
|
|
@@ -592,13 +592,13 @@ export default class Layer {
|
|
|
stateService.clearEventName()
|
|
|
elementService.hideAll()
|
|
|
addRectangle.clear();
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
this.uiControl.clearUI();
|
|
|
break
|
|
|
case LayerEvents.MoveRectangle:
|
|
|
if(focusItem == null){
|
|
|
needAutoRedraw = true
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
}
|
|
|
else{
|
|
|
this.uiControl.showAttributes(focusItem);
|
|
@@ -607,11 +607,11 @@ export default class Layer {
|
|
|
case LayerEvents.MoveRectangleVertex:
|
|
|
needAutoRedraw = true
|
|
|
elementService.hideAll()
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
break
|
|
|
case LayerEvents.MoveRectangleSide:
|
|
|
needAutoRedraw = true
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
break
|
|
|
case LayerEvents.AddingCircle:
|
|
|
if(addCircle.end != null && addCircle.currentVectorId != null)
|
|
@@ -624,13 +624,13 @@ export default class Layer {
|
|
|
stateService.clearEventName()
|
|
|
elementService.hideAll()
|
|
|
addCircle.clear();
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
this.uiControl.clearUI();
|
|
|
break
|
|
|
case LayerEvents.MoveCircle:
|
|
|
if(focusItem == null){
|
|
|
needAutoRedraw = true
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
}
|
|
|
else{
|
|
|
this.uiControl.showAttributes(focusItem);
|
|
@@ -638,7 +638,7 @@ export default class Layer {
|
|
|
break
|
|
|
case LayerEvents.MoveCircleVertex:
|
|
|
needAutoRedraw = true
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
break
|
|
|
case LayerEvents.AddingIcon:
|
|
|
if(addIcon.end != null && addIcon.currentVectorId != null){
|
|
@@ -650,13 +650,13 @@ export default class Layer {
|
|
|
stateService.clearEventName()
|
|
|
elementService.hideAll()
|
|
|
addIcon.clear();
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
this.uiControl.clearUI();
|
|
|
break
|
|
|
case LayerEvents.MoveIcon:
|
|
|
if(focusItem == null){
|
|
|
needAutoRedraw = true
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
}
|
|
|
else{
|
|
|
this.uiControl.showAttributes(focusItem);
|
|
@@ -664,7 +664,7 @@ export default class Layer {
|
|
|
break
|
|
|
case LayerEvents.MoveIconVertex:
|
|
|
needAutoRedraw = true
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
break
|
|
|
case LayerEvents.AddingArrow:
|
|
|
if(addArrow.start != null && addArrow.currentVectorId != null){
|
|
@@ -676,17 +676,17 @@ export default class Layer {
|
|
|
stateService.clearEventName()
|
|
|
elementService.hideAll()
|
|
|
addArrow.clear();
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
this.uiControl.clearUI();
|
|
|
break
|
|
|
case LayerEvents.MoveArrow:
|
|
|
needAutoRedraw = true
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
break
|
|
|
case LayerEvents.MoveTag:
|
|
|
if(focusItem == null){
|
|
|
needAutoRedraw = true
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
}
|
|
|
else{
|
|
|
this.uiControl.showAttributes(focusItem);
|
|
@@ -695,12 +695,12 @@ export default class Layer {
|
|
|
case LayerEvents.AddTag:
|
|
|
needAutoRedraw = true
|
|
|
this.uiControl.showAttributes(focusItem)
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
break
|
|
|
case LayerEvents.MoveTable:
|
|
|
if(focusItem == null){
|
|
|
needAutoRedraw = true
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
}
|
|
|
else{
|
|
|
this.uiControl.showAttributes(focusItem);
|
|
@@ -709,20 +709,20 @@ export default class Layer {
|
|
|
case LayerEvents.AddTable:
|
|
|
needAutoRedraw = true
|
|
|
this.uiControl.showAttributes(focusItem)
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
break
|
|
|
case LayerEvents.AddSign:
|
|
|
needAutoRedraw = true
|
|
|
this.uiControl.clearUI();
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
break
|
|
|
case LayerEvents.MoveSign:
|
|
|
needAutoRedraw = true
|
|
|
if (focusItem != null && signService.isSign(focusItem.type)) {
|
|
|
this.uiControl.selectUI = focusItem.type
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
} else {
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
}
|
|
|
break
|
|
|
}
|
|
@@ -762,7 +762,7 @@ export default class Layer {
|
|
|
} else if (e.code == 'Delete') {
|
|
|
this.uiControl.deleteItem()
|
|
|
this.uiControl.clearUI();
|
|
|
- this.history.save()
|
|
|
+ history.save()
|
|
|
this.renderer.autoRedraw()
|
|
|
console.log('Delete')
|
|
|
} else if (e.code == 'Escape') {
|