This commit is contained in:
2026-05-19 10:57:28 +08:00
parent 8478d45046
commit 093a671fd7
3 changed files with 9 additions and 3 deletions

View File

@ -338,6 +338,7 @@
<button class="option-btn" data-option="louver-3">3m下拉帘</button> <button class="option-btn" data-option="louver-3">3m下拉帘</button>
<button class="option-btn" data-option="louver-4">SPFSW13FTC</button> <button class="option-btn" data-option="louver-4">SPFSW13FTC</button>
<button class="option-btn" data-option="louver-4">SPFSW10FTW</button> <button class="option-btn" data-option="louver-4">SPFSW10FTW</button>
<button class="option-btn" data-option="louver-4">SPFSW10FTC</button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -214,13 +214,14 @@ export const executeEvent2 = async (result) => {
console.log(`检查模型 ${name + '_' + category} 是否存在:`, modelAlreadyExists); console.log(`检查模型 ${name + '_' + category} 是否存在:`, modelAlreadyExists);
} }
} }
kernel.dropZone.clearZones();
// 只有在需要更换模型且模型不存在时才清除 // 只有在需要更换模型且模型不存在时才清除
if (hasModelChange && !modelAlreadyExists) { if (hasModelChange && !modelAlreadyExists) {
console.log('模型不存在,执行清除操作'); console.log('模型不存在,执行清除操作');
kernel.model.removeAll(); kernel.model.removeAll();
} else if (modelAlreadyExists) { } else if (modelAlreadyExists) {
kernel.dropZone.hide();
console.log('模型已存在,跳过清除操作,仅更新材质'); console.log('模型已存在,跳过清除操作,仅更新材质');
} }

View File

@ -31,6 +31,8 @@ export class AppDropZone {
// 存储放置区域配置数据 // 存储放置区域配置数据
private dropZoneConfig: DropZoneConfig | null = null; private dropZoneConfig: DropZoneConfig | null = null;
// 存储原始墙面配置(用于 updateDivisions 时恢复完整墙面列表)
private originalWalls: WallConfig[] = [];
constructor(scene: Scene) { constructor(scene: Scene) {
this.scene = scene; this.scene = scene;
@ -50,6 +52,8 @@ export class AppDropZone {
*/ */
setData(config: DropZoneConfig): void { setData(config: DropZoneConfig): void {
this.dropZoneConfig = config; this.dropZoneConfig = config;
// 保存原始墙面配置的深拷贝
this.originalWalls = config.walls.map(wall => ({ ...wall }));
} }
/** /**
@ -145,8 +149,8 @@ export class AppDropZone {
return null; return null;
}; };
// 更新配置中的墙面分割数,只保留后端配置的墙面 // 更新配置中的墙面分割数,从原始配置中恢复墙面列表
this.dropZoneConfig.walls = this.dropZoneConfig.walls this.dropZoneConfig.walls = this.originalWalls
.map(wall => { .map(wall => {
const newDivisions = matchWallName(wall.name); const newDivisions = matchWallName(wall.name);