|
@@ -14,6 +14,7 @@ import { rectangleService } from '../Service/RectangleService'
|
|
|
import { circleService } from '../Service/CircleService'
|
|
|
import { arrowService } from '../Service/ArrowService'
|
|
|
import { iconService } from '../Service/IconService'
|
|
|
+import { customImageService } from "../Service/CustomImageService";
|
|
|
import mitt from 'mitt'
|
|
|
|
|
|
export default class History {
|
|
@@ -141,6 +142,7 @@ export default class History {
|
|
|
this.goPreForTitle(item.title)
|
|
|
this.goPreForImage (item.image)
|
|
|
this.goPreForCompass(item.compass)
|
|
|
+ this.goPreForCustomImages(item.customImage)
|
|
|
|
|
|
historyService.undoHistoryRecord()
|
|
|
change.saveCurrentInfo()
|
|
@@ -344,25 +346,13 @@ export default class History {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- // goPreForAngle(itemForAngle) {
|
|
|
- // if (itemForAngle.handle == HistoryEvents.ModifyAngle) {
|
|
|
- // coordinate.reSet()
|
|
|
- // coordinate._setRes(itemForAngle.preState.res)
|
|
|
- // //旋转cad
|
|
|
- // floorplanService.setAngle(itemForAngle.preState.angle)
|
|
|
- // coordinate.updateForRotate(itemForAngle.preState.angle - itemForAngle.curState.angle)
|
|
|
- // //旋转三维模型
|
|
|
- // let info = coordinate.getScreenInfoForCAD()
|
|
|
- // info.floorPlanAngle = itemForAngle.preState.angle
|
|
|
- // this.layer.app.core.get('CameraControls').emit('syncCadAnd3DForRotate', info)
|
|
|
- // this.layer.app.store.getValue('metadata').floorPlanAngle = itemForAngle.preState.angle
|
|
|
- // this.layer.initPanos(floorplanService.getCurrentFloor())
|
|
|
- // return true
|
|
|
- // } else {
|
|
|
- // return false
|
|
|
- // }
|
|
|
- // }
|
|
|
+ goPreForCustomImage(itemForCustomImage) {
|
|
|
+ if (itemForCustomImage != null && itemForCustomImage.handle == HistoryEvents.ModifyCustomImage) {
|
|
|
+ const preCustomImage = itemForCustomImage.preCustomImage
|
|
|
+ let curCustomImage = floorplanService.getCustomImage()
|
|
|
+ historyUtil.assignCustomImageFromCustomImage(curCustomImage, preCustomImage)
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
goNextForPoints(itemForPoints) {
|
|
|
for (let i = 0; i < itemForPoints.length; ++i) {
|
|
@@ -549,24 +539,21 @@ export default class History {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // goNextForAngle(itemForAngle) {
|
|
|
- // if (itemForAngle.handle == HistoryEvents.ModifyAngle) {
|
|
|
- // coordinate.reSet()
|
|
|
- // coordinate._setRes(itemForAngle.curState.res)
|
|
|
- // //旋转cad
|
|
|
- // floorplanService.setAngle(itemForAngle.curState.angle)
|
|
|
- // coordinate.updateForRotate(itemForAngle.curState.angle - itemForAngle.preState.angle)
|
|
|
- // //旋转三维模型
|
|
|
- // let info = coordinate.getScreenInfoForCAD()
|
|
|
- // info.floorPlanAngle = itemForAngle.curState.angle
|
|
|
- // this.layer.app.core.get('CameraControls').emit('syncCadAnd3DForRotate', info)
|
|
|
- // this.layer.app.store.getValue('metadata').floorPlanAngle = itemForAngle.curState.angle
|
|
|
- // this.layer.initPanos(floorplanService.getCurrentFloor())
|
|
|
- // return true
|
|
|
- // } else {
|
|
|
- // return false
|
|
|
- // }
|
|
|
- // }
|
|
|
+ goNextForCustomImage(itemForCustomImages) {
|
|
|
+ for (let i = 0; i < itemForCustomImages.length; ++i) {
|
|
|
+ const item = itemForCustomImages[i]
|
|
|
+ if (item.handle == HistoryEvents.AddCustomImage) {
|
|
|
+ let vCustomImage = customImageService.createCustomImage(item.customImage.center, item.customImage.vectorId)
|
|
|
+ historyUtil.assignCustomImageFromCustomImage(vCustomImage, item.customImage)
|
|
|
+ } else if (item.handle == HistoryEvents.DeleteCustomImage) {
|
|
|
+ floorplanService.deleteCustomImage(item.customImage.id)
|
|
|
+ } else if (item.handle == HistoryEvents.ModifyCustomImage) {
|
|
|
+ const currentCustomImage = item.curCustomImage
|
|
|
+ let preCustomImage = floorplanService.getCustomImage(item.curCustomImage.id)
|
|
|
+ historyUtil.assignCustomImageFromCustomImage(preCustomImage, currentCustomImage)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 恢复
|
|
|
goNextState() {
|
|
@@ -597,6 +584,8 @@ export default class History {
|
|
|
this.goNextForTitle(item.title)
|
|
|
this.goNextForImage (item.image)
|
|
|
this.goNextForCompass(item.compass)
|
|
|
+
|
|
|
+ this.goNextForCustomImage(item.customImage)
|
|
|
}
|
|
|
change.saveCurrentInfo()
|
|
|
this.setState()
|