feat: 首帧卡片读取持久化质量状态并区分人工接受
This commit is contained in:
1 parent
e032dac0fd
commit
6b845924cf
1 file changed
+21
-3
@@ -2,6 +2,8 @@
|
||||
import IssueHint from '../../../components/ui/IssueHint.vue'
|
||||
import { productionMessage } from '../production-messages'
|
||||
import { computed } from 'vue'
|
||||
import { useQuery } from '../../../composables/useQuery'
|
||||
import { qualityApi } from '../quality-api'
|
||||
import { BadgeCheck } from '@lucide/vue'
|
||||
import { NAlert, NButton, NTag } from 'naive-ui'
|
||||
import { AssetImage, StatusBadge } from '../../../components/ui'
|
||||
@@ -12,6 +14,9 @@ import type { ShotKeyframe } from '../types'
|
||||
/** 首帧卡片统一主图标识、质量结论和晋升限制。 */
|
||||
const props = defineProps<{
|
||||
item: ShotKeyframe
|
||||
shotId: string
|
||||
/** 审核后递增以刷新持久化质量状态。 */
|
||||
reviewRevision?: number
|
||||
shotNo: number
|
||||
stale: boolean
|
||||
blocked: boolean
|
||||
@@ -19,13 +24,24 @@ const props = defineProps<{
|
||||
confirming: boolean
|
||||
}>()
|
||||
const emit = defineEmits<{ quality: []; select: []; confirm: []; cancel: [] }>()
|
||||
/** 质量状态以数据库为准;会话内检查仅在历史状态未知时兜底。 */
|
||||
const reviewKey = computed(() => props.item.status === 'completed'
|
||||
? JSON.stringify([props.shotId, props.item.id, props.reviewRevision ?? 0]) : '')
|
||||
const reviewQuery = useQuery(reviewKey, (value, signal) => {
|
||||
if (!value) return Promise.resolve(null)
|
||||
const [shotId, keyframeId] = JSON.parse(value) as [string, string, number]
|
||||
return qualityApi.keyframeQualityReview(shotId, keyframeId, signal)
|
||||
})
|
||||
const effectiveStatus = computed(() => reviewQuery.data.value?.effectiveQualityStatus ?? 'unknown')
|
||||
const isPassed = computed(() => effectiveStatus.value === 'passed' || effectiveStatus.value === 'manual_accepted' ||
|
||||
(effectiveStatus.value === 'unknown' && props.validationPassed === true))
|
||||
const canSelect = computed(
|
||||
() =>
|
||||
props.item.status === 'completed' &&
|
||||
!!props.item.imageUrl &&
|
||||
props.item.source !== 'provider_variant' &&
|
||||
!props.item.isPrimary &&
|
||||
props.validationPassed === true
|
||||
isPassed.value
|
||||
)
|
||||
</script>
|
||||
|
||||
@@ -45,8 +61,10 @@ const canSelect = computed(
|
||||
<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 v-if="effectiveStatus === 'manual_accepted'" size="small" type="success" :bordered="false">人工已接受</NTag>
|
||||
<NTag v-else-if="isPassed" size="small" type="success" :bordered="false">质量通过</NTag>
|
||||
<NTag v-else-if="effectiveStatus === 'needs_review'" size="small" type="warning" :bordered="false">待人工复核</NTag>
|
||||
<NTag v-else-if="effectiveStatus === 'failed' || (effectiveStatus === 'unknown' && validationPassed === false)" size="small" type="error" :bordered="false"
|
||||
>质量未通过</NTag
|
||||
>
|
||||
<NTag v-if="item.source === 'provider_variant'" size="small" :bordered="false">视频参考图</NTag>
|
||||
|
||||
Reference in new issue
Block a user