|
@@ -132,6 +132,7 @@
|
|
|
fixedArea:0, //初始面积值
|
|
|
layoutArea:0, //总面积
|
|
|
selectSpace:null,//
|
|
|
+ changeStatus:false,
|
|
|
}
|
|
|
},
|
|
|
beforeDestroy() {
|
|
@@ -868,7 +869,7 @@
|
|
|
calculateSpaceData(curSpace, data){
|
|
|
let that = this;
|
|
|
this.curSpaceObj = curSpace;
|
|
|
-
|
|
|
+ this.changeStatus = true;
|
|
|
// 计算宽高移动数值
|
|
|
const changeArea = data.area;
|
|
|
const isZoomIn = data.isZoomIn;
|
|
@@ -927,54 +928,50 @@
|
|
|
that.overChange = false;
|
|
|
that.callBackFun && that.callBackFun(true);
|
|
|
// that.calculateLayoutModelSize(); //重新计算家具位置
|
|
|
- that.updateWallModels(); // 替换墙体模型
|
|
|
- that.changeLayoutModel(); // 改变空间模型
|
|
|
+ if(that.changeStatus){//空间有变化才触发替换等动作
|
|
|
+ that.updateWallModels(); // 替换墙体模型
|
|
|
+ that.changeLayoutModel(); // 改变空间模型
|
|
|
+ }
|
|
|
// that.changeLayoutModelState(true); // 显示家具模型
|
|
|
}, 4200);
|
|
|
},
|
|
|
moveSpace(curSpace, directionIndex, directionIndex01, isZoomIn, newArea, newWidth, newHeight, changeWidth, changeHeight){
|
|
|
let that = this;
|
|
|
-
|
|
|
const wallLock = this.currWallLock(directionIndex, curSpace); //南边
|
|
|
const wallLock01 = this.currWallLock(directionIndex01, curSpace); //东边
|
|
|
-
|
|
|
console.log("移动空间", wallLock, wallLock01)
|
|
|
-
|
|
|
if(wallLock ==-1 && wallLock01 == -1){
|
|
|
+ this.changeStatus = false;//表示无变化
|
|
|
return this.$message.warning("空间尺寸已锁定");
|
|
|
}
|
|
|
let changeValue = changeHeight;
|
|
|
if(wallLock == -1){
|
|
|
-
|
|
|
if(wallLock01 == 0){
|
|
|
directionIndex01 = directionIndex01 == 4 ? 3 : 4; // 往西移动
|
|
|
}
|
|
|
-
|
|
|
// 南北锁死,重新计算移动的方向
|
|
|
newWidth = newArea / (curSpace.spaceHeight / 100) * 100
|
|
|
changeWidth = newWidth / 100 - curSpace.spaceWidth / 100;
|
|
|
changeWidth = Math.abs(changeWidth * 100);
|
|
|
directionIndex = directionIndex01; // 往东移动
|
|
|
-
|
|
|
changeValue = changeWidth;
|
|
|
-
|
|
|
console.log("高度锁死不能拉伸, 宽度变化1",newWidth, directionIndex,curSpace.spaceWidth, curSpace.spaceHeight, changeValue);
|
|
|
that.selectWall(directionIndex);
|
|
|
-
|
|
|
let checkResult = this.checkRightSpace(!isZoomIn, changeWidth, false, curSpace)
|
|
|
if(!checkResult.result){
|
|
|
changeWidth = checkResult.newValue
|
|
|
}
|
|
|
console.log("宽度达到极限值结果++++++++++++++", checkResult, changeWidth)
|
|
|
-
|
|
|
that.moveSpaceWall(that.curWallDirection, isZoomIn, changeWidth);
|
|
|
+ if(changeWidth==0){
|
|
|
+ this.changeStatus = false;//表示无变化
|
|
|
+ }
|
|
|
// that.autoCreateWall(directionIndex, curSpace)
|
|
|
return;
|
|
|
}else{
|
|
|
if(wallLock == 0){
|
|
|
directionIndex = directionIndex == 2 ? 1 : 2; // 往北边移动
|
|
|
}
|
|
|
-
|
|
|
if(wallLock01 == -1){
|
|
|
// 东西锁死,重新计算移动方向
|
|
|
newHeight = newArea / (curSpace.spaceWidth / 100) * 100
|
|
@@ -986,12 +983,13 @@
|
|
|
|
|
|
let checkResult = this.checkRightSpace(!isZoomIn, changeHeight, true, curSpace)
|
|
|
console.log("高度达到极限值结果++++++++++++++", checkResult, changeHeight)
|
|
|
-
|
|
|
if(!checkResult.result){
|
|
|
changeHeight = checkResult.newValue
|
|
|
}
|
|
|
-
|
|
|
that.moveSpaceWall(that.curWallDirection, isZoomIn, changeHeight);
|
|
|
+ if(changeHeight==0){
|
|
|
+ this.changeStatus = false;//表示无变化
|
|
|
+ }
|
|
|
// 自动补墙逻辑
|
|
|
// that.autoCreateWall(directionIndex, curSpace);
|
|
|
return
|
|
@@ -1038,42 +1036,28 @@
|
|
|
changeHeight = Math.abs((newHeight / 100 - curSpace.spaceHeight / 100) * 100);
|
|
|
console.log("宽度达到最小值,重新计算高度",newWidth, newHeight, changeWidth, changeHeight)
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
// if(!checkWidth || !checkHeight){
|
|
|
// return
|
|
|
// }
|
|
|
-
|
|
|
if(changeHeight > 0){
|
|
|
-
|
|
|
that.changeSpaces = [];
|
|
|
-
|
|
|
that.selectWall(directionIndex);
|
|
|
-
|
|
|
let checkResult = this.checkRightSpace(!isZoomIn, changeHeight, true, curSpace)
|
|
|
console.log("高度达到极限值结果++++++++++++++", checkResult, changeHeight)
|
|
|
-
|
|
|
if(!checkResult.result){
|
|
|
changeHeight = checkResult.newValue
|
|
|
}
|
|
|
-
|
|
|
that.moveSpaceWall(that.curWallDirection, isZoomIn, changeHeight);
|
|
|
// 自动补墙逻辑
|
|
|
// that.autoCreateWall(directionIndex, curSpace)
|
|
|
}
|
|
|
-
|
|
|
let timeout = 0
|
|
|
if(changeWidth > 0 && changeHeight > 0 ){
|
|
|
timeout = 2100
|
|
|
}
|
|
|
-
|
|
|
console.log("改变尺寸",changeWidth, changeHeight,newWidth, newHeight, timeout, directionIndex, directionIndex01, wallLock, wallLock01)
|
|
|
-
|
|
|
if(changeWidth > 0){
|
|
|
setTimeout(() => {
|
|
|
-
|
|
|
that.changeSpaces = [];
|
|
|
// // 选中墙面
|
|
|
that.selectWall(directionIndex01);
|
|
@@ -1597,33 +1581,6 @@
|
|
|
}
|
|
|
this.cameraInit();
|
|
|
},
|
|
|
- // async getInitData(){
|
|
|
- // let parmas = {
|
|
|
- // childLayout:this.childLayout || 0,
|
|
|
- // houseId:this.houseId,
|
|
|
- // }
|
|
|
- // const res = await requestConfig('getHouseTypeSpaceDetailsV2', parmas, true);
|
|
|
- // if (res.success && res.list) {
|
|
|
- // let list = res.list || [];
|
|
|
- // list && list.forEach((single,index)=>{
|
|
|
- // single.layoutStruct.forEach((item)=>{
|
|
|
- // if(item.houseJson){
|
|
|
- // let spaceList = JSON.parse(item.houseJson);
|
|
|
- // // 交换centerX, centerY
|
|
|
- // for (let index = 0; index < spaceList.length; index++) {
|
|
|
- // var element = spaceList[index];
|
|
|
- // const {centerX, centerY} = element;
|
|
|
- // element.centerX = centerY;
|
|
|
- // element.centerY = centerX;
|
|
|
- // }
|
|
|
- // item.houseJson = JSON.stringify(spaceList);
|
|
|
- // }
|
|
|
- // })
|
|
|
- // })
|
|
|
- // console.log("户型详情列表-接口原始数据: ", list);
|
|
|
- // this.houseList = list;//数据会同步到组件中-进而反馈更新页面数据
|
|
|
- // }
|
|
|
- // },
|
|
|
|
|
|
onMouseMove(e){
|
|
|
return false;
|