feat(short-drama-agent-front): 接入摄影审核与首帧制作
This commit is contained in:
1 parent
3503926d62
commit
751106985e
32 files changed
+1970
-153
No files matched your search
@@ -3,7 +3,8 @@ import ContextNotice from '../../../components/ui/ContextNotice.vue'
|
||||
|
||||
import IssueHint from '../../../components/ui/IssueHint.vue'
|
||||
import { productionMessage } from '../production-messages'
|
||||
import { computed } from 'vue'
|
||||
import { useKeyframeVision } from '../keyframe-vision'
|
||||
import { computed, watch } from 'vue'
|
||||
import { useQuery } from '../../../composables/useQuery'
|
||||
import { qualityApi } from '../quality-api'
|
||||
import { NButton, NTag } from 'naive-ui'
|
||||
@@ -29,7 +30,29 @@ const props = defineProps<{
|
||||
confirming: boolean
|
||||
}>()
|
||||
/** 用户显式触发候选审核、确认或免费恢复。 */
|
||||
const emit = defineEmits<{ recover: []; quality: []; edit: []; select: []; confirm: []; cancel: []; history: [] }>()
|
||||
const emit = defineEmits<{
|
||||
recover: []
|
||||
quality: []
|
||||
edit: []
|
||||
select: []
|
||||
confirm: []
|
||||
cancel: []
|
||||
history: []
|
||||
settled: []
|
||||
}>()
|
||||
/** 每张可见候选可独立找回自己的审核任务。 */
|
||||
const visionKey = computed(() =>
|
||||
props.item.status === 'completed' ? JSON.stringify([props.shotId, props.item.id]) : ''
|
||||
)
|
||||
const vision = useKeyframeVision(visionKey)
|
||||
watch(
|
||||
() => vision.state.value.active,
|
||||
(active, previous) => {
|
||||
if (previous && !active && visionKey.value) emit('settled')
|
||||
}
|
||||
)
|
||||
/** 画幅不符的历史图保留浏览和只读审核记录。 */
|
||||
const wrongCanvas = computed(() => props.item.canvasDiagnosis?.status === 'mismatch')
|
||||
/** 质量状态以数据库为准;会话内检查仅在历史状态未知时兜底。 */
|
||||
const reviewKey = computed(() =>
|
||||
props.item.status === 'completed' ? JSON.stringify([props.shotId, props.item.id, props.reviewRevision ?? 0]) : ''
|
||||
@@ -51,11 +74,11 @@ const reviewLabels: Record<string, string> = {
|
||||
const isPassed = computed(
|
||||
() =>
|
||||
!props.stale &&
|
||||
!wrongCanvas.value &&
|
||||
props.item.inputSnapshotStatus !== 'invalid' &&
|
||||
(effectiveStatus.value === 'passed' ||
|
||||
effectiveStatus.value === 'manual_accepted' ||
|
||||
(effectiveStatus.value === 'unknown' && props.validationPassed === true))
|
||||
(effectiveStatus.value === 'passed' || effectiveStatus.value === 'manual_accepted')
|
||||
)
|
||||
/** 晋升入口只接受持久化通过和已结算审核。 */
|
||||
const canSelect = computed(
|
||||
() =>
|
||||
props.item.status === 'completed' &&
|
||||
@@ -64,7 +87,10 @@ const canSelect = computed(
|
||||
!props.item.isPrimary &&
|
||||
!props.stale &&
|
||||
props.item.inputSnapshotStatus !== 'invalid' &&
|
||||
isPassed.value
|
||||
isPassed.value &&
|
||||
!reviewQuery.error.value &&
|
||||
!vision.blocked.value &&
|
||||
!vision.state.value.resumable
|
||||
)
|
||||
</script>
|
||||
|
||||
@@ -120,6 +146,30 @@ const canSelect = computed(
|
||||
>{{ item.width }} × {{ item.height }}</span
|
||||
>
|
||||
</div>
|
||||
<!-- 以下是候选的来源、画幅与后台审核状态 -->
|
||||
<p v-if="item.provider || item.model" class="mt-2 wrap-anywhere text-xs text-muted">
|
||||
{{ [item.provider, item.model].filter(Boolean).join(' / ') }}
|
||||
</p>
|
||||
<p
|
||||
v-if="item.canvasDiagnosis && item.status === 'completed'"
|
||||
class="mt-2 text-xs"
|
||||
:class="wrongCanvas ? 'text-danger' : 'text-muted'"
|
||||
>
|
||||
{{
|
||||
wrongCanvas
|
||||
? `历史画幅 ${item.canvasDiagnosis.actual ?? '未知'} 与交付画幅 ${item.canvasDiagnosis.expected ?? '未知'} 不符,仅供查看。`
|
||||
: item.canvasDiagnosis.status === 'matched'
|
||||
? `匹配交付画幅 ${item.canvasDiagnosis.expected}`
|
||||
: '画幅尚未确认'
|
||||
}}
|
||||
</p>
|
||||
<p
|
||||
v-if="vision.state.value.active || vision.state.value.unknown || vision.uncertain.value"
|
||||
role="status"
|
||||
class="mt-2 text-xs text-muted"
|
||||
>
|
||||
{{ vision.state.value.active?.executionId ? '质量审核在后台进行' : '审核结果或费用待核查' }}
|
||||
</p>
|
||||
<IssueHint v-if="item.error" :messages="[productionMessage(item.error)]" type="error" />
|
||||
<!-- 以下是来源记录与独立的免费恢复入口 -->
|
||||
<p v-if="item.inputSnapshotStatus" class="mt-2 text-xs text-muted">
|
||||
@@ -153,11 +203,15 @@ const canSelect = computed(
|
||||
>
|
||||
<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 v-if="!wrongCanvas && !stale" text size="small" @click="emit('quality')">
|
||||
{{
|
||||
vision.state.value.active || vision.state.value.unknown || vision.uncertain.value
|
||||
? '查看审核进度'
|
||||
: '质量检查'
|
||||
}}
|
||||
</NButton>
|
||||
<NButton
|
||||
v-if="item.source !== 'provider_variant'"
|
||||
v-if="item.source !== 'provider_variant' && !wrongCanvas && !stale"
|
||||
text
|
||||
size="small"
|
||||
:disabled="blocked"
|
||||
@@ -172,10 +226,10 @@ const canSelect = computed(
|
||||
设为主首帧
|
||||
</NButton>
|
||||
</div>
|
||||
<ContextNotice v-if="confirming" type="info" :show-icon="false" class="mt-2 text-xs">
|
||||
<ContextNotice v-if="confirming && canSelect" 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 type="primary" :disabled="blocked" @click="emit('confirm')">确认切换</NButton>
|
||||
<NButton text size="small" @click="emit('cancel')">取消</NButton>
|
||||
</div>
|
||||
</ContextNotice>
|
||||
|
||||
Reference in new issue
Block a user