fix(产品需求): 完善产品需求的诸多细节。

This commit is contained in:
dk
2026-05-09 18:15:10 +08:00
parent 5947157f89
commit 28c47b14a3
13 changed files with 337 additions and 245 deletions

View File

@@ -179,6 +179,7 @@ type RequirementResponse = Omit<
proposerId: string | number;
currentHandlerUserId?: string | number | null;
implementProjectId?: string | number | null;
implementProjectName?: string | null;
sourceBizId?: string | number | null;
children?: RequirementResponse[];
};
@@ -194,6 +195,7 @@ function normalizeRequirement(requirement: RequirementResponse): Api.Product.Req
proposerId: normalizeStringId(requirement.proposerId),
currentHandlerUserId: normalizeNullableStringId(requirement.currentHandlerUserId),
implementProjectId: normalizeNullableStringId(requirement.implementProjectId),
implementProjectName: requirement.implementProjectName ?? null,
sourceBizId: normalizeNullableStringId(requirement.sourceBizId),
children: requirement.children?.map(normalizeRequirement)
};

View File

@@ -135,6 +135,18 @@ export async function fetchGetProject(id: string) {
return mapServiceResult(result as ServiceRequestResult<ProjectResponse>, normalizeProject);
}
/** 根据产品ID获取产品下的所有项目 */
export async function fetchGetProjectListByProductId(productId: string) {
const result = await request<ProjectResponse[]>({
...safeJsonRequestConfig,
url: `${PROJECT_PREFIX}/list-by-product`,
method: 'get',
params: { productId }
});
return mapServiceResult(result as ServiceRequestResult<ProjectResponse[]>, data => data.map(normalizeProject));
}
/** 创建项目 */
export async function fetchCreateProject(data: Api.Project.SaveProjectParams) {
const result = await request<string | number>({

View File

@@ -795,5 +795,3 @@ export async function fetchGetCandidateSubordinateUsers() {
mapServiceResult(result as ServiceRequestResult<UserSimpleResponse[]>, data => data.map(normalizeUserSimple))
);
}