feat(projects): 新增项目、执行、任务等功能

This commit is contained in:
2026-05-09 11:30:34 +08:00
parent f4f43814b3
commit 824392b564
106 changed files with 13060 additions and 1049 deletions

View File

@@ -0,0 +1,59 @@
/**
* 业务对象状态颜色ElTag type集中配置
*
* 各业务域的 statusCode → ElTag type 在此统一维护,避免散落在各业务模块。
* 未来若后端状态字典返回颜色字段,可在调用方优先取后端值,缺失时回退此映射。
*/
export type StatusTagType = 'primary' | 'success' | 'warning' | 'info' | 'danger';
export type StatusDomain =
| 'projectExecution'
| 'projectTask'
| 'executionMember'
| 'project'
| 'product'
| 'requirement'
| 'workOrder';
const statusTagTypeRegistry: Record<StatusDomain, Record<string, StatusTagType>> = {
// 项目-执行
projectExecution: {
pending: 'info',
active: 'primary',
paused: 'warning',
completed: 'success',
cancelled: 'danger'
},
// 项目-任务
projectTask: {
pending: 'info',
active: 'primary',
blocked: 'warning',
completed: 'success',
cancelled: 'danger'
},
// 执行成员变更事件
executionMember: {
join: 'success',
inactive: 'danger',
owner_transfer_in: 'warning',
owner_transfer_out: 'warning'
},
// 项目(待补全)
project: {},
// 产品(待补全)
product: {},
// 需求(待补全)
requirement: {},
// 工单(待补全)
workOrder: {}
};
export function getStatusTagType(domain: StatusDomain, statusCode: string | null | undefined): StatusTagType {
if (!statusCode) {
return 'info';
}
return statusTagTypeRegistry[domain][statusCode] || 'info';
}