fix: 补齐过期首帧素材定位与图库影响提示

This commit is contained in:
GouJ
2026-09-02 18:49:20 +08:00
parent f71d2bf0a4
commit 771b66cafc
11 changed files with 826 additions and 23 deletions
@@ -0,0 +1,63 @@
<script setup lang="ts">
import { computed } from 'vue'
import { NAlert, NButton } from 'naive-ui'
import { referenceLocation, referenceTargets } from '../asset-links'
import { useShotReferences } from '../useShotReferences'
import type { ProductionIssue } from '../types'
/** 主首帧过期提示直接定位当前引用的形态,缺失关联时明确降级到主体检索。 */
const props = defineProps<{ projectId: string; shotId: string; issues: ProductionIssue[]; inconsistent?: boolean }>()
const references = useShotReferences(
computed(() => props.projectId),
computed(() => props.shotId)
)
const targets = computed(() => referenceTargets(references.data.value, props.issues))
const reasons = computed(() => [
...new Set(props.issues.filter(issue => issue.code === 'stale_keyframe').map(issue => issue.reason))
])
const precise = computed(() =>
props.issues.some(issue => issue.code === 'stale_keyframe' && issue.missingSubjects?.length)
)
</script>
<template>
<NAlert
role="alert"
type="warning"
:show-icon="false"
class="mt-4 text-xs"
:title="inconsistent ? '主首帧状态待核对' : '主首帧已过期'"
>
<p v-if="inconsistent">
首帧检查未标记过期但视频检查报告参考资产已变化两项后端检查结果不一致请先核对下列素材与身份母版不建议直接重复生图视频仍会按后端检查阻止提交
</p>
<p v-else>
当前参考资产与生成该首帧时不一致旧首帧需重建素材本身不一定过期请先核对关联素材确认有效后返回本镜头重新生成主首帧
</p>
<p v-for="reason in reasons" :key="reason" class="mt-2">{{ reason }}</p>
<p class="mt-3 font-medium">
{{ precise ? '定位后端标记的变更主体' : '核对本镜头关联素材(后端未返回具体变更项)' }}
</p>
<div class="mt-2 flex flex-wrap items-center gap-3">
<RouterLink
v-for="target in targets"
:key="target.formId || target.subjectRef"
:to="referenceLocation(projectId, shotId, target)"
class="text-button"
>{{ target.label }} </RouterLink
>
<RouterLink
v-if="!targets.length"
:to="{
path: `/projects/${encodeURIComponent(projectId)}/subject-images`,
query: { sourceShotId: shotId }
}"
class="text-button"
>前往图库核对 </RouterLink
>
</div>
<p v-if="references.loading.value" class="mt-2 text-muted">正在定位当前引用的形态</p>
<div v-if="references.error.value" class="mt-2 text-danger">
{{ references.error.value }} <NButton text size="small" @click="references.refresh">重试定位</NButton>
</div>
</NAlert>
</template>