diff --git a/frontend/src/components/constants.tsx b/frontend/src/components/constants.tsx index e3dbe9f..1218065 100644 --- a/frontend/src/components/constants.tsx +++ b/frontend/src/components/constants.tsx @@ -1,4 +1,4 @@ -import type { TaskStatus, ProjectStatus, TaskPriority } from '@/types'; +import type { TaskStatus, TaskPriority } from '@/types'; import { Tag } from 'antd'; import type { ReactNode } from 'react'; @@ -16,24 +16,16 @@ export const taskStatusConfig: Record< }; export const taskStatusList: TaskStatus[] = [ - 'pending', - 'assigned', - 'in_progress', - 'review', - 'done', - 'rejected', - 'cancelled', + 'pending', 'assigned', 'in_progress', 'review', 'done', 'rejected', 'cancelled', ]; -export const projectStatusConfig: Record< - ProjectStatus, - { label: string; color: string } -> = { - planning: { label: '规划中', color: 'default' }, - active: { label: '进行中', color: 'processing' }, - paused: { label: '已暂停', color: 'warning' }, - completed: { label: '已完成', color: 'success' }, - cancelled: { label: '已取消', color: 'error' }, +export const projectStatusConfig: Record = { + draft: { label: '草稿', color: 'default' }, + planning: { label: '规划中', color: 'processing' }, + in_progress: { label: '执行中', color: 'processing' }, + review: { label: '审核中', color: 'warning' }, + accepted: { label: '已验收', color: 'success' }, + archived: { label: '已归档', color: 'default' }, }; export const priorityConfig: Record = { @@ -48,8 +40,8 @@ export function TaskStatusTag({ status }: { status: TaskStatus }) { return {cfg.label}; } -export function ProjectStatusTag({ status }: { status: ProjectStatus }) { - const cfg = projectStatusConfig[status]; +export function ProjectStatusTag({ status }: { status: string }) { + const cfg = projectStatusConfig[status] || { label: status, color: 'default' }; return {cfg.label}; }