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

@@ -1,4 +1,6 @@
<script setup lang="ts">
import { userFacingText } from '../../../lib/user-facing-text'
import { qualityIssueLabel } from '../repair'
import { computed, ref } from 'vue'
import { NButton, NCollapse, NCollapseItem } from 'naive-ui'
import { AppDrawer } from '../../../components/ui'
@@ -25,6 +27,8 @@ const props = defineProps<{
locatable: boolean
/** 当前版本统一审核,历史问题与当前问题分开。 */
quality?: BreakdownQuality
/** 真实写入例外期间禁止关闭和定位,普通读取不锁定。 */
busy?: boolean
}>()
/** 独立问题抽屉显隐。 */
const open = defineModel<boolean>('open', { default: false })
@@ -56,7 +60,7 @@ const pendingLocation = ref<ShotValidation['issues'][number] | null>(null)
* @param issue 后端提供的问题位置
*/
function locate(issue: ShotValidation['issues'][number]) {
if (!props.locatable) return
if (!props.locatable || props.busy) return
pendingLocation.value = { ...issue }
open.value = false
}
@@ -72,7 +76,7 @@ function finish() {
<template>
<!-- 以下是全屏展示的拆解执行错误与分镜校验问题模块 -->
<AppDrawer v-model:open="open" title="拆解问题" class="breakdown-issues-drawer" @closed="finish">
<AppDrawer v-model:open="open" title="拆解问题" :busy="busy" class="breakdown-issues-drawer" @closed="finish">
<template #description
><span v-if="quality">{{ quality.isCandidate ? '当前候选' : quality.source === 'history' ? '历史结果(当前质量未确认)' : '当前正式结果' }} · 结构 {{ quality.structuralCount }} 项 · 动作 {{ quality.actionBlocks.length }} 镜</span
><span v-else-if="count">{{ count }} 项校验问题 · {{ groups.length }} 个位置</span
@@ -87,18 +91,18 @@ function finish() {
<h3 class="text-sm font-medium">{{ group.label }} · {{ group.items.length }}</h3>
<article v-for="item in group.items" :key="item.key" class="workspace-panel problem-surface space-y-3 break-words" :data-problem-type="item.type">
<div v-if="item.location" class="flex flex-wrap items-center justify-between gap-3"><p class="text-sm">第 {{ item.location.episodeNo }} 集<span v-if="item.location.beatNo"> · 节拍 {{ item.location.beatNo }}</span><span v-if="item.location.shotNo"> · 镜头 {{ item.location.shotNo }}</span><span class="ml-3 text-xs text-muted">待处理</span></p><NButton v-if="locatable" text size="small" @click="locate(item.location)">{{ item.location.beatNo ? '定位分镜' : '查看本集' }}</NButton></div>
<p class="text-sm leading-6">{{ item.message }}</p><p v-if="item.codes.length" class="text-xs text-muted break-all">阻断代码:{{ item.codes.join('、') }}</p>
<p class="text-sm leading-6">{{ userFacingText(item.message) }}</p><p v-if="item.codes.length" class="text-xs text-muted break-all">需要处理:{{ item.codes.map(qualityIssueLabel).join('、') }}</p>
</article>
</section>
<p v-if="!quality.issueCount && !workflowError" class="text-sm text-muted">当前版本没有待处理的质量问题。</p>
<!-- 以下是使用 Naive 折叠组件的历史记录,默认收起且不计入当前问题 -->
<NCollapse v-if="quality.historyIssues.length" class="text-xs text-muted" data-history-issues><NCollapseItem name="history" :title="`历史审核记录 · ${quality.historyIssues.length} 项(不计入当前问题)`"><p v-for="(item, index) in quality.historyIssues" :key="index" class="mt-3 break-words">第 {{ item.episodeNo }} 集 · {{ item.message }}</p></NCollapseItem></NCollapse>
<NCollapse v-if="quality.historyIssues.length" class="text-xs text-muted" data-history-issues><NCollapseItem name="history" :title="`历史审核记录 · ${quality.historyIssues.length} 项(不计入当前问题)`"><p v-for="(item, index) in quality.historyIssues" :key="index" class="mt-3 break-words">第 {{ item.episodeNo }} 集 · {{ userFacingText(item.message) }}</p></NCollapseItem></NCollapse>
</template>
</div>
<div class="space-y-4">
<section v-if="workflowError" class="workspace-panel problem-surface space-y-3" aria-label="执行异常">
<h3 class="text-sm font-medium">执行异常</h3>
<p class="whitespace-pre-wrap break-words text-sm leading-6">{{ workflowError }}</p>
<p class="whitespace-pre-wrap break-words text-sm leading-6">{{ userFacingText(workflowError) }}</p>
</section>
<article
v-for="group in quality ? [] : groups"
@@ -116,7 +120,7 @@ function finish() {
}}</NButton>
</div>
<p v-for="message in group.messages" :key="message" class="break-words text-sm leading-6">
{{ message }}
{{ userFacingText(message) }}
</p>
</article>
<p v-if="!quality && !groups.length && !workflowError" class="py-5 text-sm text-muted">
@@ -126,7 +130,7 @@ function finish() {
<!-- 以下是独立的问题修订与阶段恢复模块,不承载生成配置或候选提交 -->
<div v-if="$slots.repair" class="mt-6 space-y-5" aria-label="问题修订与恢复"><slot name="repair" /></div>
<!-- 以下是灰底关闭操作,绿色主按钮仅用于提交或执行任务 -->
<template #footer><NButton type="default" @click="open = false">关闭</NButton></template>
<template #footer><NButton type="default" :disabled="busy" @click="open = false">关闭</NButton></template>
</AppDrawer>
</template>