feat: 更新静态出库模板与大包上传

This commit is contained in:
Nixevol
2026-07-14 10:04:33 +08:00
parent 9644f5c128
commit 2250869244
36 changed files with 1378 additions and 461 deletions
+1 -1
View File
@@ -104,7 +104,7 @@ export const traceCodeApi = {
export const outboundApi = {
updateSingle: (id: string, data: object) => put(`/outbound/trace-codes/${id}`, data),
templateUrl: '/api/outbound/import/template',
preview: (data: FormData) => post('/outbound/import/preview', data, { timeout: 120000 }),
preview: (data: FormData) => post('/outbound/import/preview', data, { timeout: 0 }),
requestSession: (requestId: string, silent = false) =>
get(`/outbound/import-requests/${requestId}`, undefined, { silentError: silent }),
session: (id: string, silent = false) =>
+3 -6
View File
@@ -449,7 +449,7 @@
"successCount": "Success",
"failCount": "Failed",
"downloadResult": "Download Details",
"tip": "Download the template ZIP, fill it in, and upload. On-chain results are recorded automatically from the blockchain API response.",
"tip": "Download and complete the template package, then upload it. Batch import records outbound data only; trigger on-chain processing separately when needed.",
"downloadZipTemplate": "Download Template ZIP",
"uploadZipPreview": "Upload & Preview",
"totalRows": "Rows",
@@ -463,7 +463,6 @@
"previewFailed": "Preview parsing failed. Check the error details.",
"emptyZipFile": "Select a non-empty ZIP file",
"zipFileOnly": "Only ZIP files are supported",
"zipFileTooLarge": "The ZIP file must not exceed {size}MB",
"backgroundProcessing": "Waiting timed out. The task is still running in the background; refresh this page later to continue.",
"progressUnavailable": "Task progress is temporarily unavailable. Processing may still be running; refresh this page later.",
"activeTaskPending": "The current import task has not finished. A new file cannot be uploaded yet.",
@@ -490,8 +489,7 @@
"noPendingRows": "The import session has no rows awaiting processing",
"xlsxCount": "The ZIP must contain exactly one xlsx file",
"xlsxRoot": "The xlsx file must be in the root of the ZIP",
"xlsxTooLarge": "The xlsx file exceeds the 10MB limit",
"zipExpandedTooLarge": "The expanded ZIP exceeds the allowed size",
"xlsxTooLarge": "The xlsx file exceeds the 100MB limit",
"worksheetMissing": "The xlsx file does not contain a worksheet",
"noRows": "The xlsx file does not contain any importable rows",
"previewExpired": "The import preview expired or its status changed",
@@ -499,7 +497,7 @@
"batchNoMismatch": "Batch number does not match; the actual value is {value}",
"tooManyImages": "Each row can contain at most {count} outbound images",
"duplicateZipImage": "The ZIP contains a duplicate image path: {path}",
"imageTooLarge": "Image exceeds the 10MB limit: {path}",
"imageTooLarge": "Image exceeds the 100MB limit: {path}",
"tooManyRows": "The import exceeds the {count}-row limit",
"tooManyColumns": "The xlsx file exceeds the {count}-column limit",
"duplicateHeader": "The xlsx file contains a duplicate header: {value}",
@@ -523,7 +521,6 @@
"zipEntryLimit": "The ZIP contains more than {count} entries",
"xlsxEntryLimit": "The xlsx file contains more than {count} entries",
"imageReferenceLimit": "The import contains more than {count} image references",
"storedImageSizeLimit": "Referenced images exceed the {count}MB stored-output limit",
"incompleteRows": "Import row states are incomplete: {success} succeeded, {fail} failed, {remaining} pending, {total} total",
"previewSessionMissing": "The import preview session no longer exists",
"previewJobMismatch": "The preview task does not match this import session",
+3 -6
View File
@@ -449,7 +449,7 @@
"successCount": "成功",
"failCount": "失败",
"downloadResult": "下载结果明细",
"tip": "下载模板 ZIP 后按说明填写并上传;链上结果由区块链接口返回后自动记录。",
"tip": "下载模板包后按说明填写并上传;批量导入仅登记出库,完成后可按需另行触发上链。",
"downloadZipTemplate": "下载模板包",
"uploadZipPreview": "上传并预览",
"totalRows": "总行数",
@@ -463,7 +463,6 @@
"previewFailed": "预览解析失败,请查看错误原因",
"emptyZipFile": "请选择非空的 ZIP 文件",
"zipFileOnly": "仅支持 ZIP 文件",
"zipFileTooLarge": "ZIP 文件不能超过 {size}MB",
"backgroundProcessing": "等待已超时,任务仍在后台处理,稍后刷新页面可继续查看",
"progressUnavailable": "暂时无法获取任务进度,任务可能仍在后台处理,请稍后刷新查看",
"activeTaskPending": "当前导入任务尚未结束,不能上传新的文件",
@@ -490,8 +489,7 @@
"noPendingRows": "导入会话中没有待处理数据",
"xlsxCount": "ZIP 中必须且只能包含一个 xlsx 文件",
"xlsxRoot": "xlsx 文件必须位于 ZIP 根目录",
"xlsxTooLarge": "xlsx 文件超过 10MB",
"zipExpandedTooLarge": "ZIP 解压后总大小超过限制",
"xlsxTooLarge": "xlsx 文件超过 100MB",
"worksheetMissing": "xlsx 中缺少工作表",
"noRows": "xlsx 中没有可导入的数据",
"previewExpired": "导入预览会话已过期或状态已变化",
@@ -499,7 +497,7 @@
"batchNoMismatch": "批次编号不匹配,实际为 {value}",
"tooManyImages": "每行最多填写 {count} 张出库图",
"duplicateZipImage": "ZIP 中存在重复图片路径:{path}",
"imageTooLarge": "图片超过 10MB:{path}",
"imageTooLarge": "图片超过 100MB:{path}",
"tooManyRows": "导入数据超过 {count} 行限制",
"tooManyColumns": "xlsx 列数超过 {count} 列限制",
"duplicateHeader": "xlsx 表头重复:{value}",
@@ -523,7 +521,6 @@
"zipEntryLimit": "ZIP 文件数量超过限制(最多 {count} 个)",
"xlsxEntryLimit": "xlsx 文件数量超过限制(最多 {count} 个)",
"imageReferenceLimit": "出库图片引用总数超过限制(最多 {count} 张)",
"storedImageSizeLimit": "出库图片按引用累计大小超过限制(最多 {count}MB)",
"incompleteRows": "导入行状态不完整:成功 {success},失败 {fail},待处理 {remaining},总数 {total}",
"previewSessionMissing": "导入预览会话不存在",
"previewJobMismatch": "导入预览任务与会话不匹配",
+2 -9
View File
@@ -84,7 +84,6 @@ import { useI18n } from 'vue-i18n';
import type { UploadCustomRequestOptions } from 'naive-ui';
import { NButton, NIcon, NImage, NTag, NText, type DataTableColumns } from 'naive-ui';
import { CloudUploadOutline, DownloadOutline } from '@vicons/ionicons5';
import { MAX_OUTBOUND_IMPORT_SIZE } from '@artveris/shared';
import { jobApi, outboundApi } from '@/api';
import { useAuthStore } from '@/stores/auth';
import { message } from '@/utils/feedback';
@@ -694,10 +693,6 @@ function validateUploadFile(file: File | null | undefined): file is File {
message.error(t('pages.outbound.zipFileOnly'));
return false;
}
if (file.size > MAX_OUTBOUND_IMPORT_SIZE) {
message.error(t('pages.outbound.zipFileTooLarge', { size: MAX_OUTBOUND_IMPORT_SIZE / 1024 / 1024 }));
return false;
}
return true;
}
@@ -1010,8 +1005,7 @@ const BACKEND_ERROR_KEY_BY_MESSAGE: Record<string, string> = {
'导入会话中没有待处理数据': 'noPendingRows',
'ZIP 中必须且只能包含一个 xlsx 文件': 'xlsxCount',
'xlsx 文件必须位于 ZIP 根目录': 'xlsxRoot',
'xlsx 文件超过 10MB': 'xlsxTooLarge',
'ZIP 解压后总大小超过限制': 'zipExpandedTooLarge',
'xlsx 文件超过 100MB': 'xlsxTooLarge',
'xlsx 解压后总大小超过限制': 'xlsxExpandedTooLarge',
'ZIP 文件结构无效': 'zipInvalidStructure',
'xlsx 文件结构无效': 'xlsxInvalidStructure',
@@ -1047,12 +1041,11 @@ function localizeBackendError(value?: unknown) {
[/^批次编号不匹配,实际为 (.+)$/, 'batchNoMismatch', 'value'],
[/^每行最多填写 (\d+) 张出库图$/, 'tooManyImages', 'count'],
[/^ZIP 中存在重复图片路径:(.+)$/, 'duplicateZipImage', 'path'],
[/^图片超过 10MB:(.+)$/, 'imageTooLarge', 'path'],
[/^图片超过 100MB:(.+)$/, 'imageTooLarge', 'path'],
[/^导入数据超过 (\d+) 行限制$/, 'tooManyRows', 'count'],
[/^ZIP 文件数量超过限制(最多 (\d+) 个)$/, 'zipEntryLimit', 'count'],
[/^xlsx 文件数量超过限制(最多 (\d+) 个)$/, 'xlsxEntryLimit', 'count'],
[/^出库图片引用总数超过限制(最多 (\d+) 张)$/, 'imageReferenceLimit', 'count'],
[/^出库图片按引用累计大小超过限制(最多 (\d+)MB)$/, 'storedImageSizeLimit', 'count'],
[/^xlsx 列数超过 (\d+) 列限制$/, 'tooManyColumns', 'count'],
[/^xlsx 表头重复:(.+)$/, 'duplicateHeader', 'value'],
[/^xlsx 包含未知表头:(.+)$/, 'unknownHeaders', 'value'],