fix require photo event

This commit is contained in:
Timi
2026-08-30 01:25:10 +08:00
parent 320dab542a
commit e1a3df43a9
5 changed files with 189 additions and 32 deletions
+9
View File
@@ -1,6 +1,15 @@
import type { EventRecord } from "@/types/EventRecord";
import { getAttachmentReadURL } from "@/utils/attachment";
type EventRecordAttachment = {
attachType?: string;
};
/** 判断登记记录附件列表中是否包含照片。未指定类型时按历史默认值 PHOTO 处理。 */
export function hasPhotoAttachment(attachmentList?: readonly EventRecordAttachment[]): boolean {
return !!attachmentList?.some(item => !item.attachType || item.attachType === "PHOTO");
}
export function getEventRecordPhotoURL(record?: EventRecord, thumbnailSize?: number): string {
const attachment = record?.attachmentList?.find(item => item.attachType === "PHOTO") || record?.attachmentList?.[0];
if (!attachment?.id) {