From 1aae80d73018042ba68b89f0c88aef39c955dc19 Mon Sep 17 00:00:00 2001 From: GouJ Date: Tue, 1 Sep 2026 14:47:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=BF=87=E6=9C=9F=E9=A6=96=E5=B8=A7?= =?UTF-8?q?=E9=87=8D=E7=94=9F=E6=88=90=E9=BB=98=E8=AE=A4=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E4=B8=BB=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../production/components/KeyframeDialog.vue | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/features/production/components/KeyframeDialog.vue b/src/features/production/components/KeyframeDialog.vue index 04512af..61f98f0 100644 --- a/src/features/production/components/KeyframeDialog.vue +++ b/src/features/production/components/KeyframeDialog.vue @@ -4,8 +4,14 @@ import { AppDialog } from '../../../components/ui' import { validOptionalSize } from '../model' import type { GenerateKeyframeInput, ShotKeyframe } from '../types' -/** 单镜头首帧表单;是否替换主首帧必须由用户明确选择。 */ -const props = defineProps<{ shotId: string; shotTitle: string; keyframes: ShotKeyframe[]; disabled: boolean }>() +/** 单镜头首帧表单;普通候选仍由用户明确选择,过期主首帧默认替换为新图。 */ +const props = defineProps<{ + shotId: string + shotTitle: string + keyframes: ShotKeyframe[] + disabled: boolean + replacePrimary?: boolean +}>() const open = defineModel('open', { default: false }) const emit = defineEmits<{ generate: [input: GenerateKeyframeInput] }>() const width = ref('') @@ -16,11 +22,11 @@ const hasPrimary = computed(() => props.keyframes.some(item => item.isPrimary && const sizeValid = computed(() => validOptionalSize(width.value, height.value)) const canSubmit = computed(() => !props.disabled && sizeValid.value && confirmed.value) -/** 切换镜头或重新打开时清空费用确认,避免沿用上个镜头的覆盖选择。 */ +/** 切换镜头或重新打开时清空费用确认;过期首帧默认让新结果成为 Primary。 */ function reset() { width.value = '' height.value = '' - setPrimary.value = !hasPrimary.value + setPrimary.value = !!props.replacePrimary || !hasPrimary.value confirmed.value = false } watch([() => props.shotId, open], reset, { immediate: true }) @@ -41,9 +47,12 @@ function submit() {