feat: 拆解设置按需展示历史镜头诊断统计与异常镜头定位
This commit is contained in:
1 parent
4745c564ce
commit
c55ca5cb90
1 file changed
+50
-2
@@ -13,7 +13,7 @@ import { Layers, LoaderCircle, ArrowRight, Settings2 } from '@lucide/vue'
|
|||||||
import { EmptyState, StatusBadge, WorkspaceTools } from '../../components/ui'
|
import { EmptyState, StatusBadge, WorkspaceTools } from '../../components/ui'
|
||||||
import { useProjectContext } from '../projects/context'
|
import { useProjectContext } from '../projects/context'
|
||||||
import { breakdownApi } from './api'
|
import { breakdownApi } from './api'
|
||||||
import type { BreakdownAction, BreakdownInput, BreakdownModule, BreakdownPreview, StoryboardHandOccupancyDiagnostics, StoryboardHandRepairPreview, LegacyActionDiagnosisPreview } from './types'
|
import type { BreakdownAction, BreakdownInput, BreakdownModule, BreakdownPreview, StoryboardHandOccupancyDiagnostics, StoryboardHandRepairPreview, LegacyActionDiagnosisPreview, LegacyActionDiagnosisResults } from './types'
|
||||||
import { breakdownSnapshot, recoveryOptions, workflowCheckpoints } from '../workflows/selectors'
|
import { breakdownSnapshot, recoveryOptions, workflowCheckpoints } from '../workflows/selectors'
|
||||||
import { getOperation, isOperationRunning, runOperation } from '../workflows/operations'
|
import { getOperation, isOperationRunning, runOperation } from '../workflows/operations'
|
||||||
import ConfirmAction from '../workflows/ConfirmAction.vue'
|
import ConfirmAction from '../workflows/ConfirmAction.vue'
|
||||||
@@ -98,7 +98,29 @@ const legacyPreview = ref<LegacyActionDiagnosisPreview | null>(null)
|
|||||||
const legacyPreviewBusy = ref(false)
|
const legacyPreviewBusy = ref(false)
|
||||||
const legacyStarting = ref(false)
|
const legacyStarting = ref(false)
|
||||||
const legacyDiagnosisScope = ref<'episode' | 'project'>('episode')
|
const legacyDiagnosisScope = ref<'episode' | 'project'>('episode')
|
||||||
watch([legacyEpisodeNo, legacyDiagnosisScope, projectId], () => { legacyPreview.value = null })
|
const legacyResults = ref<LegacyActionDiagnosisResults | null>(null)
|
||||||
|
const legacyResultsBusy = ref(false)
|
||||||
|
async function loadLegacyResults() {
|
||||||
|
const id = projectId.value
|
||||||
|
const version = handDiagnosticsVersion
|
||||||
|
legacyResultsBusy.value = true
|
||||||
|
try {
|
||||||
|
const data = await breakdownApi.legacyActionDiagnosisResults(id,
|
||||||
|
legacyDiagnosisScope.value === 'episode' ? legacyEpisodeNo.value : undefined)
|
||||||
|
if (version === handDiagnosticsVersion && projectId.value === id && toolsOpen.value) legacyResults.value = data
|
||||||
|
} catch (cause) {
|
||||||
|
if (version === handDiagnosticsVersion && projectId.value === id && toolsOpen.value) actionMessage?.error(errorMessage(cause))
|
||||||
|
} finally {
|
||||||
|
if (version === handDiagnosticsVersion) legacyResultsBusy.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
watch(() => legacyDiagnosisExecution.query.data.value?.status, (status, previous) => {
|
||||||
|
if (status && status !== previous && (status === 'completed' || status === 'failed') && toolsOpen.value) {
|
||||||
|
void loadLegacyResults()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
watch([legacyEpisodeNo, legacyDiagnosisScope, projectId], () => { legacyPreview.value = null; legacyResults.value = null })
|
||||||
const legacyDiagnosisDescription = computed(() => legacyDiagnosisScope.value === 'project' ? '全项目历史镜头 AI 诊断,已有有效结果将跳过。会产生模型费用,不会修改镜头。' : `第 ${legacyEpisodeNo.value} 集,共 ${legacyPreview.value?.candidateCount ?? '未知'} 个镜头,并发 ${legacyConcurrency.value}。会产生模型费用,已有有效结果将跳过。`)
|
const legacyDiagnosisDescription = computed(() => legacyDiagnosisScope.value === 'project' ? '全项目历史镜头 AI 诊断,已有有效结果将跳过。会产生模型费用,不会修改镜头。' : `第 ${legacyEpisodeNo.value} 集,共 ${legacyPreview.value?.candidateCount ?? '未知'} 个镜头,并发 ${legacyConcurrency.value}。会产生模型费用,已有有效结果将跳过。`)
|
||||||
|
|
||||||
async function loadLegacyPreview() {
|
async function loadLegacyPreview() {
|
||||||
@@ -500,6 +522,32 @@ const rules = {
|
|||||||
:loading="legacyStarting" :disabled="legacyDiagnosisExecution.active.value || legacyStarting || (legacyDiagnosisScope === 'episode' && !legacyPreview)"
|
:loading="legacyStarting" :disabled="legacyDiagnosisExecution.active.value || legacyStarting || (legacyDiagnosisScope === 'episode' && !legacyPreview)"
|
||||||
primary @confirm="startLegacyDiagnosis" />
|
primary @confirm="startLegacyDiagnosis" />
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mt-3 flex flex-wrap items-center justify-between gap-3">
|
||||||
|
<span class="text-xs text-muted">诊断结果</span>
|
||||||
|
<NButton text :loading="legacyResultsBusy" @click="loadLegacyResults">查看结果</NButton>
|
||||||
|
</div>
|
||||||
|
<div v-if="legacyResults" class="mt-2 space-y-3 text-xs">
|
||||||
|
<div class="flex flex-wrap gap-x-4 gap-y-2 text-muted">
|
||||||
|
<span>总计 {{ legacyResults.counts.total }}</span>
|
||||||
|
<span>冲突 {{ legacyResults.counts.conflict }}</span>
|
||||||
|
<span>未发现冲突 {{ legacyResults.counts.clear }}</span>
|
||||||
|
<span>证据不足 {{ legacyResults.counts.insufficient }}</span>
|
||||||
|
<span>证据无效 {{ legacyResults.counts.invalid }}</span>
|
||||||
|
<span>已过期 {{ legacyResults.counts.stale }}</span>
|
||||||
|
<span>未诊断 {{ legacyResults.counts.pending }}</span>
|
||||||
|
</div>
|
||||||
|
<div v-for="item in legacyResults.shots.filter(shot => shot.status !== 'no_conflict_found')" :key="item.shotId" class="py-1">
|
||||||
|
第 {{ item.episodeNo }} 集 / Beat {{ item.beatNo }} / Shot {{ item.shotNo }} · {{ item.title }}
|
||||||
|
<span class="ml-2 text-muted">{{ ({
|
||||||
|
conflict_found: '手部冲突',
|
||||||
|
insufficient_evidence: '证据不足',
|
||||||
|
invalid_evidence: '证据无效',
|
||||||
|
stale: '诊断过期',
|
||||||
|
not_diagnosed: '尚未诊断',
|
||||||
|
no_conflict_found: '未发现冲突'
|
||||||
|
} as const)[item.status] }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<WorkflowExecutionPanel v-if="legacyDiagnosisExecution.executionId.value"
|
<WorkflowExecutionPanel v-if="legacyDiagnosisExecution.executionId.value"
|
||||||
title="历史动作诊断任务"
|
title="历史动作诊断任务"
|
||||||
:execution="legacyDiagnosisExecution.query.data.value ?? null"
|
:execution="legacyDiagnosisExecution.query.data.value ?? null"
|
||||||
|
|||||||
Reference in new issue
Block a user