feat(short-drama-agent-front): 完善分镜审核与制作准备流程

This commit is contained in:
GJ committed 2026-10-19 21:59:22 +08:00
1 parent c4b43b9725
commit 1da56e0d46
72 files changed
+2801 -528

No files matched your search

+11 -5
View File
@@ -29,7 +29,7 @@ import ActionExceptionRepair from './components/ActionExceptionRepair.vue'
import { useBreakdownQuality } from './useBreakdownQuality'
import { useBreakdownStartPolicy } from './useBreakdownStartPolicy'
import type { DiagnosisLocation } from './diagnosis'
import { errorMessage } from '../../lib/http'
import { ApiError, errorMessage } from '../../lib/http'
import { downloadText } from '../../lib/format'
/** 拆解工作区:先预览真实分组,再启动;恢复操作根据 checkpoint 分阶段展示。 */
@@ -436,7 +436,9 @@ async function loadPreview() {
async function run(action: BreakdownAction) {
if (project.value?.status !== 'completed' || operation.value.pending || error.value) return
if (breakdownBusy.value || backgroundExecution.discovering.value || backgroundExecution.discoveryError.value) return
if (action === 'start' && (!canStart.value || !startPolicy.consumePermit())) return
if (action === 'start' && !canStart.value) return
const permit = action === 'start' ? startPolicy.consumePermit() : null
if (action === 'start' && !permit) return
const labels: Record<BreakdownAction, string> = {
start: '正在拆解剧本',
retry: '正在重试失败抽取',
@@ -444,17 +446,21 @@ async function run(action: BreakdownAction) {
'resume-storyboard': '正在修复分镜绑定'
}
const id = project.value.id
await runOperation(
const success = await runOperation(
id,
labels[action],
async () => {
const started = await breakdownApi.run(id, action, action === 'start' ? input.value : undefined)
const started = await breakdownApi.run(id, action, action === 'start' ? { ...input.value, ...permit! } : undefined)
await backgroundExecution.track(started.executionId)
return started
},
{ type: 'info', content: '拆解任务已提交,可在“拆解设置”中查看进度。' }
)
await refresh()
const cause = operation.value.cause
if (!success && action === 'start' && id === projectId.value && cause instanceof ApiError &&
['QUALITY_POLICY_NOT_CONFIRMED', 'QUALITY_POLICY_VERSION_CONFLICT'].includes(cause.code ?? ''))
await startPolicy.prepare()
}
/** 刷新候选和正式阶段状态,不重放候选生成请求。 */
@@ -526,7 +532,7 @@ const rules = {
>
<!-- 以下是在同一全屏抽屉内核对真实质量规则的模块,不叠加第二个抽屉 -->
<div v-if="startPolicy.reviewOpen.value && startPolicy.policy.value" class="breakdown-policy-review">
<p class="text-sm leading-6 text-muted">请核对动作与物理规则,修改将在继续时保存。当前浏览器会记住确认,规则未变时不再重复提醒。</p>
<p class="text-sm leading-6 text-muted">请核对动作与物理规则,修改将在继续时保存。确认会保存到当前项目,规则未变时不再重复提醒。</p>
<QualityPolicySettings
ref="qualityForm"
:key="startPolicy.editorKey.value"