feat: 按质量结果管理主首帧候选
This commit is contained in:
1 parent
a72d96506a
commit
4298438219
6 files changed
+243
-88
No files matched your search
@@ -0,0 +1,73 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { BadgeCheck } from '@lucide/vue'
|
||||
import { NAlert, NButton, NTag } from 'naive-ui'
|
||||
import { AssetImage, StatusBadge } from '../../../components/ui'
|
||||
import { formatDate } from '../../../lib/format'
|
||||
import { productionStatusLabel } from '../model'
|
||||
import type { ShotKeyframe } from '../types'
|
||||
|
||||
/** 首帧卡片统一主图标识、质量结论和晋升限制。 */
|
||||
const props = defineProps<{
|
||||
item: ShotKeyframe
|
||||
shotNo: number
|
||||
stale: boolean
|
||||
blocked: boolean
|
||||
validationPassed: boolean | null
|
||||
confirming: boolean
|
||||
}>()
|
||||
const emit = defineEmits<{ quality: []; select: []; confirm: []; cancel: [] }>()
|
||||
const canSelect = computed(
|
||||
() =>
|
||||
props.item.status === 'completed' &&
|
||||
!!props.item.imageUrl &&
|
||||
props.item.source !== 'provider_variant' &&
|
||||
!props.item.isPrimary &&
|
||||
props.validationPassed === true
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<article class="keyframe-card">
|
||||
<div class="keyframe-image">
|
||||
<AssetImage
|
||||
:src="item.status === 'completed' ? item.imageUrl : null"
|
||||
:alt="`镜头 ${shotNo} 首帧`"
|
||||
preview
|
||||
:empty-text="item.status === 'failed' ? '首帧生成失败' : '首帧生成中'"
|
||||
/>
|
||||
<span v-if="item.isPrimary" class="primary-keyframe-mark" aria-label="当前主首帧" title="当前主首帧">
|
||||
<BadgeCheck :size="15" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="p-3">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<StatusBadge :status="item.status" :label="productionStatusLabel(item.status)" />
|
||||
<NTag v-if="validationPassed === true" size="small" type="success" :bordered="false">质量通过</NTag>
|
||||
<NTag v-else-if="validationPassed === false" size="small" type="error" :bordered="false"
|
||||
>质量未通过</NTag
|
||||
>
|
||||
<NTag v-if="item.source === 'provider_variant'" size="small" :bordered="false">模型输入变体</NTag>
|
||||
<NTag v-if="item.isPrimary && stale" size="small" :bordered="false">已过期</NTag>
|
||||
<span class="text-[10px] text-muted">{{ item.width || '—' }} × {{ item.height || '—' }}</span>
|
||||
</div>
|
||||
<p v-if="item.error" class="mt-2 line-clamp-3 text-xs text-danger">{{ item.error }}</p>
|
||||
<p class="mt-2 text-[10px] text-muted">{{ formatDate(item.createdAt) }}</p>
|
||||
<div v-if="item.status === 'completed' && item.imageUrl" class="mt-2 flex flex-wrap items-center gap-3">
|
||||
<NButton text size="small" @click="emit('quality')">
|
||||
{{ validationPassed === null ? '质量检查' : '重新检查' }}
|
||||
</NButton>
|
||||
<NButton v-if="canSelect" :disabled="blocked" text size="small" @click="emit('select')">
|
||||
设为主首帧
|
||||
</NButton>
|
||||
</div>
|
||||
<NAlert v-if="confirming" type="info" :show-icon="false" class="mt-2 text-xs">
|
||||
<p>该候选已通过本次质量检查。确认让后续视频使用此首帧?</p>
|
||||
<div class="mt-2 flex gap-3">
|
||||
<NButton type="primary" @click="emit('confirm')">确认切换</NButton>
|
||||
<NButton text size="small" @click="emit('cancel')">取消</NButton>
|
||||
</div>
|
||||
</NAlert>
|
||||
</div>
|
||||
</article>
|
||||
</template>
|
||||
Reference in new issue
Block a user