feat: 拆解设置面板按需展示手部动作证据覆盖与冲突定位

This commit is contained in:
GouJ committed 2026-10-15 19:38:35 +08:00
1 parent 4db23d2288
commit c17c7533b4
1 file changed
+45 -1
+45 -1
View File
@@ -13,7 +13,7 @@ import { Layers, LoaderCircle, ArrowRight, Settings2 } from '@lucide/vue'
import { EmptyState, StatusBadge, WorkspaceTools } from '../../components/ui'
import { useProjectContext } from '../projects/context'
import { breakdownApi } from './api'
import type { BreakdownAction, BreakdownInput, BreakdownModule, BreakdownPreview } from './types'
import type { BreakdownAction, BreakdownInput, BreakdownModule, BreakdownPreview, StoryboardHandOccupancyDiagnostics } from './types'
import { breakdownSnapshot, recoveryOptions, workflowCheckpoints } from '../workflows/selectors'
import { getOperation, isOperationRunning, runOperation } from '../workflows/operations'
import ConfirmAction from '../workflows/ConfirmAction.vue'
@@ -32,6 +32,24 @@ const preview = ref<BreakdownPreview | null>(null)
const previewBusy = ref(false)
const tab = ref('character')
const toolsOpen = ref(false)
/** 仅打开设置面板时按需查询,不增加页面常驻提示或后台轮询。 */
const handDiagnostics = ref<StoryboardHandOccupancyDiagnostics | null>(null)
const handDiagnosticsBusy = ref(false)
let handDiagnosticsVersion = 0
async function loadHandDiagnostics(id: string) {
const version = ++handDiagnosticsVersion
handDiagnosticsBusy.value = true
handDiagnostics.value = null
try {
const data = await breakdownApi.handOccupancyDiagnostics(id)
if (version === handDiagnosticsVersion) handDiagnostics.value = data
} catch (cause) {
if (version === handDiagnosticsVersion) actionMessage?.error(errorMessage(cause))
} finally {
if (version === handDiagnosticsVersion) handDiagnosticsBusy.value = false
}
}
const moduleOptions: { value: BreakdownModule; label: string; description: string }[] = [
{ value: 'character', label: '人物', description: '人物身份、外观与形态' },
{ value: 'scene', label: '场景', description: '故事空间与环境特征' },
@@ -48,6 +66,13 @@ const summary = computed(() => snapshot.value?.taskSummary)
const validation = computed(() => result.value?.storyboardShotValidation ?? snapshot.value?.storyboardShotValidation)
const projectId = computed(() => project.value?.id ?? '')
const operation = computed(() => getOperation(projectId.value))
watch([toolsOpen, projectId], ([open, id]) => {
++handDiagnosticsVersion
handDiagnostics.value = null
handDiagnosticsBusy.value = false
if (open && id) void loadHandDiagnostics(id)
})
const backgroundExecution = useWorkflowExecution(projectId, 'breakdown')
const recovery = computed(() => recoveryOptions(checkpoints.value))
const execution = computed(() => snapshot.value?.workflowExecution)
@@ -379,6 +404,25 @@ const rules = {
@refresh="backgroundExecution.query.refresh"
@dismiss="backgroundExecution.dismiss"
/>
<!-- 手部动作诊断按需读取,历史镜头缺少证据时不误报为安全。 -->
<section v-if="handDiagnostics || handDiagnosticsBusy" class="workspace-panel">
<div class="flex flex-wrap items-center justify-between gap-3">
<h3 class="text-sm font-medium">手部动作质量</h3>
<NButton text :loading="handDiagnosticsBusy" :disabled="!projectId" @click="loadHandDiagnostics(projectId)">刷新</NButton>
</div>
<div v-if="handDiagnostics" class="mt-3 flex flex-wrap gap-x-4 gap-y-2 text-xs text-muted">
<span>镜头 {{ handDiagnostics.shotCount }}</span>
<span>有效证据 {{ handDiagnostics.evidenceShotCount }} / {{ handDiagnostics.shotCount }}</span>
<span>冲突 {{ handDiagnostics.warningCount }}</span>
<span v-if="handDiagnostics.assessment === 'insufficient_evidence'">证据不足</span>
<span v-else-if="handDiagnostics.assessment === 'partial_evidence'">部分镜头缺少证据</span>
</div>
<div v-if="handDiagnostics?.diagnostics.length" class="mt-3 space-y-2 text-xs">
<div v-for="(issue, index) in handDiagnostics.diagnostics" :key="index">
第 {{ issue.episodeNo }} 集 / Beat {{ issue.beatNo }} / Shot {{ issue.shotNo }} / 阶段 {{ issue.phaseNo }}:{{ issue.suggestion }}
</div>
</div>
</section>
<section v-if="snapshot">
<div class="mb-3 flex flex-wrap items-center justify-between gap-3">
<h2 class="text-sm font-medium">