fix: 分镜单镜头工具不受其他操作阻塞

This commit is contained in:
GouJ committed 2026-09-25 00:47:29 +08:00
1 parent 7ac23c1a24
commit 3f9f2aab24
1 file changed
+8 -5
@@ -9,7 +9,7 @@ import type { DesignedShot, ShotReferences } from '../types'
import type { ShotGenerationSpec } from '../generation-spec.types' import type { ShotGenerationSpec } from '../generation-spec.types'
import { errorMessage } from '../../../lib/http' import { errorMessage } from '../../../lib/http'
import { downloadText } from '../../../lib/format' import { downloadText } from '../../../lib/format'
import { getOperation, runOperation } from '../../workflows/operations' import { runOperation } from '../../workflows/operations'
import ConfirmAction from '../../workflows/ConfirmAction.vue' import ConfirmAction from '../../workflows/ConfirmAction.vue'
/** 镜头级只读资源与显式 Prompt 生成;查询与耗费模型的操作分开。 */ /** 镜头级只读资源与显式 Prompt 生成;查询与耗费模型的操作分开。 */
@@ -20,8 +20,7 @@ const errors = ref({ references: '', spec: '' })
const busy = ref({ references: false, spec: false }) const busy = ref({ references: false, spec: false })
const force = ref(false) const force = ref(false)
const prompt = computed(() => getStoryboardSession(props.projectId).prompts[props.shot.shotId]) const prompt = computed(() => getStoryboardSession(props.projectId).prompts[props.shot.shotId])
const operation = computed(() => getOperation(props.projectId)) const locked = computed(() => props.disabled)
const locked = computed(() => props.disabled || operation.value.pending)
const controllers: Partial<Record<'references' | 'spec', AbortController>> = {} const controllers: Partial<Record<'references' | 'spec', AbortController>> = {}
let revision = 0 let revision = 0
@@ -88,8 +87,12 @@ async function generatePrompt() {
throw new Error('接口未返回此镜头的有效提示词,请检查后端记录后重试。') throw new Error('接口未返回此镜头的有效提示词,请检查后端记录后重试。')
session.prompts[shotId] = result session.prompts[shotId] = result
}) })
if (!ok && /primary keyframe|主首帧/i.test(operation.value.error)) { if (!ok) {
operation.value.recovery = { // 单镜头错误由 runOperation 记录到项目操作状态;这里只处理可恢复的首帧前置问题。
const { getOperation } = await import('../../workflows/operations')
const operation = getOperation(projectId)
if (!/primary keyframe|主首帧/i.test(operation.error)) return
operation.recovery = {
target: 'keyframe', target: 'keyframe',
shotId, shotId,
episodeNo: props.episodeNo episodeNo: props.episodeNo