czh-20260430-修复任务管理相关bug

This commit is contained in:
zhihao
2026-04-30 22:43:59 +08:00
parent 2641522dcd
commit d9d5ab70cc
8 changed files with 1925 additions and 556 deletions
+29
View File
@@ -0,0 +1,29 @@
export const PRIORITY_OPTIONS = [
{ label: '高', value: 'high' },
{ label: '中', value: 'medium' },
{ label: '低', value: 'low' },
];
const PRIORITY_COLOR_MAP: Record<string, string> = {
high: '#ffccc7',
medium: '#ffe58f',
low: '#91d5ff',
};
export function getPriorityBg(value: string): string {
return PRIORITY_COLOR_MAP[value] || '#f5f5f5';
}
export function getPriorityLabel(value: string): string {
const opt = PRIORITY_OPTIONS.find((o) => o.value === value);
return opt?.label || value;
}
export function isOverdue(task: { endTime?: string; completed?: boolean }): boolean {
if (!task.endTime || task.completed) return false;
const end = new Date(task.endTime);
const now = new Date();
now.setHours(0, 0, 0, 0);
end.setHours(0, 0, 0, 0);
return now > end;
}