| | |
| | | import CorporateFareIcon from '@mui/icons-material/CorporateFare'; |
| | | import LocInit from "./LocInit"; |
| | | import rowSx from "./rowSx"; |
| | | import BulkUpdateButton from "./BulkUpdateButton"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | <ReferenceInput source="locSts" label="table.field.loc.locSts" reference="locSts" alwaysOn> |
| | | <AutocompleteInput label="table.field.loc.locSts" optionText="name" filterToQuery={(val) => ({ name: val })} /> |
| | | </ReferenceInput>, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | <NumberInput source="row" label="table.field.loc.row" alwaysOn />, |
| | | <NumberInput source="bay" label="table.field.loc.bay" alwaysOn />, |
| | | <NumberInput source="lev" label="table.field.loc.lev" alwaysOn />, |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <ReferenceInput source="code" label="table.field.loc.code" reference="code" alwaysOn> |
| | | <AutocompleteInput label="table.field.loc.code" optionText="data" filterToQuery={(val) => ({ data: val })} /> |
| | | </ReferenceInput>, |
| | | <DateInput label='common.time.after' source="timeStart" />, |
| | | <DateInput label='common.time.before' source="timeEnd" />, |
| | | <TextInput source="uuid" label="table.field.loc.uuid" />, |
| | | <ReferenceInput source="zoneId" label="table.field.loc.zoneId" reference="zone"> |
| | | <AutocompleteInput label="table.field.loc.zoneId" optionText="name" filterToQuery={(val) => ({ name: val })} /> |
| | | </ReferenceInput>, |
| | | <TextInput source="name" label="table.field.loc.name" />, |
| | | <ReferenceInput source="code" label="table.field.loc.code" reference="code" alwaysOn> |
| | | <AutocompleteInput label="table.field.loc.code" optionText="data" filterToQuery={(val) => ({ data: val })} /> |
| | | </ReferenceInput>, |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <NumberInput source="offset" label="table.field.loc.offset" />, |
| | | <NumberInput source="row" label="table.field.loc.row" alwaysOn />, |
| | | <NumberInput source="bay" label="table.field.loc.bay" alwaysOn />, |
| | | <NumberInput source="lev" label="table.field.loc.lev" alwaysOn />, |
| | | <TextInput source="barcode" label="table.field.loc.barcode" />, |
| | | <TextInput source="zpallet" label="table.field.loc.zpallet" />, |
| | | <ReferenceInput source="locType" label="table.field.loc.locType" reference="locType"> |
| | |
| | | ]} |
| | | />, |
| | | ] |
| | | |
| | | const LocBulkActionButtons = (props) => { |
| | | const translate = useTranslate(); |
| | | |
| | | return ( |
| | | <> |
| | | <BulkUpdateButton |
| | | {...props} |
| | | resource="loc" |
| | | label={translate('ra.action.update')} |
| | | /> |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} /> |
| | | </> |
| | | ); |
| | | }; |
| | | |
| | | |
| | | const LocList = () => { |
| | | const translate = useTranslate(); |
| | |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='loc' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | bulkActionButtons={<LocBulkActionButtons />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <LocPanel />} |
| | | expandSingle={true} |