export const QUEUE_NAMES = { GEN_CODE: 'gen-code', IMPORT_OUTBOUND: 'import-outbound', IMPORT_OUTBOUND_PREVIEW: 'import-outbound-preview', WATERMARK: 'watermark', ONCHAIN: 'onchain', BACKUP: 'backup', RESTORE: 'restore', } as const; export const SHORT_CODE_LENGTH = 12; export const TRACE_CODE_PATTERN = /^\d{12}$/; export const MAX_IMAGE_SIZE = 10 * 1024 * 1024; export const MAX_VIDEO_SIZE = 100 * 1024 * 1024; export const MAX_FILE_SIZE = 20 * 1024 * 1024; // 不允许上传 SVG:SVG 可内嵌脚本,从同源 /uploads 直接打开会造成存储型 XSS。 // 内置默认图标是打包进前端的静态 svg(/admin、/trace 下),不经上传,不受影响。 export const ALLOWED_IMAGE_TYPES = ['image/jpeg', 'image/png', 'image/webp', 'image/gif']; export const ALLOWED_VIDEO_TYPES = ['video/mp4', 'video/webm', 'video/quicktime']; export const ALLOWED_DOC_TYPES = ['application/pdf', 'image/jpeg', 'image/png']; export interface ImportColumn { key: string; header: string; required: boolean; note: string; example: string; } export const OUTBOUND_IMPORT_COLUMNS: ImportColumn[] = [ { key: 'shortCode', header: '追溯码', required: true, note: '必填,生码导出文件中的追溯码,定位到具体一件作品。', example: '482630790612', }, { key: 'batchNo', header: '批次编号', required: false, note: '选填,仅作核对;与该码实际批次不符则该行失败。', example: 'B20240601', }, { key: 'outTime', header: '出库时间', required: false, note: '选填,格式 YYYY-MM-DD HH:mm。', example: '2024-06-01 10:00', }, { key: 'outImages', header: '出库实况图路径', required: false, note: '选填,ZIP 内 images 目录下的图片路径,多张用 ; 分隔,如 images/out-001.jpg;images/out-002.png。', example: 'images/out-001.jpg;images/out-002.png', }, { key: 'remark', header: '备注', required: false, note: '选填。', example: '', }, ];