diff --git a/src/features/projects/ProjectLayout.vue b/src/features/projects/ProjectLayout.vue index 12943b4..10d41b6 100644 --- a/src/features/projects/ProjectLayout.vue +++ b/src/features/projects/ProjectLayout.vue @@ -5,7 +5,8 @@ import { NScrollbar, NAlert, NButton, NPageHeader, NSpin, NEllipsis } from 'naiv import { EmptyState } from '../../components/ui' import { projectContextKey, useProjectData } from './context' import { getOperation } from '../workflows/operations' -import { isProjectComplete, projectAccessKey, type ProjectAccess } from './access' +import { projectAccessKey, projectSectionFromPath, type ProjectAccess } from './access' +import { useProjectStageAccess } from './useProjectStageAccess' import { useWorkflowExecution } from '../workflows/execution' import WorkflowExecutionPanel from '../workflows/WorkflowExecutionPanel.vue' @@ -28,8 +29,14 @@ watchEffect(() => { void context.refresh() } }) -const complete = computed(() => isProjectComplete(context.project.value, id.value)) -const isCreation = computed(() => route.path.replace(/\/+$/, '').endsWith('/create-drama')) +const stageAccess = useProjectStageAccess(id, context.project, context.checkpoints) +const complete = stageAccess.scriptReady +const currentSection = computed(() => projectSectionFromPath(route.path)) +const currentAccess = computed(() => { + const section = currentSection.value + return section ? stageAccess.sections.value[section] : null +}) +const isCreation = computed(() => currentSection.value === 'create-drama') type OperationGuide = { title: string description: string @@ -98,7 +105,7 @@ function resolveOperationError() { const access = inject(projectAccessKey, undefined) let published: ProjectAccess | null = null watchEffect(() => { - published = { projectId: id.value, completed: complete.value } + published = { projectId: id.value, completed: complete.value, sections: stageAccess.sections.value } if (access) access.value = published }) onScopeDispose(() => { @@ -154,14 +161,19 @@ onScopeDispose(() => { @dismiss="createDramaExecution.dismiss" />
- + - 返回剧本创作 + {{ currentAccess.nextLabel || '前往上一步' }} 刷新项目状态 @@ -169,7 +181,7 @@ onScopeDispose(() => {