fix(工作报告、我的绩效、产品/项目、消息通知): 修复已知的一些问题。

This commit is contained in:
dk
2026-06-28 14:04:28 +08:00
parent a4884035cd
commit 499f2115b2
10 changed files with 189 additions and 58 deletions

View File

@@ -67,20 +67,20 @@ type MonthlyResultResponse = Omit<Api.Performance.Sheet.MonthlyResult, 'sheetId'
type TeamSummaryResponse = Omit<
Api.Performance.Team.Summary,
| 'totalSheetCount'
| 'expectedSheetCount'
| 'pendingSendCount'
| 'pendingConfirmCount'
| 'pendingSendUsers'
| 'pendingConfirmUsers'
| 'deptOrgAverages'
> & {
totalSheetCount?: number | string | null;
expectedSheetCount?: number | string | null;
pendingSendCount?: number | string | null;
pendingConfirmCount?: number | string | null;
pendingSendUsers?: Array<
Omit<Api.Performance.Team.PendingSendUser, 'userId' | 'managerUserId' | 'sheetId'> & {
userId: StringIdResponse;
managerUserId: StringIdResponse;
managerUserId?: StringIdResponse | null;
sheetId?: StringIdResponse | null;
}
> | null;
@@ -188,13 +188,13 @@ function normalizeMonthlyResult(response: MonthlyResultResponse): Api.Performanc
function normalizeTeamSummary(response: TeamSummaryResponse): Api.Performance.Team.Summary {
return {
...response,
totalSheetCount: normalizeTotal(response.totalSheetCount),
expectedSheetCount: normalizeTotal(response.expectedSheetCount),
pendingSendCount: normalizeTotal(response.pendingSendCount),
pendingConfirmCount: normalizeTotal(response.pendingConfirmCount),
pendingSendUsers: (response.pendingSendUsers || []).map(item => ({
...item,
userId: normalizeStringId(item.userId),
managerUserId: normalizeStringId(item.managerUserId),
managerUserId: normalizeNullableStringId(item.managerUserId),
sheetId: normalizeNullableStringId(item.sheetId),
statusCode: item.statusCode ?? null
})),

View File

@@ -99,15 +99,19 @@ type ProjectOptionResponse = Omit<Api.WorkReport.Project.ProjectReportOwnerProje
id: StringIdResponse;
};
type TeamReportPendingUserResponse = Omit<Api.WorkReport.Common.TeamReportPendingUser, 'userId'> & {
type TeamReportUnsubmittedReportResponse = Omit<
Api.WorkReport.Common.TeamReportUnsubmittedReport,
'userId' | 'projectId'
> & {
userId: StringIdResponse;
projectId?: StringIdResponse | null;
};
type TeamReportSummaryResponse = Omit<
Api.WorkReport.Common.TeamReportSummary,
'unsubmittedUsers' | 'periodStartDate' | 'periodEndDate'
'unsubmittedReports' | 'periodStartDate' | 'periodEndDate'
> & {
unsubmittedUsers?: TeamReportPendingUserResponse[] | null;
unsubmittedReports?: TeamReportUnsubmittedReportResponse[] | null;
periodStartDate?: unknown;
periodEndDate?: unknown;
};
@@ -375,10 +379,16 @@ function normalizeTeamReportSummary(response: TeamReportSummaryResponse): Api.Wo
...response,
periodStartDate: normalizeDateText(response.periodStartDate) ?? undefined,
periodEndDate: normalizeDateText(response.periodEndDate) ?? undefined,
unsubmittedUsers:
response.unsubmittedUsers?.map(item => ({
expectedReportCount: response.expectedReportCount ?? 0,
submittedReportCount: response.submittedReportCount ?? 0,
unsubmittedReportCount: response.unsubmittedReportCount ?? 0,
pendingApprovalReportCount: response.pendingApprovalReportCount ?? 0,
unsubmittedReports:
response.unsubmittedReports?.map(item => ({
...item,
userId: normalizeStringId(item.userId)
userId: normalizeStringId(item.userId),
projectId: normalizeNullableStringId(item.projectId),
projectName: item.projectName ?? null
})) ?? []
};
}