开发任务类型保留:前端开发、后端开发、数据库设计、接口联调、数据处理、实施支持 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
34 lines
1.4 KiB
TypeScript
34 lines
1.4 KiB
TypeScript
export type CategoryGroup = 'development' | 'implementation' | 'other';
|
|
|
|
export interface TaskCategory {
|
|
id: string;
|
|
name: string;
|
|
group: CategoryGroup;
|
|
color?: string;
|
|
sortOrder: number;
|
|
isSystem: boolean;
|
|
}
|
|
|
|
export const CATEGORY_GROUP_LABEL: Record<CategoryGroup, string> = {
|
|
development: '开发',
|
|
implementation: '实施',
|
|
other: '其他',
|
|
};
|
|
|
|
export const PRESET_CATEGORIES: TaskCategory[] = [
|
|
{ id: 'cat-1', name: '前端开发', group: 'development', color: '#3b82f6', sortOrder: 1, isSystem: true },
|
|
{ id: 'cat-2', name: '后端开发', group: 'development', color: '#6366f1', sortOrder: 2, isSystem: true },
|
|
{ id: 'cat-3', name: '数据库设计', group: 'development', color: '#8b5cf6', sortOrder: 3, isSystem: true },
|
|
{ id: 'cat-4', name: '接口联调', group: 'development', color: '#0ea5e9', sortOrder: 4, isSystem: true },
|
|
{ id: 'cat-5', name: '数据处理', group: 'implementation', color: '#f59e0b', sortOrder: 5, isSystem: true },
|
|
{ id: 'cat-6', name: '实施支持', group: 'implementation', color: '#10b981', sortOrder: 6, isSystem: true },
|
|
];
|
|
|
|
export function getCategoryById(categories: TaskCategory[], id: string): TaskCategory | undefined {
|
|
return categories.find((c) => c.id === id);
|
|
}
|
|
|
|
export function getCategoriesByGroup(categories: TaskCategory[], group: CategoryGroup): TaskCategory[] {
|
|
return categories.filter((c) => c.group === group).sort((a, b) => a.sortOrder - b.sortOrder);
|
|
}
|