1
This commit is contained in:
@ -338,6 +338,7 @@
|
||||
<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">SPFSW10FTW</button>
|
||||
<button class="option-btn" data-option="louver-4">SPFSW10FTC</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
3
index.js
3
index.js
@ -214,13 +214,14 @@ export const executeEvent2 = async (result) => {
|
||||
console.log(`检查模型 ${name + '_' + category} 是否存在:`, modelAlreadyExists);
|
||||
}
|
||||
}
|
||||
kernel.dropZone.clearZones();
|
||||
|
||||
// 只有在需要更换模型且模型不存在时才清除
|
||||
if (hasModelChange && !modelAlreadyExists) {
|
||||
console.log('模型不存在,执行清除操作');
|
||||
|
||||
kernel.model.removeAll();
|
||||
} else if (modelAlreadyExists) {
|
||||
kernel.dropZone.hide();
|
||||
console.log('模型已存在,跳过清除操作,仅更新材质');
|
||||
}
|
||||
|
||||
|
||||
@ -31,6 +31,8 @@ export class AppDropZone {
|
||||
|
||||
// 存储放置区域配置数据
|
||||
private dropZoneConfig: DropZoneConfig | null = null;
|
||||
// 存储原始墙面配置(用于 updateDivisions 时恢复完整墙面列表)
|
||||
private originalWalls: WallConfig[] = [];
|
||||
|
||||
constructor(scene: Scene) {
|
||||
this.scene = scene;
|
||||
@ -50,6 +52,8 @@ export class AppDropZone {
|
||||
*/
|
||||
setData(config: DropZoneConfig): void {
|
||||
this.dropZoneConfig = config;
|
||||
// 保存原始墙面配置的深拷贝
|
||||
this.originalWalls = config.walls.map(wall => ({ ...wall }));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -145,8 +149,8 @@ export class AppDropZone {
|
||||
return null;
|
||||
};
|
||||
|
||||
// 更新配置中的墙面分割数,只保留后端配置的墙面
|
||||
this.dropZoneConfig.walls = this.dropZoneConfig.walls
|
||||
// 更新配置中的墙面分割数,从原始配置中恢复墙面列表
|
||||
this.dropZoneConfig.walls = this.originalWalls
|
||||
.map(wall => {
|
||||
const newDivisions = matchWallName(wall.name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user