diff --git a/src/features/breakdown/BreakdownPage.vue b/src/features/breakdown/BreakdownPage.vue index 7cbbe4b..46eeb4c 100644 --- a/src/features/breakdown/BreakdownPage.vue +++ b/src/features/breakdown/BreakdownPage.vue @@ -15,6 +15,8 @@ import { breakdownSnapshot, recoveryOptions, workflowCheckpoints } from '../work import { getOperation, runOperation } from '../workflows/operations' import ConfirmAction from '../workflows/ConfirmAction.vue' import HistoryPanel from '../workflows/HistoryPanel.vue' +import WorkflowExecutionPanel from '../workflows/WorkflowExecutionPanel.vue' +import { useWorkflowExecution } from '../workflows/execution' import SubjectList from './components/SubjectList.vue' import StoryboardList from './components/StoryboardList.vue' import { errorMessage } from '../../lib/http' @@ -44,7 +46,9 @@ const plans = computed(() => result.value?.storyboardPlans ?? []) const shots = computed(() => result.value?.storyboardEpisodeShots ?? []) const summary = computed(() => snapshot.value?.taskSummary) const validation = computed(() => result.value?.storyboardShotValidation ?? snapshot.value?.storyboardShotValidation) -const operation = computed(() => getOperation(project.value!.id)) +const projectId = computed(() => project.value?.id ?? '') +const operation = computed(() => getOperation(projectId.value)) +const backgroundExecution = useWorkflowExecution(projectId, 'breakdown') const recovery = computed(() => recoveryOptions(checkpoints.value)) const execution = computed(() => snapshot.value?.workflowExecution) const taskStopped = computed(() => execution.value?.status === 'failed' || execution.value?.status === 'completed') @@ -62,6 +66,7 @@ const canStart = computed( !!preview.value && configValid.value && !operation.value.pending && + !backgroundExecution.active.value && !error.value && (!records.value.length || taskStopped.value) ) @@ -120,9 +125,13 @@ async function run(action: BreakdownAction) { 'resume-storyboard': '正在修复分镜绑定' } const id = project.value.id - await runOperation(id, labels[action], () => - breakdownApi.run(id, action, action === 'start' ? input.value : undefined) - ) + await runOperation(id, labels[action], async () => { + const result = await breakdownApi.run(id, action, action === 'start' ? input.value : undefined) + if (action === 'start' && 'executionId' in result) { + await backgroundExecution.track(result.executionId) + } + return result + }) await refresh() } @@ -282,6 +291,15 @@ const rules = { 后端尚无明确的完成或失败记录。为避免重复执行,已禁用整条重新拆解;如进程已中断,请先核实后台,再选择对应恢复操作。

+