feat: 拆解质量面板按需展示手部冲突修复候选和资产阻断原因
This commit is contained in:
1 parent
74cc0d467f
commit
10ea44d26f
1 file changed
+34
-1
@@ -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, StoryboardHandOccupancyDiagnostics } from './types'
|
||||
import type { BreakdownAction, BreakdownInput, BreakdownModule, BreakdownPreview, StoryboardHandOccupancyDiagnostics, StoryboardHandRepairPreview } from './types'
|
||||
import { breakdownSnapshot, recoveryOptions, workflowCheckpoints } from '../workflows/selectors'
|
||||
import { getOperation, isOperationRunning, runOperation } from '../workflows/operations'
|
||||
import ConfirmAction from '../workflows/ConfirmAction.vue'
|
||||
@@ -35,6 +35,22 @@ const toolsOpen = ref(false)
|
||||
/** 仅打开设置面板时按需查询,不增加页面常驻提示或后台轮询。 */
|
||||
const handDiagnostics = ref<StoryboardHandOccupancyDiagnostics | null>(null)
|
||||
const handDiagnosticsBusy = ref(false)
|
||||
const handRepairPreview = ref<StoryboardHandRepairPreview | null>(null)
|
||||
const handRepairBusy = ref(false)
|
||||
/** 只在用户主动查看时加载修复候选,避免打开设置就请求额外接口。 */
|
||||
async function loadHandRepairPreview(id: string) {
|
||||
const version = handDiagnosticsVersion
|
||||
handRepairBusy.value = true
|
||||
try {
|
||||
const data = await breakdownApi.handRepairPreview(id)
|
||||
if (version === handDiagnosticsVersion && toolsOpen.value && projectId.value === id) handRepairPreview.value = data
|
||||
} catch (cause) {
|
||||
if (version === handDiagnosticsVersion && toolsOpen.value && projectId.value === id) actionMessage?.error(errorMessage(cause))
|
||||
} finally {
|
||||
if (version === handDiagnosticsVersion) handRepairBusy.value = false
|
||||
}
|
||||
}
|
||||
|
||||
let handDiagnosticsVersion = 0
|
||||
async function loadHandDiagnostics(id: string) {
|
||||
const version = ++handDiagnosticsVersion
|
||||
@@ -70,6 +86,8 @@ watch([toolsOpen, projectId], () => {
|
||||
++handDiagnosticsVersion
|
||||
handDiagnostics.value = null
|
||||
handDiagnosticsBusy.value = false
|
||||
handRepairPreview.value = null
|
||||
handRepairBusy.value = false
|
||||
})
|
||||
|
||||
const backgroundExecution = useWorkflowExecution(projectId, 'breakdown')
|
||||
@@ -422,6 +440,21 @@ const rules = {
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section v-if="handDiagnostics?.warningCount" class="workspace-panel">
|
||||
<div class="flex items-center justify-between gap-3">
|
||||
<h3 class="text-sm font-medium">局部修复候选</h3>
|
||||
<NButton text :loading="handRepairBusy" :disabled="handRepairBusy" @click="loadHandRepairPreview(projectId)">
|
||||
{{ handRepairPreview ? '刷新候选' : '查看候选' }}
|
||||
</NButton>
|
||||
</div>
|
||||
<div v-if="handRepairPreview" class="mt-3 space-y-2 text-xs">
|
||||
<div v-for="(item, index) in handRepairPreview.candidates" :key="index" class="space-y-1">
|
||||
<p>第 {{ item.episodeNo }} 集 / Beat {{ item.beatNo }} / Shot {{ item.shotNo }} / 阶段 {{ item.phaseNo }}</p>
|
||||
<p class="text-muted">{{ item.suggestion }}</p>
|
||||
<p v-if="item.blockingReasons.length" class="text-muted">{{ item.blockingReasons.join(';') }}</p>
|
||||
</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">
|
||||
|
||||
Reference in new issue
Block a user