1
This commit is contained in:
@ -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