From 5edc467d1979938f68722f6eda4d0dbfd3ceea14 Mon Sep 17 00:00:00 2001 From: WangDL Date: Sun, 24 May 2026 20:58:09 +0800 Subject: [PATCH] fix: add Chinese labels for import status, type, and step fields Co-Authored-By: Claude Opus 4.7 --- src/pages/ImportMonitor.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/pages/ImportMonitor.tsx b/src/pages/ImportMonitor.tsx index 56fca5d..4f6f894 100644 --- a/src/pages/ImportMonitor.tsx +++ b/src/pages/ImportMonitor.tsx @@ -31,14 +31,20 @@ export default function ImportMonitorPage() { qc.invalidateQueries({ queryKey: ['admin-imports'] }) } + const statusLabel: Record = { + QUEUED: '排队中', PROCESSING: '处理中', COMPLETED: '已完成', FAILED: '失败', CANCELLED: '已取消', + } const statusColor: Record = { QUEUED: 'blue', PROCESSING: 'processing', COMPLETED: 'green', FAILED: 'red', CANCELLED: 'default', } + const stepLabel: Record = { + pending: '待处理', running: '执行中', completed: '已完成', failed: '失败', skipped: '已跳过', + } const columns = [ { title: '名称', dataIndex: 'sourceName', width: 180, ellipsis: true }, - { title: '类型', dataIndex: 'sourceType', width: 80 }, - { title: '状态', dataIndex: 'status', width: 90, render: (s: string) => {s} }, + { title: '类型', dataIndex: 'sourceType', width: 80, render: (s: string) => (s === 'file' ? '文件' : s === 'url' ? '链接' : s === 'text' ? '文本' : s) }, + { title: '状态', dataIndex: 'status', width: 90, render: (s: string) => {statusLabel[s] || s} }, { title: '进度', dataIndex: 'progress', width: 70, render: (v: number) => `${v || 0}%` }, { title: '重试', dataIndex: 'retryCount', width: 60, align: 'center' as const }, { title: '步骤', dataIndex: 'step', width: 100, ellipsis: true }, @@ -57,7 +63,7 @@ export default function ImportMonitorPage() { const stepCols = [ { title: '步骤', dataIndex: 'step', width: 120 }, - { title: '状态', dataIndex: 'status', width: 80, render: (s: string) => {s} }, + { title: '状态', dataIndex: 'status', width: 80, render: (s: string) => {stepLabel[s] || s} }, { title: '详情', dataIndex: 'detail', ellipsis: true }, { title: '开始', dataIndex: 'startedAt', width: 130, render: (d: string) => d ? dayjs(d).format('HH:mm:ss') : '-' }, { title: '完成', dataIndex: 'completedAt', width: 130, render: (d: string) => d ? dayjs(d).format('HH:mm:ss') : '-' }, @@ -75,7 +81,7 @@ export default function ImportMonitorPage() { {detail && ( <> Job: {detail.job?.id} - 状态: {detail.job?.status} + 状态: {statusLabel[detail.job?.status] || detail.job?.status} 进度: {detail.job?.progress || 0}% 重试: {detail.job?.retryCount}/{detail.job?.maxRetries} {detail.job?.errorMessage &&
{detail.job?.errorMessage}
}