feat(short-drama-agent-front): 完善质量规则确认与中文交互

This commit is contained in:
GJ committed 2026-10-17 22:09:28 +08:00
1 parent 190333d4f9
commit c4b43b9725
85 files changed
+2059 -480

No files matched your search

+2 -2
View File
@@ -306,7 +306,7 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
>
<div class="production-tools-intro workspace-panel">
<div>
<p class="eyebrow">PRODUCTION</p>
<p class="eyebrow">镜头制作</p>
<h2 class="text-lg font-semibold">镜头生产</h2>
<p class="mt-2 text-sm text-muted">
从可生成的提示词和首帧,到异步视频任务与最终成片。
@@ -416,7 +416,7 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
><component :is="stage.icon" :size="17"
/></span>
<div>
<p class="eyebrow">STEP {{ stage.code }}</p>
<p class="eyebrow">步骤 {{ stage.code }}</p>
<h3 class="mt-2 text-sm font-semibold">
{{ stage.title }}
</h3>
@@ -79,8 +79,7 @@ const confirmationDescription = computed(
>依次补齐形态提示词、参考图、首帧质量校验与修复、视频提示词,再提交视频任务。视觉风格、身份母版、导演设计和即时状态仍需提前准备。</ContextNotice
>
<p class="mt-3 text-xs leading-6 text-muted">
范围固定为全项目并跳过已有有效结果。默认开启测试安全模式:允许 LLM、Vision、主体图、少量首帧和 Video
Prompt,但会在视频生成前正常停止,不向视频 Provider 提交任务。
处理整个项目,并保留已有可用结果。试运行可以整理文字、检查图片、生成主体图片和少量首帧,并准备视频描述;会在真正生成视频前停止。试运行中的文字和图片处理仍可能产生费用。
</p>
<!-- 以下是生产范围配置模块,修改任一参数后须重新预检。 -->
<div class="surface-inset mt-4 p-4">
@@ -67,7 +67,7 @@ onScopeDispose(() => controller?.abort())
<NSpin :show="loading">
<div class="flex flex-wrap items-center justify-between gap-3">
<p class="text-xs text-muted">
按 Beat 和 Shot 顺序拼接当前有效主视频。V1 只输出无声视频,不包含对白、配乐、字幕和转场。
按剧情段落和镜头顺序拼接当前选用的视频。目前只生成无声视频,不包含对白、配乐、字幕和转场。
</p>
<NButton size="small" :disabled="loading" @click="refresh">刷新就绪状态</NButton>
</div>
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { userFacingText } from '../../../lib/user-facing-text'
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
@@ -150,7 +151,7 @@ async function loadPreview() {
</ContextNotice>
<div class="mt-5 flex flex-wrap items-center gap-3">
<NButton :loading="previewPending" @click="loadPreview">预览实际生成输入</NButton>
<span class="text-xs text-muted">只读取参考图规划与最终 Prompt,不调用图片模型。</span>
<span class="text-xs text-muted">只读取参考图规划与最终画面描述,不调用图片模型。</span>
</div>
<FeedbackMessage v-if="previewError" :message="previewError" />
<div v-if="preview" class="panel mt-3 p-4 text-xs leading-6">
@@ -192,7 +193,7 @@ async function loadPreview() {
:key="`${issue.code}:${issue.subjectRef ?? index}`"
class="mt-3 bg-muted/10 p-3"
>
<p class="font-medium">{{ issue.message }}</p>
<p class="font-medium">{{ userFacingText(issue.message) }}</p>
<p v-if="issue.subjectRef" class="mt-1 text-muted">主体:{{ issue.subjectRef }}</p>
<p class="mt-1 text-muted">涉及字段:{{ issue.fieldPaths.join('、') }}</p>
<p class="mt-1">建议:{{ issue.suggestion }}</p>
@@ -206,7 +207,7 @@ async function loadPreview() {
</li>
</ul>
<NCollapse class="mt-3" :default-expanded-names="['prompt']">
<NCollapseItem name="prompt" title="最终 Provider Prompt">
<NCollapseItem name="prompt" title="本次实际使用的画面描述">
<p class="mt-3 whitespace-pre-wrap">{{ preview.providerPrompt }}</p>
</NCollapseItem>
<NCollapseItem
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { userFacingText } from '../../../lib/user-facing-text'
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
@@ -210,11 +211,11 @@ const records = computed(() =>
: '未取得完整视觉结论'
}}
</p>
<p v-if="record.error" class="text-danger">{{ record.error }}</p>
<p v-if="record.error" class="text-danger">{{ userFacingText(record.error) }}</p>
<template v-if="record.validation">
<p>{{ record.validation.summary }}</p>
<p v-for="(issue, index) in record.validation.issues" :key="index" class="text-danger">
{{ issue.description }}
{{ userFacingText(issue.description) }}
</p>
</template>
<!-- 以下是原始校验结果的 Naive 折叠模块 -->
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { userFacingText } from '../../../lib/user-facing-text'
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
@@ -62,7 +63,7 @@ async function inspect() {
<FeedbackMessage v-if="error" :message="error" />
<template v-if="providers">
<p v-if="!providers.some(item => item.active)" class="mt-2 text-danger">
没有匹配的启用图片模型,请检查后端配置。
没有可用的图片模型,请先到项目配置中选择模型。
</p>
<p v-for="item in providers" :key="item.provider" class="mt-2">
{{ item.provider }} · {{ item.active ? '当前启用' : '已注册' }} ·
@@ -77,9 +78,9 @@ async function inspect() {
</template>
<ContextNotice v-if="capability" :type="capability.valid ? 'info' : 'error'" :show-icon="false" class="mt-3">{{
capability.valid
? capability.message ||
`当前镜头共有 ${capability.referenceCount} 张业务参考图,后端已判定本次规划符合 ${capability.provider} 能力。`
: capability.message || '当前镜头不满足模型能力限制。'
? userFacingText(capability.message) ||
`当前镜头有 ${capability.referenceCount} 张参考图,本次选择符合 ${capability.provider} 的使用要求。`
: userFacingText(capability.message) || '当前镜头不满足模型能力限制。'
}}</ContextNotice>
<p v-if="capability?.valid && capability.plannedReferenceCount !== undefined" class="mt-2 text-muted">
本次计划输入 {{ capability.plannedReferenceCount }} 张 · 转为文字约束
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { userFacingText } from '../../../lib/user-facing-text'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { NButton } from 'naive-ui'
@@ -61,7 +62,7 @@ function exportReceipt() {
<ul v-if="receipt.result.failures.length" class="mt-3 space-y-2 text-xs text-danger">
<li v-for="failure in receipt.result.failures" :key="failure.shotId">
<code>{{ failure.shotId }}</code
>:{{ failure.error }}
>:{{ userFacingText(failure.error) }}
</li>
</ul>
</section>
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { userFacingText } from '../../../lib/user-facing-text'
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
import { computed, onScopeDispose, ref, watch } from 'vue'
@@ -72,7 +73,7 @@ async function inspect() {
{{ result.providerInputKeyframe.source === 'provider_variant' ? '模型专用变体' : '业务主首帧' }}
</p>
<p v-if="result.providerInputKeyframe.variantReason">
变体原因:{{ result.providerInputKeyframe.variantReason }}
变体原因:{{ userFacingText(result.providerInputKeyframe.variantReason) }}
</p>
<ul class="space-y-2">
<li v-for="reference in result.references" :key="`${reference.subjectId}:${reference.subjectFormId}`">
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { userFacingText } from '../../../lib/user-facing-text'
import { videoOperationAllowed } from '../video-permissions'
import FeedbackMessage from '../../../components/ui/FeedbackMessage.vue'
@@ -265,7 +266,7 @@ const optionsExpanded = ref<string[]>(['options'])
type="warning"
:show-icon="false"
>
{{ videoQuery.error.value || videoQuery.data.value?.staleReason }}
{{ userFacingText(videoQuery.error.value || videoQuery.data.value?.staleReason) }}
</ContextNotice>
<AppForm
ref="formRef"
@@ -322,7 +323,7 @@ const optionsExpanded = ref<string[]>(['options'])
本次仅创建一个修复视频,不自动等待或复检。完成后请打开新候选的质量检查;修复约束沿用上次失败校验,不使用额外参数。
</p>
<ContextNotice v-if="!repairAvailable" type="warning" :show-icon="false" class="mt-3"
>当前候选不允许执行所选质量操作,请查看后端原因或刷新权限。</ContextNotice
>当前候选暂时不能执行这项检查,请查看原因或刷新任务状态。</ContextNotice
>
<NCollapse
v-if="!videoRepair"
@@ -399,7 +400,7 @@ const optionsExpanded = ref<string[]>(['options'])
个视频生成任务,可能产生费用;生成完成不会切换主视频,需再次付费复检通过后才会晋升。</template
>
<template v-else-if="target?.kind === 'video'"
>本次提交一次视频校验请求,后端可能调用多个视觉模型并产生费用。</template
>本次会检查视频画面,可能使用多个识图模型并产生费用。</template
>
<template v-else-if="valid"
>本次最多调用 {{ maxImages }} 次生图、{{ maxValidations }} 次视觉校验,均可能产生费用。</template
@@ -437,7 +438,7 @@ const optionsExpanded = ref<string[]>(['options'])
><NCollapseItem name="saved" :title="`本会话最近校验 · ${saved.passed ? '通过' : '未通过'}`"
><p>{{ saved.summary }}</p>
<p v-for="(issue, index) in saved.issues" :key="index" class="mt-2 text-danger">
{{ issue.description }}
{{ userFacingText(issue.description) }}
</p>
<p class="mt-3 text-xs text-muted">此为历史抽样结论,不保证当前上游素材仍然一致。</p></NCollapseItem
></NCollapse
@@ -1,4 +1,6 @@
<script setup lang="ts">
import RawDataDetails from '../../../components/ui/RawDataDetails.vue'
import { userFacingText } from '../../../lib/user-facing-text'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { computed } from 'vue'
@@ -105,10 +107,10 @@ function exportResult() {
</p>
</template>
<template v-else>
<p class="mt-3 text-sm">{{ receipt.result.summary || '后端未提供摘要。' }}</p>
<p class="mt-3 text-sm">{{ receipt.result.summary || '本次检查没有提供结果摘要。' }}</p>
<p v-if="receipt.kind === 'video'" class="mt-2 text-xs text-muted">
{{
receipt.promoted ? '修复候选已通过,后端已将其设为主视频。' : '本次校验未晋升主视频。'
receipt.promoted ? '修复后的视频已通过检查,并设为主视频。' : '本次检查没有更换主视频。'
}}仅为抽样帧视觉结果,不含音频、口型或完整运动检测。
</p>
<p v-else class="mt-2 text-xs text-muted">只校验,不重生成或切换主首帧。</p>
@@ -120,7 +122,7 @@ function exportResult() {
:show-icon="false"
class="mt-3"
>
{{ issue.frameLabel ? `${issue.frameLabel} · ` : '' }}{{ issue.description }}
{{ issue.frameLabel ? `${issue.frameLabel} · ` : '' }}{{ userFacingText(issue.description) }}
</ContextNotice>
<NCollapse class="mt-4" :default-expanded-names="['details']">
<NCollapseItem name="details" title="主体检查与执行详情">
@@ -143,7 +145,7 @@ function exportResult() {
>{{
check.result.applicable === false ? '不适用' : check.result.passed ? '通过' : '未通过'
}}
· {{ check.result.summary }}</template
· {{ userFacingText(check.result.summary) }}</template
><template v-else>未执行</template>
</div>
<div
@@ -162,7 +164,7 @@ function exportResult() {
<p v-for="issue in subject.issues" :key="issue">{{ issue }}</p>
</div>
</template>
<pre class="quality-json">{{ JSON.stringify(receipt.result, null, 2) }}</pre>
<RawDataDetails :value="receipt.result" />
</NCollapseItem>
</NCollapse>
</section>
@@ -870,7 +870,7 @@ defineExpose({ inspectSpecs, inspecting })
videoStale
? '使用当前视频提示词、主首帧和主体参考图启动严格质量流水线;最多自动修复 2 次,通过后才接替当前过期主视频。'
: currentVideo
? '新增一个严格质量候选;后端会自动校验并最多修复 2 次,通过后才替换主视频。'
? '新增一个视频候选,自动检查并最多修复 2 次;通过检查后才替换主视频。'
: '启动严格视频质量流水线;任务在后台生成、校验并有限修复,通过后才晋升主视频。'
"
primary
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { userFacingText } from '../../../lib/user-facing-text'
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { computed } from 'vue'
@@ -145,7 +146,7 @@ function rollbackLabel(target: VideoQualityRollbackTarget) {
:key="index"
:class="issue.severity === 'error' ? 'text-danger' : 'text-muted'"
>
{{ issue.frameLabel ? `${issue.frameLabel} · ` : '' }}{{ issue.description }}
{{ issue.frameLabel ? `${issue.frameLabel} · ` : '' }}{{ userFacingText(issue.description) }}
</li>
</ul>
</article>
@@ -1,3 +1,4 @@
import { userFacingText } from '../../lib/user-facing-text'
import { issueLabel } from './model'
import type { ProductionIssue } from './types'
@@ -36,7 +37,7 @@ export function productionMessage(message: string): string {
.replace(/服务器内部错误[::]?\s*/g, '')
.replace(/\s*[::]?\s*\bc[a-z0-9]{20,}\b/g, '')
.trim()
return /[\u4e00-\u9fff]/.test(translated) ? translated : '暂时无法读取生成信息,请稍后重新获取。'
return userFacingText(translated, '暂时无法读取生成信息,请稍后重新获取。')
}
/**
@@ -266,7 +266,7 @@ export function useAdvancedProduction() {
}
throw cause
}
if (!started.executionId) throw new Error('后端未返回 Production executionId,请勿重复提交。')
if (!started.executionId) throw new Error('未取得制作任务编号,请先刷新状态,避免重复提交。')
await execution.track(started.executionId, projectId)
})
if (!disposed && id.value === projectId) {
+3 -3
View File
@@ -217,7 +217,7 @@ export function useQuality(
if (video.motionPlanStale || video.qualityTerminalStatus === 'stale_motion_plan')
clearVideoQualification(projectId, target.shotId, target.assetId)
if (!videoOperationAllowed(video, action === 'repair' ? 'repair' : 'validate'))
throw new Error(video.staleReason || '后端当前不允许此候选执行所选质量操作,请刷新权限。')
throw new Error(video.staleReason || '当前候选暂时不能执行这项检查,请刷新状态后再试。')
if (action === 'repair') {
if (videos.some(item => ['pending', 'queued', 'running'].includes(item.status)))
throw new Error('此镜头仍有活动视频任务,请结束后再修复。')
@@ -257,7 +257,7 @@ export function useQuality(
!Array.isArray(result.sampleFrames) ||
typeof result.isPrimary !== 'boolean'
)
throw new Error('视频校验结果与目标不匹配或不完整,请核对后端记录。')
throw new Error('视频检查结果不完整或与所选视频不一致,请刷新检查记录。')
receiptTarget.videoValidation = result
receipt = {
kind: 'video',
@@ -309,7 +309,7 @@ export function useQuality(
result.keyframeId !== target.assetId ||
!result.validationTaskId
)
throw new Error('首帧校验结果不完整或与目标不匹配,请核对后端记录。')
throw new Error('首帧检查结果不完整或与所选图片不一致,请刷新检查记录。')
receipt = { kind: 'keyframe', result }
}
}