feat(short-drama-agent-front): 完善视觉资产审核流程

This commit is contained in:
GJ committed 2026-11-04 14:09:21 +08:00
1 parent dc8bb17a23
commit b88ad8770f
45 files changed
+2258 -352

No files matched your search

@@ -5,7 +5,8 @@ import { AppDialog, AssetImage, AssetOpenLink, StatusBadge } from '../../../comp
import { formatDate } from '../../../lib/format'
import ConfirmAction from '../../workflows/ConfirmAction.vue'
import { canBeAnchor, identityViewLabels } from '../model'
import type { IdentityImage, IdentityImageOperation } from '../types'
import { imageValidationPassed } from '../../subject-images/validation'
import type { IdentityImage, IdentityImageOperation, IdentityValidationResult } from '../types'
/** 母版与候选共用图片卡片,操作始终绑定卡片的正式图片编号。 */
const props = defineProps<{
@@ -27,6 +28,8 @@ const props = defineProps<{
description?: string
/** 候选管理是否可见,关闭管理弹窗时同步收起错误浮层。 */
active?: boolean
/** 只用于同一候选的已知审核证据。 */
validationResult?: IdentityValidationResult | null
}>()
/** 卡片只请求父页面执行操作,不直接调用模型或修改母版。 */
const emit = defineEmits<{
@@ -51,12 +54,19 @@ const confirmLoading = computed(
const validateLoading = computed(
() => props.pendingOperation?.imageId === props.image.id && props.pendingOperation.kind === 'validate'
)
/** 当前图片需要具备刚刚读取的明确审核结果。 */
const quality = computed(() =>
props.validationResult?.imageId === props.image.id
? imageValidationPassed(props.validationResult, props.module)
: null
)
/** 只有完成的 primary 可以确认,已锁定的当前母版不提供重复确认。 */
const canSelect = computed(
() =>
!props.disabled &&
!props.pendingOperation &&
canBeAnchor(props.image) &&
quality.value === true &&
(!props.image.isAnchor || (character.value && !props.identityLocked))
)
/** 卡片标识区分身份母版、母版候选和辅助视角,不重复强调当前状态。 */
@@ -174,6 +184,13 @@ function regenerate() {
</NScrollbar>
</NPopover>
<NTag size="small" :bordered="false">{{ imageLabel }}</NTag>
<NTag
v-if="image.status === 'completed' && !image.isAnchor && image.viewType === 'primary'"
size="small"
:bordered="false"
>
{{ quality === null ? '待审核' : quality ? '审核通过' : '审核未通过或待复核' }}
</NTag>
<!-- 以下是母版身份锁定状态模块,紧邻图片下方的身份母版标签。 -->
<NTag
v-if="image.isAnchor"
@@ -221,8 +238,8 @@ function regenerate() {
<ConfirmAction
:key="image.id"
label="校验此身份图片"
:description="`将校验图片 ${image.id},会调用视觉模型并可能产生费用,不会切换母版。`"
:disabled="disabled || !!pendingOperation"
description="将核对当前候选,可能调用视觉模型并产生费用。审核后仍需人工确认母版。"
:disabled="disabled || !!pendingOperation || image.viewType !== 'primary'"
:loading="validateLoading"
acknowledgement
@confirm="emit('validate', image.id)"
@@ -241,12 +258,16 @@ function regenerate() {
>
<!-- 以下是身份母版采纳的费用与门禁说明模块 -->
<p class="text-sm leading-7 text-muted">
确认时会核对当前来源和质量,可能调用视觉模型并产生审核费用。通过后才锁定并采纳;未通过时保留旧母版,不自动追加生图。
{{
character
? '将复核已保存的质量证据,通过后锁定并采纳。'
: '将复核已保存的质量证据。若审核记录失效,服务可能再次调用视觉模型并产生费用。'
}}
</p>
<template #footer>
<NButton @click="confirming = false">取消</NButton>
<NButton :disabled="!canSelect" type="primary" @click="chooseAnchor">{{
character ? '确认演员选择' : '确认切换身份母版'
character ? '确认演员选择' : '确认费用并切换母版'
}}</NButton>
</template>
</AppDialog>