817 lines
42 KiB
Vue
817 lines
42 KiB
Vue
<script setup lang="ts">
|
||
import { userFacingText } from '../../lib/user-facing-text'
|
||
import { isOperationRunning } from '../workflows/operations'
|
||
|
||
import ContextNotice from '../../components/ui/ContextNotice.vue'
|
||
|
||
import AppForm from '../../components/ui/AppForm.vue'
|
||
import { NFormItem } from 'naive-ui'
|
||
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, NButton, NCheckbox, NInputNumber, NProgress, NSelect, NTab, NTabs } from 'naive-ui'
|
||
import { computed, ref, watch } from 'vue'
|
||
import { EmptyState } from '../../components/ui'
|
||
import { downloadText } from '../../lib/format'
|
||
import ConfirmAction from '../workflows/ConfirmAction.vue'
|
||
import GenerationReceipt from './components/GenerationReceipt.vue'
|
||
import { useQuery } from '../../composables/useQuery'
|
||
import { productionApi } from '../production/api'
|
||
import ShotProductionAssets from '../production/components/ShotProductionAssets.vue'
|
||
import ShotDerivedReview from './components/ShotDerivedReview.vue'
|
||
import ShotDesign from './components/ShotDesign.vue'
|
||
import MotionPlanPanel from './components/MotionPlanPanel.vue'
|
||
import MotionAuditPanel from './components/MotionAuditPanel.vue'
|
||
import SpatialBindingsPanel from './components/SpatialBindingsPanel.vue'
|
||
import type { MotionPlanAudit } from './motion.types'
|
||
import { useActionMessage } from '../../components/ui/useActionMessage'
|
||
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 { useWorkflowExecution } from '../workflows/execution'
|
||
import { useStoryboard } from './useStoryboard'
|
||
import { storyboardApi, type StoryboardDurationAudit } from './api'
|
||
import { projectsApi } from '../projects/api'
|
||
import type { ProjectDurationBudgetSummary } from '../projects/types'
|
||
|
||
const detailTab = ref('design')
|
||
/** 动作审计只能定位当前项目正式列表中的镜头。 */
|
||
const feedback = useActionMessage()
|
||
/**
|
||
* 按后端正式镜头坐标定位动作预警。
|
||
* @param item 后端返回的真实镜头及剧集
|
||
*/
|
||
function locateMotion(item: MotionPlanAudit['items'][number]) {
|
||
if (!episodeOptions.value.some(episode => episode.episodeNo === item.episodeNo)) {
|
||
feedback?.warning('审计中的剧集已不在当前项目列表,请刷新分镜。')
|
||
return
|
||
}
|
||
selectedEpisode.value = item.episodeNo
|
||
selectedShot.value = item.shotId
|
||
detailTab.value = 'motion'
|
||
toolsOpen.value = false
|
||
}
|
||
|
||
/** 分镜工作区按单集查看正式数据,生成配置与镜头检查分开。 */
|
||
const {
|
||
id,
|
||
selectedEpisode,
|
||
episodeNo,
|
||
episodeOptions,
|
||
selectedShot,
|
||
shots,
|
||
shot,
|
||
query,
|
||
data,
|
||
episodeSourceUnavailable,
|
||
prerequisites,
|
||
projectAssetsReady,
|
||
session,
|
||
operation,
|
||
concurrency,
|
||
maxRepairAttempts,
|
||
force,
|
||
allowed,
|
||
blocked,
|
||
directionComplete,
|
||
approval,
|
||
approved,
|
||
visualStateComplete,
|
||
hasCurrentEpisodeShots,
|
||
executions,
|
||
run
|
||
} = useStoryboard()
|
||
/** 仅在首帧标签读取项目列表中的本镜就绪结果,独立于项目制作入口。 */
|
||
const keyframeProject = computed(() => (detailTab.value === 'keyframes' ? id.value : ''))
|
||
/** 按当前项目读取后端的逐镜头首帧就绪项。 */
|
||
const keyframeReadiness = useQuery(keyframeProject, (projectId, signal) =>
|
||
projectId ? productionApi.keyframeReadiness(projectId, true, signal) : Promise.resolve(null)
|
||
)
|
||
/** 只使用当前镜头对应的结果。 */
|
||
const shotReadiness = computed(() =>
|
||
keyframeReadiness.data.value?.items.find(item => item.shotId === shot.value?.shotId)
|
||
)
|
||
/** 切换详情标签后仍观察起点视觉任务,重新进入项目时恢复真实终态。 */
|
||
useWorkflowExecution(id, 'motion-plan-start-state-validation')
|
||
const productionReady = computed(() => directionComplete.value && visualStateComplete.value)
|
||
/** 分镜时长审计为只读预警,接口失败不能影响分镜设计。 */
|
||
const durationAudit = ref<StoryboardDurationAudit | null>(null)
|
||
/** 项目预算汇总为只读数据,失败不影响现有分镜操作。 */
|
||
const durationBudget = ref<ProjectDurationBudgetSummary | null>(null)
|
||
const currentDurationBudget = computed(
|
||
() => durationBudget.value?.episodes?.find(item => item.episodeNo === episodeNo.value) ?? null
|
||
)
|
||
const durationAuditError = ref('')
|
||
/** 仅在只读预算请求进行中展示局部加载状态。 */
|
||
const durationLoading = ref(false)
|
||
const durationStatusLabel = computed(() => {
|
||
const audit = currentDurationBudget.value?.audit
|
||
if (!audit || audit.status === 'auto') return null
|
||
if (audit.status === 'over_budget') return '超出预算'
|
||
if (audit.status === 'under_budget') return '低于预算'
|
||
return '符合预算'
|
||
})
|
||
/** 请求代次保证重生成刷新与切换项目时,迟到响应不会覆盖新数据。 */
|
||
let durationRequestVersion = 0
|
||
async function refreshDuration(projectId: string) {
|
||
const version = ++durationRequestVersion
|
||
durationLoading.value = true
|
||
const [audit, budget] = await Promise.allSettled([
|
||
storyboardApi.durationAudit(projectId),
|
||
projectsApi.durationBudget(projectId)
|
||
])
|
||
if (version !== durationRequestVersion || id.value !== projectId) return
|
||
durationLoading.value = false
|
||
if (audit.status === 'fulfilled') durationAudit.value = audit.value
|
||
if (budget.status === 'fulfilled' && Array.isArray(budget.value?.episodes)) durationBudget.value = budget.value
|
||
durationAuditError.value =
|
||
audit.status === 'rejected' || budget.status === 'rejected' ? '部分时长信息暂不可用,不影响分镜操作。' : ''
|
||
}
|
||
watch(
|
||
id,
|
||
projectId => {
|
||
++durationRequestVersion
|
||
durationAudit.value = null
|
||
durationBudget.value = null
|
||
durationLoading.value = false
|
||
durationAuditError.value = ''
|
||
if (projectId) void refreshDuration(projectId)
|
||
},
|
||
{ immediate: true }
|
||
)
|
||
const currentEpisodeDurationIssues = computed(
|
||
() => durationAudit.value?.issues.filter(issue => issue.episodeNo === episodeNo.value) ?? []
|
||
)
|
||
|
||
const coverage = computed(() => [
|
||
{
|
||
title: '导演设计',
|
||
count: data.value?.directions.directionCount ?? 0,
|
||
total: data.value?.directions.shotCount ?? 0
|
||
},
|
||
{
|
||
title: '画面状态',
|
||
count: data.value?.visualStates.visualStateCount ?? 0,
|
||
total: data.value?.visualStates.shotCount ?? 0
|
||
}
|
||
])
|
||
|
||
/** 导出当前剧集的正式镜头数据;标题与剧情描述来源于 Breakdown 快照。 */
|
||
function exportEpisode() {
|
||
downloadText(
|
||
`episode-${episodeNo.value}-storyboard.json`,
|
||
JSON.stringify(
|
||
{
|
||
projectId: id.value,
|
||
episodeNo: episodeNo.value,
|
||
directions: data.value?.directions,
|
||
visualStates: data.value?.visualStates,
|
||
shots: shots.value
|
||
},
|
||
null,
|
||
2
|
||
),
|
||
'application/json'
|
||
)
|
||
}
|
||
/** 回执到达后打开诊断区;平时留出镜头检查空间。 */
|
||
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 => {
|
||
if (receipt) {
|
||
toolsOpen.value = true
|
||
/** 正式镜头重生成完成后重新读取预算与审计,避免展示旧时长。 */
|
||
if (receipt.kind === 'shots' && id.value) void refreshDuration(id.value)
|
||
}
|
||
}
|
||
)
|
||
const formModel = computed(() => ({ concurrency: concurrency.value, maxRepairAttempts: maxRepairAttempts.value }))
|
||
const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: integerRule('状态自动修复次数', 0) }
|
||
</script>
|
||
|
||
<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>
|
||
<ContextNotice v-if="currentEpisodeDurationIssues.length" type="warning" :show-icon="false">
|
||
<div class="text-sm font-medium">
|
||
本集有 {{ currentEpisodeDurationIssues.length }} 条分镜时长建议(不阻断生成)
|
||
</div>
|
||
<div v-for="(issue, index) in currentEpisodeDurationIssues" :key="index" class="mt-1 text-sm">
|
||
剧情段落 {{ issue.beatNo }}<span v-if="issue.shotNo"> · 镜头 {{ issue.shotNo }}</span
|
||
>:{{ userFacingText(issue.message) }}
|
||
</div>
|
||
</ContextNotice>
|
||
<span v-if="durationAuditError" class="text-xs text-muted">{{ durationAuditError }}</span>
|
||
</template>
|
||
<template #header
|
||
><div class="workspace-toolbar">
|
||
<div class="toolbar-episode">
|
||
<NSelect
|
||
:value="episodeNo"
|
||
aria-label="选择分镜剧集"
|
||
@update:value="selectedEpisode = Number($event)"
|
||
:options="[
|
||
...(!episodeOptions.length ? [{ label: String('暂无剧集'), value: 0 }] : []),
|
||
...episodeOptions.map(episode => ({
|
||
label: String(' 第 ' + episode.episodeNo + ' 集 · ' + episode.title),
|
||
value: episode.episodeNo
|
||
}))
|
||
]"
|
||
class="select-control"
|
||
></NSelect>
|
||
</div>
|
||
<!-- 当前剧集时长汇总仅占一行;窄屏自动换行,不挤压操作按钮。 -->
|
||
<div
|
||
v-if="currentDurationBudget || durationLoading"
|
||
class="storyboard-duration-summary"
|
||
aria-label="本集时长预算"
|
||
>
|
||
<span v-if="durationLoading" class="text-muted" role="status">时长数据更新中…</span>
|
||
<template v-if="currentDurationBudget">
|
||
<span v-if="currentDurationBudget.targetDurationSeconds !== null"
|
||
>目标 {{ currentDurationBudget.targetDurationSeconds }} 秒</span
|
||
>
|
||
<span v-else>自动规划时长</span>
|
||
<span v-if="currentDurationBudget.plannedSeconds !== null"
|
||
>剧情段落 {{ currentDurationBudget.plannedSeconds }} 秒</span
|
||
>
|
||
<span v-if="currentDurationBudget.shotCount > 0 && currentDurationBudget.shotSeconds !== null"
|
||
>镜头 {{ currentDurationBudget.shotSeconds }} 秒</span
|
||
>
|
||
<span
|
||
v-if="durationStatusLabel"
|
||
:class="currentDurationBudget.audit?.needsReview ? 'text-warning' : 'text-muted'"
|
||
>
|
||
{{ durationStatusLabel }}
|
||
<template
|
||
v-if="
|
||
currentDurationBudget.audit?.deviationSeconds !== null &&
|
||
currentDurationBudget.audit?.deviationSeconds !== undefined
|
||
"
|
||
>
|
||
{{ currentDurationBudget.audit.deviationSeconds > 0 ? '+' : ''
|
||
}}{{ currentDurationBudget.audit.deviationSeconds }} 秒 (±{{
|
||
currentDurationBudget.audit.toleranceSeconds ?? 0
|
||
}}
|
||
秒)
|
||
</template>
|
||
</span>
|
||
</template>
|
||
</div>
|
||
<div class="toolbar-metrics">
|
||
<span v-for="item in coverage" :key="item.title"
|
||
>{{ item.title }} {{ item.count }} / {{ item.total }}</span
|
||
>
|
||
</div>
|
||
<div class="toolbar-actions">
|
||
<div class="flex gap-3">
|
||
<ActionMenu
|
||
label="分镜更多操作"
|
||
:items="[{ key: 'export', label: '导出本集', disabled: !shots.length }]"
|
||
@select="exportEpisode"
|
||
/>
|
||
</div>
|
||
|
||
<WorkspaceTools
|
||
:pending="operation.pending"
|
||
:pending-label="operation.label"
|
||
v-model:open="toolsOpen"
|
||
title="分镜生成配置与回执"
|
||
label="生成与恢复"
|
||
:has-receipt="!!session.receipt"
|
||
>
|
||
<div class="flex flex-wrap items-end justify-between gap-4">
|
||
<div>
|
||
<h2 class="text-lg font-semibold">分镜设计</h2>
|
||
<p class="mt-2 text-sm text-muted">从镜头拆解到摄影设计,再补齐每一镜的即时状态。</p>
|
||
</div>
|
||
</div>
|
||
<section class="mt-3" aria-label="分镜生成配置">
|
||
<AppForm :model="formModel" :rules="rules" :disabled="operation.pending" validate-on-change>
|
||
<div class="form-controls storyboard-controls">
|
||
<NFormItem
|
||
path="concurrency"
|
||
label="批量并发"
|
||
:label-props="{ for: 'storyboard-concurrency' }"
|
||
><NInputNumber
|
||
:disabled="operation.pending"
|
||
:input-props="{ id: 'storyboard-concurrency' }"
|
||
:value="typeof concurrency === 'number' ? concurrency : null"
|
||
@update:value="concurrency = $event ?? 0"
|
||
:min="1"
|
||
:step="1"
|
||
></NInputNumber
|
||
></NFormItem>
|
||
<NFormItem
|
||
path="maxRepairAttempts"
|
||
label="状态自动修复次数"
|
||
:label-props="{ for: 'storyboard-repairs' }"
|
||
><NInputNumber
|
||
:disabled="operation.pending"
|
||
:input-props="{ id: 'storyboard-repairs' }"
|
||
:value="typeof maxRepairAttempts === 'number' ? maxRepairAttempts : null"
|
||
@update:value="maxRepairAttempts = $event ?? 0"
|
||
:min="0"
|
||
:step="1"
|
||
></NInputNumber
|
||
></NFormItem>
|
||
<NCheckbox
|
||
v-model:checked="force"
|
||
:disabled="operation.pending"
|
||
class="control-row-checkbox text-xs"
|
||
>批量覆盖已有结果</NCheckbox
|
||
>
|
||
</div>
|
||
</AppForm>
|
||
</section>
|
||
<div class="storyboard-coverage grid grid-cols-2 gap-3">
|
||
<div v-for="item in coverage" :key="item.title" class="panel px-3 py-2">
|
||
<div class="mb-3 flex items-center justify-between text-xs">
|
||
<span>{{ item.title }}</span
|
||
><span class="font-mono text-muted">{{ item.count }} / {{ item.total }} 镜头</span>
|
||
</div>
|
||
<NProgress
|
||
:aria-label="item.title + '已保存覆盖率'"
|
||
type="line"
|
||
:show-indicator="false"
|
||
:height="4"
|
||
:percentage="
|
||
Math.min(
|
||
100,
|
||
Math.max(0, (item.count / Math.max(1, Math.max(item.total, 1))) * 100)
|
||
)
|
||
"
|
||
class=""
|
||
></NProgress>
|
||
</div>
|
||
</div>
|
||
<div class="workspace-overview-panel">
|
||
<div class="overview-content workspace-section-stack">
|
||
<!-- 以下是零费用主体引用覆盖检查模块 -->
|
||
<SubjectCoverageAudit :project-id="id" @locate="locateCoverageIssue" />
|
||
<MotionAuditPanel :project-id="id" @locate="locateMotion" />
|
||
<ContextNotice v-if="auditLocationError" type="warning" :show-icon="false">{{
|
||
auditLocationError
|
||
}}</ContextNotice>
|
||
<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
|
||
:loading="
|
||
isOperationRunning(operation, `生成第 ${episodeNo} 集镜头`) ||
|
||
(!!executions[0]?.observer.active.value &&
|
||
executions[0]?.observer.query.data.value?.metadata?.episodeNo ===
|
||
episodeNo)
|
||
"
|
||
: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
|
||
:loading="
|
||
isOperationRunning(operation, '生成项目导演设计') ||
|
||
!!executions[1]?.observer.active.value
|
||
"
|
||
: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
|
||
:loading="
|
||
isOperationRunning(operation, '生成项目即时状态') ||
|
||
!!executions[2]?.observer.active.value
|
||
"
|
||
: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">
|
||
修改或覆盖前面的设计后,已有状态和视频提示词不会自动更新;请按顺序重新生成后续内容。自动修复次数仅用于
|
||
画面即时状态。
|
||
</p>
|
||
<section>
|
||
<h3 class="text-sm font-semibold">视频提示词批量操作</h3>
|
||
<p class="my-3 text-xs leading-6 text-muted">
|
||
生成前会检查镜头设计和主体参考图是否齐全。这里只生成提示词;首帧、视频任务、状态检查与失败重试已整理到
|
||
镜头生产。
|
||
</p>
|
||
<ConfirmAction
|
||
:loading="
|
||
isOperationRunning(operation, '生成项目视频提示词') ||
|
||
!!executions[3]?.observer.active.value
|
||
"
|
||
: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>
|
||
</div></div
|
||
></template>
|
||
<NScrollbar
|
||
v-if="
|
||
query.error.value ||
|
||
!prerequisites.directionEpisode ||
|
||
!prerequisites.visualEpisode ||
|
||
(data && !directionComplete && data.directions.shotCount)
|
||
"
|
||
class="workspace-feedback"
|
||
>
|
||
<ContextNotice v-if="query.error.value" role="alert" type="error" :show-icon="false" class="mt-4"
|
||
>{{ query.error.value }} 当前保留上次成功读取的数据,暂停生成操作。<NButton
|
||
@click="query.refresh"
|
||
text
|
||
size="small"
|
||
class="ml-3"
|
||
>
|
||
重试查询
|
||
</NButton></ContextNotice
|
||
><ContextNotice
|
||
v-if="data && data.directions.shotCount && !productionReady"
|
||
type="warning"
|
||
:show-icon="false"
|
||
class="mt-4"
|
||
>
|
||
<strong>镜头生产前置设计尚未补齐或更新。</strong>
|
||
当前导演设计 {{ data.directions.directionCount }}/{{ data.directions.shotCount }},即时视觉状态
|
||
{{ data.visualStates.visualStateCount }}/{{ data.visualStates.shotCount }}。<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"
|
||
:show-icon="false"
|
||
class="mt-4"
|
||
>
|
||
最新剧本拆解
|
||
缺少本集生成所需的镜头、主体或形态数据。已保存设计仍可查看;请先在拆解页完成或恢复相应阶段。 </ContextNotice
|
||
><ContextNotice
|
||
v-else-if="data && !directionComplete && data.directions.shotCount"
|
||
type="info"
|
||
:show-icon="false"
|
||
class="mt-4"
|
||
>
|
||
本集导演设计尚未补齐或版本已变化,请先完成第 01 步,再生成本集即时状态。
|
||
</ContextNotice>
|
||
</NScrollbar>
|
||
<div v-if="!data && query.loading.value" class="panel p-8 text-sm text-muted" role="status">
|
||
正在读取正式分镜数据……
|
||
</div>
|
||
<div v-else-if="shots.length" class="panel storyboard-workspace workspace-surface">
|
||
<nav class="shot-list directory-panel" aria-label="本集镜头">
|
||
<div class="directory-heading">
|
||
<h3>
|
||
镜头目录 <span>{{ shots.length }} 镜</span>
|
||
</h3>
|
||
<span>按段落排列</span>
|
||
</div>
|
||
<NScrollbar
|
||
class="panel-scroll directory-scroll"
|
||
content-class="directory-list-content shot-list-content"
|
||
x-scrollable
|
||
>
|
||
<BeatShotDirectory
|
||
:shots="shots"
|
||
:active-id="shot?.shotId || ''"
|
||
item-class="shot-link"
|
||
@select="selectedShot = $event"
|
||
>
|
||
<template #meta="{ shot: item }">
|
||
<span class="directory-status">{{ item.direction ? '设计已保存' : '待设计' }}</span>
|
||
<span class="directory-status">{{ item.visualState ? '状态已保存' : '待状态' }}</span>
|
||
</template>
|
||
</BeatShotDirectory>
|
||
</NScrollbar>
|
||
</nav>
|
||
<article class="storyboard-detail min-w-0">
|
||
<NScrollbar v-if="shot" class="panel-scroll" content-class="shot-detail-content p-5 lg:p-7">
|
||
<header class="mb-6">
|
||
<p class="eyebrow">
|
||
段落 {{ shot.beatNo }} · 镜头 {{ shot.shotNo }}
|
||
<span v-if="shot.durationSeconds" class="ml-3">{{ shot.durationSeconds }}s</span>
|
||
</p>
|
||
<h3 class="mt-2 text-lg font-semibold">{{ shot.title }}</h3>
|
||
<p v-if="shot.description" class="mt-3 whitespace-pre-wrap text-sm leading-7">
|
||
{{ shot.description }}
|
||
</p>
|
||
<p v-if="shot.visualFocus" class="mt-2 text-xs leading-6 text-muted">
|
||
视觉重点:{{ shot.visualFocus }}
|
||
</p>
|
||
</header>
|
||
<div>
|
||
<NTabs v-model:value="detailTab" type="line" size="small" aria-label="镜头详情"
|
||
><NTab name="design">设计与状态</NTab><NTab name="tools">参考图与提示词</NTab
|
||
><NTab name="motion">动作与视线</NTab><NTab name="keyframes">首帧</NTab></NTabs
|
||
>
|
||
<!-- 以下是统一标签内容起点与模块间距的动作和视线模块 -->
|
||
<div
|
||
v-if="detailTab === 'motion'"
|
||
class="pt-6 workspace-section-stack workspace-section-stack-spacious"
|
||
>
|
||
<MotionPlanPanel
|
||
:key="shot.shotId"
|
||
:shot-id="shot.shotId"
|
||
:revision="session.prompts[shot.shotId]?.updatedAt"
|
||
:project-id="id"
|
||
:disabled="blocked || !projectAssetsReady"
|
||
@changed="query.refresh"
|
||
/>
|
||
<SpatialBindingsPanel
|
||
:key="shot.shotId"
|
||
:project-id="id"
|
||
:shot-id="shot.shotId"
|
||
:disabled="blocked || !projectAssetsReady"
|
||
@changed="query.refresh"
|
||
/>
|
||
</div>
|
||
<!-- 以下是正式摄影、即时状态与待审草案入口 -->
|
||
<div v-if="detailTab === 'design'" class="space-y-5 pt-6">
|
||
<ShotDerivedReview
|
||
:key="shot.shotId"
|
||
:project-id="id"
|
||
:episode-no="episodeNo"
|
||
:shot="shot"
|
||
:shots="shots"
|
||
:disabled="blocked"
|
||
@changed="query.refresh"
|
||
/>
|
||
<ShotDesign :shot="shot" />
|
||
</div>
|
||
<!-- 以下是独立于项目批量制作门禁的单镜头首帧 -->
|
||
<div v-if="detailTab === 'keyframes'" class="pt-4">
|
||
<p
|
||
v-if="keyframeReadiness.loading.value && !keyframeReadiness.data.value"
|
||
role="status"
|
||
class="text-xs text-muted"
|
||
>
|
||
正在检查本镜生成条件…
|
||
</p>
|
||
<NButton
|
||
v-if="keyframeReadiness.error.value"
|
||
size="small"
|
||
@click="keyframeReadiness.refresh"
|
||
>重新读取生成条件</NButton
|
||
>
|
||
<ShotProductionAssets
|
||
:key="shot.shotId"
|
||
:project-id="id"
|
||
:shot="shot"
|
||
:episode-no="episodeNo"
|
||
:keyframe-readiness="shotReadiness"
|
||
keyframe-only
|
||
:disabled="blocked || !!keyframeReadiness.error.value"
|
||
@changed="keyframeReadiness.refresh"
|
||
/>
|
||
</div>
|
||
<div v-if="detailTab === 'tools'" class="pt-6">
|
||
<ShotTools
|
||
:key="shot.shotId"
|
||
:project-id="id"
|
||
:episode-no="episodeNo"
|
||
:shot="shot"
|
||
:disabled="blocked || !projectAssetsReady"
|
||
/>
|
||
</div>
|
||
</div>
|
||
</NScrollbar>
|
||
<!-- 以下是无效镜头地址的定位反馈模块 -->
|
||
<EmptyState
|
||
v-if="!shot"
|
||
title="链接中的镜头已不存在或不属于本集"
|
||
description="请在左侧目录重新选择镜头。"
|
||
/>
|
||
</article>
|
||
</div>
|
||
<EmptyState
|
||
v-else-if="data"
|
||
title="本集还没有正式分镜"
|
||
description="先完成剧本拆解,再回来完善镜头设计和画面状态。"
|
||
></EmptyState
|
||
></WorkspacePage>
|
||
</template>
|
||
|
||
<style>
|
||
/* 本组件专属布局与 Naive 内部结构覆盖。 */
|
||
@reference "../../styles/styles.css";
|
||
.storyboard-duration-summary {
|
||
@apply flex flex-wrap items-center gap-x-3 gap-y-1 min-w-0 text-xs;
|
||
}
|
||
.storyboard-duration-summary > span {
|
||
@apply whitespace-nowrap;
|
||
}
|
||
.storyboard-controls {
|
||
@apply grid grid-cols-[minmax(180px,_1fr)_100px_145px_auto] gap-[18px] items-end;
|
||
}
|
||
.generation-row {
|
||
@apply flex items-center justify-between gap-5 pt-5 mt-5;
|
||
}
|
||
.generation-row > div:last-child {
|
||
@apply shrink-0;
|
||
}
|
||
.storyboard-workspace {
|
||
@apply grid grid-cols-[220px_minmax(0,_1fr)] gap-3 overflow-hidden;
|
||
}
|
||
.shot-list {
|
||
@apply max-h-[1000px] overflow-hidden bg-(--app-surface) pt-0 px-2 pb-5;
|
||
}
|
||
@media (max-width: 1200px) {
|
||
.generation-row {
|
||
@apply items-start flex-col gap-3;
|
||
}
|
||
.storyboard-controls {
|
||
@apply grid-cols-[minmax(0,_1fr)_minmax(0,_1fr)];
|
||
}
|
||
}
|
||
@media (max-width: 760px) {
|
||
.storyboard-controls {
|
||
@apply grid-cols-[minmax(0,_1fr)] gap-3;
|
||
}
|
||
.storyboard-workspace {
|
||
@apply grid-cols-[minmax(0,_1fr)];
|
||
}
|
||
.shot-list {
|
||
@apply max-h-[240px];
|
||
border-right: 0;
|
||
}
|
||
}
|
||
.storyboard-workspace-page .storyboard-workspace {
|
||
@apply flex-1 h-auto min-h-0 overflow-hidden;
|
||
}
|
||
.storyboard-coverage {
|
||
@apply shrink-0;
|
||
}
|
||
.storyboard-workspace {
|
||
@apply grid-cols-[clamp(240px,_22%,_280px)_minmax(0,_1fr)];
|
||
}
|
||
.storyboard-workspace {
|
||
@apply h-[clamp(360px,65dvh,850px)] min-h-0;
|
||
}
|
||
.storyboard-workspace > article,
|
||
.storyboard-workspace .shot-list {
|
||
@apply overflow-hidden min-h-0 h-full max-h-none;
|
||
}
|
||
.shot-list-content {
|
||
@apply gap-3 pt-0 px-0 pb-3;
|
||
}
|
||
.shot-list {
|
||
@apply p-0;
|
||
}
|
||
@media (max-width: 760px) {
|
||
/* 手机目录按实际内容占高,避免没有状态或短标题时保留整块空白。 */
|
||
.storyboard-workspace {
|
||
@apply grid-cols-[minmax(0,_1fr)] grid-rows-[auto_minmax(0,_1fr)] gap-2;
|
||
}
|
||
.storyboard-controls {
|
||
@apply grid-cols-[minmax(0,_1fr)_minmax(0,_1fr)];
|
||
}
|
||
}
|
||
</style>
|