feat: 剧本完成后同步制作阶段并优化文案

This commit is contained in:
GouJ committed 2026-09-26 21:41:47 +08:00
1 parent 1eb9fe3493
commit ad95ffaf0b
1 file changed
+7 -6
@@ -17,7 +17,7 @@ import { useWorkflowExecution } from '../workflows/execution'
import WorkflowExecutionPanel from '../workflows/WorkflowExecutionPanel.vue' import WorkflowExecutionPanel from '../workflows/WorkflowExecutionPanel.vue'
/** 剧本创作工作区,正式数据库内容为准,checkpoint 只补充计划与恢复信息。 */ /** 剧本创作工作区,正式数据库内容为准,checkpoint 只补充计划与恢复信息。 */
const { project, checkpoints, refresh, error } = useProjectContext() const { project, checkpoints, refresh, refreshStageReadiness, error } = useProjectContext()
const tab = ref('episodes') const tab = ref('episodes')
const showHistory = ref(false) const showHistory = ref(false)
const dramaRecords = computed(() => workflowCheckpoints(checkpoints.value, 'create-drama')) const dramaRecords = computed(() => workflowCheckpoints(checkpoints.value, 'create-drama'))
@@ -30,7 +30,8 @@ const backgroundExecution = useWorkflowExecution(projectId, 'create-drama')
watch( watch(
() => backgroundExecution.query.data.value?.status, () => backgroundExecution.query.data.value?.status,
(status, previous) => { (status, previous) => {
if ((status === 'completed' || status === 'failed') && status !== previous) void refresh() if ((status === 'completed' || status === 'failed') && status !== previous)
void Promise.all([refresh(), refreshStageReadiness()])
} }
) )
const complete = computed(() => project.value?.status === 'completed') const complete = computed(() => project.value?.status === 'completed')
@@ -99,7 +100,7 @@ function exportScript() {
></template> ></template>
<WorkflowExecutionPanel <WorkflowExecutionPanel
v-if="backgroundExecution.executionId.value" v-if="backgroundExecution.executionId.value"
title="剧本创作后台任务" title="剧本创作任务"
:execution="backgroundExecution.query.data.value" :execution="backgroundExecution.query.data.value"
:loading="backgroundExecution.query.loading.value" :loading="backgroundExecution.query.loading.value"
:error="backgroundExecution.query.error.value" :error="backgroundExecution.query.error.value"
@@ -111,19 +112,19 @@ function exportScript() {
已写入 {{ episodes.length }}<span v-if="total"> / {{ total }}</span> 集<span v-if="!total"> 已写入 {{ episodes.length }}<span v-if="total"> / {{ total }}</span> 集<span v-if="!total">
· 等待计划集数</span · 等待计划集数</span
>。{{ >。{{
project?.status === 'generating' ? '生成状态来自后端,请等待下一次更新。' : '可按中断阶段继续处理。' project?.status === 'generating' ? '剧本仍在生成,请等待状态更新。' : '如中途停止,可从当前阶段继续。'
}} }}
</p> </p>
<div class="flex flex-wrap gap-2"> <div class="flex flex-wrap gap-2">
<ConfirmAction <ConfirmAction
label="恢复生成" label="恢复生成"
description="用于剧集尚未写完的情况。后端会检查角色、世界观与 checkpoint,并继续处理剧集。" description="用于剧集尚未写完的情况。系统会从已保存的角色、世界观和剧集进度继续生成。"
acknowledgement acknowledgement
:disabled="!canGenerate || operation.pending || backgroundExecution.active.value || !!error" :disabled="!canGenerate || operation.pending || backgroundExecution.active.value || !!error"
@confirm="resume('resume-generation')" @confirm="resume('resume-generation')"
/><ConfirmAction /><ConfirmAction
label="恢复改写" label="恢复改写"
description="用于剧集已齐全但审核未通过的情况。将读取 checkpoint 的改写上下文并重新审核。" description="用于剧集已齐全但审核未通过的情况。系统会从已保存的改写进度继续审核和调整。"
acknowledgement acknowledgement
:disabled="!canRewrite || operation.pending || backgroundExecution.active.value || !!error" :disabled="!canRewrite || operation.pending || backgroundExecution.active.value || !!error"
@confirm="resume('resume-rewrite')" @confirm="resume('resume-rewrite')"