feat(short-drama-agent-front): 完善分镜审核与制作准备流程
This commit is contained in:
1 parent
c4b43b9725
commit
1da56e0d46
72 files changed
+2801
-528
No files matched your search
@@ -72,6 +72,8 @@ const {
|
||||
allowed,
|
||||
blocked,
|
||||
directionComplete,
|
||||
approval,
|
||||
approved,
|
||||
visualStateComplete,
|
||||
hasCurrentEpisodeShots,
|
||||
executions,
|
||||
@@ -224,6 +226,8 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
<template>
|
||||
<WorkspacePage split compact mobile-scroll class="storyboard-workspace-page compact-shot-workspace">
|
||||
<template #notice>
|
||||
<!-- 以下是正式分镜审核先于派生生成的明确提示,查看已有设计仍可继续 -->
|
||||
<ContextNotice v-if="!approved" type="info" :show-icon="false"><p>{{ approval.loading.value ? '正在核对正式分镜审核…' : approval.error.value ? '整体审核记录暂时无法读取,已暂停镜头设计与画面状态生成。' : '当前正式分镜尚未完成整体审核,或规则与镜头版本已变化。请先打开顶部“制作前检查”。' }}</p><NButton v-if="approval.error.value" :loading="approval.loading.value" @click="approval.refresh">重新读取审核记录</NButton></ContextNotice>
|
||||
<ContextNotice v-if="episodeSourceUnavailable" type="info" :show-icon="false">
|
||||
本集镜头已重新生成。新标题和剧情详情尚未提供,当前只显示正式镜头编号;请按实际生成规格核对内容。
|
||||
</ContextNotice>
|
||||
@@ -546,11 +550,11 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
:show-icon="false"
|
||||
class="mt-4"
|
||||
>
|
||||
<strong>镜头生产前置设计未完成。</strong>
|
||||
<strong>镜头生产前置设计尚未补齐或更新。</strong>
|
||||
当前导演设计 {{ data.directions.directionCount }}/{{ data.directions.shotCount }},即时视觉状态
|
||||
{{ data.visualStates.visualStateCount }}/{{
|
||||
data.visualStates.shotCount
|
||||
}}。请先补齐后再进入镜头生产,避免 后续镜头制作受阻。 </ContextNotice
|
||||
}}。<span v-if="data.directions.staleCount || data.visualStates.staleCount">其中过期镜头设计 {{ data.directions.staleCount }} 条、画面状态 {{ data.visualStates.staleCount }} 条。</span>请先补齐或更新后再进入镜头生产。 </ContextNotice
|
||||
><ContextNotice
|
||||
v-if="!prerequisites.directionEpisode || !prerequisites.visualEpisode"
|
||||
type="info"
|
||||
@@ -565,7 +569,7 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
:show-icon="false"
|
||||
class="mt-4"
|
||||
>
|
||||
本集导演设计尚未补齐,请先完成第 01 步,再生成本集即时状态。
|
||||
本集导演设计尚未补齐或版本已变化,请先完成第 01 步,再生成本集即时状态。
|
||||
</ContextNotice>
|
||||
</NScrollbar>
|
||||
<div v-if="!data && query.loading.value" class="panel p-8 text-sm text-muted" role="status">
|
||||
|
||||
@@ -105,6 +105,7 @@ export function directionsResult(projectId: string, episodeNo = 1, complete = tr
|
||||
projectId,
|
||||
episodeNo,
|
||||
shotCount: 2,
|
||||
staleCount: 0,
|
||||
directionCount: complete ? 2 : 0,
|
||||
coverage: complete ? 1 : 0,
|
||||
beats: [1, 2].map(beatNo => ({
|
||||
@@ -122,6 +123,7 @@ export function visualStatesResult(projectId: string, episodeNo = 1, complete =
|
||||
projectId,
|
||||
episodeNo,
|
||||
shotCount: 2,
|
||||
staleCount: 0,
|
||||
visualStateCount: complete ? 2 : 0,
|
||||
coverage: complete ? 1 : 0,
|
||||
beats: [1, 2].map(beatNo => ({
|
||||
|
||||
@@ -41,6 +41,8 @@ export interface EpisodeDirections {
|
||||
episodeNo: number
|
||||
shotCount: number
|
||||
directionCount: number
|
||||
/** 因镜头修订过期的设计数量,缺失时不视为已核对。 */
|
||||
staleCount: number
|
||||
coverage: number
|
||||
beats: { beatNo: number; shots: { shotId: string; shotNo: number; direction: ShotDirection | null }[] }[]
|
||||
}
|
||||
@@ -51,6 +53,8 @@ export interface EpisodeVisualStates {
|
||||
episodeNo: number
|
||||
shotCount: number
|
||||
visualStateCount: number
|
||||
/** 早于镜头修订或镜头设计的画面状态数量。 */
|
||||
staleCount: number
|
||||
coverage: number
|
||||
beats: { beatNo: number; shots: { shotId: string; shotNo: number; visualState: ShotVisualState | null }[] }[]
|
||||
}
|
||||
@@ -71,6 +75,8 @@ export interface EpisodeGenerationResult {
|
||||
shotCount: number
|
||||
directionCount?: number
|
||||
visualStateCount?: number
|
||||
/** 本轮结束后仍然过期的记录。 */
|
||||
staleCount?: number
|
||||
error?: string
|
||||
repaired?: boolean
|
||||
repairAttempts?: number
|
||||
@@ -79,6 +85,8 @@ export interface EpisodeGenerationResult {
|
||||
|
||||
/** 两种设计批处理返回相同的汇总结构。 */
|
||||
export interface StoryboardBatchResult {
|
||||
/** 本轮结束后仍然过期的设计记录,不因覆盖率完整而忽略。 */
|
||||
staleCount?: number
|
||||
projectId: string
|
||||
episodeCount: number
|
||||
completedEpisodes: number
|
||||
|
||||
@@ -6,6 +6,8 @@ import { useQuery } from '../../composables/useQuery'
|
||||
import { useProjectContext } from '../projects/context'
|
||||
import { formalBreakdownSnapshot } from '../workflows/selectors'
|
||||
import { getOperation, runOperation } from '../workflows/operations'
|
||||
import { preparationApi } from '../storyboard-preparation/api'
|
||||
import { currentStoryboardApproval } from '../storyboard-preparation/model'
|
||||
import { storyboardApi } from './api'
|
||||
import {
|
||||
currentEpisodeSource,
|
||||
@@ -75,6 +77,12 @@ export function useStoryboard() {
|
||||
return { directions, visualStates }
|
||||
})
|
||||
const data = query.data
|
||||
/** 镜头设计与画面状态的新接口要求当前整体审核,独立读取而不影响只读查看。 */
|
||||
const approval = useQuery(id, (projectId, signal) => projectId ? preparationApi.approval(projectId, signal) : Promise.resolve(null))
|
||||
/** 有效审核必须绑定正式内容;旧记录或未知状态不放行。 */
|
||||
const approved = computed(() => !approval.loading.value && !approval.error.value && currentStoryboardApproval(approval.data.value, id.value))
|
||||
/** 正式修订或审核后随项目数据刷新核对凭据,避免沿用旧权限。 */
|
||||
watch(context.checkpoints, () => { if (approval.data.value || approval.error.value) void approval.refresh() })
|
||||
/** 当前工作区的响应式状态或派生业务条件。 */
|
||||
const session = computed(() => getStoryboardSession(id.value))
|
||||
/** 单集重生成返回的是最新镜头正文,优先于不会随局部覆盖更新的历史 Breakdown 快照。 */
|
||||
@@ -118,14 +126,14 @@ export function useStoryboard() {
|
||||
() =>
|
||||
!!data.value?.directions.shotCount &&
|
||||
data.value.directions.directionCount === data.value.directions.shotCount &&
|
||||
data.value.directions.coverage === 1
|
||||
data.value.directions.coverage === 1 && data.value.directions.staleCount === 0
|
||||
)
|
||||
/** 当前工作区的响应式状态或派生业务条件。 */
|
||||
const visualStateComplete = computed(
|
||||
() =>
|
||||
!!data.value?.visualStates.shotCount &&
|
||||
data.value.visualStates.visualStateCount === data.value.visualStates.shotCount &&
|
||||
data.value.visualStates.coverage === 1
|
||||
data.value.visualStates.coverage === 1 && data.value.visualStates.staleCount === 0
|
||||
)
|
||||
/** 当前工作区的响应式状态或派生业务条件。 */
|
||||
const hasCurrentEpisodeShots = computed(
|
||||
@@ -133,8 +141,8 @@ export function useStoryboard() {
|
||||
)
|
||||
const allowed = computed<Record<StoryboardCommand, boolean>>(() => ({
|
||||
'shots-current': !blocked.value && episodeNo.value > 0 && hasCurrentEpisodeShots.value,
|
||||
'direction-all': !blocked.value && prerequisites.value.directionProject && batchValid.value,
|
||||
'visual-all': !blocked.value && prerequisites.value.visualProject && batchValid.value && repairsValid.value,
|
||||
'direction-all': approved.value && !blocked.value && prerequisites.value.directionProject && batchValid.value,
|
||||
'visual-all': approved.value && !blocked.value && prerequisites.value.visualProject && batchValid.value && repairsValid.value,
|
||||
prompts: !blocked.value && shots.value.length > 0 && batchValid.value
|
||||
}))
|
||||
|
||||
@@ -194,6 +202,7 @@ export function useStoryboard() {
|
||||
const repairs = maxRepairAttempts.value
|
||||
const targetEpisode = episodeNo.value
|
||||
const target = getStoryboardSession(projectId)
|
||||
const expectedApproval = JSON.stringify(approval.data.value?.evidence)
|
||||
const titles: Record<StoryboardCommand, string> = {
|
||||
'shots-current': `第 ${targetEpisode} 集镜头`,
|
||||
'direction-all': '项目导演设计',
|
||||
@@ -202,6 +211,11 @@ export function useStoryboard() {
|
||||
}
|
||||
target.receipt = null
|
||||
await runOperation(projectId, `生成${titles[command]}`, async () => {
|
||||
if (command === 'direction-all' || command === 'visual-all') {
|
||||
const latest = await preparationApi.approval(projectId)
|
||||
if (id.value !== projectId || !currentStoryboardApproval(latest, projectId) || JSON.stringify(latest.evidence) !== expectedApproval)
|
||||
throw new Error('正式分镜审核已变化,请重新进行制作前检查并核对费用。')
|
||||
}
|
||||
if (command === 'shots-current') {
|
||||
const started = await storyboardApi.regenerateEpisodeShots(projectId, targetEpisode)
|
||||
await executions[0]!.observer.track(started.executionId, projectId)
|
||||
@@ -246,6 +260,8 @@ export function useStoryboard() {
|
||||
repairsValid,
|
||||
blocked,
|
||||
directionComplete,
|
||||
approval,
|
||||
approved,
|
||||
visualStateComplete,
|
||||
hasCurrentEpisodeShots,
|
||||
executions,
|
||||
|
||||
Reference in new issue
Block a user