| | |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | Button, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import MyField from "../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE } from '@/config/setting'; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | import InitButton from "./InitButton"; |
| | | import RepartitionIcon from '@mui/icons-material/Repartition'; |
| | | import CorporateFareIcon from '@mui/icons-material/CorporateFare'; |
| | | import LocInit from "./LocInit"; |
| | | import rowSx from "./rowSx"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | })); |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <TextInput source="locNo" label="table.field.loc.locNo" alwaysOn />, |
| | | <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 />, |
| | | |
| | | <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="locNo" label="table.field.loc.locNo" alwaysOn />, |
| | | <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>, |
| | | <ReferenceInput source="locSts" label="table.field.loc.locSts" reference="locSts" alwaysOn> |
| | | <AutocompleteInput label="table.field.loc.locSts" optionText="name" filterToQuery={(val) => ({ name: 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 />, |
| | |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [initDialog, setInitDialog] = useState(false); |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <InitButton label='page.loc.init' icon={<RepartitionIcon />} /> |
| | | <Button label='page.loc.init' onClick={(event) => { |
| | | setInitDialog(true); |
| | | }}><CorporateFareIcon /></Button> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='loc' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={25} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='loc' |
| | |
| | | expand={() => <LocPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'locType', 'uuid', 'statusBool', 'updateBy', 'createTime', 'createBy', 'memo']} |
| | | rowSx={rowSx(drawerVal || null)} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="locNo" label="table.field.loc.locNo" /> |
| | |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | <LocInit |
| | | open={initDialog} |
| | | setOpen={setInitDialog} |
| | | /> |
| | | </Box> |
| | | ) |
| | | } |