From 5fa1c251a9e12aae37baa7d06896f835fed9ecd3 Mon Sep 17 00:00:00 2001 From: GouJ Date: Sun, 11 Oct 2026 17:18:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A6=96=E5=B8=A7=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E9=95=9C=E5=A4=B4=E5=92=8C=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=90=8E=E5=B1=95=E7=A4=BA=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E5=AE=A1=E8=AE=A1=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../production/components/KeyframeDialog.vue | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/features/production/components/KeyframeDialog.vue b/src/features/production/components/KeyframeDialog.vue index 5b4ea61..2ae88b5 100644 --- a/src/features/production/components/KeyframeDialog.vue +++ b/src/features/production/components/KeyframeDialog.vue @@ -35,6 +35,17 @@ const imageProvider = ref('') const imageGenerationOptions = ref({}) const projectAspectRatio = ref('9:16') const canSubmit = computed(() => !props.disabled && confirmed.value) +/** 预览仅对应当前镜头、模型和参数;请求过期后不得覆盖新配置。 */ +const previewRequestKey = computed(() => JSON.stringify([ + props.shotId, + imageProvider.value, + imageGenerationOptions.value +])) +watch(previewRequestKey, () => { + preview.value = null + previewError.value = '' +}) + /** 切换镜头或重新打开时清空费用确认;新图一律先作为候选。 */ async function reset() { @@ -77,16 +88,20 @@ async function loadPreview() { if (!props.shotId || previewPending.value) return previewPending.value = true previewError.value = '' + const requestKey = previewRequestKey.value try { const result = await productionApi.previewKeyframe(props.shotId, { provider: imageProvider.value || undefined, generationOptions: imageGenerationOptions.value }) + if (requestKey !== previewRequestKey.value || !open.value) return if (!result || result.shotId !== props.shotId) throw new Error('预览结果与当前镜头不匹配。') preview.value = result } catch (cause) { - preview.value = null - previewError.value = errorMessage(cause) + if (requestKey === previewRequestKey.value && open.value) { + preview.value = null + previewError.value = errorMessage(cause) + } } finally { previewPending.value = false } @@ -149,7 +164,7 @@ async function loadPreview() { -
+
生成规格检查