|  |  | 
 |  |  |     ReferenceArrayInput, | 
 |  |  |     AutocompleteInput, | 
 |  |  |     DeleteButton, | 
 |  |  |     useRefresh, | 
 |  |  |     Button | 
 |  |  | } from 'react-admin'; | 
 |  |  | import { Box, Typography, Card, Stack } from '@mui/material'; | 
 |  |  | import { styled } from '@mui/material/styles'; | 
 |  |  | 
 |  |  | import MyCreateButton from "../components/MyCreateButton"; | 
 |  |  | import MyExportButton from '../components/MyExportButton'; | 
 |  |  | import PageDrawer from "../components/PageDrawer"; | 
 |  |  | import MyField from "../components/MyField"; | 
 |  |  | import BatchModal from "./BatchModal"; | 
 |  |  | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; | 
 |  |  | import * as Common from '@/utils/common'; | 
 |  |  | import EditIcon from '@mui/icons-material/Edit'; | 
 |  |  |  | 
 |  |  | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ | 
 |  |  |     '& .css-1vooibu-MuiSvgIcon-root': { | 
 |  |  | 
 |  |  |  | 
 |  |  | const filters = [ | 
 |  |  |     <SearchInput source="condition" alwaysOn />, | 
 |  |  |  | 
 |  |  |     <TextField source="warehouseId" label="table.field.warehouseAreas.wareId" />, | 
 |  |  |     <TextInput source="uuid" label="table.field.warehouseAreas.uuid" />, | 
 |  |  |     <TextInput source="name" label="table.field.warehouseAreas.name" />, | 
 |  |  |     <TextInput source="code" label="table.field.warehouseAreas.code" />, | 
 |  |  | 
 |  |  |             > | 
 |  |  |                 <StyledDatagrid | 
 |  |  |                     preferenceKey='warehouseAreas' | 
 |  |  |                     bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} | 
 |  |  |                     bulkActionButtons={ | 
 |  |  |                         <> | 
 |  |  |                             <WareButton /> | 
 |  |  |                             <MixButton /> | 
 |  |  |                             <StatusButton /> | 
 |  |  |                             <BulkDeleteButton mutationMode={OPERATE_MODE} /> | 
 |  |  |                         </> | 
 |  |  |                     } | 
 |  |  |                     rowClick={(id, resource, record) => false} | 
 |  |  |                     expand={() => <WarehouseAreasPanel />} | 
 |  |  |                     expandSingle={true} | 
 |  |  |                     omit={['id', 'createTime', 'createBy', 'memo']} | 
 |  |  |                 > | 
 |  |  |                     <NumberField source="id" /> | 
 |  |  | 
 |  |  |                     {/* <ReferenceField source="shipperId" label="table.field.warehouseAreas.shipperId" reference="shipper" link={false} sortable={false}> | 
 |  |  |                         <TextField source="name" /> | 
 |  |  |                     </ReferenceField> */} | 
 |  |  |                     <TextField source="warehouseId$" label="table.field.warehouseAreas.wareId" /> | 
 |  |  |                     <TextField source="shipperId$" label="table.field.warehouseAreas.shipperId" /> | 
 |  |  |                     <NumberField source="supplierId" label="table.field.warehouseAreas.supplierId" /> | 
 |  |  |                     <TextField source="flagMinus$" label="table.field.warehouseAreas.flagMinus" sortable={false} /> | 
 |  |  | 
 |  |  | } | 
 |  |  |  | 
 |  |  | export default WarehouseAreasList; | 
 |  |  |  | 
 |  |  |  | 
 |  |  | const MixButton = () => { | 
 |  |  |     const record = useRecordContext(); | 
 |  |  |     const notify = useNotify(); | 
 |  |  |     const refresh = useRefresh(); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     const [createDialog, setCreateDialog] = useState(false); | 
 |  |  |  | 
 |  |  |     return ( | 
 |  |  |         <> | 
 |  |  |             <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchMix"}> | 
 |  |  |                 <EditIcon /> | 
 |  |  |             </Button> | 
 |  |  |  | 
 |  |  |             <BatchModal | 
 |  |  |                 open={createDialog} | 
 |  |  |                 setOpen={setCreateDialog} | 
 |  |  |                 fieldType={'flagMix'} | 
 |  |  |             /> | 
 |  |  |         </> | 
 |  |  |  | 
 |  |  |     ) | 
 |  |  | } | 
 |  |  |  | 
 |  |  | const WareButton = () => { | 
 |  |  |     const record = useRecordContext(); | 
 |  |  |     const notify = useNotify(); | 
 |  |  |     const refresh = useRefresh(); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     const [createDialog, setCreateDialog] = useState(false); | 
 |  |  |  | 
 |  |  |     return ( | 
 |  |  |         <> | 
 |  |  |             <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchWarehouse"}> | 
 |  |  |                 <EditIcon /> | 
 |  |  |             </Button> | 
 |  |  |  | 
 |  |  |             <BatchModal | 
 |  |  |                 open={createDialog} | 
 |  |  |                 setOpen={setCreateDialog} | 
 |  |  |                 fieldType={'wareId'} | 
 |  |  |             /> | 
 |  |  |         </> | 
 |  |  |  | 
 |  |  |     ) | 
 |  |  | } | 
 |  |  |  | 
 |  |  | const StatusButton = () => { | 
 |  |  |     const record = useRecordContext(); | 
 |  |  |     const notify = useNotify(); | 
 |  |  |     const refresh = useRefresh(); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     const [createDialog, setCreateDialog] = useState(false); | 
 |  |  |  | 
 |  |  |     return ( | 
 |  |  |         <> | 
 |  |  |             <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchStatus"}> | 
 |  |  |                 <EditIcon /> | 
 |  |  |             </Button> | 
 |  |  |  | 
 |  |  |             <BatchModal | 
 |  |  |                 open={createDialog} | 
 |  |  |                 setOpen={setCreateDialog} | 
 |  |  |                 fieldType={'status'} | 
 |  |  |             /> | 
 |  |  |         </> | 
 |  |  |  | 
 |  |  |     ) | 
 |  |  | } |