From b242014af20f16179dc135d66d49072c2eb55879 Mon Sep 17 00:00:00 2001 From: GouJ Date: Fri, 25 Sep 2026 20:21:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=86=E9=A2=91=E6=97=B6=E9=95=BF?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E4=BD=BF=E7=94=A8=E6=A8=A1=E5=9E=8B=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E4=B8=8B=E6=8B=89=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/GenerationModelControls.vue | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/features/generation-config/components/GenerationModelControls.vue b/src/features/generation-config/components/GenerationModelControls.vue index ed0f725..614b996 100644 --- a/src/features/generation-config/components/GenerationModelControls.vue +++ b/src/features/generation-config/components/GenerationModelControls.vue @@ -48,9 +48,19 @@ function updateOption(key: string, value: string | number | boolean | null) { } function choices(item: GenerationModelItem['generationOptions'][number]): SelectOption[] { - return [...(item.options ?? []), ...(item.specialValues ?? [])] + const options = [...(item.options ?? []), ...(item.specialValues ?? [])] .filter(option => typeof option.value === 'string' || typeof option.value === 'number') .map(option => ({ label: option.label, value: option.value as string | number })) + if ( + /duration|时长/i.test(`${item.key} ${item.label}`) && + Number.isInteger(item.min) && + Number.isInteger(item.max) && + item.max! >= item.min! && + item.max! - item.min! <= 60 + ) { + for (let value = item.min!; value <= item.max!; value++) options.push({ label: `${value} 秒`, value }) + } + return options } function selectValue(key: string): string | number | null { @@ -88,6 +98,13 @@ function selectValue(key: string): string | number | null { /> {{ options[item.key] ? '已启用' : '未启用' }} +