瀏覽代碼

隐藏自动补墙逻辑

caodongdong 1 年之前
父節點
當前提交
f5f752926b
共有 3 個文件被更改,包括 24 次插入10 次删除
  1. 13 6
      src/mixins/loadModel.js
  2. 10 4
      src/pages/webgl_rxdz/webgl_rxdz.vue
  3. 1 0
      src/static/globlShowModel.js

+ 13 - 6
src/mixins/loadModel.js

@@ -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()
 			}

+ 10 - 4
src/pages/webgl_rxdz/webgl_rxdz.vue

@@ -996,7 +996,7 @@
 					console.log("高度锁死不能拉伸, 宽度变化1",newWidth, directionIndex,curSpace.spaceWidth, curSpace.spaceHeight, changeValue);
 					that.selectWall(directionIndex);
 					that.moveSpaceWall(that.curWallDirection, isZoomIn, changeValue);
-					that.autoCreateWall(directionIndex, curSpace)
+					// that.autoCreateWall(directionIndex, curSpace)
 					return;
 				}else{
 					if(wallLock == 0){
@@ -1013,7 +1013,7 @@
 						that.selectWall(directionIndex);
 						that.moveSpaceWall(that.curWallDirection, isZoomIn, changeValue);
 						// 自动补墙逻辑
-						that.autoCreateWall(directionIndex, curSpace);
+						// that.autoCreateWall(directionIndex, curSpace);
 						return
 					}
 			
@@ -1068,12 +1068,16 @@
 					// }
 			
 					if(changeHeight > 0){
+						
+						that.changeSpaces = [];
+						
 						that.selectWall(directionIndex);
 						// // 隐藏变化空间的家具模型,空间动画结束后显示
 						// that.changeLayoutModelState(); 
+
 						that.moveSpaceWall(that.curWallDirection, isZoomIn, changeHeight);
 						// 自动补墙逻辑
-						that.autoCreateWall(directionIndex, curSpace)
+						// that.autoCreateWall(directionIndex, curSpace)
 					}
 			
 					let timeout = 0
@@ -1085,6 +1089,8 @@
 					
 					if(changeWidth > 0){
 						setTimeout(() => {
+							
+							that.changeSpaces = [];
 							// // 选中墙面
 							that.selectWall(directionIndex01);
 							// // 隐藏变化空间的家具模型,空间动画结束后显示
@@ -1092,7 +1098,7 @@
 							// 移动墙面
 							that.moveSpaceWall(that.curWallDirection, isZoomIn, changeWidth);
 							// 自动补墙逻辑
-							that.autoCreateWall(directionIndex01, curSpace)
+							// that.autoCreateWall(directionIndex01, curSpace)
 						}, timeout);
 					}
 				}

+ 1 - 0
src/static/globlShowModel.js

@@ -19,6 +19,7 @@ var globlShowModel = [
 	"BP_K_cookerhood2",
 	"BP_K_icebox_2door002",
 	"BP_K_flue002",
+	"BP_T_flue001",
 	"BP_K_caozuotai03",
 	"BP_K_caozuotai001",
 	"BP_K_cookerhood02",