diff --git a/src/features/projects/context.ts b/src/features/projects/context.ts index aed198f..508607d 100644 --- a/src/features/projects/context.ts +++ b/src/features/projects/context.ts @@ -8,15 +8,17 @@ import type { Ref } from 'vue' /** 同一项目的各个 graph 共用一份查询,避免每个面板重复请求。 */ export function useProjectData(id: Ref) { const query = useQuery(id, async (projectId, signal) => { - const [project, checkpoints] = await Promise.all([ + const [project, checkpoints, stageReadiness] = await Promise.all([ projectsApi.detail(projectId, signal), - projectsApi.checkpoints(projectId, signal) + projectsApi.checkpoints(projectId, signal), + projectsApi.stageReadiness(projectId, signal) ]) - return { project, checkpoints } + return { project, checkpoints, stageReadiness } }) const project = computed(() => query.data.value?.project ?? null) const checkpoints = computed(() => query.data.value?.checkpoints ?? []) - return { ...query, project, checkpoints } + const stageReadiness = computed(() => query.data.value?.stageReadiness ?? null) + return { ...query, project, checkpoints, stageReadiness } } /** 项目布局向子页面提供的类型安全上下文。 */