feat: 接入分镜导演设计与即时视觉状态工作台
增加单集和批量生成、修复诊断、正式镜头检查、参考图、生成规格与视频提示词。 补齐接口契约、竞态保护和确认交互测试,保持现有两条工作流。
This commit is contained in:
1 parent
2ee6f049f6
commit
bae69c3c62
22 files changed
+2211
-11
No files matched your search
@@ -0,0 +1,113 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { Download } from '@lucide/vue'
|
||||
import { downloadText } from '../../../lib/format'
|
||||
import type { StoryboardIssue, StoryboardReceipt } from '../types'
|
||||
|
||||
/** 独立展示提交结果,不能将 HTTP 成功或局部成功显示为整批完成。 */
|
||||
const props = defineProps<{ receipt: StoryboardReceipt }>()
|
||||
const issues = computed<StoryboardIssue[]>(() => {
|
||||
if (props.receipt.kind === 'direction') return props.receipt.result.validation.issues
|
||||
if (props.receipt.kind === 'visual-state')
|
||||
return props.receipt.result.remainingIssues.length
|
||||
? props.receipt.result.remainingIssues
|
||||
: props.receipt.result.validation.issues
|
||||
return []
|
||||
})
|
||||
const failed = computed(() => {
|
||||
if (props.receipt.kind === 'batch') return props.receipt.result.failedEpisodes > 0
|
||||
if (props.receipt.kind === 'prompts') return props.receipt.result.failed > 0
|
||||
if (props.receipt.kind === 'visual-state' && !props.receipt.result.persisted) return true
|
||||
return !props.receipt.result.validation.valid
|
||||
})
|
||||
|
||||
/** 导出原始回执,保留后端提供的完整失败诊断。 */
|
||||
function exportReceipt() {
|
||||
downloadText('storyboard-generation-receipt.json', JSON.stringify(props.receipt, null, 2), 'application/json')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="panel mt-5 p-5" aria-label="生成回执">
|
||||
<div class="flex items-center justify-between gap-3">
|
||||
<h3 class="text-sm font-semibold">{{ receipt.title }} · 本次回执</h3>
|
||||
<button class="text-button" @click="exportReceipt"><Download :size="13" />导出诊断</button>
|
||||
</div>
|
||||
<p v-if="failed" class="alert alert-error mt-3" role="alert">
|
||||
本次存在失败、校验未通过或未保存项。关闭“批量覆盖已有结果”后再补齐,可跳过已完整保存项。
|
||||
</p>
|
||||
<template v-if="receipt.kind === 'batch'">
|
||||
<p class="my-4 text-xs text-muted">
|
||||
共 {{ receipt.result.episodeCount }} 集 · 完成 {{ receipt.result.completedEpisodes }} · 跳过
|
||||
{{ receipt.result.skippedEpisodes }} · 失败 {{ receipt.result.failedEpisodes }}
|
||||
</p>
|
||||
<div class="table-scroll">
|
||||
<table class="project-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>剧集</th>
|
||||
<th>结果</th>
|
||||
<th>回执数量 / 镜头</th>
|
||||
<th>自动修复</th>
|
||||
<th>诊断</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in receipt.result.episodes" :key="item.episodeNo">
|
||||
<td>第 {{ item.episodeNo }} 集</td>
|
||||
<td :class="item.status === 'failed' ? 'text-danger' : 'text-success'">
|
||||
{{ { completed: '完成', skipped: '跳过已有', failed: '失败' }[item.status] }}
|
||||
</td>
|
||||
<td>{{ item.directionCount ?? item.visualStateCount ?? 0 }} / {{ item.shotCount }}</td>
|
||||
<td>
|
||||
{{ item.repairAttempts === undefined ? '—' : item.repairAttempts + ' 次'
|
||||
}}<span v-if="item.repaired"> · 已修复</span>
|
||||
</td>
|
||||
<td class="min-w-48 whitespace-pre-wrap text-xs">
|
||||
<p>{{ item.error || '—' }}</p>
|
||||
<p v-for="(issue, index) in item.remainingIssues" :key="index" class="mt-2 text-danger">
|
||||
Beat {{ issue.beatNo ?? '—' }} / Shot {{ issue.shotNo ?? '—' }}
|
||||
{{ issue.subjectRef }}:{{ issue.message }}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="receipt.kind === 'prompts'">
|
||||
<p class="mt-4 text-sm">
|
||||
共 {{ receipt.result.total }} 个镜头 · 本次目标 {{ receipt.result.targetCount }} · 处理成功
|
||||
{{ receipt.result.generated }} · 跳过 {{ receipt.result.skipped }} · 失败 {{ receipt.result.failed }}
|
||||
</p>
|
||||
<ul class="mt-3 space-y-2 text-xs text-danger">
|
||||
<li v-for="item in receipt.result.failures" :key="item.shotId">
|
||||
<code>{{ item.shotId }}</code
|
||||
>:{{ item.error }}
|
||||
</li>
|
||||
</ul>
|
||||
<p class="mt-3 text-xs text-muted">
|
||||
当前批量接口不返回成功镜头的 Prompt 正文;选择镜头后点击“读取/生成提示词”,已有内容会直接复用。
|
||||
</p>
|
||||
</template>
|
||||
<template v-else>
|
||||
<p class="mt-4 text-sm" :class="failed ? 'text-danger' : 'text-success'">
|
||||
{{ receipt.result.validation.valid ? '生成校验通过' : '校验失败,未保存本次生成结果'
|
||||
}}<span v-if="receipt.kind === 'visual-state'">
|
||||
· 自动修复 {{ receipt.result.repairAttempts }} 次 ·
|
||||
{{ receipt.result.persisted ? '已持久化' : '未持久化' }}</span
|
||||
>
|
||||
</p>
|
||||
<p v-if="receipt.kind === 'direction' && receipt.result.validation.valid" class="mt-2 text-xs text-muted">
|
||||
已请求持久化,数据库实际覆盖率以下方刷新后的数据为准。
|
||||
</p>
|
||||
<ul class="mt-3 space-y-2 text-xs text-danger">
|
||||
<li v-for="(issue, index) in issues" :key="index">
|
||||
第 {{ issue.episodeNo }} 集 / Beat {{ issue.beatNo ?? '—' }} / Shot {{ issue.shotNo ?? '—' }}
|
||||
{{ issue.subjectRef }}:{{ issue.message }}
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
<p class="mt-4 text-[11px] text-muted">回执仅保留在当前浏览器会话中。数据库结果是覆盖率和镜头详情的依据。</p>
|
||||
</section>
|
||||
</template>
|
||||
Reference in new issue
Block a user