feat(short-drama-agent-front): 接入首帧授权与连续性审核
This commit is contained in:
1 parent
dbf97e6f98
commit
518b630a46
35 files changed
+3070
-97
No files matched your search
@@ -0,0 +1,724 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onScopeDispose, ref, watch } from 'vue'
|
||||
import { NButton, NCollapse, NCollapseItem, NInput, NSelect, NSkeleton } from 'naive-ui'
|
||||
import { AssetImage } from '../../../components/ui'
|
||||
import AppDrawer from '../../../components/ui/AppDrawer.vue'
|
||||
import WorkspaceSectionHeading from '../../../components/ui/WorkspaceSectionHeading.vue'
|
||||
import { useActionMessage, showActionFeedback } from '../../../components/ui/useActionMessage'
|
||||
import { useQuery } from '../../../composables/useQuery'
|
||||
import { ApiError, errorMessage } from '../../../lib/http'
|
||||
import { formatDate } from '../../../lib/format'
|
||||
import { userFacingText } from '../../../lib/user-facing-text'
|
||||
import { storyboardApi } from '../../storyboard/api'
|
||||
import { directionLabel } from '../../storyboard/model'
|
||||
import type { DesignedShot } from '../../storyboard/types'
|
||||
import { productionApi } from '../api'
|
||||
import { sourceDiagnosticsApi } from '../../subject-images/source-diagnostics'
|
||||
import { subjectImagesApi } from '../../subject-images/api'
|
||||
import {
|
||||
continuityApi,
|
||||
continuityInvalidationLabels,
|
||||
continuitySelectionValid,
|
||||
continuityStatusLabels,
|
||||
validObservation
|
||||
} from '../continuity'
|
||||
import type {
|
||||
ContinuityDiagnosis,
|
||||
ContinuityInput,
|
||||
ContinuityIssue,
|
||||
ContinuityObservation,
|
||||
GeometryFrameObservation
|
||||
} from '../continuity.types'
|
||||
import GeometryObservationEditor from './GeometryObservationEditor.vue'
|
||||
import LayoutSupplementPanel from './LayoutSupplementPanel.vue'
|
||||
|
||||
/** 现有生产工作区的增量入口,范围仅限当前集正式镜头。 */
|
||||
const props = defineProps<{
|
||||
/** 项目归属。 */ projectId: string
|
||||
/** 当前集完整正式镜头顺序。 */ shots: DesignedShot[]
|
||||
/** 活动任务等状态只阻止正式写入,免费读取仍可关闭。 */ disabled: boolean
|
||||
}>()
|
||||
/** 全屏审核界面开关。 */
|
||||
const open = defineModel<boolean>('open', { default: false })
|
||||
/** 正式确认后通知生产页回读真实来源。 */
|
||||
const emit = defineEmits<{ changed: [] }>()
|
||||
/** 用户明确选择的镜头。 */
|
||||
const selected = ref<string[]>([])
|
||||
/** 当前共同场景形态。 */
|
||||
const sceneFormId = ref('')
|
||||
/** 最新诊断及原始依据。 */
|
||||
const diagnosis = ref<ContinuityDiagnosis | null>(null)
|
||||
/** 相同来源问题合并镜头范围,避免三镜重复堆叠相同提示。 */
|
||||
const diagnosisIssues = computed(() => {
|
||||
const groups = new Map<string, ContinuityIssue>()
|
||||
for (const issue of diagnosis.value?.issues ?? []) {
|
||||
const key = JSON.stringify([issue.code, issue.featureKey, issue.message])
|
||||
const existing = groups.get(key)
|
||||
if (existing) existing.shotIds = [...new Set([...existing.shotIds, ...issue.shotIds])]
|
||||
else groups.set(key, { ...issue, shotIds: [...issue.shotIds] })
|
||||
}
|
||||
return [...groups.values()].map(issue => ({
|
||||
...issue,
|
||||
scope: issue.shotIds
|
||||
.map(id => {
|
||||
const frame = diagnosis.value?.frames.find(item => item.shotId === id)
|
||||
return frame ? `${frame.beatNo}.${frame.shotNo}` : '未定位镜头'
|
||||
})
|
||||
.join('、')
|
||||
}))
|
||||
})
|
||||
/** 用户逐镜填写的观察,不自动判断左右或数量。 */
|
||||
const observation = ref<ContinuityObservation | null>(null)
|
||||
/** 最近一次消费的观察快照,编辑后禁止保存旧结论。 */
|
||||
const diagnosedInput = ref<ContinuityInput | null>(null)
|
||||
/** 明确填写的真实审核人。 */
|
||||
const reviewer = ref('')
|
||||
/** 本次免费诊断请求。 */
|
||||
const diagnosing = ref(false)
|
||||
/** 正式保存期间防止重复操作及意外关闭。 */
|
||||
const saving = ref(false)
|
||||
/** 子级布局正式写入状态。 */
|
||||
const layoutSaving = ref(false)
|
||||
/** 布局正式确认表单通过当前抽屉底栏提交。 */
|
||||
const layoutPanelRef = ref<InstanceType<typeof LayoutSupplementPanel> | null>(null)
|
||||
/** 已知历史审核编号或用户输入的正式编号。 */
|
||||
const reviewId = ref('')
|
||||
/** 用户输入后再显式读取,避免输入时反复请求。 */
|
||||
const requestedReviewId = ref('')
|
||||
/** 当前审核提交锁。 */
|
||||
const busy = computed(() => saving.value || layoutSaving.value)
|
||||
/** 正式镜头选择约束。 */
|
||||
const selectionValid = computed(() =>
|
||||
continuitySelectionValid(
|
||||
selected.value,
|
||||
props.shots.map(item => item.shotId)
|
||||
)
|
||||
)
|
||||
/** 当前打开范围包含项目及整集镜头身份。 */
|
||||
const context = computed(() =>
|
||||
open.value ? JSON.stringify([props.projectId, props.shots.map(item => item.shotId)]) : ''
|
||||
)
|
||||
/** 所选正式来源按需读取,普通浏览不做全项目检查。 */
|
||||
const sourcesKey = computed(() =>
|
||||
context.value && selectionValid.value ? JSON.stringify([props.projectId, selected.value]) : ''
|
||||
)
|
||||
/** 正式场景绑定及当前 Primary 列表。 */
|
||||
const sources = useQuery(sourcesKey, async (value, signal) => {
|
||||
if (!value) return []
|
||||
const [projectId, shotIds] = JSON.parse(value) as [string, string[]]
|
||||
return Promise.all(
|
||||
shotIds.map(async shotId => {
|
||||
const [spec, keyframes] = await Promise.all([
|
||||
storyboardApi.generationSpec(shotId, signal, projectId),
|
||||
productionApi.listKeyframes(shotId, signal, projectId)
|
||||
])
|
||||
if (
|
||||
spec.projectId !== projectId ||
|
||||
spec.shotId !== shotId ||
|
||||
keyframes.some(item => item.shotId !== shotId)
|
||||
)
|
||||
throw new Error('镜头来源与当前项目不匹配。')
|
||||
return { spec, primary: keyframes.find(item => item.isPrimary) ?? null }
|
||||
})
|
||||
)
|
||||
})
|
||||
/** 仅提供每个选中镜头均实际绑定的同一场景形态。 */
|
||||
const scenes = computed(
|
||||
() =>
|
||||
sources.data.value?.[0]?.spec.subjects.filter(
|
||||
subject =>
|
||||
subject.module === 'scene' &&
|
||||
sources.data.value?.every(item =>
|
||||
item.spec.subjects.some(
|
||||
other =>
|
||||
other.module === 'scene' &&
|
||||
other.subjectFormId === subject.subjectFormId &&
|
||||
other.subjectId === subject.subjectId
|
||||
)
|
||||
)
|
||||
) ?? []
|
||||
)
|
||||
/** 当前场景正式主体,供布局来源查询。 */
|
||||
const scene = computed(() => scenes.value.find(item => item.subjectFormId === sceneFormId.value))
|
||||
/** 场景形态和布局母版独立回读。 */
|
||||
const sceneKey = computed(() =>
|
||||
context.value && scene.value ? JSON.stringify([props.projectId, scene.value.subjectId, sceneFormId.value]) : ''
|
||||
)
|
||||
/** 读取当前布局和母版;只读校验形态主图来源,不调 Vision。 */
|
||||
const sceneSources = useQuery(sceneKey, async (value, signal) => {
|
||||
if (!value) return null
|
||||
const [projectId, subjectId, formId] = JSON.parse(value) as [string, string, string]
|
||||
const [layouts, images] = await Promise.all([
|
||||
sourceDiagnosticsApi.scene(projectId, subjectId, formId, signal),
|
||||
subjectImagesApi.listImages(formId, signal)
|
||||
])
|
||||
const primary = images.find(item => item.isPrimary && item.subjectFormId === formId)
|
||||
const currentness = primary ? await subjectImagesApi.validationPreview(formId, primary.id, signal) : null
|
||||
return { layouts, currentness }
|
||||
})
|
||||
/** 项目范围内的审核回读,原结论与当前失效分开。 */
|
||||
const reviewKey = computed(() =>
|
||||
context.value && requestedReviewId.value ? JSON.stringify([props.projectId, requestedReviewId.value]) : ''
|
||||
)
|
||||
/** 指定审核可在刷新后重新取得当前性。 */
|
||||
const reviewQuery = useQuery(reviewKey, async (value, signal) => {
|
||||
if (!value) return null
|
||||
const [projectId, id] = JSON.parse(value) as [string, string]
|
||||
return continuityApi.review(projectId, id, signal)
|
||||
})
|
||||
/** 保存仅接受本次已诊断且未编辑的指纹观察。 */
|
||||
const canSave = computed(
|
||||
() =>
|
||||
!!diagnosis.value?.observation &&
|
||||
['passed', 'failed', 'needs_review'].includes(diagnosis.value.status) &&
|
||||
diagnosis.value.fingerprint === observation.value?.expectedFingerprint &&
|
||||
JSON.stringify(diagnosedInput.value?.observation) === JSON.stringify(observation.value) &&
|
||||
!!reviewer.value.trim() &&
|
||||
reviewer.value.trim().length <= 120 &&
|
||||
!props.disabled &&
|
||||
!busy.value &&
|
||||
!diagnosing.value
|
||||
)
|
||||
/** 与来源和参数绑定的诊断身份。 */
|
||||
const target = computed(() => JSON.stringify([context.value, selected.value, sceneFormId.value]))
|
||||
/** 请求代次防止切范围、关闭或编辑期间回填旧结果。 */
|
||||
let generation = 0
|
||||
/** 免费诊断取消控制器。 */
|
||||
let controller: AbortController | undefined
|
||||
/** 复用现有消息层。 */
|
||||
const message = useActionMessage()
|
||||
watch(
|
||||
context,
|
||||
() => {
|
||||
selected.value = open.value ? props.shots.slice(0, 3).map(item => item.shotId) : []
|
||||
sceneFormId.value = ''
|
||||
reviewer.value = ''
|
||||
try {
|
||||
reviewId.value = localStorage.getItem('continuity-review:' + props.projectId) || ''
|
||||
} catch {
|
||||
reviewId.value = ''
|
||||
}
|
||||
requestedReviewId.value = reviewId.value
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
watch(scenes, items => {
|
||||
if (!items.some(item => item.subjectFormId === sceneFormId.value))
|
||||
sceneFormId.value = items.length === 1 ? items[0]!.subjectFormId : ''
|
||||
})
|
||||
watch(
|
||||
target,
|
||||
() => {
|
||||
generation++
|
||||
controller?.abort()
|
||||
diagnosing.value = false
|
||||
diagnosis.value = null
|
||||
observation.value = null
|
||||
diagnosedInput.value = null
|
||||
},
|
||||
{ flush: 'sync' }
|
||||
)
|
||||
onScopeDispose(() => {
|
||||
generation++
|
||||
controller?.abort()
|
||||
})
|
||||
/**
|
||||
* 始终按正式顺序保存选择,避免输入点击顺序成为镜头顺序。
|
||||
* @param ids 用户选择镜头
|
||||
*/
|
||||
function selectShots(ids: string[]) {
|
||||
selected.value = props.shots.filter(item => ids.includes(item.shotId)).map(item => item.shotId)
|
||||
}
|
||||
/**
|
||||
* 从真实图组建立空白人工观察,所有未知项明确保持未知。
|
||||
* @param result 当前正式诊断
|
||||
* @returns 尚未填写的观察
|
||||
*/
|
||||
function blankObservation(result: ContinuityDiagnosis): ContinuityObservation {
|
||||
return {
|
||||
expectedFingerprint: result.fingerprint!,
|
||||
landmarks: ['', ''],
|
||||
frames: result.frames.map(frame => ({
|
||||
shotId: frame.shotId,
|
||||
view: 'unknown',
|
||||
landmarkOrder: 'unknown',
|
||||
evidence: '',
|
||||
features: []
|
||||
}))
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 免费核对当前图组或显式提交人工观察,绝不调用付费 Provider。
|
||||
* @param withObservation 是否包含用户填写的观察
|
||||
* @returns 当前诊断完成
|
||||
*/
|
||||
async function diagnose(withObservation = false) {
|
||||
if (
|
||||
!selectionValid.value ||
|
||||
!scene.value ||
|
||||
diagnosing.value ||
|
||||
busy.value ||
|
||||
sources.loading.value ||
|
||||
sources.error.value
|
||||
)
|
||||
return
|
||||
if (withObservation && !validObservation(observation.value, selected.value)) {
|
||||
showActionFeedback(message, '请填写两个不同地标、逐镜观察依据及固定结构位置或数量。', 'warning')
|
||||
return
|
||||
}
|
||||
const identity = target.value
|
||||
const current = ++generation
|
||||
controller?.abort()
|
||||
controller = new AbortController()
|
||||
const input: ContinuityInput = JSON.parse(
|
||||
JSON.stringify({
|
||||
shotIds: [...selected.value],
|
||||
sceneFormId: sceneFormId.value,
|
||||
...(withObservation ? { observation: observation.value } : {})
|
||||
})
|
||||
)
|
||||
diagnosing.value = true
|
||||
diagnosedInput.value = null
|
||||
try {
|
||||
const result = await continuityApi.diagnose(props.projectId, input, controller.signal)
|
||||
if (identity !== target.value || current !== generation) return
|
||||
if (
|
||||
result.projectId !== props.projectId ||
|
||||
result.sceneFormId !== input.sceneFormId ||
|
||||
result.frames.length !== input.shotIds.length ||
|
||||
result.frames.some((frame, i) => frame.shotId !== input.shotIds[i])
|
||||
)
|
||||
throw new Error('诊断与当前项目或镜头范围不匹配。')
|
||||
diagnosis.value = result
|
||||
diagnosedInput.value = input
|
||||
if (!withObservation) observation.value = result.fingerprint && result.layout ? blankObservation(result) : null
|
||||
if (result.status === 'stale') {
|
||||
observation.value = null
|
||||
diagnosedInput.value = null
|
||||
}
|
||||
} catch (cause) {
|
||||
if (identity === target.value && current === generation)
|
||||
showActionFeedback(message, errorMessage(cause), 'error')
|
||||
} finally {
|
||||
if (current === generation) diagnosing.value = false
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 保存本次诊断的原始观察及真实审核人,重复提交由正式服务幂等处理。
|
||||
* @returns 审核写入和当前性回读完成
|
||||
*/
|
||||
async function saveReview() {
|
||||
if (!canSave.value || !diagnosedInput.value) return
|
||||
const identity = target.value
|
||||
const projectId = props.projectId
|
||||
const input = JSON.parse(
|
||||
JSON.stringify({ ...diagnosedInput.value, reviewer: reviewer.value.trim() })
|
||||
) as ContinuityInput & { reviewer: string }
|
||||
saving.value = true
|
||||
try {
|
||||
const result = await continuityApi.save(projectId, input)
|
||||
if (identity !== target.value) return
|
||||
if (!result.reviewId || result.diagnosis.fingerprint !== input.observation?.expectedFingerprint)
|
||||
throw new Error('审核记录与本次诊断不一致,请重新核对。')
|
||||
reviewId.value = result.reviewId
|
||||
requestedReviewId.value = result.reviewId
|
||||
try {
|
||||
localStorage.setItem('continuity-review:' + projectId, result.reviewId)
|
||||
} catch {
|
||||
/* 保存位置失败不影响正式记录。 */
|
||||
}
|
||||
await reviewQuery.refresh()
|
||||
if (identity !== target.value) return
|
||||
showActionFeedback(message, '连续性审核已保存,主首帧保持原状。', 'success')
|
||||
} catch (cause) {
|
||||
if (identity === target.value) {
|
||||
showActionFeedback(message, errorMessage(cause), 'error')
|
||||
if (cause instanceof ApiError && cause.status === 409) {
|
||||
diagnosedInput.value = null
|
||||
observation.value = null
|
||||
diagnosis.value = null
|
||||
await sources.refresh()
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
saving.value = false
|
||||
}
|
||||
}
|
||||
/** 明确读取输入编号;同编号只刷新一次,不在输入时请求。 */
|
||||
function loadReview() {
|
||||
const id = reviewId.value.trim()
|
||||
if (!id) return
|
||||
if (requestedReviewId.value === id) void reviewQuery.refresh()
|
||||
else requestedReviewId.value = id
|
||||
}
|
||||
/** 正式布局变化后只刷新来源,不发起生成。 */
|
||||
async function refreshSources() {
|
||||
const identity = context.value
|
||||
generation++
|
||||
controller?.abort()
|
||||
diagnosing.value = false
|
||||
diagnosis.value = null
|
||||
observation.value = null
|
||||
diagnosedInput.value = null
|
||||
await Promise.all([sources.refresh(), sceneSources.refresh(), reviewQuery.refresh()])
|
||||
if (identity !== context.value) return
|
||||
emit('changed')
|
||||
if (open.value && selectionValid.value && scene.value) await diagnose()
|
||||
}
|
||||
/**
|
||||
* 将用户明确编辑的一镜观察写回当前表单。
|
||||
* @param index 正式图组索引
|
||||
* @param value 当前人工观察
|
||||
*/
|
||||
function updateFrame(index: number, value: GeometryFrameObservation) {
|
||||
if (observation.value) observation.value.frames[index] = value
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 以下是同场景连续镜头的全屏诊断与持久化审核模块 -->
|
||||
<AppDrawer
|
||||
v-model:open="open"
|
||||
title="跨镜固定几何审核"
|
||||
description="免费对照相邻两到三镜的固定结构,审核不会自动修改主首帧。"
|
||||
:busy="busy"
|
||||
>
|
||||
<div class="space-y-6">
|
||||
<section class="space-y-3">
|
||||
<WorkspaceSectionHeading
|
||||
title="选择审核范围"
|
||||
description="选择同一场景形态下、同集正式顺序连续的两到三镜。"
|
||||
/>
|
||||
<NSelect
|
||||
:value="selected"
|
||||
multiple
|
||||
:max="3"
|
||||
:disabled="busy || diagnosing"
|
||||
aria-label="连续性审核镜头"
|
||||
:options="
|
||||
shots.map(item => ({
|
||||
label: `${item.beatNo}.${item.shotNo} · ${item.title}`,
|
||||
value: item.shotId
|
||||
}))
|
||||
"
|
||||
@update:value="selectShots"
|
||||
/>
|
||||
<p v-if="selected.length && !selectionValid" class="text-sm text-muted">请选择相邻的两到三镜。</p>
|
||||
<NSelect
|
||||
v-model:value="sceneFormId"
|
||||
:disabled="busy || diagnosing || sources.loading.value"
|
||||
:loading="sources.loading.value"
|
||||
aria-label="连续性场景形态"
|
||||
placeholder="选择共同场景形态"
|
||||
:options="
|
||||
scenes.map(item => ({
|
||||
label: `${item.subjectName} · ${item.subjectFormName}`,
|
||||
value: item.subjectFormId
|
||||
}))
|
||||
"
|
||||
/>
|
||||
<p v-if="selectionValid && sources.data.value?.length && !scenes.length" class="text-sm text-muted">
|
||||
这些镜头没有共同的正式场景形态,请调整选择。
|
||||
</p>
|
||||
<NButton
|
||||
:loading="diagnosing"
|
||||
:disabled="!selectionValid || !scene || busy || sources.loading.value || !!sources.error.value"
|
||||
@click="diagnose()"
|
||||
>免费读取当前证据</NButton
|
||||
>
|
||||
</section>
|
||||
<!-- 以下是按真实三镜卡片结构预留的静态加载骨架 -->
|
||||
<section
|
||||
v-if="sources.loading.value && !sources.data.value?.length"
|
||||
class="continuity-frame-grid"
|
||||
role="status"
|
||||
aria-label="正在读取镜头与主首帧"
|
||||
>
|
||||
<article v-for="shotId in selected" :key="shotId" class="min-w-0 space-y-3" aria-hidden="true">
|
||||
<NSkeleton :animated="false" :height="20" width="60%" />
|
||||
<div class="relative aspect-square">
|
||||
<NSkeleton :animated="false" class="absolute inset-0" width="100%" height="100%" />
|
||||
</div>
|
||||
<NSkeleton :animated="false" :height="14" width="85%" /><NSkeleton
|
||||
:animated="false"
|
||||
:height="14"
|
||||
width="65%"
|
||||
/>
|
||||
</article>
|
||||
</section>
|
||||
<!-- 以下是当前 Primary、摄影设计与场景来源模块,缺图时预留稳定区域 -->
|
||||
<section v-if="sources.data.value?.length" class="continuity-frame-grid">
|
||||
<article v-for="item in sources.data.value" :key="item.spec.shotId" class="min-w-0 space-y-3">
|
||||
<h3 class="font-semibold">
|
||||
镜头 {{ item.spec.beatNo }}.{{ item.spec.shotNo }} · {{ item.spec.title }}
|
||||
</h3>
|
||||
<AssetImage
|
||||
:src="item.primary?.imageUrl"
|
||||
:style="{
|
||||
aspectRatio:
|
||||
item.primary?.width && item.primary?.height
|
||||
? `${item.primary.width} / ${item.primary.height}`
|
||||
: '1 / 1'
|
||||
}"
|
||||
:alt="`镜头 ${item.spec.beatNo}.${item.spec.shotNo} 当前主首帧`"
|
||||
preview
|
||||
object-fit="contain"
|
||||
empty-text="暂无当前主首帧"
|
||||
/>
|
||||
<p class="wrap-anywhere text-xs text-muted">当前主首帧:{{ item.primary?.id || '未设置' }}</p>
|
||||
<p class="text-sm">
|
||||
镜头设计:{{
|
||||
[
|
||||
item.spec.direction.shotSize,
|
||||
item.spec.direction.cameraAngle,
|
||||
item.spec.direction.cameraMovement
|
||||
]
|
||||
.filter(Boolean)
|
||||
.map(value => directionLabel(value))
|
||||
.join(' · ') || '未填写'
|
||||
}}
|
||||
</p>
|
||||
<NCollapse
|
||||
><NCollapseItem name="direction" title="完整镜头设计"
|
||||
><dl class="space-y-2 text-sm">
|
||||
<div v-for="(value, field) in item.spec.direction" :key="field">
|
||||
{{ directionLabel(value, field) }}
|
||||
</div>
|
||||
</dl></NCollapseItem
|
||||
></NCollapse
|
||||
>
|
||||
<p class="text-sm">
|
||||
场景形态:{{
|
||||
item.spec.subjects
|
||||
.filter(subject => subject.module === 'scene')
|
||||
.map(subject => `${subject.subjectName} · ${subject.subjectFormName}`)
|
||||
.join('、')
|
||||
}}
|
||||
</p>
|
||||
<p v-if="diagnosis?.frames.find(frame => frame.shotId === item.spec.shotId)" class="text-sm">
|
||||
当前来源:{{
|
||||
continuityStatusLabels[
|
||||
diagnosis.frames.find(frame => frame.shotId === item.spec.shotId)!.status
|
||||
]
|
||||
}}
|
||||
{{
|
||||
userFacingText(
|
||||
diagnosis.frames.find(frame => frame.shotId === item.spec.shotId)!.reason,
|
||||
''
|
||||
)
|
||||
}}
|
||||
</p>
|
||||
<NCollapse
|
||||
v-if="
|
||||
diagnosis?.frames.find(frame => frame.shotId === item.spec.shotId)?.formalSourceFingerprint
|
||||
"
|
||||
>
|
||||
<NCollapseItem name="source" title="高级来源详情">
|
||||
<pre class="whitespace-pre-wrap break-words text-xs">{{
|
||||
JSON.stringify(
|
||||
diagnosis.frames.find(frame => frame.shotId === item.spec.shotId),
|
||||
null,
|
||||
2
|
||||
)
|
||||
}}</pre>
|
||||
</NCollapseItem>
|
||||
</NCollapse>
|
||||
</article>
|
||||
</section>
|
||||
<!-- 以下是当前布局母版、场景形态当前性及历史版本模块 -->
|
||||
<section v-if="sceneSources.data.value" class="space-y-3">
|
||||
<WorkspaceSectionHeading title="布局母版与场景来源" />
|
||||
<p class="text-sm">
|
||||
场景形态当前性:{{
|
||||
sceneSources.loading.value || sceneSources.error.value
|
||||
? '待重新核对'
|
||||
: sceneSources.data.value.currentness
|
||||
? sceneSources.data.value.currentness.sourceCurrent
|
||||
? '来源有效'
|
||||
: userFacingText(
|
||||
sceneSources.data.value.currentness.sourceStaleReason,
|
||||
'来源已变化,需要重新核对'
|
||||
)
|
||||
: '缺少主图证据'
|
||||
}}
|
||||
</p>
|
||||
<div v-for="layout in sceneSources.data.value.layouts" :key="layout.id" class="space-y-3">
|
||||
<p class="text-sm">
|
||||
{{ layout.name }} ·
|
||||
<span class="wrap-anywhere text-xs text-muted">当前版本:{{ layout.version }}</span>
|
||||
</p>
|
||||
<p v-if="!layout.masters.length" class="text-sm text-muted">暂无适用布局母版。</p>
|
||||
<div class="continuity-frame-grid">
|
||||
<article v-for="master in layout.masters" :key="master.id" class="space-y-2 min-w-0">
|
||||
<AssetImage :src="master.imageUrl" alt="布局母版" preview object-fit="contain" />
|
||||
<p class="text-sm">
|
||||
{{ master.subjectFormId ? '当前场景形态机位' : '全局布局母版' }} ·
|
||||
{{
|
||||
master.spatialLayoutVersion === layout.version && master.status === 'confirmed'
|
||||
? '当前版本已确认'
|
||||
: '待重新确认'
|
||||
}}
|
||||
</p>
|
||||
<p v-if="master.viewDescription" class="text-sm text-muted">{{ master.viewDescription }}</p>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- 以下是固定地标与逐镜人工观察模块,不将门的开关当作几何变化 -->
|
||||
<section v-if="observation" class="space-y-4">
|
||||
<WorkspaceSectionHeading
|
||||
title="人工观察"
|
||||
description="相对已确认布局核对观察面与地标顺序。只记录固定结构位置和完整可辨数量;开门、关门属于即时状态。无法判断时请保留未知。"
|
||||
/>
|
||||
<div class="continuity-landmarks">
|
||||
<NInput
|
||||
v-model:value="observation.landmarks[0]"
|
||||
:disabled="busy || diagnosing"
|
||||
:maxlength="120"
|
||||
placeholder="固定地标一"
|
||||
:input-props="{ 'aria-label': '固定地标一' }"
|
||||
/><NInput
|
||||
v-model:value="observation.landmarks[1]"
|
||||
:disabled="busy || diagnosing"
|
||||
:maxlength="120"
|
||||
placeholder="固定地标二"
|
||||
:input-props="{ 'aria-label': '固定地标二' }"
|
||||
/>
|
||||
</div>
|
||||
<div class="continuity-frame-grid">
|
||||
<article v-for="(frame, index) in observation.frames" :key="frame.shotId" class="min-w-0 space-y-3">
|
||||
<h3 class="font-semibold">
|
||||
镜头 {{ diagnosis?.frames[index]?.beatNo }}.{{ diagnosis?.frames[index]?.shotNo }} 观察
|
||||
</h3>
|
||||
<GeometryObservationEditor
|
||||
:model-value="frame"
|
||||
:disabled="busy || diagnosing"
|
||||
@update:model-value="updateFrame(index, $event)"
|
||||
/>
|
||||
</article>
|
||||
</div>
|
||||
<NButton :loading="diagnosing" :disabled="busy" @click="diagnose(true)">免费诊断人工观察</NButton>
|
||||
</section>
|
||||
<!-- 以下是最新诊断结论及正式审核保存模块 -->
|
||||
<section v-if="diagnosis" class="space-y-3 text-sm" role="status">
|
||||
<WorkspaceSectionHeading :title="`诊断结果:${continuityStatusLabels[diagnosis.status]}`" />
|
||||
<p v-for="(issue, index) in diagnosisIssues" :key="index">
|
||||
镜头 {{ issue.scope }}:{{ userFacingText(issue.message) }}
|
||||
</p>
|
||||
<p v-if="!diagnosis.issues.length">本次提交的固定结构观察未发现冲突。</p>
|
||||
<NInput
|
||||
v-if="diagnosis.observation"
|
||||
v-model:value="reviewer"
|
||||
:disabled="busy"
|
||||
:maxlength="120"
|
||||
placeholder="填写真实审核人"
|
||||
:input-props="{ 'aria-label': '连续性审核人' }"
|
||||
/>
|
||||
<p
|
||||
v-if="
|
||||
diagnosis.observation &&
|
||||
JSON.stringify(diagnosedInput?.observation) !== JSON.stringify(observation)
|
||||
"
|
||||
class="text-muted"
|
||||
>
|
||||
观察已修改,请重新诊断后再保存。
|
||||
</p>
|
||||
</section>
|
||||
<!-- 以下是正式历史审核回读,失效保留原结论及原始诊断 -->
|
||||
<section class="space-y-3">
|
||||
<WorkspaceSectionHeading
|
||||
title="读取历史审核"
|
||||
description="刷新后恢复本机最近审核,也可填写已有审核编号。"
|
||||
/>
|
||||
<div class="flex items-end gap-2">
|
||||
<NInput
|
||||
v-model:value="reviewId"
|
||||
placeholder="审核编号"
|
||||
:input-props="{ 'aria-label': '连续性历史审核编号' }"
|
||||
/><NButton :loading="reviewQuery.loading.value" :disabled="!reviewId.trim()" @click="loadReview"
|
||||
>读取</NButton
|
||||
>
|
||||
</div>
|
||||
<article v-if="reviewQuery.data.value" class="space-y-2 text-sm">
|
||||
<p>
|
||||
审核人:{{ reviewQuery.data.value.reviewer }} ·
|
||||
{{ formatDate(reviewQuery.data.value.reviewedAt) }}
|
||||
</p>
|
||||
<p>原审核结论:{{ continuityStatusLabels[reviewQuery.data.value.diagnosis.status] }}</p>
|
||||
<p>当前状态:{{ continuityStatusLabels[reviewQuery.data.value.status] }}</p>
|
||||
<template v-if="reviewQuery.data.value.invalidation"
|
||||
><p>
|
||||
{{ continuityInvalidationLabels[reviewQuery.data.value.invalidation.code] || '来源已变化' }}
|
||||
</p>
|
||||
<p v-for="(issue, index) in reviewQuery.data.value.invalidation.issues" :key="index">
|
||||
{{ userFacingText(issue.message) }}
|
||||
</p></template
|
||||
>
|
||||
<NCollapse
|
||||
><NCollapseItem name="original" title="原始诊断">
|
||||
<pre class="whitespace-pre-wrap break-words text-xs">{{
|
||||
JSON.stringify(reviewQuery.data.value.diagnosis, null, 2)
|
||||
}}</pre>
|
||||
</NCollapseItem></NCollapse
|
||||
>
|
||||
</article>
|
||||
</section>
|
||||
<!-- 以下是布局补充与正式确认模块,确认后回读来源但不生成素材 -->
|
||||
<LayoutSupplementPanel
|
||||
ref="layoutPanelRef"
|
||||
v-if="scene && selected[0] && sceneSources.data.value"
|
||||
:project-id="projectId"
|
||||
:shot-id="selected[0]"
|
||||
:scene-subject-id="scene.subjectId"
|
||||
:scene-form-id="sceneFormId"
|
||||
:layouts="sceneSources.data.value.layouts"
|
||||
:disabled="disabled || saving || diagnosing"
|
||||
@busy="layoutSaving = $event"
|
||||
@changed="refreshSources"
|
||||
/>
|
||||
</div>
|
||||
<template #footer>
|
||||
<NButton :disabled="busy" @click="open = false">关闭</NButton>
|
||||
<NButton
|
||||
v-if="diagnosis?.observation"
|
||||
type="primary"
|
||||
:loading="saving"
|
||||
:disabled="!canSave"
|
||||
@click="saveReview"
|
||||
>保存本次连续性审核</NButton
|
||||
>
|
||||
<NButton
|
||||
v-if="layoutPanelRef?.previewAvailable"
|
||||
type="primary"
|
||||
:loading="layoutSaving"
|
||||
:disabled="!layoutPanelRef.canConfirm || saving || diagnosing"
|
||||
@click="layoutPanelRef.confirmLayout()"
|
||||
>确认正式布局</NButton
|
||||
>
|
||||
</template>
|
||||
</AppDrawer>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
/* 与工作区共用列间距,窄屏逐镜排列,长内容交给公共抽屉滚动。 */
|
||||
.continuity-frame-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: var(--app-content-gap);
|
||||
}
|
||||
.continuity-landmarks {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: var(--app-content-gap);
|
||||
}
|
||||
@media (max-width: 900px) {
|
||||
.continuity-frame-grid {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
}
|
||||
@media (max-width: 639px) {
|
||||
.continuity-landmarks {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user