fix(加班申请、工作报告、我的绩效): 重构页面样式、修复一系列bug、对不合理的地方进行调整。
This commit is contained in:
@@ -34,7 +34,26 @@ type OvertimeApplicationApprovalRecordResponse = Omit<
|
||||
auditorUserId: StringIdResponse;
|
||||
};
|
||||
|
||||
type TeamOvertimeSummaryResponse = Api.OvertimeApplication.TeamOvertimeSummary;
|
||||
type TeamOvertimeSummaryResponse = Omit<
|
||||
Api.OvertimeApplication.TeamOvertimeSummary,
|
||||
'overtimeDateStart' | 'overtimeDateEnd'
|
||||
> & {
|
||||
overtimeDateStart?: unknown;
|
||||
overtimeDateEnd?: unknown;
|
||||
};
|
||||
|
||||
function normalizeDateText(value: unknown) {
|
||||
if (value === null || value === undefined) return undefined;
|
||||
const text = String(value).trim();
|
||||
const commaDateMatch = text.match(/^(\d{4}),(\d{1,2}),(\d{1,2})$/);
|
||||
|
||||
if (commaDateMatch) {
|
||||
const [, year, month, day] = commaDateMatch;
|
||||
return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`;
|
||||
}
|
||||
|
||||
return text || undefined;
|
||||
}
|
||||
|
||||
function normalizeBooleanFlag(value: boolean | number | string | null | undefined) {
|
||||
if (typeof value === 'boolean') {
|
||||
@@ -309,7 +328,14 @@ export async function fetchGetTeamOvertimeSummary(params: Api.OvertimeApplicatio
|
||||
params
|
||||
});
|
||||
|
||||
return mapServiceResult(result as ServiceRequestResult<TeamOvertimeSummaryResponse>, data => data);
|
||||
return mapServiceResult(result as ServiceRequestResult<TeamOvertimeSummaryResponse>, data => {
|
||||
if (!data) return data;
|
||||
return {
|
||||
...data,
|
||||
overtimeDateStart: normalizeDateText(data.overtimeDateStart) || '',
|
||||
overtimeDateEnd: normalizeDateText(data.overtimeDateEnd) || ''
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
export function fetchExportOvertimeApplications(params: Api.OvertimeApplication.OvertimeApplicationSearchParams = {}) {
|
||||
|
||||
Reference in New Issue
Block a user