feat(short-drama-agent-front): 补齐后端生产与质量功能

This commit is contained in:
GJ committed 2026-10-08 18:28:35 +08:00
1 parent 967c4ebea1
commit 470b52e26d
52 files changed
+3754 -1075

No files matched your search

+173 -115
View File
@@ -5,17 +5,7 @@ import { integerRule } from '../../lib/form-rules'
import WorkspacePage from '../../components/ui/WorkspacePage.vue'
import ActionMenu from '../../components/ui/ActionMenu.vue'
import WorkspaceTools from '../../components/ui/WorkspaceTools.vue'
import {
NScrollbar,
NAlert,
NButton,
NCheckbox,
NInputNumber,
NProgress,
NSelect,
NTab,
NTabs
} from 'naive-ui'
import { NScrollbar, NAlert, NButton, NCheckbox, NInputNumber, NProgress, NSelect, NTab, NTabs } from 'naive-ui'
import { computed, ref, watch } from 'vue'
import { ArrowLeft, RefreshCw } from '@lucide/vue'
import { EmptyState } from '../../components/ui'
@@ -25,6 +15,9 @@ import GenerationReceipt from './components/GenerationReceipt.vue'
import ShotDesign from './components/ShotDesign.vue'
import ShotTools from './components/ShotTools.vue'
import BeatShotDirectory from './components/BeatShotDirectory.vue'
import SubjectCoverageAudit from './components/SubjectCoverageAudit.vue'
import type { SubjectCoverageIssue } from './coverage.types'
import WorkflowExecutionPanel from '../workflows/WorkflowExecutionPanel.vue'
import { useStoryboard } from './useStoryboard'
import { useProjectContext } from '../projects/context'
@@ -43,6 +36,7 @@ const {
shot,
query,
data,
episodeSourceUnavailable,
prerequisites,
session,
operation,
@@ -54,6 +48,7 @@ const {
directionComplete,
visualStateComplete,
hasCurrentEpisodeShots,
executions,
run
} = useStoryboard()
const productionReady = computed(() => directionComplete.value && visualStateComplete.value)
@@ -90,6 +85,51 @@ function exportEpisode() {
}
/** 回执到达后打开诊断区;平时留出镜头检查空间。 */
const toolsOpen = ref(false)
/** 覆盖审计只保存剧集与镜头坐标,正式 ID 从当前查询结果中定位。 */
const auditLocation = ref<SubjectCoverageIssue | null>(null)
/** 覆盖定位失败时保留明确反馈,不猜测其它镜头。 */
const auditLocationError = ref('')
/**
* 切换到引用遗漏发生的剧集,等待正式镜头数据后定位。
* @param issue 后端实际覆盖问题
*/
function locateCoverageIssue(issue: SubjectCoverageIssue) {
if (!episodeOptions.value.some(episode => episode.episodeNo === issue.episodeNo)) {
auditLocationError.value = '审计中的剧集不在当前项目,请刷新分镜与审计结果。'
return
}
auditLocation.value = issue
auditLocationError.value = ''
selectedEpisode.value = issue.episodeNo
}
/** 当前集查询完成后按唯一坐标匹配正式镜头;目标缺失时不切到其他镜头。 */
watch(
[episodeNo, shots, () => query.loading.value, auditLocation],
() => {
const issue = auditLocation.value
if (
!issue ||
query.loading.value ||
episodeNo.value !== issue.episodeNo ||
data.value?.directions.episodeNo !== issue.episodeNo
)
return
if (issue.shotNo !== null) {
const target = shots.value.find(item => item.beatNo === issue.beatNo && item.shotNo === issue.shotNo)
if (!target) {
auditLocationError.value = '目标镜头已变化,请刷新后重新检查主体引用。'
auditLocation.value = null
return
}
selectedShot.value = target.shotId
}
toolsOpen.value = false
auditLocation.value = null
},
{ flush: 'post' }
)
watch(
() => session.value.receipt,
receipt => {
@@ -105,6 +145,9 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
<template>
<WorkspacePage split compact class="storyboard-workspace-page">
<template #notice>
<NAlert v-if="episodeSourceUnavailable" type="info" :show-icon="false">
本集镜头已重新生成。新标题和剧情详情尚未提供,当前只显示正式镜头编号;请按实际生成规格核对内容。
</NAlert>
<NAlert v-if="stageComplete" type="success" :show-icon="false">
分镜设计已经准备完成,可以继续生成首帧、视频提示词和视频。
<RouterLink :to="`/projects/${id}/production`" class="text-button ml-2">继续镜头生产 →</RouterLink>
@@ -226,109 +269,124 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
</div>
<div class="workspace-overview-panel">
<div class="overview-content workspace-section-stack">
<!-- 以下是零费用主体引用覆盖检查模块 -->
<SubjectCoverageAudit :project-id="id" @locate="locateCoverageIssue" />
<NAlert v-if="auditLocationError" type="warning" :show-icon="false">{{
auditLocationError
}}</NAlert>
<h3 class="mb-3 text-sm font-semibold">生成与恢复</h3>
<div class="generation-row">
<div>
<h3 class="text-sm font-semibold">
<span class="mr-2 font-mono text-xs text-muted">00</span
>本集镜头拆解
</h3>
<p class="mt-2 text-xs leading-6 text-muted">
只重新拆解当前选择的第
{{ episodeNo }}
集,其它剧集不受影响。新镜头会替换旧镜头,并清空本集已有的导演设计、即时状态、首帧与视频结果。
</p>
</div>
<div class="flex flex-wrap gap-2">
<ConfirmAction
:label="`重生成第 ${episodeNo} 集镜头`"
:disabled="!allowed['shots-current']"
acknowledgement
:description="`将删除并重建第 ${episodeNo} 集的正式镜头。该集已有导演设计、即时状态、首帧、提示词和视频结果会随旧镜头一并失效,且无法撤销;其它剧集保持不变。`"
@confirm="run('shots-current')"
/>
</div>
</div>
<p v-if="!hasCurrentEpisodeShots" class="mt-3 text-[11px] text-muted">
当前集还没有可用镜头,请先完成剧本拆解。
<div class="generation-row">
<div>
<h3 class="text-sm font-semibold">
<span class="mr-2 font-mono text-xs text-muted">00</span>本集镜头拆解
</h3>
<p class="mt-2 text-xs leading-6 text-muted">
只重新拆解当前选择的第
{{ episodeNo }}
集,其它剧集不受影响。新镜头会替换旧镜头,并清空本集已有的导演设计、即时状态、首帧与视频结果。
</p>
<div class="generation-row">
<div>
<h3 class="text-sm font-semibold">
<span class="mr-2 font-mono text-xs text-muted">01</span
>导演摄影设计
</h3>
<p class="mt-2 text-xs leading-6 text-muted">
景别、机位、运镜与构图。正式项目生成默认跳过已完整剧集,覆盖模式会重新生成全部剧集。
</p>
</div>
<div class="flex flex-wrap gap-2">
<ConfirmAction
:label="force ? '重生成全部导演设计' : '补齐项目导演设计'"
:disabled="!allowed['direction-all']"
acknowledgement
:description="
force
? '重新生成项目全部剧集的导演设计,覆盖已有结果。'
: '对整个项目生成导演设计,跳过已完整保存的剧集,可用于重试失败或未完成的剧集。'
"
@confirm="run('direction-all')"
/>
</div>
</div>
<div class="generation-row">
<div>
<h3 class="text-sm font-semibold">
<span class="mr-2 font-mono text-xs text-muted">02</span
>即时视觉状态
</h3>
<p class="mt-2 text-xs leading-6 text-muted">
表情、姿态、位置、环境与连续性。每集需要完整导演设计;批量中缺少前置设计的剧集会单独报错。
</p>
</div>
<div class="flex flex-wrap gap-2">
<ConfirmAction
:label="force ? '重生成全部即时状态' : '补齐项目即时状态'"
:disabled="!allowed['visual-all']"
acknowledgement
:description="
force
? '重新生成整个项目的即时状态,覆盖已有结果。每集必须先有完整导演设计。'
: '补齐项目即时状态,跳过完整剧集;未完成导演设计的剧集会返回失败原因。'
"
@confirm="run('visual-all')"
/>
</div>
</div>
<p class="mt-4 text-[11px] leading-6 text-muted">
修改或覆盖前面的设计后,已有状态和视频提示词不会自动更新;请按顺序重新生成后续内容。自动修复次数仅用于
VisualState。
</p>
<section>
<h3 class="text-sm font-semibold">视频提示词批量操作</h3>
<p class="my-3 text-xs leading-6 text-muted">
生成前会检查镜头设计和主体参考图是否齐全。这里只生成提示词;首帧、视频任务、状态检查与失败重试已整理到
<RouterLink
:to="`/projects/${id}/production`"
class="text-button mx-1"
>镜头生产</RouterLink
>。
</p>
<ConfirmAction
:label="force ? '重生成全部视频提示词' : '补齐项目视频提示词'"
:disabled="!allowed.prompts"
acknowledgement
:description="
force
? '调用模型重新生成全项目镜头的视频提示词,覆盖已有正文。'
: '调用模型生成缺少视频提示词的镜头,已有提示词直接跳过。参考图缺失会返回失败。'
"
@confirm="run('prompts')" />
</section>
<GenerationReceipt
v-if="session.receipt"
:receipt="session.receipt"
</div>
<div class="flex flex-wrap gap-2">
<ConfirmAction
:label="`重生成第 ${episodeNo} 集镜头`"
:disabled="!allowed['shots-current']"
acknowledgement
:description="`将删除并重建第 ${episodeNo} 集的正式镜头。该集已有导演设计、即时状态、首帧、提示词和视频结果会随旧镜头一并失效,且无法撤销;其它剧集保持不变。`"
@confirm="run('shots-current')"
/>
</div>
</div>
<p v-if="!hasCurrentEpisodeShots" class="mt-3 text-[11px] text-muted">
当前集还没有可用镜头,请先完成剧本拆解。
</p>
<div class="generation-row">
<div>
<h3 class="text-sm font-semibold">
<span class="mr-2 font-mono text-xs text-muted">01</span>导演摄影设计
</h3>
<p class="mt-2 text-xs leading-6 text-muted">
景别、机位、运镜与构图。正式项目生成默认跳过已完整剧集,覆盖模式会重新生成全部剧集。
</p>
</div>
<div class="flex flex-wrap gap-2">
<ConfirmAction
:label="force ? '重生成全部导演设计' : '补齐项目导演设计'"
:disabled="!allowed['direction-all']"
acknowledgement
:description="
force
? '重新生成项目全部剧集的导演设计,覆盖已有结果。'
: '对整个项目生成导演设计,跳过已完整保存的剧集,可用于重试失败或未完成的剧集。'
"
@confirm="run('direction-all')"
/>
</div>
</div>
<div class="generation-row">
<div>
<h3 class="text-sm font-semibold">
<span class="mr-2 font-mono text-xs text-muted">02</span>即时视觉状态
</h3>
<p class="mt-2 text-xs leading-6 text-muted">
表情、姿态、位置、环境与连续性。每集需要完整导演设计;批量中缺少前置设计的剧集会单独报错。
</p>
</div>
<div class="flex flex-wrap gap-2">
<ConfirmAction
:label="force ? '重生成全部即时状态' : '补齐项目即时状态'"
:disabled="!allowed['visual-all']"
acknowledgement
:description="
force
? '重新生成整个项目的即时状态,覆盖已有结果。每集必须先有完整导演设计。'
: '补齐项目即时状态,跳过完整剧集;未完成导演设计的剧集会返回失败原因。'
"
@confirm="run('visual-all')"
/>
</div>
</div>
<p class="mt-4 text-[11px] leading-6 text-muted">
修改或覆盖前面的设计后,已有状态和视频提示词不会自动更新;请按顺序重新生成后续内容。自动修复次数仅用于
VisualState。
</p>
<section>
<h3 class="text-sm font-semibold">视频提示词批量操作</h3>
<p class="my-3 text-xs leading-6 text-muted">
生成前会检查镜头设计和主体参考图是否齐全。这里只生成提示词;首帧、视频任务、状态检查与失败重试已整理到
<RouterLink :to="`/projects/${id}/production`" class="text-button mx-1"
>镜头生产</RouterLink
>。
</p>
<ConfirmAction
:label="force ? '重生成全部视频提示词' : '补齐项目视频提示词'"
:disabled="!allowed.prompts"
acknowledgement
:description="
force
? '调用模型重新生成全项目镜头的视频提示词,覆盖已有正文。'
: '调用模型生成缺少视频提示词的镜头,已有提示词直接跳过。参考图缺失会返回失败。'
"
@confirm="run('prompts')"
/>
</section>
<!-- 以下是正式分镜后台执行状态模块 -->
<WorkflowExecutionPanel
v-for="entry in executions.filter(
item =>
item.observer.executionId.value &&
(item.title !== '单集镜头重生成' ||
item.observer.query.data.value?.metadata?.action ===
'regenerate-storyboard-episode')
)"
:key="entry.title"
:title="entry.title"
:execution="entry.observer.query.data.value"
:loading="entry.observer.query.loading.value"
:error="entry.observer.query.error.value"
@refresh="entry.observer.query.refresh"
@dismiss="entry.observer.dismiss"
/>
<GenerationReceipt v-if="session.receipt" :receipt="session.receipt" />
</div>
</div>
</WorkspaceTools>
@@ -360,9 +418,9 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
>
<strong>Production 前置设计未完成。</strong>
当前导演设计 {{ data.directions.directionCount }}/{{ data.directions.shotCount }},即时视觉状态
{{ data.visualStates.visualStateCount }}/{{ data.visualStates.shotCount }}。请先补齐后再进入镜头生产,避免
后续镜头制作无法开始。
</NAlert
{{ data.visualStates.visualStateCount }}/{{
data.visualStates.shotCount
}}。请先补齐后再进入镜头生产,避免 后续镜头制作无法开始。 </NAlert
><NAlert
v-if="!prerequisites.directionEpisode || !prerequisites.visualEpisode"
type="info"
@@ -424,7 +482,7 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
视觉重点:{{ shot.visualFocus }}
</p>
<p class="mt-3 break-all font-mono text-[10px] text-muted">Shot ID · {{ shot.shotId }}</p>
<p class="mt-1 text-[10px] text-muted">
<p v-if="!episodeSourceUnavailable" class="mt-1 text-[10px] text-muted">
标题与剧情描述取自最近可用 Breakdown 快照;以下设计与状态取自数据库。
</p>
</header>