|
@@ -339,7 +339,11 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
{ id: 'living', name: '客厅', isExpanded: false, order: 2 },
|
|
{ id: 'living', name: '客厅', isExpanded: false, order: 2 },
|
|
{ id: 'kitchen', name: '厨房', isExpanded: false, order: 3 }
|
|
{ id: 'kitchen', name: '厨房', isExpanded: false, order: 3 }
|
|
],
|
|
],
|
|
- content: {}
|
|
|
|
|
|
+ content: {
|
|
|
|
+ 'bedroom': { images: [], progress: 0, status: 'pending', notes: '', lastUpdated: new Date() },
|
|
|
|
+ 'living': { images: [], progress: 0, status: 'pending', notes: '', lastUpdated: new Date() },
|
|
|
|
+ 'kitchen': { images: [], progress: 0, status: 'pending', notes: '', lastUpdated: new Date() }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
id: 'softDecor',
|
|
id: 'softDecor',
|
|
@@ -351,7 +355,11 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
{ id: 'living', name: '客厅', isExpanded: false, order: 2 },
|
|
{ id: 'living', name: '客厅', isExpanded: false, order: 2 },
|
|
{ id: 'kitchen', name: '厨房', isExpanded: false, order: 3 }
|
|
{ id: 'kitchen', name: '厨房', isExpanded: false, order: 3 }
|
|
],
|
|
],
|
|
- content: {}
|
|
|
|
|
|
+ content: {
|
|
|
|
+ 'bedroom': { images: [], progress: 0, status: 'pending', notes: '', lastUpdated: new Date() },
|
|
|
|
+ 'living': { images: [], progress: 0, status: 'pending', notes: '', lastUpdated: new Date() },
|
|
|
|
+ 'kitchen': { images: [], progress: 0, status: 'pending', notes: '', lastUpdated: new Date() }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
id: 'rendering',
|
|
id: 'rendering',
|
|
@@ -363,7 +371,11 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
{ id: 'living', name: '客厅', isExpanded: false, order: 2 },
|
|
{ id: 'living', name: '客厅', isExpanded: false, order: 2 },
|
|
{ id: 'kitchen', name: '厨房', isExpanded: false, order: 3 }
|
|
{ id: 'kitchen', name: '厨房', isExpanded: false, order: 3 }
|
|
],
|
|
],
|
|
- content: {}
|
|
|
|
|
|
+ content: {
|
|
|
|
+ 'bedroom': { images: [], progress: 0, status: 'pending', notes: '', lastUpdated: new Date() },
|
|
|
|
+ 'living': { images: [], progress: 0, status: 'pending', notes: '', lastUpdated: new Date() },
|
|
|
|
+ 'kitchen': { images: [], progress: 0, status: 'pending', notes: '', lastUpdated: new Date() }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
];
|
|
];
|
|
|
|
|
|
@@ -1622,16 +1634,36 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
|
|
|
removeImageFromPreview(): void {
|
|
removeImageFromPreview(): void {
|
|
if (this.previewImageData) {
|
|
if (this.previewImageData) {
|
|
- // 根据图片类型调用相应的删除方法
|
|
|
|
- if (this.whiteModelImages.find(i => i.id === this.previewImageData.id)) {
|
|
|
|
- this.removeWhiteModelImage(this.previewImageData.id);
|
|
|
|
- } else if (this.softDecorImages.find(i => i.id === this.previewImageData.id)) {
|
|
|
|
- this.removeSoftDecorImage(this.previewImageData.id);
|
|
|
|
- } else if (this.renderLargeImages.find(i => i.id === this.previewImageData.id)) {
|
|
|
|
- this.removeRenderLargeImage(this.previewImageData.id);
|
|
|
|
- } else if (this.postProcessImages.find(i => i.id === this.previewImageData.id)) {
|
|
|
|
- this.removePostProcessImage(this.previewImageData.id);
|
|
|
|
|
|
+ // 首先检查新的 deliveryProcesses 结构
|
|
|
|
+ let imageFound = false;
|
|
|
|
+
|
|
|
|
+ for (const process of this.deliveryProcesses) {
|
|
|
|
+ for (const space of process.spaces) {
|
|
|
|
+ if (process.content[space.id]?.images) {
|
|
|
|
+ const imageIndex = process.content[space.id].images.findIndex(img => img.id === this.previewImageData.id);
|
|
|
|
+ if (imageIndex > -1) {
|
|
|
|
+ this.removeSpaceImage(process.id, space.id, this.previewImageData.id);
|
|
|
|
+ imageFound = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (imageFound) break;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 如果在新结构中没找到,检查旧的图片数组
|
|
|
|
+ if (!imageFound) {
|
|
|
|
+ if (this.whiteModelImages.find(i => i.id === this.previewImageData.id)) {
|
|
|
|
+ this.removeWhiteModelImage(this.previewImageData.id);
|
|
|
|
+ } else if (this.softDecorImages.find(i => i.id === this.previewImageData.id)) {
|
|
|
|
+ this.removeSoftDecorImage(this.previewImageData.id);
|
|
|
|
+ } else if (this.renderLargeImages.find(i => i.id === this.previewImageData.id)) {
|
|
|
|
+ this.removeRenderLargeImage(this.previewImageData.id);
|
|
|
|
+ } else if (this.postProcessImages.find(i => i.id === this.previewImageData.id)) {
|
|
|
|
+ this.removePostProcessImage(this.previewImageData.id);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
this.closeImagePreview();
|
|
this.closeImagePreview();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -3249,6 +3281,9 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
process.content[spaceId].images.push(imageItem);
|
|
process.content[spaceId].images.push(imageItem);
|
|
process.content[spaceId].lastUpdated = new Date();
|
|
process.content[spaceId].lastUpdated = new Date();
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ // 触发变更检测以更新界面
|
|
|
|
+ this.cdr.detectChanges();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|