| import EditIcon from '@mui/icons-material/Edit'; | 
| import { useState, useEffect } from 'react'; | 
| import { | 
|     Button, useListContext, SelectInput, | 
|     required, | 
|     useTranslate, useNotify | 
| } from 'react-admin'; | 
| import request from '@/utils/request'; | 
|   | 
| const DictionarySelect = (props) => { | 
|     const { dictTypeCode, name, ...parmas } = props; | 
|     const translate = useTranslate(); | 
|     const notify = useNotify(); | 
|     const [list, setList] = useState([]) | 
|   | 
|     useEffect(() => { | 
|         http() | 
|     }, [dictTypeCode]); | 
|   | 
|     const http = async () => { | 
|         const res = await request.post('/dictData/page', { dictTypeCode }); | 
|         if (res?.data?.code === 200) { | 
|   | 
|             setList(res.data.data.records.map((item) => { | 
|                 return { | 
|                     id: item.value, | 
|                     name: item.label | 
|                 } | 
|             })) | 
|         } else { | 
|             notify(res.data.msg); | 
|         } | 
|     } | 
|   | 
|     return ( | 
|         <SelectInput | 
|             source={name} | 
|             choices={list} | 
|             {...parmas} | 
|         /> | 
|     ); | 
| }; | 
|   | 
| export default DictionarySelect; |