|
@@ -76,6 +76,7 @@ export default {
|
|
|
},
|
|
|
//拆分家具模型加载逻辑
|
|
|
furnHandle(arrFrunList, spaceObj = null){
|
|
|
+ console.log("bug修复", arrFrunList, spaceObj)
|
|
|
if(!arrFrunList || arrFrunList.length == 0){
|
|
|
return
|
|
|
}
|
|
@@ -133,7 +134,7 @@ export default {
|
|
|
tmpList = this.realList;
|
|
|
}
|
|
|
let realFurArr = this.preFurnitureData(tmpList);//统一处理家具模型
|
|
|
- if(spaceObj){
|
|
|
+ if(spaceObj != null){
|
|
|
this.calculateLayoutModelSizeBySpace(spaceObj) // 提前计算模型的位置
|
|
|
}else{
|
|
|
this.calculateLayoutModelSize() // 提前计算模型的位置
|
|
@@ -409,9 +410,11 @@ export default {
|
|
|
},
|
|
|
// 计算家具的位置
|
|
|
calculateLayoutModelSize() {
|
|
|
- console.log("计算家具的位置", this.gltfLayouts);
|
|
|
- for (let index = 0; index < this.spaceList.length; index++) {
|
|
|
- const element = this.spaceList[index];
|
|
|
+ console.log("计算家具的位置", this.gltfLayouts,this.changeSpaces);
|
|
|
+ // 有改变空间,只刷新改变空间的模型数据
|
|
|
+ const spaceList = this.changeSpaces.length ==0 ? this.spaceList : this.changeSpaces;
|
|
|
+ for (let index = 0; index < spaceList.length; index++) {
|
|
|
+ const element = spaceList[index];
|
|
|
const gltfLayoutModels = this.gltfLayouts.filter(item => {
|
|
|
return element.layoutId == item.userData.layoutId && element.spaceId == item.userData.spaceId;
|
|
|
})
|
|
@@ -437,7 +440,11 @@ export default {
|
|
|
return element.layoutId == item.userData.layoutId && element.spaceId == item.userData.spaceId;
|
|
|
})
|
|
|
|
|
|
- console.log("计算指定空间的家具的位置", spaceObj, element.layoutId, gltfLayoutModels);
|
|
|
+ const gltfLayoutModelss = this.gltfLayouts.filter(item => {
|
|
|
+ return element.spaceId == item.userData.spaceId;
|
|
|
+ })
|
|
|
+
|
|
|
+ console.log("计算指定空间的家具的位置", spaceObj, element.layoutId, gltfLayoutModels, gltfLayoutModelss);
|
|
|
//空间下不存在家具模型,则该空间不需要进行下一步处理
|
|
|
if (!gltfLayoutModels || gltfLayoutModels.length == 0) {
|
|
|
return;
|
|
@@ -1093,7 +1100,7 @@ export default {
|
|
|
|
|
|
// 合适的布局更现有布局相同
|
|
|
if(spaceObj.layoutId == layoutObj.id){
|
|
|
- this.calculateLayoutModelSizeBySpace(spaceObj) // 提前计算模型的位置
|
|
|
+ // this.calculateLayoutModelSizeBySpace(spaceObj) // 提前计算模型的位置
|
|
|
// this.changeLayoutModelState(true); // 显示家具模型
|
|
|
return resolve()
|
|
|
}
|