From 645f73d1a35af2f7f85ac96594828028171a998a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=9D=E5=B0=98?= <237809796@qq.com> Date: Wed, 17 Jun 2026 18:10:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96:=20LEGACY=5FSTATUS=5FMAP=20?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E6=8A=BD=20mapLegacyStatus=20=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E6=94=B6=E6=95=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constants/project.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/constants/project.ts b/src/constants/project.ts index b69aa62..813f34b 100644 --- a/src/constants/project.ts +++ b/src/constants/project.ts @@ -92,14 +92,17 @@ const LEGACY_STATUS_MAP: Record = { abandoned: 'cancelled', } +/** 老DB 旧态映射(completed→done / review_ready→in_review 等),新 DB 无此数据 */ +function mapLegacyStatus(status: string): string { + return LEGACY_STATUS_MAP[status] ?? status +} + export function taskStatusLabel(status: string): string { - const mapped = LEGACY_STATUS_MAP[status] ?? status - return TASK_STATUS_LABELS[mapped] ?? 'tasks.status.todo' + return TASK_STATUS_LABELS[mapLegacyStatus(status)] ?? 'tasks.status.todo' } export function taskStatusClass(status: string): string { - const mapped = LEGACY_STATUS_MAP[status] ?? status - return TASK_STATUS_CLASS[mapped] ?? 'status-todo' + return TASK_STATUS_CLASS[mapLegacyStatus(status)] ?? 'status-todo' } // ── 任务优先级 ──