feat(short-drama-agent-front): 完善质量规则确认与中文交互
This commit is contained in:
1 parent
190333d4f9
commit
c4b43b9725
85 files changed
+2059
-480
No files matched your search
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { userFacingText } from '../../lib/user-facing-text'
|
||||
import { isOperationRunning } from '../workflows/operations'
|
||||
|
||||
import ContextNotice from '../../components/ui/ContextNotice.vue'
|
||||
@@ -231,8 +232,8 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
本集有 {{ currentEpisodeDurationIssues.length }} 条分镜时长建议(不阻断生成)
|
||||
</div>
|
||||
<div v-for="(issue, index) in currentEpisodeDurationIssues" :key="index" class="mt-1 text-sm">
|
||||
Beat {{ issue.beatNo }}<span v-if="issue.shotNo"> · Shot {{ issue.shotNo }}</span
|
||||
>:{{ issue.message }}
|
||||
剧情段落 {{ 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>
|
||||
@@ -267,10 +268,10 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
>
|
||||
<span v-else>自动规划时长</span>
|
||||
<span v-if="currentDurationBudget.plannedSeconds !== null"
|
||||
>Beat {{ currentDurationBudget.plannedSeconds }} 秒</span
|
||||
>剧情段落 {{ currentDurationBudget.plannedSeconds }} 秒</span
|
||||
>
|
||||
<span v-if="currentDurationBudget.shotCount > 0 && currentDurationBudget.shotSeconds !== null"
|
||||
>Shot {{ currentDurationBudget.shotSeconds }} 秒</span
|
||||
>镜头 {{ currentDurationBudget.shotSeconds }} 秒</span
|
||||
>
|
||||
<span
|
||||
v-if="durationStatusLabel"
|
||||
@@ -474,7 +475,7 @@ const rules = { concurrency: integerRule('批量并发'), maxRepairAttempts: int
|
||||
</div>
|
||||
<p class="mt-4 text-[11px] leading-6 text-muted">
|
||||
修改或覆盖前面的设计后,已有状态和视频提示词不会自动更新;请按顺序重新生成后续内容。自动修复次数仅用于
|
||||
VisualState。
|
||||
画面即时状态。
|
||||
</p>
|
||||
<section>
|
||||
<h3 class="text-sm font-semibold">视频提示词批量操作</h3>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { userFacingText } from '../../../lib/user-facing-text'
|
||||
import ContextNotice from '../../../components/ui/ContextNotice.vue'
|
||||
|
||||
import { NScrollbar, NButton, NTable } from 'naive-ui'
|
||||
@@ -32,7 +33,7 @@ function exportReceipt() {
|
||||
</ContextNotice>
|
||||
<template v-if="receipt.kind === 'shots'">
|
||||
<p class="my-4 text-xs text-muted">
|
||||
第 {{ receipt.result.episodeNo }} 集 · {{ receipt.result.storyboardShotSummary.beatCount }} 个 Beat ·
|
||||
第 {{ receipt.result.episodeNo }} 集 · {{ receipt.result.storyboardShotSummary.beatCount }} 个剧情段落 ·
|
||||
{{ receipt.result.storyboardShotSummary.shotCount }} 个镜头 ·
|
||||
{{ receipt.result.storyboardShotSummary.totalDurationSeconds }} 秒 · 形态绑定覆盖率
|
||||
{{ Math.round(receipt.result.storyboardShotSummary.bindingCoverage * 100) }}%
|
||||
@@ -47,7 +48,7 @@ function exportReceipt() {
|
||||
</ContextNotice>
|
||||
<ul v-else class="mt-3 space-y-2 text-xs text-danger">
|
||||
<li v-for="(issue, index) in receipt.result.storyboardShotValidation.issues" :key="index">
|
||||
Beat {{ issue.beatNo ?? '—' }} / Shot {{ issue.shotNo ?? '—' }}:{{ issue.message }}
|
||||
剧情段落 {{ issue.beatNo ?? '—' }} / 镜头 {{ issue.shotNo ?? '—' }}:{{ userFacingText(issue.message) }}
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
@@ -81,8 +82,8 @@ function exportReceipt() {
|
||||
<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 }}
|
||||
剧情段落 {{ issue.beatNo ?? '—' }} / 镜头 {{ issue.shotNo ?? '—' }}
|
||||
{{ issue.subjectRef }}:{{ userFacingText(issue.message) }}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -98,11 +99,11 @@ function exportReceipt() {
|
||||
<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 }}
|
||||
>:{{ userFacingText(item.error) }}
|
||||
</li>
|
||||
</ul>
|
||||
<p class="mt-3 text-xs text-muted">
|
||||
当前批量接口不返回成功镜头的 Prompt 正文;选择镜头后点击“读取/生成提示词”,已有内容会直接复用。
|
||||
批量处理完成后,可选择镜头查看完整画面描述;已有描述会直接使用,无需重新生成。
|
||||
</p>
|
||||
</template>
|
||||
<p class="mt-4 text-[11px] text-muted">回执仅保留在当前浏览器会话中。数据库结果是覆盖率和镜头详情的依据。</p>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { userFacingText } from '../../../lib/user-facing-text'
|
||||
import { computed } from 'vue'
|
||||
import { NButton, NCheckbox, NInput, NInputNumber, NSelect, NTag } from 'naive-ui'
|
||||
import { AppDialog, AssetImage } from '../../../components/ui'
|
||||
@@ -301,7 +302,7 @@ function updateRefs(index: number, value: string) {
|
||||
<section v-if="preview" class="motion-revision-feedback" aria-label="免费预检查结果">
|
||||
<h3>预检查结果</h3>
|
||||
<p>{{ preview.valid ? '结构检查通过,仍须视觉校验;尚不可激活。' : '结构检查未通过,请修改草稿。' }}</p>
|
||||
<p v-for="(message, index) in previewMessages" :key="index">{{ message }}</p>
|
||||
<p v-for="(message, index) in previewMessages" :key="index">{{ userFacingText(message) }}</p>
|
||||
</section>
|
||||
<!-- 以下是收费视觉校验与激活模块,费用说明和操作成组排列 -->
|
||||
<section class="workspace-panel motion-revision-section" aria-label="动作起点视觉校验">
|
||||
@@ -331,7 +332,7 @@ function updateRefs(index: number, value: string) {
|
||||
<p v-if="state.execution.query.error.value" class="text-danger">
|
||||
{{ state.execution.query.error.value }}
|
||||
</p>
|
||||
<p v-if="record?.error" class="text-danger">{{ record.error }}</p>
|
||||
<p v-if="record?.error" class="text-danger">{{ userFacingText(record.error) }}</p>
|
||||
<p v-if="record?.result?.summary">{{ record.result.summary }}</p>
|
||||
<p v-for="(issue, index) in taskIssues" :key="index">{{ issue }}</p>
|
||||
<NTag v-if="invalidated && record" type="warning" :bordered="false"
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import RawDataDetails from '../../../components/ui/RawDataDetails.vue'
|
||||
import { userFacingText } from '../../../lib/user-facing-text'
|
||||
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
|
||||
|
||||
import { NScrollbar, NButton, NCheckbox } from 'naive-ui'
|
||||
import { NButton, NCheckbox } from 'naive-ui'
|
||||
import { computed, onScopeDispose, ref, watch } from 'vue'
|
||||
import { Download, ExternalLink } from '@lucide/vue'
|
||||
import IssueHint from '../../../components/ui/IssueHint.vue'
|
||||
@@ -13,7 +15,7 @@ import type { ShotGenerationSpec } from '../generation-spec.types'
|
||||
import { useQuery } from '../../../composables/useQuery'
|
||||
import { errorMessage } from '../../../lib/http'
|
||||
import { downloadText } from '../../../lib/format'
|
||||
import { getOperation, runOperation } from '../../workflows/operations'
|
||||
import { getOperation, operationErrorText, runOperation } from '../../workflows/operations'
|
||||
import ConfirmAction from '../../workflows/ConfirmAction.vue'
|
||||
|
||||
/** 镜头级只读资源与显式 Prompt 生成;查询与耗费模型的操作分开。 */
|
||||
@@ -75,12 +77,12 @@ async function load(kind: 'references' | 'spec') {
|
||||
if (kind === 'references') {
|
||||
const result = await storyboardApi.references(shotId, controller.signal)
|
||||
if (version !== revision) return
|
||||
if (result.shotId !== shotId) throw new Error('参考图返回的 Shot ID 不匹配。')
|
||||
if (result.shotId !== shotId) throw new Error('参考图结果与当前镜头不一致,请重新读取。')
|
||||
references.value = result
|
||||
} else {
|
||||
const result = await storyboardApi.generationSpec(shotId, controller.signal)
|
||||
if (version !== revision) return
|
||||
if (result.shotId !== shotId) throw new Error('生成规格返回的 Shot ID 不匹配。')
|
||||
if (result.shotId !== shotId) throw new Error('生成方案与当前镜头不一致,请重新读取。')
|
||||
spec.value = result
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -108,7 +110,7 @@ async function generatePrompt() {
|
||||
if (!ok) {
|
||||
// 单镜头错误由 runOperation 记录到项目操作状态;这里只处理可恢复的首帧前置问题。
|
||||
const operation = getOperation(projectId)
|
||||
if (!/primary keyframe|主首帧/i.test(operation.error)) return
|
||||
if (!/primary keyframe|主首帧/i.test(operationErrorText(operation))) return
|
||||
operation.recovery = {
|
||||
target: 'keyframe',
|
||||
shotId,
|
||||
@@ -173,7 +175,7 @@ function exportResult(kind: 'spec' | 'prompt') {
|
||||
</div>
|
||||
<ul v-if="references.missing.length" class="alert mt-3 space-y-2 text-xs">
|
||||
<li v-for="item in references.missing" :key="item.subjectId">
|
||||
{{ item.subjectName }}({{ item.subjectRef }}):{{ item.reason }}
|
||||
{{ item.subjectName }}({{ item.subjectRef }}):{{ userFacingText(item.reason) }}
|
||||
</li>
|
||||
</ul>
|
||||
<p v-if="!references.references.length && !references.missing.length" class="mt-3 text-xs text-muted">
|
||||
@@ -187,15 +189,15 @@ function exportResult(kind: 'spec' | 'prompt') {
|
||||
<section>
|
||||
<!-- 以下是统一的生成规格模块标题与读取操作模块 -->
|
||||
<WorkspaceSectionHeading
|
||||
title="镜头生成规格"
|
||||
description="后端合并主体稳定身份、具体形态、摄影设计与即时状态,编译为 GenerationSpec,不调用模型。需要本镜头已有 Direction 和 VisualState。"
|
||||
title="镜头生成方案"
|
||||
description="汇总角色特征、形态、镜头设计和画面状态,整理成生成方案。请先补齐本镜头的设计和画面状态;这一步不生成图片或视频。"
|
||||
>
|
||||
<template #actions>
|
||||
<NButton
|
||||
:disabled="locked || busy.spec || !shot.direction || !shot.visualState"
|
||||
:loading="busy.spec"
|
||||
@click="load('spec')"
|
||||
>{{ busy.spec ? '编译中…' : '读取生成规格' }}</NButton
|
||||
>{{ busy.spec ? '整理中…' : '整理生成方案' }}</NButton
|
||||
>
|
||||
</template>
|
||||
</WorkspaceSectionHeading>
|
||||
@@ -204,18 +206,16 @@ function exportResult(kind: 'spec' | 'prompt') {
|
||||
><div class="mt-4 flex items-center justify-between">
|
||||
<span class="text-xs text-muted"
|
||||
>{{ spec.subjects.length }} 个主体 · {{ spec.durationSeconds }} 秒</span
|
||||
><NButton @click="exportResult('spec')" text size="small"><Download :size="13" />导出规格</NButton>
|
||||
><NButton @click="exportResult('spec')" text size="small"><Download :size="13" />导出方案</NButton>
|
||||
</div>
|
||||
<NScrollbar class="code-scroll mt-3" x-scrollable>
|
||||
<pre class="storyboard-json">{{ JSON.stringify(spec, null, 2) }}</pre>
|
||||
</NScrollbar>
|
||||
<RawDataDetails :value="spec" title="完整生成方案(高级)" />
|
||||
</template>
|
||||
</section>
|
||||
<section>
|
||||
<!-- 以下是统一的视频提示词模块标题与说明模块 -->
|
||||
<WorkspaceSectionHeading
|
||||
title="视频提示词"
|
||||
description="已有提示词可直接复用,没有则依据 GenerationSpec 与参考图调用模型生成。此处只处理 Prompt;首帧和实际视频任务请到“镜头生产”。"
|
||||
description="已有的视频描述可以直接使用;缺少时会根据镜头生成方案和参考图调用模型整理。生成图片和视频请前往“镜头生产”。"
|
||||
/>
|
||||
<div class="mt-4 flex flex-wrap items-center gap-4">
|
||||
<ConfirmAction
|
||||
@@ -244,7 +244,7 @@ function exportResult(kind: 'spec' | 'prompt') {
|
||||
</div>
|
||||
<p class="whitespace-pre-wrap text-sm leading-7">{{ prompt.videoPrompt }}</p>
|
||||
<template v-if="prompt.negativePrompt"
|
||||
><h4 class="mb-2 mt-5 text-xs font-medium text-muted">Negative prompt(负向提示词)</h4>
|
||||
><h4 class="mb-2 mt-5 text-xs font-medium text-muted">避免出现的内容</h4>
|
||||
<p class="whitespace-pre-wrap text-sm leading-6">{{ prompt.negativePrompt }}</p></template
|
||||
>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { userFacingText } from '../../../lib/user-facing-text'
|
||||
import ContextNotice from '../../../components/ui/ContextNotice.vue'
|
||||
|
||||
import { computed, ref } from 'vue'
|
||||
@@ -41,7 +42,7 @@ const result = computed(() => query.data.value)
|
||||
<template v-if="result">
|
||||
<ContextNotice :type="result.valid ? 'success' : 'warning'" :show-icon="false">
|
||||
{{ result.valid ? '未发现主体引用遗漏' : `发现 ${result.issueCount} 项引用遗漏` }} ·
|
||||
{{ result.episodeCount }} 集 / {{ result.beatCount }} 个 Beat / {{ result.shotCount }} 镜
|
||||
{{ result.episodeCount }} 集 / {{ result.beatCount }} 个剧情段落 / {{ result.shotCount }} 镜
|
||||
</ContextNotice>
|
||||
<p class="mt-2 text-muted">
|
||||
检查主体 {{ result.subjectSummary.total }} · 人物 {{ result.subjectSummary.character }} / 场景
|
||||
@@ -54,7 +55,7 @@ const result = computed(() => query.data.value)
|
||||
>
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<strong
|
||||
>第 {{ issue.episodeNo }} 集 · Beat {{ issue.beatNo
|
||||
>第 {{ issue.episodeNo }} 集 · 剧情段落 {{ issue.beatNo
|
||||
}}{{ issue.shotNo !== null ? ` · 镜头 ${issue.shotNo}` : '' }} · {{ issue.subjectName }}
|
||||
{{ issue.subjectRef }}</strong
|
||||
>
|
||||
@@ -62,7 +63,7 @@ const result = computed(() => query.data.value)
|
||||
issue.shotNo === null ? '查看所在剧集' : '定位镜头'
|
||||
}}</NButton>
|
||||
</div>
|
||||
<p>{{ issue.message }}</p>
|
||||
<p>{{ userFacingText(issue.message) }}</p>
|
||||
<p class="text-muted">
|
||||
原文匹配:{{ issue.matchedTerm }} ·
|
||||
{{
|
||||
|
||||
Reference in new issue
Block a user