change type in PhotoScroller

This commit is contained in:
Timi
2026-08-24 17:53:21 +08:00
parent 9b843fc921
commit f42e865430
9 changed files with 316 additions and 35 deletions
+8 -3
View File
@@ -115,7 +115,8 @@
<div class="photo-part">
<photo-scroller
v-model="photoList"
:photo-items="photoItemList"
v-model:photo-items="photoItemList"
:edit-mode="true"
:loading="isPhotoUploading"
@add="capturePhoto"
/>
@@ -225,6 +226,7 @@ const navBarStore = useNavBarStore();
type EditablePhoto = {
attachment?: Partial<Attachment>;
attachType?: string;
previewUrl?: string;
tempFileId?: string;
url: string;
@@ -694,12 +696,15 @@ function buildTempFileIdList(): string[] {
function buildPhotoAttachmentList(): Array<Partial<Attachment>> {
return photoItemList.value.map((item) => {
if (item.attachment) {
return item.attachment;
return {
...item.attachment,
attachType: item.attachType || item.attachment.attachType || "PHOTO"
};
}
return {
tempFileId: item.tempFileId,
attachType: "PHOTO"
attachType: item.attachType || "PHOTO"
};
});
}