feat: support WPS report material workbooks

This commit is contained in:
hectorzhao
2026-09-04 17:10:04 +08:00
parent 48d0363920
commit fb39c8b606
29 changed files with 2737 additions and 734 deletions
+8 -1
View File
@@ -7,7 +7,14 @@ export function isImageUpload(file: Pick<File, 'name' | 'type'>) {
return file.type.toLowerCase().startsWith('image/') || IMAGE_FILE_EXTENSION.test(file.name);
}
export function assertUploadFileSize(file: Pick<File, 'name' | 'size' | 'type'>) {
export function assertUploadFileSize(
file: Pick<File, 'name' | 'size' | 'type'>,
customLimit?: { bytes: number; message: string },
) {
if (customLimit) {
if (file.size > customLimit.bytes) throw new Error(customLimit.message);
return;
}
const image = isImageUpload(file);
const limit = image ? IMAGE_UPLOAD_MAX_BYTES : FILE_UPLOAD_MAX_BYTES;
if (file.size > limit) {