File was renamed from rsf-admin/src/page/customer/CustomerList.jsx |
| | |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import CustomerCreate from "./CustomerCreate"; |
| | | import CustomerPanel from "./CustomerPanel"; |
| | | import DictTypeCreate from "./DictTypeCreate"; |
| | | import DictTypePanel from "./DictTypePanel"; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | |
| | | <TextInput source="uuid" label="table.field.customer.uuid" />, |
| | | <TextInput source="name" label="table.field.customer.name" />, |
| | | <TextInput source="uuid" label="table.field.dictType.uuid" />, |
| | | <TextInput source="name" label="table.field.dictType.name" />, |
| | | <TextInput source="description" label="table.field.dictType.description" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | |
| | | />, |
| | | ] |
| | | |
| | | const CustomerList = () => { |
| | | const DictTypeList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | |
| | | }), |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.customer"} |
| | | title={"menu.dictType"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='customer' /> |
| | | <SelectColumnsButton preferenceKey='dictType' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='customer' |
| | | preferenceKey='dictType' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <CustomerPanel />} |
| | | expand={() => <DictTypePanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="uuid" label="table.field.customer.uuid" /> |
| | | <TextField source="name" label="table.field.customer.name" /> |
| | | <TextField source="name" label="table.field.dictType.name" /> |
| | | <TextField source="description" label="table.field.dictType.description" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <CustomerCreate |
| | | <DictTypeCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='Customer Detail' |
| | | title='DictType Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | |
| | | ) |
| | | } |
| | | |
| | | export default CustomerList; |
| | | export default DictTypeList; |