feat(short-drama-agent-front): 补齐后端生产与质量功能
This commit is contained in:
1 parent
967c4ebea1
commit
470b52e26d
52 files changed
+3754
-1075
No files matched your search
@@ -1,28 +1,38 @@
|
||||
<script setup lang="ts">
|
||||
import ConfirmAction from '../../workflows/ConfirmAction.vue'
|
||||
import { NScrollbar, NAlert, NButton, NTag } from 'naive-ui'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { AssetImage, StatusBadge } from '../../../components/ui'
|
||||
import { referenceImageUrl } from '../../../lib/assets'
|
||||
import { formatDate } from '../../../lib/format'
|
||||
import { canBeAnchor, currentAnchor, identityViewLabels } from '../model'
|
||||
import type { IdentityImage } from '../types'
|
||||
import type { IdentityImage, IdentityValidationResult } from '../types'
|
||||
|
||||
/** 身份图库区分权威母版、primary 候选和辅助视图,保留后端原始状态。 */
|
||||
const props = defineProps<{
|
||||
/** 指定图片本次校验回执。 */
|
||||
validationResult?: IdentityValidationResult | null
|
||||
images: IdentityImage[]
|
||||
subjectName: string
|
||||
module: string
|
||||
identityLocked: boolean
|
||||
disabled: boolean
|
||||
}>()
|
||||
const emit = defineEmits<{ anchor: [imageId: string] }>()
|
||||
/** 用户确认的图片操作。 */
|
||||
const emit = defineEmits<{ anchor: [imageId: string]; validate: [imageId: string] }>()
|
||||
/** selectedId 的当前界面状态与输入绑定。 */
|
||||
const selectedId = ref('')
|
||||
/** confirming 的当前界面状态与输入绑定。 */
|
||||
const confirming = ref(false)
|
||||
/** anchor 的当前界面状态与输入绑定。 */
|
||||
const anchor = computed(() => currentAnchor(props.images))
|
||||
/** selected 的当前界面状态与输入绑定。 */
|
||||
const selected = computed(
|
||||
() => props.images.find(image => image.id === selectedId.value) ?? anchor.value ?? props.images[0]
|
||||
)
|
||||
/** character 的当前界面状态与输入绑定。 */
|
||||
const character = computed(() => props.module === 'character')
|
||||
/** canSelect 的当前界面状态与输入绑定。 */
|
||||
const canSelect = computed(
|
||||
() =>
|
||||
!props.disabled &&
|
||||
@@ -30,7 +40,9 @@ const canSelect = computed(
|
||||
canBeAnchor(selected.value) &&
|
||||
(!selected.value.isAnchor || (character.value && !props.identityLocked))
|
||||
)
|
||||
/** imageUrl 的当前界面状态与输入绑定。 */
|
||||
const imageUrl = computed(() => referenceImageUrl(selected.value?.imageUrl ?? ''))
|
||||
/** 监听界面目标变化并重置关联确认状态。 */
|
||||
watch(
|
||||
() => selected.value?.id,
|
||||
() => {
|
||||
@@ -133,6 +145,25 @@ function chooseAnchor() {
|
||||
>{{ selected.provider }} · {{ selected.model }} · {{ formatDate(selected.createdAt) }}</span
|
||||
>
|
||||
</div>
|
||||
<!-- 以下是指定身份图片质量校验模块 -->
|
||||
<ConfirmAction
|
||||
:key="selected.id"
|
||||
label="校验此身份图片"
|
||||
:description="`将校验图片 ${selected.id},会调用视觉模型并可能产生费用,不会切换母版。`"
|
||||
:disabled="disabled || selected.status !== 'completed' || !selected.imageUrl"
|
||||
acknowledgement
|
||||
@confirm="emit('validate', selected.id)"
|
||||
/>
|
||||
<NAlert
|
||||
v-if="validationResult?.imageId === selected.id"
|
||||
:type="validationResult.passed ? 'success' : 'warning'"
|
||||
class="mt-3"
|
||||
>
|
||||
<p>{{ validationResult.passed ? '本次校验通过' : '本次校验未通过' }}:{{ validationResult.summary }}</p>
|
||||
<p v-for="(issue, index) in validationResult.issues" :key="index">
|
||||
{{ issue.severity }} · {{ issue.type }}:{{ issue.description }}
|
||||
</p>
|
||||
</NAlert>
|
||||
<p v-if="selected.viewType !== 'primary'" class="mt-2 text-xs text-muted">
|
||||
辅助视图不能直接设为母版;它会继承当前身份母版,不适合用来更换演员。
|
||||
</p>
|
||||
|
||||
Reference in new issue
Block a user