feat(projects): 1、站内信、通知功能完善;2、项目列表按会议需求重新开发
This commit is contained in:
@@ -37,7 +37,7 @@ import {
|
||||
|
||||
const PROJECT_PREFIX = `${WEB_SERVICE_PREFIX}/project/project`;
|
||||
|
||||
type ProjectResponse = Omit<
|
||||
export type ProjectResponse = Omit<
|
||||
Api.Project.Project,
|
||||
'id' | 'managerUserId' | 'productId' | 'plannedStartDate' | 'plannedEndDate' | 'actualStartDate' | 'actualEndDate'
|
||||
> & {
|
||||
@@ -79,7 +79,7 @@ function getTaskPrefix(projectId: string, executionId: string) {
|
||||
}
|
||||
|
||||
/** 归一化项目数据 */
|
||||
function normalizeProject(project: ProjectResponse): Api.Project.Project {
|
||||
export function normalizeProject(project: ProjectResponse): Api.Project.Project {
|
||||
return {
|
||||
...project,
|
||||
id: normalizeStringId(project.id),
|
||||
@@ -136,13 +136,34 @@ export async function fetchGetProjectPage(params?: Api.Project.ProjectSearchPara
|
||||
}));
|
||||
}
|
||||
|
||||
type ProjectOverviewSummaryResponse = Omit<Api.Project.ProjectOverviewSummary, 'total' | 'items'> & {
|
||||
/** 后端 overview-summary 升级(total/items)灰度期间可能缺省,适配层兜底 */
|
||||
total?: number | null;
|
||||
items?: Api.Project.OverviewStatusItem[] | null;
|
||||
};
|
||||
|
||||
/** 归一化项目概览统计:total/items 兜底,保证业务层拿到完整结构 */
|
||||
function normalizeProjectOverviewSummary(data: ProjectOverviewSummaryResponse): Api.Project.ProjectOverviewSummary {
|
||||
return {
|
||||
...data,
|
||||
statusCounts: data.statusCounts ?? {},
|
||||
total: data.total ?? 0,
|
||||
items: data.items ?? []
|
||||
};
|
||||
}
|
||||
|
||||
/** 获取项目入口页概览统计 */
|
||||
export function fetchGetProjectOverviewSummary() {
|
||||
return request<Api.Project.ProjectOverviewSummary>({
|
||||
export async function fetchGetProjectOverviewSummary() {
|
||||
const result = await request<ProjectOverviewSummaryResponse>({
|
||||
...safeJsonRequestConfig,
|
||||
url: `${PROJECT_PREFIX}/overview-summary`,
|
||||
method: 'get'
|
||||
});
|
||||
|
||||
return mapServiceResult(
|
||||
result as ServiceRequestResult<ProjectOverviewSummaryResponse>,
|
||||
normalizeProjectOverviewSummary
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取项目详情 */
|
||||
|
||||
Reference in New Issue
Block a user