mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
fix: Fixed the issue that the related form value does not change after selecting the freedom field of the model #1804 (#1805)
### What problem does this PR solve? fix: Fixed the issue that the related form value does not change after selecting the freedom field of the model #1804 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -17,7 +17,13 @@ const LLMSelect = ({ id, value, onChange }: IProps) => {
|
||||
);
|
||||
|
||||
return (
|
||||
<Popover content={content} trigger="click" placement="left" arrow={false}>
|
||||
<Popover
|
||||
content={content}
|
||||
trigger="click"
|
||||
placement="left"
|
||||
arrow={false}
|
||||
destroyTooltipOnHide
|
||||
>
|
||||
<Select
|
||||
style={{ width: '100%' }}
|
||||
dropdownStyle={{ display: 'none' }}
|
||||
|
||||
@ -28,9 +28,13 @@ const LlmSettingItems = ({ prefix, formItemLayout = {} }: IProps) => {
|
||||
const handleParametersChange = useCallback(
|
||||
(value: ModelVariableType) => {
|
||||
const variable = settledModelVariableMap[value];
|
||||
form?.setFieldsValue(variable);
|
||||
let nextVariable: Record<string, any> = variable;
|
||||
if (prefix) {
|
||||
nextVariable = { [prefix]: variable };
|
||||
}
|
||||
form.setFieldsValue(nextVariable);
|
||||
},
|
||||
[form],
|
||||
[form, prefix],
|
||||
);
|
||||
|
||||
const memorizedPrefix = useMemo(() => (prefix ? [prefix] : []), [prefix]);
|
||||
@ -46,7 +50,13 @@ const LlmSettingItems = ({ prefix, formItemLayout = {} }: IProps) => {
|
||||
{...formItemLayout}
|
||||
rules={[{ required: true, message: t('modelMessage') }]}
|
||||
>
|
||||
<Select options={[...modelOptions[LlmModelType.Chat], ...modelOptions[LlmModelType.Image2text],]} showSearch/>
|
||||
<Select
|
||||
options={[
|
||||
...modelOptions[LlmModelType.Chat],
|
||||
...modelOptions[LlmModelType.Image2text],
|
||||
]}
|
||||
showSearch
|
||||
/>
|
||||
</Form.Item>
|
||||
<Divider></Divider>
|
||||
<Form.Item
|
||||
|
||||
Reference in New Issue
Block a user