| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { Box, Card, CardContent, Grid, Typography, Tooltip } from '@mui/material'; |
| | | import { Box, Card, CardContent, Grid, Typography, Tooltip, Pagination } from '@mui/material'; |
| | | import { |
| | | List, |
| | | DatagridConfigurable, |
| | |
| | | CreateButton, |
| | | ExportButton, |
| | | BulkDeleteButton, |
| | | useDataProvider, |
| | | WrapperField, |
| | | useGetList, |
| | | useRecordContext, |
| | | useTranslate, |
| | | useNotify, |
| | |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | useList, |
| | | ReferenceManyField, |
| | | } from 'react-admin'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | |
| | | const translate = useTranslate(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | // const { data, isPending, error } = useGetList('taskItem', { pagination: { page: 1, perPage: 10 } }); |
| | | // const listContext = useList({ |
| | | // data, |
| | | // isPending, |
| | | // perPage: 10, |
| | | // sort: {field: 'create_time', order: 'DESC'} |
| | | // }) |
| | | return ( |
| | | <> |
| | | <Box display="flex"> |
| | | <List |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.taskItem"} |
| | | empty={false} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <ReferenceManyField pagination={<Pagination />} reference="taskItem" target="task_id"> |
| | | <StyledDatagrid |
| | | preferenceKey='taskItem' |
| | | bulkActionButtons={false} |
| | |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <PageDrawer |
| | | title='TaskItem Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </ReferenceManyField> |
| | | </Box> |
| | | </> |
| | | ); |