Przeglądaj źródła

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 <noreply@anthropic.com>
master
fengsilin 1 tydzień temu
rodzic
commit
c824381642
1 zmienionych plików z 10 dodań i 0 usunięć
  1. +10
    -0
      web/src/pages/Setting/Ratio/ModelSettingsVisualEditor.jsx

+ 10
- 0
web/src/pages/Setting/Ratio/ModelSettingsVisualEditor.jsx Wyświetl plik

@@ -613,6 +613,16 @@ export default function ModelSettingsVisualEditor(props) {
valuesToSave.completionRatio = ''; 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); addOrUpdateModel(valuesToSave);
} }
}} }}


Ładowanie…
Anuluj
Zapisz