From 62859bfc38c395bee743c8e05433330a16bab5af Mon Sep 17 00:00:00 2001 From: hongawen <83944980@qq.com> Date: Thu, 21 May 2026 22:05:30 +0800 Subject: [PATCH] =?UTF-8?q?fix(projects):=20=E5=B7=A5=E4=BD=9C=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E7=BC=96=E8=BE=91=E6=97=A5=E6=9C=9F=E4=B8=8D=E5=9B=9E?= =?UTF-8?q?=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/service/api/project-shared.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/service/api/project-shared.ts b/src/service/api/project-shared.ts index b6dc0fa..1ad6a54 100644 --- a/src/service/api/project-shared.ts +++ b/src/service/api/project-shared.ts @@ -143,13 +143,15 @@ export type ProjectTaskResponse = Omit< export type TaskWorklogResponse = Omit< Api.Project.TaskWorklog, - 'id' | 'taskId' | 'userId' | 'difficulty' | 'attachments' + 'id' | 'taskId' | 'userId' | 'difficulty' | 'attachments' | 'startDate' | 'endDate' > & { id: StringIdResponse; taskId: StringIdResponse; userId: StringIdResponse; difficulty?: string | null; attachments?: AttachmentItemResponse[] | null; + startDate?: ProjectLocalDateValue; + endDate?: ProjectLocalDateValue; }; export interface ProjectMemberResponse { @@ -353,6 +355,9 @@ export function normalizeTaskWorklog(response: TaskWorklogResponse): Api.Project workContent: response.workContent ?? null, attachments: normalizeAttachments(response.attachments), progressRate: typeof response.progressRate === 'number' ? response.progressRate : 0, + // 后端 LocalDate 默认序列化为 [year, month, day] 数组,必须归一为 'YYYY-MM-DD' 字符串供 ElDatePicker 使用 + startDate: normalizeProjectLocalDate(response.startDate) ?? '', + endDate: normalizeProjectLocalDate(response.endDate) ?? '', // 历史记录或异常缺失时兜底为字典默认档位 "2" difficulty: response.difficulty ?? '2', difficultyName: response.difficultyName ?? null