From c824381642d8696f0f1c29c7289fa7c982f00360 Mon Sep 17 00:00:00 2001 From: fengsilin Date: Thu, 4 Jun 2026 14:23:05 +0800 Subject: [PATCH] fix(ratio): read advanced ratio values from form on submit Form.InputNumber values were not synced to currentModel state via onChange, so the advanced ratio fields were always empty when saving. Now reads values directly from formRef in onOk handler. Co-Authored-By: Claude Sonnet 4.6 --- .../pages/Setting/Ratio/ModelSettingsVisualEditor.jsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web/src/pages/Setting/Ratio/ModelSettingsVisualEditor.jsx b/web/src/pages/Setting/Ratio/ModelSettingsVisualEditor.jsx index f3f6128..f03452e 100644 --- a/web/src/pages/Setting/Ratio/ModelSettingsVisualEditor.jsx +++ b/web/src/pages/Setting/Ratio/ModelSettingsVisualEditor.jsx @@ -613,6 +613,16 @@ export default function ModelSettingsVisualEditor(props) { valuesToSave.completionRatio = ''; } + // 从表单读取高级倍率字段(Form.InputNumber 的值不会自动同步到 currentModel) + if (formRef.current) { + const formValues = formRef.current.getValues(); + valuesToSave.cacheRatio = formValues.cacheRatio ?? ''; + valuesToSave.cacheCreationRatio = formValues.cacheCreationRatio ?? ''; + valuesToSave.imageRatio = formValues.imageRatio ?? ''; + valuesToSave.audioRatio = formValues.audioRatio ?? ''; + valuesToSave.audioCompletionRatio = formValues.audioCompletionRatio ?? ''; + } + addOrUpdateModel(valuesToSave); } }}