zhou zhou
9 小时以前 065e97f80bc82d412b68390c8f7ddbe14b8b9e03
#DictionarySelect修改
1个文件已修改
13 ■■■■ 已修改文件
rsf-admin/src/page/components/DictionarySelect.jsx 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/components/DictionarySelect.jsx
@@ -3,7 +3,8 @@
import {
    Button, useListContext, SelectInput,
    required, SelectArrayInput,
    useTranslate, useNotify
    useTranslate, useNotify,
    AutocompleteInput, AutocompleteArrayInput
} from 'react-admin';
import { useFormContext } from 'react-hook-form';
import request from '@/utils/request';
@@ -96,13 +97,21 @@
        return list;
    }, [list, currentValue, multiple]);
    const InputComponent = multiple ? SelectArrayInput : SelectInput;
    const InputComponent = multiple ? AutocompleteArrayInput : AutocompleteInput;
    return (
        <InputComponent
            source={name}
            choices={choices}
            isLoading={loading}
            options={{
                ListboxProps: {
                    style: {
                        maxHeight: '200px',
                    }
                },
                ...(parmas.options || {})
            }}
            {...parmas}
        />
    );