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() {