|  |  |  | 
|---|
|  |  |  | useTranslate, | 
|---|
|  |  |  | } from 'react-admin'; | 
|---|
|  |  |  | import { Box } from '@mui/material'; | 
|---|
|  |  |  | import BusinessIcon from '@mui/icons-material/Business'; | 
|---|
|  |  |  | import LocalShippingIcon from '@mui/icons-material/LocalShipping'; | 
|---|
|  |  |  | import SupervisorAccountIcon from '@mui/icons-material/SupervisorAccount'; | 
|---|
|  |  |  | import CommuteIcon from '@mui/icons-material/Commute'; | 
|---|
|  |  |  | import FiberManualRecordIcon from '@mui/icons-material/FiberManualRecord'; | 
|---|
|  |  |  | import request from '@/utils/request' | 
|---|
|  |  |  |  | 
|---|
|  |  |  | export const AgvListFilter = () => { | 
|---|
|  |  |  | const translate = useTranslate(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const [models, setModels] = React.useState([]); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | React.useEffect(() => { | 
|---|
|  |  |  | request.post('/agvModel/list', {}).then(res => { | 
|---|
|  |  |  | if (res?.data?.code === 200) { | 
|---|
|  |  |  | setModels(res.data.data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, []) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <Box width="13em" minWidth="13em" order={-1} mr={2} mt={5}> | 
|---|
|  |  |  | <FilterLiveSearch hiddenLabel source='uuid' label={translate('table.field.agv.uuid')} /> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <FilterList label="Size" icon={<BusinessIcon />}> | 
|---|
|  |  |  | <FilterList | 
|---|
|  |  |  | label={translate('table.field.agvDetail.pos')} | 
|---|
|  |  |  | icon={<FiberManualRecordIcon />} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <FilterListItem label="common.enums.true" value={{ pos: '1' }} /> | 
|---|
|  |  |  | <FilterListItem label="common.enums.false" value={{ pos: '0' }} /> | 
|---|
|  |  |  | </FilterList> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <FilterList label="Sector" icon={<LocalShippingIcon />}> | 
|---|
|  |  |  | <FilterList | 
|---|
|  |  |  | label={translate('table.field.agv.agvModel')} | 
|---|
|  |  |  | icon={<CommuteIcon />} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | {models.map(model => { | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <FilterListItem | 
|---|
|  |  |  | key={model.id} | 
|---|
|  |  |  | label={`${model.name}`} | 
|---|
|  |  |  | value={{ agvModel: model.id }} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | })} | 
|---|
|  |  |  | </FilterList> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </Box> | 
|---|