| | |
| | | import { useNavigate } from 'react-router-dom'; |
| | | import { |
| | | List, |
| | | DatagridConfigurable, |
| | | SearchInput, |
| | | TopToolbar, |
| | | SelectColumnsButton, |
| | | ColumnsButton, |
| | | EditButton, |
| | | FilterButton, |
| | | CreateButton, |
| | |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import BasStationAreaCreate from "./BasStationAreaCreate"; |
| | | import BasStationAreaPanel from "./BasStationAreaPanel"; |
| | | import EmptyData from "../components/EmptyData"; |
| | |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import MyField from "../components/MyField"; |
| | | import StickyDataTable from "@/page/components/StickyDataTable"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | | }, |
| | | '& .RaDatagrid-row': { |
| | | cursor: 'auto' |
| | | }, |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 200 |
| | | }, |
| | | })); |
| | | import useTableLayout from '@/utils/useTableLayout'; |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | const { boxMaxWidth, boxMaxHeight } = useTableLayout(drawerVal); |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <Box display="flex" sx={{ |
| | | '& .opt': { |
| | | width: 200 |
| | | } |
| | | }}> |
| | | <List |
| | | sx={{ |
| | | flexGrow: 1, |
| | |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='basStationArea' /> |
| | | <ColumnsButton storeKey='basStationArea' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='basStationArea' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | <Box |
| | | sx={{ |
| | | position: 'relative', |
| | | maxHeight: boxMaxHeight, |
| | | maxWidth: boxMaxWidth, |
| | | overflowX: 'auto', |
| | | overflowY: 'auto', |
| | | '& .MuiTableCell-root': { |
| | | whiteSpace: 'nowrap', |
| | | } |
| | | }} |
| | | > |
| | | <StickyDataTable |
| | | storeKey='basStationArea' |
| | | bulkActionButtons={<BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <BasStationAreaPanel />} |
| | | stickyRight={['opt']} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | hiddenColumns={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="type" label="table.field.basStationArea.type" /> |
| | | <TextField source="stationAreaName" label="table.field.basStationArea.stationAreaName" /> |
| | | <NumberField source="inAble" label="table.field.basStationArea.inAble" /> |
| | | <NumberField source="outAble" label="table.field.basStationArea.outAble" /> |
| | | <TextField source="useStatus" label="table.field.basStationArea.useStatus" /> |
| | | <NumberField source="area" label="table.field.basStationArea.area" /> |
| | | <NumberField source="isCrossZone" label="table.field.basStationArea.isCrossZone" /> |
| | | <TextField source="crossZoneArea" label="table.field.basStationArea.crossZoneArea" /> |
| | | <NumberField source="isWcs" label="table.field.basStationArea.isWcs" /> |
| | | <TextField source="wcsData" label="table.field.basStationArea.wcsData" /> |
| | | <TextField source="containerType" label="table.field.basStationArea.containerType" /> |
| | | <TextField source="barcode" label="table.field.basStationArea.barcode" /> |
| | | <NumberField source="autoTransfer" label="table.field.basStationArea.autoTransfer" /> |
| | | <TextField source="stationAreaId" label="table.field.basStationArea.stationAreaId" /> |
| | | <TextField source="stationAlias" label="table.field.basStationArea.stationAlias" /> |
| | | |
| | |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | |
| | | <WrapperField source="opt" cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </StickyDataTable> |
| | | </Box> |
| | | |
| | | </List> |
| | | <BasStationAreaCreate |
| | | open={createDialog} |