feat(short-drama-agent-front): 同步拆解候选审核与安全提交

This commit is contained in:
GJ committed 2026-10-17 20:18:20 +08:00
1 parent cc27d463e0
commit 190333d4f9
26 files changed
+1495 -249

No files matched your search

@@ -1,8 +1,9 @@
<script setup lang="ts">
import { computed, ref } from 'vue'
import { NButton } from 'naive-ui'
import { NButton, NCollapse, NCollapseItem } from 'naive-ui'
import { AppDrawer } from '../../../components/ui'
import type { ShotValidation } from '../types'
import type { BreakdownQuality } from '../quality'
/** 同一剧集、节拍和镜头的校验问题分组。 */
interface BreakdownIssueGroup {
@@ -22,11 +23,18 @@ const props = defineProps<{
workflowError?: string
/** 当前结果是否允许定位到分镜正文。 */
locatable: boolean
/** 当前版本统一审核,历史问题与当前问题分开。 */
quality?: BreakdownQuality
}>()
/** 独立问题抽屉显隐。 */
const open = defineModel<boolean>('open', { default: false })
/** 抽屉关闭后再定位正文,避免焦点陷阱阻止定位。 */
const emit = defineEmits<{ locate: [issue: ShotValidation['issues'][number]] }>()
const emit = defineEmits<{ locate: [issue: ShotValidation['issues'][number]]; refresh: [] }>()
/** 问题类型统一分类,缺失精确坐标时只提供剧集查看。 */
const problemGroups = computed(() => ([
['subject', '主体引用缺失'], ['binding', '形态绑定异常'], ['structure', '分镜结构校验'],
['action', '动作质量阻断'], ['pending', '待审核剧集'], ['workflow', '当前执行异常']
] as const).map(([type, label]) => ({ type, label, items: props.quality?.problems.filter(item => item.type === type) ?? [] })).filter(group => group.items.length))
/** 相同镜头的问题合并为一组,重复消息不重复显示。 */
const groups = computed(() => {
const result = new Map<string, BreakdownIssueGroup>()
@@ -64,18 +72,36 @@ function finish() {
<template>
<!-- 以下是全屏展示的拆解执行错误与分镜校验问题模块 -->
<AppDrawer v-model:open="open" title="拆解问题" @closed="finish">
<AppDrawer v-model:open="open" title="拆解问题" class="breakdown-issues-drawer" @closed="finish">
<template #description
><span v-if="count">{{ count }} 项校验问题 · {{ groups.length }} 个位置</span
><span v-if="quality">{{ quality.isCandidate ? '当前候选' : quality.source === 'history' ? '历史结果(当前质量未确认)' : '当前正式结果' }} · 结构 {{ quality.structuralCount }} 项 · 动作 {{ quality.actionBlocks.length }} 镜</span
><span v-else-if="count">{{ count }} 项校验问题 · {{ groups.length }} 个位置</span
><span v-else>查看最近保存结果中的问题</span></template
>
<!-- 以下是当前版本的分类问题,历史错误不会混入当前问题数量 -->
<div v-if="quality" class="space-y-5" :aria-busy="quality.loading">
<p v-if="quality.loading" class="text-sm text-muted" role="status">正在读取当前候选审核…</p>
<div v-else-if="quality.error" class="problem-surface p-5 space-y-3"><p class="text-sm break-words">{{ quality.error }}</p><NButton @click="emit('refresh')">重新读取审核</NButton></div>
<template v-else>
<section v-for="group in problemGroups" :key="group.type" class="space-y-3" :aria-label="group.label">
<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>
</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>
</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>
</section>
<article
v-for="group in groups"
v-for="group in quality ? [] : groups"
:key="group.key"
class="workspace-panel problem-surface breakdown-issue-group space-y-3"
>
@@ -93,7 +119,7 @@ function finish() {
{{ message }}
</p>
</article>
<p v-if="!groups.length && !workflowError" class="py-5 text-sm text-muted">
<p v-if="!quality && !groups.length && !workflowError" class="py-5 text-sm text-muted">
当前没有具体错误描述,可读取修复清单确认待处理镜头。
</p>
</div>
@@ -103,3 +129,10 @@ function finish() {
<template #footer><NButton type="default" @click="open = false">关闭</NButton></template>
</AppDrawer>
</template>
<style>
/* 问题正文可滚动,滚动轨道隐藏;公共抽屉继续固定标题与底部关闭操作。 */
.breakdown-issues-drawer .n-scrollbar-rail {
display: none;
}
</style>