|  |  | 
 |  |  |     ReferenceArrayInput, | 
 |  |  |     AutocompleteInput, | 
 |  |  |     DeleteButton, | 
 |  |  |     Button, | 
 |  |  | } from 'react-admin'; | 
 |  |  | import { Box, Typography, Card, Stack } from '@mui/material'; | 
 |  |  | import { styled } from '@mui/material/styles'; | 
 |  |  | 
 |  |  | import MyField from "../components/MyField"; | 
 |  |  | import { PAGE_DRAWER_WIDTH, OPERATE_MODE } from '@/config/setting'; | 
 |  |  | import * as Common from '@/utils/common'; | 
 |  |  | import CorporateFareIcon from '@mui/icons-material/CorporateFare'; | 
 |  |  | import LocInit from "./LocInit"; | 
 |  |  | import rowSx from "./rowSx"; | 
 |  |  |  | 
 |  |  | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ | 
 |  |  |     '& .css-1vooibu-MuiSvgIcon-root': { | 
 |  |  | 
 |  |  |     '& .RaDatagrid-row': { | 
 |  |  |         cursor: 'auto' | 
 |  |  |     }, | 
 |  |  |     '& .column-name': { | 
 |  |  |     '& .column-locNo': { | 
 |  |  |         minWidth: 180 | 
 |  |  |     }, | 
 |  |  |     '& .opt': { | 
 |  |  |         width: 200 | 
 |  |  | 
 |  |  |  | 
 |  |  |     const [createDialog, setCreateDialog] = useState(false); | 
 |  |  |     const [drawerVal, setDrawerVal] = useState(false); | 
 |  |  |     const [initDialog, setInitDialog] = useState(false); | 
 |  |  |  | 
 |  |  |     return ( | 
 |  |  |         <Box display="flex"> | 
 |  |  | 
 |  |  |                 title={"menu.loc"} | 
 |  |  |                 empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} | 
 |  |  |                 filters={filters} | 
 |  |  |                 sort={{ field: "create_time", order: "desc" }} | 
 |  |  |                 sort={{ field: "locNo", order: "asc" }} | 
 |  |  |                 actions={( | 
 |  |  |                     <TopToolbar> | 
 |  |  |                         <FilterButton /> | 
 |  |  |                         <Button label='page.loc.init' onClick={(event) => { | 
 |  |  |                             setInitDialog(true); | 
 |  |  |                         }}><CorporateFareIcon /></Button> | 
 |  |  |                         <MyCreateButton onClick={() => { setCreateDialog(true) }} /> | 
 |  |  |                         <SelectColumnsButton preferenceKey='loc' /> | 
 |  |  |                         <MyExportButton /> | 
 |  |  | 
 |  |  |                     rowClick={(id, resource, record) => false} | 
 |  |  |                     expand={() => <LocPanel />} | 
 |  |  |                     expandSingle={true} | 
 |  |  |                     omit={['id', 'locType', 'uuid', 'updateBy', 'createTime', 'createBy', 'memo']} | 
 |  |  |                     omit={['id', 'locType', 'uuid', 'statusBool', 'updateBy', 'createTime', 'createBy', 'memo']} | 
 |  |  |                     rowSx={rowSx(drawerVal || null)} | 
 |  |  |                 > | 
 |  |  |                     <NumberField source="id" /> | 
 |  |  |                     <TextField source="locNo" label="table.field.loc.locNo" /> | 
 |  |  | 
 |  |  |                         <TextField source="data" /> | 
 |  |  |                     </ReferenceField> | 
 |  |  |                     {/* <TextField source="compDirect$" label="table.field.loc.compDirect" sortable={false} /> */} | 
 |  |  |                     <ReferenceField source="locSts" label="table.field.loc.locSts" reference="locSts" link={false} sortable={false}> | 
 |  |  |                     <ReferenceField source="locSts" label="table.field.loc.locSts" reference="locSts" link={false} sortable={true}> | 
 |  |  |                         <TextField source="name" /> | 
 |  |  |                     </ReferenceField> | 
 |  |  |                     <NumberField source="row" label="table.field.loc.row" /> | 
 |  |  | 
 |  |  |                     <TextField source="memo" label="common.field.memo" sortable={false} /> | 
 |  |  |                     <WrapperField cellClassName="opt" label="common.field.opt"> | 
 |  |  |                         <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> | 
 |  |  |                         <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> | 
 |  |  |                         <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={'optimistic'} /> | 
 |  |  |                     </WrapperField> | 
 |  |  |                 </StyledDatagrid> | 
 |  |  |             </List> | 
 |  |  | 
 |  |  |                 setDrawerVal={setDrawerVal} | 
 |  |  |             > | 
 |  |  |             </PageDrawer> | 
 |  |  |             <LocInit | 
 |  |  |                 open={initDialog} | 
 |  |  |                 setOpen={setInitDialog} | 
 |  |  |             /> | 
 |  |  |         </Box> | 
 |  |  |     ) | 
 |  |  | } |