// 全局常量。 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; // 公开随机短码长度(Base62) export const SHORT_CODE_LENGTH = 10; // 上传限制 export const MAX_IMAGE_SIZE = 10 * 1024 * 1024; // 10MB export const MAX_VIDEO_SIZE = 100 * 1024 * 1024; // 100MB export const MAX_FILE_SIZE = 20 * 1024 * 1024; // 20MB export const ALLOWED_IMAGE_TYPES = ['image/jpeg', 'image/png', 'image/webp', 'image/gif', 'image/svg+xml']; 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: 'a8K3pQ9x2M' }, { 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: 'txHash', header: '上链哈希值', required: false, note: '选填,链上交易/存证哈希,填写则记录上链结果', example: '0xabc123...' }, { key: 'onchainAt', header: '上链时间', required: false, note: '选填,格式 YYYY-MM-DD HH:mm', example: '2024-06-02 09:30' }, { key: 'blockHeight', header: '区块高度', required: false, note: '选填,整数', example: '8500001' }, { key: 'remark', header: '备注', required: false, note: '选填', example: '' }, ];