fix require photo event
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user