| | |
| | | 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'; |
| | |
| | | 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} |
| | | /> |
| | | ); |