perf(short-drama-agent-front): 优化制作工作台交互与移动端布局
This commit is contained in:
1 parent
b5eaed3981
commit
54a381ebd3
37 files changed
+1217
-426
No files matched your search
@@ -4,9 +4,8 @@ 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'
|
||||
import { AssetImage, AssetOpenLink, StatusBadge } from '../../../components/ui'
|
||||
import { formatDate } from '../../../lib/format'
|
||||
import { productionStatusLabel } from '../model'
|
||||
import type { ShotKeyframe } from '../types'
|
||||
@@ -25,16 +24,21 @@ const props = defineProps<{
|
||||
}>()
|
||||
const emit = defineEmits<{ quality: []; select: []; confirm: []; cancel: []; history: [] }>()
|
||||
/** 质量状态以数据库为准;会话内检查仅在历史状态未知时兜底。 */
|
||||
const reviewKey = computed(() => props.item.status === 'completed'
|
||||
? JSON.stringify([props.shotId, props.item.id, props.reviewRevision ?? 0]) : '')
|
||||
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 isPassed = computed(
|
||||
() =>
|
||||
effectiveStatus.value === 'passed' ||
|
||||
effectiveStatus.value === 'manual_accepted' ||
|
||||
(effectiveStatus.value === 'unknown' && props.validationPassed === true)
|
||||
)
|
||||
const canSelect = computed(
|
||||
() =>
|
||||
props.item.status === 'completed' &&
|
||||
@@ -47,29 +51,44 @@ const canSelect = computed(
|
||||
|
||||
<template>
|
||||
<article class="keyframe-card">
|
||||
<div class="keyframe-image">
|
||||
<!-- 以下是首帧画面模块,主图身份通过下方文字标签说明 -->
|
||||
<div class="relative">
|
||||
<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>
|
||||
<AssetOpenLink :src="item.status === 'completed' ? item.imageUrl : null" label="打开图片" />
|
||||
</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="effectiveStatus === 'manual_accepted'" size="small" type="success" :bordered="false">人工已接受</NTag>
|
||||
<NTag v-if="item.source !== 'provider_variant'" size="small" :bordered="false">
|
||||
{{ item.isPrimary ? '主首帧' : '候选首帧' }}
|
||||
</NTag>
|
||||
<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 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>
|
||||
<NTag v-if="item.isPrimary && stale" size="small" :bordered="false">已过期</NTag>
|
||||
<span class="text-[10px] text-muted">{{ item.width || '—' }} × {{ item.height || '—' }}</span>
|
||||
<NTag v-if="item.isPrimary && stale" size="small" type="warning" :bordered="false">已过期</NTag>
|
||||
<!-- 以下是完整尺寸信息模块,数据缺失时隐藏 -->
|
||||
<span v-if="item.width && item.height" class="text-[10px] text-muted"
|
||||
>{{ item.width }} × {{ item.height }}</span
|
||||
>
|
||||
</div>
|
||||
<IssueHint v-if="item.error" :messages="[productionMessage(item.error)]" type="error" />
|
||||
<p class="mt-2 text-[10px] text-muted">{{ formatDate(item.createdAt) }}</p>
|
||||
@@ -77,7 +96,9 @@ const canSelect = computed(
|
||||
<NButton text size="small" @click="emit('quality')">
|
||||
{{ validationPassed === null ? '质量检查' : '重新检查' }}
|
||||
</NButton>
|
||||
<NButton v-if="item.status === 'completed'" text size="small" @click="emit('history')">查看首帧校验历史</NButton>
|
||||
<NButton v-if="item.status === 'completed'" text size="small" @click="emit('history')"
|
||||
>查看首帧校验历史</NButton
|
||||
>
|
||||
<NButton v-if="canSelect" :disabled="blocked" text size="small" @click="emit('select')">
|
||||
设为主首帧
|
||||
</NButton>
|
||||
|
||||
Reference in new issue
Block a user