fix(projects): 工作日志编辑日期不回填
This commit is contained in:
@@ -143,13 +143,15 @@ export type ProjectTaskResponse = Omit<
|
|||||||
|
|
||||||
export type TaskWorklogResponse = Omit<
|
export type TaskWorklogResponse = Omit<
|
||||||
Api.Project.TaskWorklog,
|
Api.Project.TaskWorklog,
|
||||||
'id' | 'taskId' | 'userId' | 'difficulty' | 'attachments'
|
'id' | 'taskId' | 'userId' | 'difficulty' | 'attachments' | 'startDate' | 'endDate'
|
||||||
> & {
|
> & {
|
||||||
id: StringIdResponse;
|
id: StringIdResponse;
|
||||||
taskId: StringIdResponse;
|
taskId: StringIdResponse;
|
||||||
userId: StringIdResponse;
|
userId: StringIdResponse;
|
||||||
difficulty?: string | null;
|
difficulty?: string | null;
|
||||||
attachments?: AttachmentItemResponse[] | null;
|
attachments?: AttachmentItemResponse[] | null;
|
||||||
|
startDate?: ProjectLocalDateValue;
|
||||||
|
endDate?: ProjectLocalDateValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface ProjectMemberResponse {
|
export interface ProjectMemberResponse {
|
||||||
@@ -353,6 +355,9 @@ export function normalizeTaskWorklog(response: TaskWorklogResponse): Api.Project
|
|||||||
workContent: response.workContent ?? null,
|
workContent: response.workContent ?? null,
|
||||||
attachments: normalizeAttachments(response.attachments),
|
attachments: normalizeAttachments(response.attachments),
|
||||||
progressRate: typeof response.progressRate === 'number' ? response.progressRate : 0,
|
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"
|
// 历史记录或异常缺失时兜底为字典默认档位 "2"
|
||||||
difficulty: response.difficulty ?? '2',
|
difficulty: response.difficulty ?? '2',
|
||||||
difficultyName: response.difficultyName ?? null
|
difficultyName: response.difficultyName ?? null
|
||||||
|
|||||||
Reference in New Issue
Block a user