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
@@ -24,6 +24,7 @@ import { productionStatusLabel } from './model'
|
||||
import { useProduction } from './useProduction'
|
||||
import ProductionReceipt from './components/ProductionReceipt.vue'
|
||||
import ShotProductionAssets from './components/ShotProductionAssets.vue'
|
||||
import ActionMenu from '../../components/ui/ActionMenu.vue'
|
||||
import AdvancedProduction from './components/AdvancedProduction.vue'
|
||||
import StaleKeyframeNotice from './components/StaleKeyframeNotice.vue'
|
||||
import { routeLocationKey } from 'vue-router'
|
||||
@@ -70,6 +71,14 @@ const {
|
||||
promptExecution,
|
||||
videoExecution
|
||||
} = useProduction()
|
||||
/** 当前镜头资产组件引用,标题菜单仅操作此镜头的只读检查弹窗。 */
|
||||
const shotAssetsRef = ref<InstanceType<typeof ShotProductionAssets> | null>(null)
|
||||
/** 标题状态只描述最近视频任务,不能表示质量通过或当前主视频仍可用。 */
|
||||
const latestVideoTaskLabel = computed(() =>
|
||||
videoStatusItem.value?.status === 'completed'
|
||||
? '最近视频任务:生成完成'
|
||||
: `最近视频任务:${productionStatusLabel(videoStatusItem.value?.status ?? 'not_started')}`
|
||||
)
|
||||
/** 首帧质量任务在关闭弹窗后仍可观察,刷新页面后恢复持久化句柄。 */
|
||||
const keyframeQualityExecution = useWorkflowExecution(id, 'keyframe-quality')
|
||||
|
||||
@@ -254,7 +263,7 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<WorkspacePage split compact class="production-workspace-page"
|
||||
<WorkspacePage split compact mobile-scroll class="production-workspace-page compact-shot-workspace"
|
||||
><template #header
|
||||
><div class="workspace-toolbar">
|
||||
<div class="toolbar-episode">
|
||||
@@ -278,7 +287,17 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
|
||||
></span
|
||||
>
|
||||
<div class="toolbar-actions">
|
||||
<NButton :disabled="blocked || !episodeNo" @click="qualityOpen = true">首帧质量生成</NButton>
|
||||
<!-- 以下是移动端图标入口模块,桌面保留完整文字,手机保留中文无障碍说明 -->
|
||||
<NButton
|
||||
class="mobile-toolbar-icon"
|
||||
:disabled="blocked || !episodeNo"
|
||||
aria-label="首帧质量生成"
|
||||
title="首帧质量生成"
|
||||
@click="qualityOpen = true"
|
||||
>
|
||||
<Image :size="18" class="mobile-action-icon" />
|
||||
<span class="workspace-action-label">首帧质量生成</span>
|
||||
</NButton>
|
||||
|
||||
<WorkspaceTools
|
||||
v-model:open="toolsOpen"
|
||||
@@ -696,10 +715,11 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
|
||||
}}<span v-if="query.data.value"> 当前保留上次读取的数据,生产操作已暂停。</span></NAlert
|
||||
></NScrollbar
|
||||
>
|
||||
<!-- 以下是需要处理的项目状态摘要模块,数量为零的项目不占空间 -->
|
||||
<div v-if="staleKeyframes || staleVideos || identityBlocked" class="workspace-inline-status">
|
||||
<span
|
||||
>首帧待更新 {{ staleKeyframes }} · 视频待更新 {{ staleVideos }} · 身份待确认 {{ identityBlocked }}</span
|
||||
>
|
||||
<span v-if="staleKeyframes">首帧待更新 {{ staleKeyframes }}</span>
|
||||
<span v-if="staleVideos">视频待更新 {{ staleVideos }}</span>
|
||||
<span v-if="identityBlocked">身份待确认 {{ identityBlocked }}</span>
|
||||
</div>
|
||||
<div v-if="shots.length" class="panel production-workspace workspace-surface">
|
||||
<nav class="production-shot-list directory-panel" aria-label="本集生产镜头">
|
||||
@@ -763,22 +783,37 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
|
||||
</NScrollbar>
|
||||
</nav>
|
||||
<article class="production-detail min-w-0">
|
||||
<NScrollbar v-if="shot" class="panel-scroll" content-class="p-5 lg:p-7">
|
||||
<NScrollbar v-if="shot" class="panel-scroll" content-class="shot-detail-content p-5 lg:p-7">
|
||||
<header class="mb-5 pb-5">
|
||||
<NAlert v-if="linkedShotMissing" type="warning" :show-icon="false" class="mb-4"
|
||||
>链接中的镜头已不存在或不属于该剧集,请在左侧重新选择。</NAlert
|
||||
>
|
||||
<div class="flex flex-wrap items-start justify-between gap-3">
|
||||
<div>
|
||||
<p class="eyebrow">段落 {{ shot.beatNo }} · 镜头 {{ shot.shotNo }}</p>
|
||||
<h3 class="mt-2 text-lg font-semibold">{{ shot.title }}</h3>
|
||||
</div>
|
||||
<!-- 以下是镜头编号与最近视频任务状态模块,分别对齐左右边缘 -->
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<p class="eyebrow">段落 {{ shot.beatNo }} · 镜头 {{ shot.shotNo }}</p>
|
||||
<StatusBadge
|
||||
v-if="videoStatusItem"
|
||||
:status="videoStatusItem.status"
|
||||
:label="productionStatusLabel(videoStatusItem.status)"
|
||||
:label="latestVideoTaskLabel"
|
||||
/>
|
||||
</div>
|
||||
<!-- 以下是镜头标题与低频生成检查菜单模块,菜单固定在标题行最右侧 -->
|
||||
<div class="mt-2 flex items-center justify-between gap-3">
|
||||
<h3 class="min-w-0 flex-1 break-words text-lg font-semibold">{{ shot.title }}</h3>
|
||||
<div class="shrink-0">
|
||||
<ActionMenu
|
||||
label="镜头资产更多操作"
|
||||
:items="[
|
||||
{
|
||||
key: 'specs',
|
||||
label: '检查生成规格与模型限制',
|
||||
disabled: !shotAssetsRef || shotAssetsRef.inspecting
|
||||
}
|
||||
]"
|
||||
@select="shotAssetsRef?.inspectSpecs()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="shot.description" class="mt-3 text-sm leading-7">{{ shot.description }}</p>
|
||||
<NAlert
|
||||
v-if="videoStatusItem?.status === 'failed'"
|
||||
@@ -817,6 +852,7 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
|
||||
</NAlert>
|
||||
</header>
|
||||
<ShotProductionAssets
|
||||
ref="shotAssetsRef"
|
||||
:key="shot.shotId"
|
||||
:project-id="id"
|
||||
:shot="shot"
|
||||
@@ -994,22 +1030,9 @@ const videoRules = { videoLimit: integerRule('本批镜头上限'), videoRepairA
|
||||
}
|
||||
}
|
||||
@media (max-width: 760px) {
|
||||
/* 移动端隐藏可由镜头目录获知的重复统计,并让操作从左侧连续排列。 */
|
||||
.production-workspace-page .workspace-toolbar {
|
||||
@apply grid grid-cols-[minmax(0,_1fr)] gap-2;
|
||||
}
|
||||
.production-workspace-page .toolbar-episode,
|
||||
.production-workspace-page .toolbar-actions {
|
||||
@apply w-full min-w-0 m-0;
|
||||
}
|
||||
.production-workspace-page .toolbar-summary {
|
||||
@apply hidden;
|
||||
}
|
||||
.production-workspace-page .toolbar-actions {
|
||||
@apply justify-start;
|
||||
}
|
||||
/* 手机目录按实际内容占高,将剩余空间交给镜头正文。 */
|
||||
.production-workspace {
|
||||
@apply grid-cols-[minmax(0,_1fr)] grid-rows-[184px_minmax(0,_1fr)] gap-3;
|
||||
@apply grid-cols-[minmax(0,_1fr)] grid-rows-[auto_minmax(0,_1fr)] gap-2;
|
||||
}
|
||||
.production-pipeline {
|
||||
@apply grid-cols-[1fr];
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -157,9 +157,11 @@ async function loadPreview() {
|
||||
:bordered="false"
|
||||
:type="preview.specConsistencySummary?.hasWarnings ? 'warning' : 'success'"
|
||||
>
|
||||
{{ preview.specConsistencySummary?.hasWarnings
|
||||
? `发现 ${preview.specConsistencySummary.warningCount} 项预警`
|
||||
: '检查通过' }}
|
||||
{{
|
||||
preview.specConsistencySummary?.hasWarnings
|
||||
? `发现 ${preview.specConsistencySummary.warningCount} 项预警`
|
||||
: '检查通过'
|
||||
}}
|
||||
</NTag>
|
||||
<span class="text-muted">仅提示,不阻止生成</span>
|
||||
</div>
|
||||
|
||||
@@ -18,11 +18,11 @@ const props = defineProps<{
|
||||
keyframeId: string
|
||||
/** 正在执行其他镜头操作时禁止提交审核。 */
|
||||
disabled?: boolean
|
||||
/** 在独立弹窗内直接展示内容,无需再次点击展开。 */
|
||||
/** 在独立弹窗内直接展示内容,并隐藏内部标题、说明与操作栏。 */
|
||||
initialOpen?: boolean
|
||||
}>()
|
||||
const emit = defineEmits<{ reviewed: [] }>()
|
||||
/** 默认折叠,仅展开后查询。 */
|
||||
/** 普通入口展开后查询,独立弹窗打开时直接查询。 */
|
||||
const open = ref(props.initialOpen ?? false)
|
||||
/** 查询键包含全部归属信息,旧请求会被取消。 */
|
||||
const key = computed(() =>
|
||||
@@ -44,13 +44,14 @@ const reviewQuery = useQuery(key, (value, signal) => {
|
||||
return qualityApi.keyframeQualityReview(shotId, keyframeId, signal)
|
||||
})
|
||||
const review = computed(() => reviewQuery.data.value)
|
||||
const decisionLabel = (value: string) => ({
|
||||
passed: 'AI 校验通过',
|
||||
failed: 'AI 校验未通过',
|
||||
needs_review: '需要人工复核',
|
||||
manual_accepted: '人工已接受',
|
||||
unknown: '未校验'
|
||||
})[value] ?? value
|
||||
const decisionLabel = (value: string) =>
|
||||
({
|
||||
passed: 'AI 校验通过',
|
||||
failed: 'AI 校验未通过',
|
||||
needs_review: '需要人工复核',
|
||||
manual_accepted: '人工已接受',
|
||||
unknown: '未校验'
|
||||
})[value] ?? value
|
||||
const reviewAction = ref<'accepted' | 'rejected' | null>(null)
|
||||
const reviewReason = ref('')
|
||||
const reviewer = ref('user')
|
||||
@@ -60,8 +61,15 @@ const submitSuccess = ref('')
|
||||
|
||||
/** 人工接受必须先执行最新安全预检查;任何写入都需要明确按钮操作。 */
|
||||
async function submitReview() {
|
||||
if (!reviewAction.value || !review.value?.validationTaskId || !reviewReason.value.trim() ||
|
||||
!reviewer.value.trim() || submitting.value || props.disabled) return
|
||||
if (
|
||||
!reviewAction.value ||
|
||||
!review.value?.validationTaskId ||
|
||||
!reviewReason.value.trim() ||
|
||||
!reviewer.value.trim() ||
|
||||
submitting.value ||
|
||||
props.disabled
|
||||
)
|
||||
return
|
||||
submitting.value = true
|
||||
submitError.value = ''
|
||||
submitSuccess.value = ''
|
||||
@@ -107,26 +115,37 @@ const records = computed(() =>
|
||||
<!-- 以下是首帧已有校验记录的只读查询模块 -->
|
||||
<ReadonlyInspection
|
||||
v-model:open="open"
|
||||
:collapsible="!initialOpen"
|
||||
:show-header="!initialOpen"
|
||||
title="首帧校验历史"
|
||||
description="查看记录不收费;设置主首帧前仍需完成本次检查。"
|
||||
:loading="query.loading.value"
|
||||
:error="query.error.value"
|
||||
@refresh="() => { query.refresh(); reviewQuery.refresh() }"
|
||||
@refresh="
|
||||
() => {
|
||||
query.refresh()
|
||||
reviewQuery.refresh()
|
||||
}
|
||||
"
|
||||
>
|
||||
<section v-if="review" class="panel p-3 text-xs leading-6">
|
||||
<p class="font-semibold">当前质量复核</p>
|
||||
<p>原始模型判定:{{ decisionLabel(review.qualityDecision) }}</p>
|
||||
<p>当前有效状态:{{ decisionLabel(review.effectiveQualityStatus) }}</p>
|
||||
<p v-if="review.manualReview">
|
||||
人工审核:{{ review.manualReview.decision === 'accepted' ? '已接受' : '已拒绝' }}
|
||||
· {{ review.manualReview.reason || '未填写理由' }}
|
||||
人工审核:{{ review.manualReview.decision === 'accepted' ? '已接受' : '已拒绝' }} ·
|
||||
{{ review.manualReview.reason || '未填写理由' }}
|
||||
</p>
|
||||
<p v-else-if="review.manualReviewAvailable" class="text-muted">
|
||||
已发现可人工复核的证据分歧;当前仅展示信息,不会自动接受候选。
|
||||
</p>
|
||||
<div v-for="(item, index) in review.historicalGazePreview" :key="index" class="mt-2 bg-muted/10 p-2">
|
||||
<p>{{ item.subjectRef }} → {{ item.targetDescription }}:{{ decisionLabel(item.decision) }}</p>
|
||||
<p>结构判断:{{ item.physicalAlignment || '未知' }};独立观察:{{ item.observationCertainty || '未知' }}</p>
|
||||
<p>
|
||||
结构判断:{{ item.physicalAlignment || '未知' }};独立观察:{{
|
||||
item.observationCertainty || '未知'
|
||||
}}
|
||||
</p>
|
||||
<p class="text-muted">{{ item.reason }}</p>
|
||||
</div>
|
||||
</section>
|
||||
@@ -134,17 +153,37 @@ const records = computed(() =>
|
||||
<p class="font-semibold">人工复核</p>
|
||||
<p class="mt-2 text-muted">请先预览候选图片并确认视觉效果。接受会替换当前主首帧,拒绝只保存审核记录。</p>
|
||||
<div class="mt-3 flex flex-wrap gap-2">
|
||||
<NButton size="small" :disabled="disabled || submitting" @click="reviewAction = 'accepted'">人工接受</NButton>
|
||||
<NButton size="small" :disabled="disabled || submitting" @click="reviewAction = 'rejected'">人工拒绝</NButton>
|
||||
<NButton size="small" :disabled="disabled || submitting" @click="reviewAction = 'accepted'"
|
||||
>人工接受</NButton
|
||||
>
|
||||
<NButton size="small" :disabled="disabled || submitting" @click="reviewAction = 'rejected'"
|
||||
>人工拒绝</NButton
|
||||
>
|
||||
</div>
|
||||
<div v-if="reviewAction" class="mt-3 space-y-3">
|
||||
<NInput v-model:value="reviewer" placeholder="审核人" :disabled="submitting" />
|
||||
<NInput v-model:value="reviewReason" type="textarea" :rows="3" placeholder="填写审核理由(必填)" :disabled="submitting" />
|
||||
<NInput
|
||||
v-model:value="reviewReason"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="填写审核理由(必填)"
|
||||
:disabled="submitting"
|
||||
/>
|
||||
<NAlert :type="reviewAction === 'accepted' ? 'warning' : 'info'" :show-icon="false">
|
||||
{{ reviewAction === 'accepted' ? '确认接受后将替换当前主首帧;AI 原始失败记录仍会保留。' : '拒绝后保留图片及原始质量记录。' }}
|
||||
{{
|
||||
reviewAction === 'accepted'
|
||||
? '确认接受后将替换当前主首帧;AI 原始失败记录仍会保留。'
|
||||
: '拒绝后保留图片及原始质量记录。'
|
||||
}}
|
||||
</NAlert>
|
||||
<div class="flex gap-3">
|
||||
<NButton type="primary" :loading="submitting" :disabled="!reviewReason.trim() || !reviewer.trim()" @click="submitReview">确认{{ reviewAction === 'accepted' ? '接受' : '拒绝' }}</NButton>
|
||||
<NButton
|
||||
type="primary"
|
||||
:loading="submitting"
|
||||
:disabled="!reviewReason.trim() || !reviewer.trim()"
|
||||
@click="submitReview"
|
||||
>确认{{ reviewAction === 'accepted' ? '接受' : '拒绝' }}</NButton
|
||||
>
|
||||
<NButton :disabled="submitting" @click="reviewAction = null">取消</NButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import { NTag } from 'naive-ui'
|
||||
import StatusBadge from '../../../components/ui/StatusBadge.vue'
|
||||
import IssueHint from '../../../components/ui/IssueHint.vue'
|
||||
|
||||
/** 三个生产阶段共用的状态与原因入口参数。 */
|
||||
defineProps<{
|
||||
/** 后端返回的当前阶段状态。 */
|
||||
status?: string
|
||||
/** 状态的中文显示名称。 */
|
||||
label?: string
|
||||
/** 需要优先展示的过期或更新警告。 */
|
||||
warningLabel?: string
|
||||
/** 当前状态对应的原因说明,没有原因时隐藏入口。 */
|
||||
messages: string[]
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 以下是同一行展示状态与查看原因入口的公共模块 -->
|
||||
<div class="flex flex-wrap items-center justify-end gap-x-3 gap-y-2">
|
||||
<NTag v-if="warningLabel" size="small" type="warning" :bordered="false">{{ warningLabel }}</NTag>
|
||||
<StatusBadge v-else-if="status" :status="status" :label="label" />
|
||||
<IssueHint :messages="messages" inline />
|
||||
</div>
|
||||
</template>
|
||||
@@ -4,20 +4,18 @@ import { useActionMessage } from '../../../components/ui/useActionMessage'
|
||||
import ProviderInputInspector from './ProviderInputInspector.vue'
|
||||
import { NAlert, NButton, NCollapse, NCollapseItem, NSelect, NTag } from 'naive-ui'
|
||||
import { computed, onScopeDispose, ref, watch } from 'vue'
|
||||
import { ExternalLink, ImagePlus, RefreshCw } from '@lucide/vue'
|
||||
import { AssetImage, StatusBadge } from '../../../components/ui'
|
||||
import { ImagePlus, RefreshCw } from '@lucide/vue'
|
||||
import { AssetImage } from '../../../components/ui'
|
||||
import { usePolling } from '../../../composables/usePolling'
|
||||
import { useQuery } from '../../../composables/useQuery'
|
||||
import { mediaAssetUrl } from '../../../lib/assets'
|
||||
import { errorMessage } from '../../../lib/http'
|
||||
import { formatDate } from '../../../lib/format'
|
||||
import type { DesignedShot } from '../../storyboard/types'
|
||||
import { storyboardApi } from '../../storyboard/api'
|
||||
import ConfirmAction from '../../workflows/ConfirmAction.vue'
|
||||
import { runOperation } from '../../workflows/operations'
|
||||
import { productionApi } from '../api'
|
||||
import { qualityApi } from '../quality-api'
|
||||
import { isActiveVideo, primaryKeyframe, primaryVideo, productionStatusLabel, videoQualityStatusLabel } from '../model'
|
||||
import { isActiveVideo, primaryKeyframe, primaryVideo, productionStatusLabel, videoRecordedValidation } from '../model'
|
||||
import { productionIssueText, productionMessage } from '../production-messages'
|
||||
import type {
|
||||
GenerateKeyframeInput,
|
||||
@@ -29,10 +27,11 @@ import type {
|
||||
} from '../types'
|
||||
import KeyframeDialog from './KeyframeDialog.vue'
|
||||
import KeyframeCard from './KeyframeCard.vue'
|
||||
import VideoCard from './VideoCard.vue'
|
||||
import ProductionStageStatus from './ProductionStageStatus.vue'
|
||||
import QualityDialog from './QualityDialog.vue'
|
||||
import VideoQualityDiagnostics from './VideoQualityDiagnostics.vue'
|
||||
import KeyframeValidationHistory from './KeyframeValidationHistory.vue'
|
||||
import ActionMenu from '../../../components/ui/ActionMenu.vue'
|
||||
import { AppDialog } from '../../../components/ui'
|
||||
import ModelCapabilities from './ModelCapabilities.vue'
|
||||
import type { QualityTarget } from '../quality.types'
|
||||
@@ -138,10 +137,19 @@ const currentVideoInput = computed(() =>
|
||||
)
|
||||
const keyframes = computed(() => query.data.value?.keyframes ?? [])
|
||||
const videos = computed(() => query.data.value?.videos ?? [])
|
||||
/** 当前镜头尚未结束的首帧任务数量,包含等待提交和生成中。 */
|
||||
const activeKeyframeCount = computed(
|
||||
() => keyframes.value.filter(item => ['pending', 'generating'].includes(item.status)).length
|
||||
)
|
||||
/** 当前镜头尚未结束的视频任务数量,包含等待提交、排队和生成中。 */
|
||||
const activeVideoCount = computed(() => videos.value.filter(isActiveVideo).length)
|
||||
const videoQualityStatus = computed(() => query.data.value?.qualityStatus ?? null)
|
||||
const videoInputPlan = computed(() => query.data.value?.inputPlan ?? null)
|
||||
const currentKeyframe = computed(() => primaryKeyframe(keyframes.value))
|
||||
/** 主区只展示正式成功主视频,不用候选代替尚未确认的主视频。 */
|
||||
const currentVideo = computed(() => primaryVideo(videos.value))
|
||||
/** 其它视频记录统一放入候选弹窗,包含生成中和失败记录。 */
|
||||
const videoCandidates = computed(() => videos.value.filter(item => item.id !== currentVideo.value?.id))
|
||||
const activeVideo = computed(() => videos.value.find(isActiveVideo))
|
||||
const assetBlocked = computed(() => props.disabled || !!query.error.value)
|
||||
/**
|
||||
@@ -158,6 +166,14 @@ watch(
|
||||
)
|
||||
const qualityOpen = ref(false)
|
||||
const candidatesOpen = ref(false)
|
||||
/** 视频候选仅在用户打开弹窗后展示。 */
|
||||
const videoCandidatesOpen = ref(false)
|
||||
/** 仅点击视频卡片入口后显示已有质量记录。 */
|
||||
const videoHistoryOpen = ref(false)
|
||||
/** 当前查看记录的视频 ID,按资产隔离主视频和候选。 */
|
||||
const videoHistoryId = ref('')
|
||||
/** 记录弹窗中的视频是否为需要更新的当前主视频。 */
|
||||
const videoHistoryStale = computed(() => videoHistoryId.value === currentVideo.value?.id && videoStale.value)
|
||||
const qualityTarget = ref<QualityTarget | null>(null)
|
||||
const specsOpen = ref(false)
|
||||
const generationCatalog = ref<GenerationModelCatalog | null>(null)
|
||||
@@ -197,9 +213,14 @@ watch(
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
/** 从实际候选打开质量面板,保留单镜头主操作。 */
|
||||
/**
|
||||
* 从实际候选打开质量面板,先关闭候选弹窗,避免遮挡费用与操作确认。
|
||||
* @param kind 需要检查的资产种类
|
||||
* @param assetId 当前选中的真实资产编号
|
||||
*/
|
||||
function openQuality(kind: 'keyframe' | 'video', assetId: string) {
|
||||
candidatesOpen.value = false
|
||||
videoCandidatesOpen.value = false
|
||||
qualityTarget.value = {
|
||||
kind,
|
||||
shotId: props.shot.shotId,
|
||||
@@ -208,6 +229,15 @@ function openQuality(kind: 'keyframe' | 'video', assetId: string) {
|
||||
}
|
||||
qualityOpen.value = true
|
||||
}
|
||||
/**
|
||||
* 从主视频或候选卡片打开只读记录,关闭候选弹窗以避免弹窗叠加。
|
||||
* @param videoId 当前选中视频 ID
|
||||
*/
|
||||
function openVideoHistory(videoId: string) {
|
||||
videoCandidatesOpen.value = false
|
||||
videoHistoryId.value = videoId
|
||||
videoHistoryOpen.value = true
|
||||
}
|
||||
/** 只打开当前镜头的有限质量重跑表单,费用确认后才发送任务。 */
|
||||
function openShotKeyframeQuality() {
|
||||
if (!props.episodeNo || !canGenerateKeyframe.value) return
|
||||
@@ -221,7 +251,12 @@ function openShotKeyframeQuality() {
|
||||
}
|
||||
/** 当前查看历史的候选 ID;历史记录在独立弹窗内按候选隔离。 */
|
||||
const historyKeyframeId = ref('')
|
||||
/** 首帧校验历史弹窗的显示状态。 */
|
||||
const historyOpen = ref(false)
|
||||
/**
|
||||
* 打开指定首帧的校验历史,供主首帧与候选卡片共用。
|
||||
* @param keyframeId 需要查看历史的首帧 ID
|
||||
*/
|
||||
function openKeyframeHistory(keyframeId: string) {
|
||||
historyKeyframeId.value = keyframeId
|
||||
historyOpen.value = true
|
||||
@@ -254,9 +289,9 @@ const canGenerateVideo = computed(
|
||||
)
|
||||
const keyframeStale = computed(() => !!props.keyframeReadiness?.primaryKeyframeStale)
|
||||
/** 当前主首帧的持久化质量状态,避免会话缓存与按钮状态冲突。 */
|
||||
const primaryQualityKey = computed(() => currentKeyframe.value
|
||||
? JSON.stringify([props.shot.shotId, currentKeyframe.value.id, reviewRevision.value])
|
||||
: '')
|
||||
const primaryQualityKey = computed(() =>
|
||||
currentKeyframe.value ? JSON.stringify([props.shot.shotId, currentKeyframe.value.id, reviewRevision.value]) : ''
|
||||
)
|
||||
const primaryQualityQuery = useQuery(primaryQualityKey, (value, signal) => {
|
||||
if (!value) return Promise.resolve(null)
|
||||
const [shotId, keyframeId] = JSON.parse(value) as [string, string, number]
|
||||
@@ -273,6 +308,19 @@ async function refreshAfterReview() {
|
||||
await refreshAll()
|
||||
}
|
||||
const keyframeCandidates = computed(() => keyframes.value.filter(item => item.id !== currentKeyframe.value?.id))
|
||||
/**
|
||||
* 按候选数量计算弹窗宽度,每项 260px,每行最多五项,预留间距和左右内边距。
|
||||
* @param count 当前候选数量
|
||||
* @returns 弹窗的期望宽度,单位为像素
|
||||
*/
|
||||
function candidateDialogWidth(count: number): number {
|
||||
const columns = Math.max(1, Math.min(5, count))
|
||||
return columns * 260 + (columns - 1) * 12 + 48
|
||||
}
|
||||
/** 首帧弹窗按当前候选数适配一至五列,实际宽度由公共弹窗限制在视口内。 */
|
||||
const keyframeCandidatesWidth = computed(() => candidateDialogWidth(keyframeCandidates.value.length))
|
||||
/** 视频弹窗与首帧共用固定列宽,少量候选不留多余的整列空白。 */
|
||||
const videoCandidatesWidth = computed(() => candidateDialogWidth(videoCandidates.value.length))
|
||||
/** 仅用于本会话即时提示;最终质量判定以持久化审核结果为准。 */
|
||||
function keyframePassed(assetId: string) {
|
||||
return sessionKeyframePassed(props.projectId, props.shot.shotId, assetId)
|
||||
@@ -287,16 +335,14 @@ watch(key, () => {
|
||||
historyOpen.value = false
|
||||
historyKeyframeId.value = ''
|
||||
confirmingVideo.value = ''
|
||||
videoCandidatesOpen.value = false
|
||||
videoHistoryOpen.value = false
|
||||
videoHistoryId.value = ''
|
||||
keyframeSpec.value = null
|
||||
videoSpec.value = null
|
||||
specError.value = ''
|
||||
})
|
||||
|
||||
/** 只返回通过协议和 /storage 限制的视频地址。 */
|
||||
function safeVideoUrl(value: string | null): string | null {
|
||||
return value ? mediaAssetUrl(value) : null
|
||||
}
|
||||
|
||||
/** 重新读取单镜头资产,并通知父页刷新项目就绪状态。 */
|
||||
async function refreshAll() {
|
||||
await Promise.all([query.refresh(), promptQuery.refresh(), videoInputQuery.refresh()])
|
||||
@@ -433,38 +479,28 @@ async function inspectSpecs() {
|
||||
specError.value = [...new Set(errors)].join(' ')
|
||||
inspecting.value = false
|
||||
}
|
||||
/** 将只读检查入口与读取状态交给镜头标题行,保留弹窗在资产组件内管理。 */
|
||||
defineExpose({ inspectSpecs, inspecting })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="production-assets">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<div>
|
||||
<h4 class="text-sm font-semibold">镜头生产资产</h4>
|
||||
</div>
|
||||
<div class="flex gap-3">
|
||||
<ActionMenu
|
||||
label="镜头资产更多操作"
|
||||
:items="[{ key: 'specs', label: '检查生成规格与模型限制', disabled: inspecting }]"
|
||||
@select="inspectSpecs"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<NAlert v-if="query.error.value" role="alert" type="error" :show-icon="false" class="mt-4"
|
||||
>{{ query.error.value }} 当前保留上次成功读取的资产,操作已暂停。
|
||||
</NAlert>
|
||||
|
||||
<div class="production-stage mt-5">
|
||||
<div class="production-stage">
|
||||
<div class="production-stage-heading">
|
||||
<div>
|
||||
<h5 class="text-sm font-medium">01 · 视频提示词</h5>
|
||||
</div>
|
||||
<StatusBadge
|
||||
v-if="promptReadiness"
|
||||
:status="promptReadiness.status"
|
||||
:label="productionStatusLabel(promptReadiness.status)"
|
||||
<!-- 以下是视频提示词状态与对应原因入口模块 -->
|
||||
<ProductionStageStatus
|
||||
:status="promptReadiness?.status"
|
||||
:label="promptReadiness ? productionStatusLabel(promptReadiness.status) : undefined"
|
||||
:messages="(promptReadiness?.issues ?? []).map(productionIssueText)"
|
||||
/>
|
||||
</div>
|
||||
<IssueHint :messages="(promptReadiness?.issues ?? []).map(productionIssueText)" />
|
||||
<div v-if="savedPrompt?.videoPrompt" class="surface-inset mt-4 p-4" aria-label="本镜视频提示词">
|
||||
<p class="text-xs font-medium">本镜视频提示词</p>
|
||||
<p class="mt-3 whitespace-pre-wrap break-words text-sm leading-6">{{ savedPrompt.videoPrompt }}</p>
|
||||
@@ -506,13 +542,15 @@ async function inspectSpecs() {
|
||||
<div>
|
||||
<h5 class="text-sm font-medium">02 · 首帧</h5>
|
||||
</div>
|
||||
<StatusBadge
|
||||
v-if="keyframeReadiness"
|
||||
:status="keyframeReadiness.status"
|
||||
:label="keyframeStale ? '主首帧已过期' : productionStatusLabel(keyframeReadiness.status)"
|
||||
<!-- 以下是首帧状态与对应原因入口模块,过期使用警告色 -->
|
||||
<ProductionStageStatus
|
||||
:status="keyframeReadiness?.status"
|
||||
:label="keyframeReadiness ? productionStatusLabel(keyframeReadiness.status) : undefined"
|
||||
:warning-label="keyframeStale ? '主首帧已过期' : undefined"
|
||||
:messages="(keyframeReadiness?.issues ?? []).map(productionIssueText)"
|
||||
/>
|
||||
</div>
|
||||
<IssueHint :messages="(keyframeReadiness?.issues ?? []).map(productionIssueText)" />
|
||||
<!-- 以下是主首帧卡片模块,校验历史通过卡片入口在弹窗内查看 -->
|
||||
<div v-if="currentKeyframe" class="keyframe-grid mt-4">
|
||||
<KeyframeCard
|
||||
:shot-id="shot.shotId"
|
||||
@@ -524,18 +562,10 @@ async function inspectSpecs() {
|
||||
:validation-passed="keyframePassed(currentKeyframe.id)"
|
||||
:confirming="false"
|
||||
@quality="openQuality('keyframe', currentKeyframe.id)"
|
||||
@history="openKeyframeHistory(currentKeyframe.id)"
|
||||
/>
|
||||
</div>
|
||||
<p v-else class="mt-4 text-xs text-muted">尚无已确认主首帧。请生成候选,完成质量检查后再设为主首帧。</p>
|
||||
<!-- 以下是当前主首帧的只读视觉校验历史模块 -->
|
||||
<KeyframeValidationHistory
|
||||
v-if="currentKeyframe"
|
||||
:key="currentKeyframe.id"
|
||||
:project-id="projectId"
|
||||
:shot-id="shot.shotId"
|
||||
:keyframe-id="currentKeyframe.id"
|
||||
class="mt-3"
|
||||
/>
|
||||
<NAlert
|
||||
v-if="currentKeyframe && keyframePassed(currentKeyframe.id) === false"
|
||||
type="error"
|
||||
@@ -554,6 +584,10 @@ async function inspectSpecs() {
|
||||
<NButton v-if="keyframeCandidates.length" @click="candidatesOpen = true">
|
||||
管理候选({{ keyframeCandidates.length }})
|
||||
</NButton>
|
||||
<!-- 以下是首帧候选任务进行中的数量提示模块 -->
|
||||
<NTag v-if="activeKeyframeCount" size="small" type="warning" :bordered="false" role="status">
|
||||
首帧任务进行中({{ activeKeyframeCount }})
|
||||
</NTag>
|
||||
<NButton :disabled="!canGenerateKeyframe" @click="keyframeOpen = true"
|
||||
><ImagePlus :size="14" />{{
|
||||
keyframeStale ? '生成替代候选' : currentKeyframe ? '再生成一张候选' : '生成首帧候选'
|
||||
@@ -567,10 +601,12 @@ async function inspectSpecs() {
|
||||
<div>
|
||||
<h5 class="text-sm font-medium">03 · 视频</h5>
|
||||
</div>
|
||||
<StatusBadge
|
||||
v-if="videoReadiness"
|
||||
:status="videoReadiness.status"
|
||||
:label="videoStale ? '主视频已过期' : productionStatusLabel(videoReadiness.status)"
|
||||
<!-- 以下是视频状态与对应原因入口模块,需更新使用警告色 -->
|
||||
<ProductionStageStatus
|
||||
:status="videoReadiness?.status"
|
||||
:label="videoReadiness ? productionStatusLabel(videoReadiness.status) : undefined"
|
||||
:warning-label="videoStale ? '主视频需更新' : undefined"
|
||||
:messages="videoIssueMessages"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="videoInputPlan" class="mt-3 flex flex-wrap items-center gap-2 text-xs">
|
||||
@@ -579,7 +615,8 @@ async function inspectSpecs() {
|
||||
</NTag>
|
||||
<span class="text-muted">{{ videoInputPlan.reasons.map(productionMessage).join(';') }}</span>
|
||||
</div>
|
||||
<IssueHint :messages="videoIssueMessages" />
|
||||
<!-- 以下是主视频素材变化说明模块,与此前画面检查结论分别说明 -->
|
||||
<p v-if="videoStale" class="mt-3 text-xs text-muted">首帧或参考图已变化,请重新生成视频。</p>
|
||||
<section class="surface-inset mt-4 p-4" aria-label="当前视频生成素材引用">
|
||||
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||
<h6 class="text-xs font-medium">视频使用的素材</h6>
|
||||
@@ -645,107 +682,34 @@ async function inspectSpecs() {
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div
|
||||
v-if="videoQualityStatus && videoQualityStatus.status !== 'not_started'"
|
||||
class="mt-3 flex items-center gap-2"
|
||||
>
|
||||
<NTag
|
||||
size="small"
|
||||
:type="
|
||||
videoQualityStatus.status === 'passed'
|
||||
? 'success'
|
||||
: videoQualityStatus.status === 'exhausted'
|
||||
? 'error'
|
||||
: 'info'
|
||||
<!-- 以下是主视频展示模块,其它记录在候选弹窗中查看 -->
|
||||
<div v-if="currentVideo" class="video-grid mt-4">
|
||||
<VideoCard
|
||||
:item="currentVideo"
|
||||
:shot-no="shot.shotNo"
|
||||
:duration-seconds="shot.durationSeconds"
|
||||
:stale="videoStale"
|
||||
:blocked="assetBlocked"
|
||||
:validation-passed="sessionVideoValidation(projectId, shot.shotId, currentVideo.id)?.passed ?? null"
|
||||
:recorded-validation-passed="
|
||||
videoRecordedValidation(videoQualityStatus, shot.shotId, currentVideo.id)
|
||||
"
|
||||
:bordered="false"
|
||||
>
|
||||
{{
|
||||
videoQualityStatus.status === 'passed'
|
||||
? '视频检查通过'
|
||||
: videoQualityStatusLabel(videoQualityStatus.status)
|
||||
}}
|
||||
:confirming="false"
|
||||
@quality="openQuality('video', currentVideo.id)"
|
||||
@history="openVideoHistory(currentVideo.id)"
|
||||
/>
|
||||
</div>
|
||||
<p v-else class="mt-4 text-xs text-muted">
|
||||
{{ videoCandidates.length ? '尚无已确认主视频,请在候选中检查并选择。' : '尚无视频任务记录。' }}
|
||||
</p>
|
||||
<!-- 以下是视频候选弹窗入口模块 -->
|
||||
<div v-if="videoCandidates.length" class="mt-4 flex flex-wrap gap-3">
|
||||
<NButton @click="videoCandidatesOpen = true">管理候选({{ videoCandidates.length }})</NButton>
|
||||
<!-- 以下是视频候选任务进行中的数量提示模块 -->
|
||||
<NTag v-if="activeVideoCount" size="small" type="warning" :bordered="false" role="status">
|
||||
视频任务进行中({{ activeVideoCount }})
|
||||
</NTag>
|
||||
</div>
|
||||
<!-- 以下是当前镜头只读视频质量详情与失败归因模块 -->
|
||||
<VideoQualityDiagnostics :key="shot.shotId" :shot-id="shot.shotId" class="mt-3" />
|
||||
<div v-if="videos.length" class="video-grid mt-4">
|
||||
<article v-for="item in videos" :key="item.id" class="video-record">
|
||||
<video
|
||||
v-if="item.status === 'completed' && safeVideoUrl(item.videoUrl)"
|
||||
:src="safeVideoUrl(item.videoUrl) || undefined"
|
||||
controls
|
||||
preload="metadata"
|
||||
class="production-video"
|
||||
></video>
|
||||
<div class="min-w-0 p-3">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<StatusBadge :status="item.status" :label="productionStatusLabel(item.status)" />
|
||||
<NTag v-if="item.isPrimary" size="small" :bordered="false">主视频</NTag>
|
||||
<NTag v-if="!item.isPrimary" size="small" :bordered="false">候选视频</NTag>
|
||||
<NTag v-if="item.isPrimary && videoStale" size="small" :bordered="false">已过期</NTag>
|
||||
<span class="text-[10px] text-muted"
|
||||
>{{ item.durationSeconds || shot.durationSeconds || '—' }}s</span
|
||||
>
|
||||
</div>
|
||||
<NAlert v-if="item.error" role="alert" type="error" :show-icon="false" class="mt-3">{{
|
||||
item.error
|
||||
}}</NAlert>
|
||||
<p class="mt-3 break-all text-[10px] text-muted">
|
||||
{{ item.provider }} · {{ item.model }} · {{ formatDate(item.createdAt) }}
|
||||
</p>
|
||||
<div class="mt-3 flex flex-wrap gap-3">
|
||||
<NButton
|
||||
v-if="item.status === 'completed' && item.videoUrl"
|
||||
text
|
||||
size="small"
|
||||
@click="openQuality('video', item.id)"
|
||||
>质量检查<template v-if="sessionVideoValidation(projectId, item.shotId, item.id)">
|
||||
·
|
||||
{{
|
||||
sessionVideoValidation(projectId, item.shotId, item.id)?.passed
|
||||
? '曾通过'
|
||||
: '未通过'
|
||||
}}</template
|
||||
></NButton
|
||||
>
|
||||
<a
|
||||
v-if="safeVideoUrl(item.videoUrl)"
|
||||
:href="safeVideoUrl(item.videoUrl) || undefined"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="text-button"
|
||||
>打开视频<ExternalLink :size="12"
|
||||
/></a>
|
||||
<NButton
|
||||
v-if="
|
||||
item.status === 'completed' &&
|
||||
item.videoUrl &&
|
||||
!item.isPrimary &&
|
||||
sessionVideoValidation(projectId, item.shotId, item.id)?.passed === true
|
||||
"
|
||||
:disabled="assetBlocked"
|
||||
@click="confirmingVideo = item.id"
|
||||
text
|
||||
size="small"
|
||||
>
|
||||
设为主视频
|
||||
</NButton>
|
||||
</div>
|
||||
<NAlert v-if="confirmingVideo === item.id" type="info" :show-icon="false" class="mt-3 text-xs"
|
||||
><p>确认把此候选设为当前镜头主视频?旧成片仍会保留。</p>
|
||||
<div class="mt-2 flex gap-3">
|
||||
<NButton @click="setPrimaryVideo" type="primary">确认切换</NButton>
|
||||
<NButton @click="confirmingVideo = ''" text size="small">取消</NButton>
|
||||
</div></NAlert
|
||||
>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
<p v-else class="mt-4 text-xs text-muted">尚无视频任务记录。</p>
|
||||
<p v-if="videos.some(item => !item.isPrimary)" class="mt-3 text-xs text-muted">
|
||||
质量链状态来自后端持久化记录;手动晋升候选仍需在当前页面完成一次视觉校验。自动质量任务通过后会直接更新主视频。
|
||||
</p>
|
||||
<section
|
||||
v-if="generationCatalog"
|
||||
class="generation-settings-panel surface-inset mt-4"
|
||||
@@ -861,13 +825,10 @@ async function inspectSpecs() {
|
||||
v-model:open="candidatesOpen"
|
||||
title="首帧候选管理"
|
||||
description="先完成质量检查;只有本会话校验通过的候选才能设为主首帧。"
|
||||
wide
|
||||
:width="keyframeCandidatesWidth"
|
||||
>
|
||||
<!-- 候选图片和对应的人工复核入口按相同候选 ID 分组。 -->
|
||||
<div
|
||||
v-if="keyframeCandidates.length"
|
||||
class="mt-4 grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] items-start gap-3 max-[760px]:grid-cols-1"
|
||||
>
|
||||
<div v-if="keyframeCandidates.length" class="asset-candidate-grid mt-4">
|
||||
<div v-for="item in keyframeCandidates" :key="item.id" class="min-w-0">
|
||||
<KeyframeCard
|
||||
:shot-id="shot.shotId"
|
||||
@@ -888,6 +849,49 @@ async function inspectSpecs() {
|
||||
</div>
|
||||
<p v-else class="text-xs text-muted">暂无其它首帧候选。</p>
|
||||
</AppDialog>
|
||||
<!-- 以下是视频候选管理弹窗模块,复用主视频卡片操作与公共弹窗滚动布局 -->
|
||||
<AppDialog
|
||||
v-model:open="videoCandidatesOpen"
|
||||
title="视频候选管理"
|
||||
description="完成质量检查后,可以将通过的候选设为主视频。"
|
||||
:width="videoCandidatesWidth"
|
||||
>
|
||||
<div v-if="videoCandidatesOpen && videoCandidates.length" class="asset-candidate-grid mt-4">
|
||||
<VideoCard
|
||||
v-for="item in videoCandidates"
|
||||
:key="item.id"
|
||||
:item="item"
|
||||
:shot-no="shot.shotNo"
|
||||
:duration-seconds="shot.durationSeconds"
|
||||
:stale="false"
|
||||
:blocked="assetBlocked"
|
||||
:validation-passed="sessionVideoValidation(projectId, item.shotId, item.id)?.passed ?? null"
|
||||
:recorded-validation-passed="videoRecordedValidation(videoQualityStatus, item.shotId, item.id)"
|
||||
:confirming="confirmingVideo === item.id"
|
||||
@quality="openQuality('video', item.id)"
|
||||
@history="openVideoHistory(item.id)"
|
||||
@select="confirmingVideo = item.id"
|
||||
@confirm="setPrimaryVideo"
|
||||
@cancel="confirmingVideo = ''"
|
||||
/>
|
||||
</div>
|
||||
<p v-else class="text-xs text-muted">暂无其它视频候选。</p>
|
||||
</AppDialog>
|
||||
<!-- 以下是指定视频质量记录弹窗模块,打开后直接展示结果与修改建议 -->
|
||||
<AppDialog
|
||||
v-model:open="videoHistoryOpen"
|
||||
title="视频质量记录"
|
||||
description="查看此视频已有的画面检查结果与本镜头的相关记录,不收费。"
|
||||
wide
|
||||
>
|
||||
<VideoQualityDiagnostics
|
||||
v-if="videoHistoryOpen && videoHistoryId"
|
||||
:key="`${shot.shotId}:${videoHistoryId}`"
|
||||
:shot-id="shot.shotId"
|
||||
:video-id="videoHistoryId"
|
||||
:stale="videoHistoryStale"
|
||||
/>
|
||||
</AppDialog>
|
||||
<AppDialog
|
||||
v-model:open="historyOpen"
|
||||
title="首帧校验历史"
|
||||
@@ -932,29 +936,24 @@ async function inspectSpecs() {
|
||||
.production-stage-actions {
|
||||
@apply mt-4 flex min-h-[34px] flex-wrap items-center gap-3;
|
||||
}
|
||||
.keyframe-grid {
|
||||
@apply grid gap-3;
|
||||
grid-template-columns: repeat(auto-fill, minmax(180px, 220px));
|
||||
/* 主首帧与主视频共用 260px 宽度,画面保持正方形,小屏下不超过可用空间。 */
|
||||
.keyframe-grid,
|
||||
.video-grid {
|
||||
@apply grid w-full max-w-[260px] grid-cols-1 gap-3;
|
||||
}
|
||||
/* 候选画面固定 260px,最多五列;列数减少时仍保持左右边缘对齐。 */
|
||||
.asset-candidate-grid {
|
||||
@apply grid w-full max-w-[1348px] items-start gap-3;
|
||||
grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 260px));
|
||||
justify-content: space-between;
|
||||
}
|
||||
.keyframe-card {
|
||||
@apply relative overflow-hidden rounded-none bg-(--app-subtle);
|
||||
@apply min-w-0 overflow-hidden rounded-none bg-(--app-subtle);
|
||||
}
|
||||
.keyframe-card .asset-image {
|
||||
@apply aspect-square rounded-none;
|
||||
}
|
||||
.keyframe-image {
|
||||
@apply relative;
|
||||
}
|
||||
.primary-keyframe-mark {
|
||||
@apply absolute top-2 left-2 z-1 flex size-7 items-center justify-center;
|
||||
color: var(--app-on-accent);
|
||||
background: var(--app-button-primary);
|
||||
box-shadow:
|
||||
0 0 0 1px rgb(0 0 0 / 55%),
|
||||
0 2px 8px rgb(0 0 0 / 35%);
|
||||
}
|
||||
.video-input-grid,
|
||||
.video-grid {
|
||||
.video-input-grid {
|
||||
@apply grid gap-3;
|
||||
grid-template-columns: repeat(auto-fill, minmax(180px, 220px));
|
||||
}
|
||||
@@ -970,12 +969,6 @@ async function inspectSpecs() {
|
||||
.video-input-image .asset-image {
|
||||
@apply h-full w-full aspect-auto;
|
||||
}
|
||||
.video-record {
|
||||
@apply min-w-0 overflow-hidden rounded-none bg-(--app-subtle);
|
||||
}
|
||||
.production-video {
|
||||
@apply block w-full aspect-square bg-[#080808] object-contain;
|
||||
}
|
||||
.generation-settings-panel {
|
||||
@apply p-5;
|
||||
}
|
||||
@@ -989,9 +982,16 @@ async function inspectSpecs() {
|
||||
@apply mb-[7px] text-xs font-medium leading-5;
|
||||
}
|
||||
@media (max-width: 760px) {
|
||||
/* 手机画面占满内容宽度,图片与视频的高度继续由正方形比例确定。 */
|
||||
.keyframe-grid,
|
||||
.video-input-grid,
|
||||
.video-grid {
|
||||
@apply max-w-none;
|
||||
}
|
||||
/* 手机候选按整行展示,避免固定 260px 造成侧边留白。 */
|
||||
.asset-candidate-grid {
|
||||
@apply max-w-none grid-cols-[minmax(0,_1fr)];
|
||||
}
|
||||
.video-input-grid {
|
||||
@apply grid-cols-[repeat(2,_minmax(0,_1fr))];
|
||||
}
|
||||
.generation-settings-panel {
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { NAlert, NButton, NTag } from 'naive-ui'
|
||||
import { AssetOpenLink, StatusBadge } from '../../../components/ui'
|
||||
import { mediaAssetUrl } from '../../../lib/assets'
|
||||
import { formatDate } from '../../../lib/format'
|
||||
import { productionStatusLabel } from '../model'
|
||||
import type { ShotVideo } from '../types'
|
||||
|
||||
/** 主视频与候选视频共用的播放、质量检查和主视频切换参数。 */
|
||||
const props = defineProps<{
|
||||
/** 当前视频记录。 */
|
||||
item: ShotVideo
|
||||
/** 当前镜头编号,用于播放区域的可访问名称。 */
|
||||
shotNo: number
|
||||
/** 视频未返回时长时使用当前镜头时长。 */
|
||||
durationSeconds?: number
|
||||
/** 当前主视频是否需要更新。 */
|
||||
stale: boolean
|
||||
/** 当前状态是否禁止切换主视频。 */
|
||||
blocked: boolean
|
||||
/** 当前会话的检查结论,null 表示没有检查。 */
|
||||
validationPassed: boolean | null
|
||||
/** 此视频已有的持久化检查结论,仅用于展示,不改变候选晋升条件。 */
|
||||
recordedValidationPassed?: boolean | null
|
||||
/** 是否正在确认切换当前候选。 */
|
||||
confirming: boolean
|
||||
}>()
|
||||
/** 交由父面板执行检查与切换,卡片不直接调用生成接口。 */
|
||||
const emit = defineEmits<{ quality: []; history: []; select: []; confirm: []; cancel: [] }>()
|
||||
/** 播放和外链共用经过协议与资源路径校验的地址。 */
|
||||
const videoUrl = computed(() => (props.item.videoUrl ? mediaAssetUrl(props.item.videoUrl) : null))
|
||||
/** 优先显示本次会话的检查结果,否则显示此视频已有的记录。 */
|
||||
const previousValidation = computed(() => props.validationPassed ?? props.recordedValidationPassed ?? null)
|
||||
/** 只有已完成且在当前会话检查通过的候选才能发起切换。 */
|
||||
const canSelect = computed(
|
||||
() =>
|
||||
props.item.status === 'completed' &&
|
||||
!!videoUrl.value &&
|
||||
!props.item.isPrimary &&
|
||||
props.validationPassed === true
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 以下是视频播放与候选操作卡片模块 -->
|
||||
<article class="min-w-0 overflow-hidden bg-(--app-subtle)">
|
||||
<!-- 以下是正方形视频画面与右上角打开原文件入口模块 -->
|
||||
<div class="relative aspect-square w-full overflow-hidden bg-(--app-subtle)">
|
||||
<video
|
||||
v-if="item.status === 'completed' && videoUrl"
|
||||
:src="videoUrl"
|
||||
:aria-label="`镜头 ${shotNo} ${item.isPrimary ? '主视频' : '候选视频'}`"
|
||||
controls
|
||||
preload="metadata"
|
||||
class="block aspect-square w-full bg-[#080808] object-contain"
|
||||
></video>
|
||||
<!-- 以下是尚无可播放视频时的正方形占位模块,与完成记录保持相同尺寸 -->
|
||||
<div v-else class="flex h-full w-full items-center justify-center p-5 text-xs text-muted">
|
||||
{{
|
||||
item.status === 'failed'
|
||||
? '视频生成失败'
|
||||
: item.status === 'completed'
|
||||
? '暂无视频文件'
|
||||
: '视频任务进行中'
|
||||
}}
|
||||
</div>
|
||||
<AssetOpenLink v-if="item.status === 'completed'" :src="videoUrl" label="打开视频" />
|
||||
</div>
|
||||
<div class="min-w-0 p-3">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<StatusBadge :status="item.status" :label="productionStatusLabel(item.status)" />
|
||||
<NTag size="small" :bordered="false">{{ item.isPrimary ? '主视频' : '候选视频' }}</NTag>
|
||||
<NTag v-if="item.isPrimary && stale" size="small" type="warning" :bordered="false">需更新</NTag>
|
||||
<span class="text-[10px] text-muted">{{ item.durationSeconds || durationSeconds || '—' }}s</span>
|
||||
</div>
|
||||
<!-- 以下是此视频此前检查结果模块,历史通过不代表当前素材仍然适用 -->
|
||||
<p v-if="previousValidation !== null" class="mt-2 text-[11px] text-muted">
|
||||
{{ previousValidation ? '此前画面检查通过' : '此前画面检查未通过' }}
|
||||
</p>
|
||||
<NAlert v-if="item.error" role="alert" type="error" :show-icon="false" class="mt-3">{{
|
||||
item.error
|
||||
}}</NAlert>
|
||||
<p class="mt-3 break-all text-[10px] text-muted">
|
||||
{{ item.provider }} · {{ item.model }} · {{ formatDate(item.createdAt) }}
|
||||
</p>
|
||||
<div class="mt-3 flex flex-wrap gap-3">
|
||||
<NButton v-if="item.status === 'completed' && videoUrl" text size="small" @click="emit('quality')">
|
||||
质量检查
|
||||
</NButton>
|
||||
<NButton text size="small" @click="emit('history')">查看质量记录</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-3 text-xs">
|
||||
<p>确认把此候选设为当前镜头主视频?旧成片仍会保留。</p>
|
||||
<div class="mt-2 flex gap-3">
|
||||
<NButton :disabled="blocked || !canSelect" type="primary" @click="emit('confirm')"
|
||||
>确认切换</NButton
|
||||
>
|
||||
<NButton text size="small" @click="emit('cancel')">取消</NButton>
|
||||
</div>
|
||||
</NAlert>
|
||||
</div>
|
||||
</article>
|
||||
</template>
|
||||
@@ -1,22 +1,27 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { NAlert, NTag } from 'naive-ui'
|
||||
import ReadonlyInspection from '../../../components/ui/ReadonlyInspection.vue'
|
||||
import { useQuery } from '../../../composables/useQuery'
|
||||
import { formatDate } from '../../../lib/format'
|
||||
import { videoDiagnosticsApi } from '../diagnostics-api'
|
||||
import { videoQualityStatusLabel } from '../model'
|
||||
import type { VideoQualityRollbackTarget } from '../diagnostics.types'
|
||||
|
||||
/** 视频诊断始终绑定当前正式镜头。 */
|
||||
const props = defineProps<{ /** 正式镜头 ID。 */ shotId: string }>()
|
||||
/** 仅用户展开后查询,关闭后取消旧请求。 */
|
||||
const open = ref(false)
|
||||
/** 镜头和展开状态共同决定查询目标。 */
|
||||
const key = computed(() => (open.value ? props.shotId : ''))
|
||||
/** 视频诊断绑定正式镜头与用户选中的视频,随弹窗挂载直接读取。 */
|
||||
const props = defineProps<{
|
||||
/** 正式镜头 ID。 */
|
||||
shotId: string
|
||||
/** 用户选中的视频 ID。 */
|
||||
videoId: string
|
||||
/** 当前视频是否因首帧或参考图变化而需要更新。 */
|
||||
stale: boolean
|
||||
}>()
|
||||
/** 查询目标包含镜头和视频,切换目标后取消旧请求。 */
|
||||
const key = computed(() => (props.shotId && props.videoId ? JSON.stringify([props.shotId, props.videoId]) : ''))
|
||||
/** 切换镜头时取消查询,先读取链状态,耗尽时再查询独立归因。 */
|
||||
const query = useQuery(key, async (shotId, signal) => {
|
||||
if (!shotId) return null
|
||||
const query = useQuery(key, async (value, signal) => {
|
||||
if (!value) return null
|
||||
const [shotId] = JSON.parse(value) as [string, string]
|
||||
const detail = await videoDiagnosticsApi.qualityDetail(shotId, signal)
|
||||
if (detail.shotId !== shotId || !Array.isArray(detail.chain)) throw new Error('质量记录与当前镜头不匹配,请刷新。')
|
||||
const analysis =
|
||||
@@ -28,6 +33,16 @@ const query = useQuery(key, async (shotId, signal) => {
|
||||
})
|
||||
/** 当前请求返回的权威质量链。 */
|
||||
const detail = computed(() => query.data.value?.detail)
|
||||
/** 当前视频的独立记录,不能使用其它候选或流程整体结果兜底。 */
|
||||
const currentRecord = computed(() => detail.value?.chain.find(item => item.videoId === props.videoId))
|
||||
/** 当前视频优先展示,其它候选明确标识为相关记录。 */
|
||||
const orderedChain = computed(() => {
|
||||
const chain = detail.value?.chain ?? []
|
||||
return [
|
||||
...chain.filter(item => item.videoId === props.videoId),
|
||||
...chain.filter(item => item.videoId !== props.videoId)
|
||||
]
|
||||
})
|
||||
/** 当前链对应的后端确定性归因。 */
|
||||
const analysis = computed(() => query.data.value?.analysis)
|
||||
|
||||
@@ -50,23 +65,38 @@ function rollbackLabel(target: VideoQualityRollbackTarget) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 以下是只读视频质量详情与自动修复失败归因模块 -->
|
||||
<ReadonlyInspection
|
||||
v-model:open="open"
|
||||
title="视频质量详情"
|
||||
description="查看检查结果和修改建议,不收费。"
|
||||
:loading="query.loading.value"
|
||||
:error="query.error.value"
|
||||
@refresh="query.refresh"
|
||||
>
|
||||
<template v-if="detail">
|
||||
<p>
|
||||
<strong>{{ videoQualityStatusLabel(detail.status) }}</strong> · 修复 {{ detail.repairAttempt }} /
|
||||
{{ detail.maxRepairAttempts ?? '未设置' }} · 候选 {{ detail.chain.length }}
|
||||
<!-- 以下是弹窗中的视频已有检查记录模块,无需再次点击查看 -->
|
||||
<section class="workspace-panel text-xs leading-6" aria-label="当前视频质量记录">
|
||||
<NAlert v-if="stale" type="warning" :show-icon="false" class="mb-3">
|
||||
此视频需要更新:首帧或参考图已变化。此前画面检查结果仅供参考,请重新生成视频。
|
||||
</NAlert>
|
||||
<NAlert v-if="query.error.value" type="error" :show-icon="false" role="alert">{{ query.error.value }}</NAlert>
|
||||
<p v-if="query.loading.value" class="text-muted" role="status">正在读取质量记录…</p>
|
||||
<template v-else-if="detail">
|
||||
<p v-if="currentRecord" class="font-semibold">
|
||||
{{
|
||||
currentRecord.validationPassed === true
|
||||
? '当前视频此前画面检查通过'
|
||||
: currentRecord.validationPassed === false
|
||||
? '当前视频此前画面检查未通过'
|
||||
: '当前视频尚未完成画面检查'
|
||||
}}
|
||||
</p>
|
||||
<p v-else class="text-muted">此视频暂无自动质量流程记录。</p>
|
||||
<!-- 以下是镜头质量流程上下文模块,与当前视频的结论区分 -->
|
||||
<p class="mt-3 text-muted">
|
||||
本镜头共 {{ detail.chain.length }} 条视频记录;当前视频优先显示,其它候选单独标识。
|
||||
</p>
|
||||
<p v-if="currentRecord" class="text-muted">
|
||||
当前视频修复 {{ currentRecord.repairAttempt }} / {{ currentRecord.maxRepairAttempts ?? '未设置' }}
|
||||
</p>
|
||||
<p v-if="['generating', 'validating', 'repairing'].includes(detail.status)" class="text-muted">
|
||||
当前镜头正在执行:{{ videoQualityStatusLabel(detail.status) }}
|
||||
</p>
|
||||
<p v-if="!detail.chain.length" class="mt-2 text-muted">当前镜头尚无质量链记录。</p>
|
||||
<article v-for="item in detail.chain" :key="item.videoId" class="surface-inset mt-3 p-3">
|
||||
<article v-for="item in orderedChain" :key="item.videoId" class="surface-inset mt-3 p-3">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<NTag size="small" :bordered="false">{{ item.videoId === videoId ? '当前视频' : '其它候选' }}</NTag>
|
||||
<code>{{ item.videoId }}</code>
|
||||
<NTag size="small" :bordered="false">第 {{ item.repairAttempt }} 代</NTag>
|
||||
<span
|
||||
@@ -97,6 +127,7 @@ function rollbackLabel(target: VideoQualityRollbackTarget) {
|
||||
:type="analysis.requiresManualReview ? 'warning' : 'info'"
|
||||
:show-icon="false"
|
||||
>
|
||||
<p class="font-semibold">镜头最近一次质量流程的修改建议</p>
|
||||
{{ analysis.summary }}
|
||||
<p v-if="analysis.recommendedRollback.length" class="mt-1">
|
||||
建议检查:{{ analysis.recommendedRollback.map(rollbackLabel).join('、') }}
|
||||
@@ -110,5 +141,5 @@ function rollbackLabel(target: VideoQualityRollbackTarget) {
|
||||
</ul>
|
||||
</article>
|
||||
</template>
|
||||
</ReadonlyInspection>
|
||||
</section>
|
||||
</template>
|
||||
@@ -1,5 +1,5 @@
|
||||
import { reactive } from 'vue'
|
||||
import type { ProductionIssueCode, ProductionSession, ShotKeyframe, ShotVideo } from './types'
|
||||
import type { ProductionIssueCode, ProductionSession, ShotKeyframe, ShotVideo, ShotVideoQualityStatus } from './types'
|
||||
|
||||
/** 按项目隔离生产回执,切换页面后仍能查看上一次批量操作结果。 */
|
||||
const sessions = reactive<Record<string, ProductionSession>>({})
|
||||
@@ -34,6 +34,22 @@ export function primaryVideo(items: ShotVideo[]): ShotVideo | undefined {
|
||||
return items.find(item => item.isPrimary && item.status === 'completed' && item.videoUrl)
|
||||
}
|
||||
|
||||
/**
|
||||
* 只读取指定镜头与视频的持久化检查结论,不用流程整体状态代替单个视频结果。
|
||||
* @param qualityStatus 镜头质量流程记录,读取失败时为空
|
||||
* @param shotId 当前镜头 ID
|
||||
* @param videoId 当前视频 ID
|
||||
* @returns 对应视频的检查结论,没有记录或尚未检查时返回 null
|
||||
*/
|
||||
export function videoRecordedValidation(
|
||||
qualityStatus: ShotVideoQualityStatus | null,
|
||||
shotId: string,
|
||||
videoId: string
|
||||
): boolean | null {
|
||||
if (qualityStatus?.shotId !== shotId) return null
|
||||
return qualityStatus.chain.find(item => item.videoId === videoId)?.validationPassed ?? null
|
||||
}
|
||||
|
||||
/** 活动视频状态与后端重复任务保护保持一致。 */
|
||||
export function isActiveVideo(item: ShotVideo): boolean {
|
||||
return ['pending', 'queued', 'running'].includes(item.status)
|
||||
@@ -63,7 +79,11 @@ export function issueLabel(code: ProductionIssueCode): string {
|
||||
return labels[code] ?? '生成条件需要完善'
|
||||
}
|
||||
|
||||
/** 生产状态中文标签,未知值由状态组件回退显示原文。 */
|
||||
/**
|
||||
* 将生产任务状态转换为中文标签,包含首帧与视频的生成中状态。
|
||||
* @param status 后端返回的生产任务状态
|
||||
* @returns 状态对应的中文名称,未知状态保留原值
|
||||
*/
|
||||
export function productionStatusLabel(status: string): string {
|
||||
const labels: Record<string, string> = {
|
||||
ready: '已就绪',
|
||||
@@ -73,6 +93,7 @@ export function productionStatusLabel(status: string): string {
|
||||
pending: '等待提交',
|
||||
queued: '排队中',
|
||||
running: '生成中',
|
||||
generating: '生成中',
|
||||
completed: '已完成',
|
||||
failed: '失败',
|
||||
cancelled: '已取消',
|
||||
|
||||
@@ -94,17 +94,30 @@ export const qualityApi = {
|
||||
{ method: 'POST', body: { validationTaskId } }
|
||||
),
|
||||
/** 人工接受会修改主首帧,必须由用户明确确认。 */
|
||||
acceptKeyframeReview: (shotId: string, keyframeId: string, body: {
|
||||
validationTaskId: string; expectedPrimaryId: string; reviewer: string; reason: string
|
||||
}) =>
|
||||
acceptKeyframeReview: (
|
||||
shotId: string,
|
||||
keyframeId: string,
|
||||
body: {
|
||||
validationTaskId: string
|
||||
expectedPrimaryId: string
|
||||
reviewer: string
|
||||
reason: string
|
||||
}
|
||||
) =>
|
||||
request<{ reviewId: string; decision: 'accepted'; primaryChanged: boolean }>(
|
||||
`/storyboard-shots/${encodeURIComponent(shotId)}/keyframes/${encodeURIComponent(keyframeId)}/quality-review/accept`,
|
||||
{ method: 'POST', body }
|
||||
),
|
||||
/** 人工拒绝只记录审核决定,不删除候选图片。 */
|
||||
rejectKeyframeReview: (shotId: string, keyframeId: string, body: {
|
||||
validationTaskId: string; reviewer: string; reason: string
|
||||
}) =>
|
||||
rejectKeyframeReview: (
|
||||
shotId: string,
|
||||
keyframeId: string,
|
||||
body: {
|
||||
validationTaskId: string
|
||||
reviewer: string
|
||||
reason: string
|
||||
}
|
||||
) =>
|
||||
request<{ reviewId: string; decision: 'rejected'; primaryChanged: false }>(
|
||||
`/storyboard-shots/${encodeURIComponent(shotId)}/keyframes/${encodeURIComponent(keyframeId)}/quality-review/reject`,
|
||||
{ method: 'POST', body }
|
||||
|
||||
Reference in new issue
Block a user