fix(short-drama-agent-front): 完善素材准入与选角审核读取
This commit is contained in:
1 parent
75e86f7486
commit
3503926d62
13 files changed
+355
-42
No files matched your search
@@ -17,14 +17,27 @@ export function useProjectData(id: Ref<string>) {
|
||||
})
|
||||
const project = computed<ProjectDetail | null>(() => query.data.value?.project ?? null)
|
||||
const checkpoints = computed<Checkpoint[]>(() => query.data.value?.checkpoints ?? [])
|
||||
const stageReadiness = computed(() => query.data.value?.stageReadiness ?? null)
|
||||
/** 导航只消费当前项目的准入响应。 */
|
||||
const stageReadiness = computed(() => {
|
||||
const readiness = query.data.value?.stageReadiness
|
||||
return readiness?.projectId === id.value ? readiness : null
|
||||
})
|
||||
/** 同项目并发轻量刷新只采用最后一次请求。 */
|
||||
let readinessRefresh = 0
|
||||
/** 子页面完成当前步骤后调用,只刷新轻量项目状态与导航门禁。 */
|
||||
async function refreshStageReadiness() {
|
||||
const projectId = id.value
|
||||
if (!projectId || !query.data.value) return
|
||||
const snapshot = query.data.value
|
||||
if (!projectId || snapshot?.project.id !== projectId) return
|
||||
const request = ++readinessRefresh
|
||||
const nextReadiness = await projectsApi.stageReadiness(projectId)
|
||||
if (id.value === projectId && query.data.value)
|
||||
query.data.value = { ...query.data.value, stageReadiness: nextReadiness }
|
||||
if (
|
||||
request === readinessRefresh &&
|
||||
id.value === projectId &&
|
||||
query.data.value === snapshot &&
|
||||
nextReadiness.projectId === projectId
|
||||
)
|
||||
query.data.value = { ...snapshot, stageReadiness: nextReadiness }
|
||||
}
|
||||
return { ...query, project, checkpoints, stageReadiness, refreshStageReadiness }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user