| | |
| | | Button, useListContext, SelectInput, |
| | | required, SelectArrayInput, |
| | | useTranslate, useNotify, |
| | | SelectArrayInputClasses |
| | | SelectArrayInputClasses, |
| | | AutocompleteInput, AutocompleteArrayInput |
| | | } from 'react-admin'; |
| | | import request from '@/utils/request'; |
| | | |
| | |
| | | const { |
| | | dictTypeCode, |
| | | name, |
| | | multiple = false, |
| | | multiple = true, |
| | | perPage = 100, // 默认每页显示100条数据 |
| | | page = 1, // 默认第一页 |
| | | ...parmas |
| | |
| | | } |
| | | }; |
| | | |
| | | const InputComponent = multiple ? SelectArrayInput : SelectInput; |
| | | const InputComponent = multiple ? AutocompleteArrayInput : AutocompleteInput; |
| | | |
| | | return ( |
| | | <SelectArrayInput |
| | | <InputComponent |
| | | source={name} |
| | | choices={list} |
| | | isLoading={loading} |
| | | options={{ |
| | | ListboxProps: { |
| | | style: { |
| | | maxHeight: '200px', |
| | | } |
| | | }, |
| | | ...(parmas.options || {}) |
| | | }} |
| | | {...parmas} |
| | | /> |
| | | ); |