feat: 分镜卡片单独诊断定位复用 WorkflowExecution 与确认流程
This commit is contained in:
1 parent
82dbeda453
commit
9254d2a789
1 file changed
+24
-8
@@ -100,7 +100,9 @@ const legacyConcurrency = ref(3)
|
||||
const legacyPreview = ref<LegacyActionDiagnosisPreview | null>(null)
|
||||
const legacyPreviewBusy = ref(false)
|
||||
const legacyStarting = ref(false)
|
||||
const legacyDiagnosisScope = ref<'episode' | 'project'>('episode')
|
||||
const legacyDiagnosisScope = ref<'episode' | 'project' | 'beat' | 'shot'>('episode')
|
||||
const legacyBeatNo = ref<number>()
|
||||
const legacyShotNo = ref<number>()
|
||||
const legacyResults = ref<LegacyActionDiagnosisResults | null>(null)
|
||||
const legacyResultsBusy = ref(false)
|
||||
let legacyResultsRequest = 0
|
||||
@@ -108,7 +110,7 @@ async function loadLegacyResults() {
|
||||
const id = projectId.value
|
||||
const version = handDiagnosticsVersion
|
||||
const requestVersion = ++legacyResultsRequest
|
||||
const episode = legacyDiagnosisScope.value === 'episode' ? legacyEpisodeNo.value : undefined
|
||||
const episode = legacyDiagnosisScope.value === 'project' ? undefined : legacyEpisodeNo.value
|
||||
legacyResultsBusy.value = true
|
||||
try {
|
||||
const data = await breakdownApi.legacyActionDiagnosisResults(id, episode)
|
||||
@@ -125,7 +127,7 @@ watch(() => legacyDiagnosisExecution.query.data.value?.status, (status, previous
|
||||
}
|
||||
})
|
||||
|
||||
watch([legacyEpisodeNo, legacyDiagnosisScope, projectId], () => {
|
||||
watch([legacyEpisodeNo, legacyBeatNo, legacyShotNo, legacyDiagnosisScope, projectId], () => {
|
||||
++legacyResultsRequest
|
||||
legacyResultsBusy.value = false
|
||||
legacyPreview.value = null
|
||||
@@ -138,7 +140,9 @@ async function loadLegacyPreview() {
|
||||
const version = handDiagnosticsVersion
|
||||
legacyPreviewBusy.value = true
|
||||
try {
|
||||
const data = await breakdownApi.legacyActionDiagnosisPreview(id, legacyEpisodeNo.value)
|
||||
const data = await breakdownApi.legacyActionDiagnosisPreview(id, legacyEpisodeNo.value,
|
||||
legacyDiagnosisScope.value === 'beat' || legacyDiagnosisScope.value === 'shot' ? legacyBeatNo.value : undefined,
|
||||
legacyDiagnosisScope.value === 'shot' ? legacyShotNo.value : undefined)
|
||||
if (version === handDiagnosticsVersion && projectId.value === id && toolsOpen.value) legacyPreview.value = data
|
||||
} catch (cause) {
|
||||
if (version === handDiagnosticsVersion && projectId.value === id && toolsOpen.value) actionMessage?.error(errorMessage(cause))
|
||||
@@ -146,13 +150,24 @@ async function loadLegacyPreview() {
|
||||
if (version === handDiagnosticsVersion) legacyPreviewBusy.value = false
|
||||
}
|
||||
}
|
||||
/** 从 Beat / Shot 悬停入口定位诊断范围,并复用统一费用确认。 */
|
||||
async function openLegacyShotDiagnosis(scope: { episodeNo: number; beatNo: number; shotNo?: number }) {
|
||||
legacyEpisodeNo.value = scope.episodeNo
|
||||
legacyBeatNo.value = scope.beatNo
|
||||
legacyShotNo.value = scope.shotNo
|
||||
legacyDiagnosisScope.value = scope.shotNo === undefined ? 'beat' : 'shot'
|
||||
toolsOpen.value = true
|
||||
await loadLegacyPreview()
|
||||
}
|
||||
async function startLegacyDiagnosis() {
|
||||
const id = projectId.value
|
||||
legacyStarting.value = true
|
||||
try {
|
||||
const diagnosisTask = await breakdownApi.startLegacyActionDiagnosis(id, {
|
||||
confirmed: true,
|
||||
...(legacyDiagnosisScope.value === 'episode' ? { episodeNo: legacyEpisodeNo.value } : {}),
|
||||
...(legacyDiagnosisScope.value !== 'project' ? { episodeNo: legacyEpisodeNo.value } : {}),
|
||||
...(legacyDiagnosisScope.value === 'beat' || legacyDiagnosisScope.value === 'shot' ? { beatNo: legacyBeatNo.value } : {}),
|
||||
...(legacyDiagnosisScope.value === 'shot' ? { shotNo: legacyShotNo.value } : {}),
|
||||
concurrency: legacyConcurrency.value
|
||||
})
|
||||
await legacyDiagnosisExecution.track(diagnosisTask.executionId, id)
|
||||
@@ -520,7 +535,8 @@ const rules = {
|
||||
<div class="mt-3 flex flex-wrap items-center gap-3">
|
||||
<NButton size="small" :type="legacyDiagnosisScope === 'episode' ? 'primary' : 'default'" @click="legacyDiagnosisScope = 'episode'">单集</NButton>
|
||||
<NButton size="small" :type="legacyDiagnosisScope === 'project' ? 'primary' : 'default'" @click="legacyDiagnosisScope = 'project'">全项目</NButton>
|
||||
<NInputNumber v-if="legacyDiagnosisScope === 'episode'" v-model:value="legacyEpisodeNo" :min="1" :precision="0" size="small" class="w-24" />
|
||||
<span v-if="legacyDiagnosisScope === 'beat' || legacyDiagnosisScope === 'shot'" class="text-xs text-muted">Beat {{ legacyBeatNo }}{{ legacyDiagnosisScope === 'shot' ? ` / Shot ${legacyShotNo}` : '' }}</span>
|
||||
<NInputNumber v-if="legacyDiagnosisScope !== 'project'" v-model:value="legacyEpisodeNo" :min="1" :precision="0" size="small" class="w-24" />
|
||||
<span class="text-xs text-muted">并发</span>
|
||||
<NInputNumber v-model:value="legacyConcurrency" :min="1" :max="5" :precision="0" size="small" class="w-20" />
|
||||
</div>
|
||||
@@ -529,7 +545,7 @@ const rules = {
|
||||
</div>
|
||||
<div class="mt-3 flex justify-end">
|
||||
<ConfirmAction label="启动 AI 诊断" :description="legacyDiagnosisDescription"
|
||||
:loading="legacyStarting" :disabled="legacyDiagnosisExecution.active.value || legacyStarting || (legacyDiagnosisScope === 'episode' && !legacyPreview)"
|
||||
:loading="legacyStarting" :disabled="legacyDiagnosisExecution.active.value || legacyStarting || (legacyDiagnosisScope !== 'project' && !legacyPreview)"
|
||||
primary @confirm="startLegacyDiagnosis" />
|
||||
</div>
|
||||
<div class="mt-3 flex flex-wrap items-center justify-between gap-3">
|
||||
@@ -754,7 +770,7 @@ const rules = {
|
||||
/></div
|
||||
></template>
|
||||
<div v-if="tab === 'storyboard'" class="breakdown-result-pad">
|
||||
<StoryboardList :plans="plans" :episodes="shots">
|
||||
<StoryboardList :plans="plans" :episodes="shots" @diagnose="openLegacyShotDiagnosis">
|
||||
<template #actions>
|
||||
<RouterLink :to="`/projects/${project?.id}/storyboard`" class="text-button"
|
||||
>进入分镜设计<ArrowRight :size="14"
|
||||
|
||||
Reference in new issue
Block a user