| | |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | FunctionField, |
| | | Pagination, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { Box, Chip, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import TaskCreate from "./TaskCreate"; |
| | | import TaskPanel from "./TaskPanel"; |
| | |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | import TaskListAside from "./TaskListAside"; |
| | | import { getTaskStsChipColor } from '@/utils/color-util'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | pagination={<Pagination rowsPerPageOptions={[10, 20, 50, 100]} />} |
| | | perPage={20} |
| | | aside={<TaskListAside />} |
| | | > |
| | | <StyledDatagrid |
| | |
| | | <ReferenceField source="taskType" label="table.field.task.taskType" reference="taskType" link={false} sortable={false}> |
| | | <TextField source="name" /> |
| | | </ReferenceField> |
| | | <ReferenceField source="taskSts" label="table.field.task.taskSts" reference="taskSts" link={false} sortable={false}> |
| | | {/* <ReferenceField source="taskSts" label="table.field.task.taskSts" reference="taskSts" link={false} sortable={false}> |
| | | <TextField source="name" /> |
| | | </ReferenceField> */} |
| | | <ReferenceField source="taskSts" label="table.field.task.taskSts" reference="taskSts" link={false} sortable={true}> |
| | | <FunctionField render={record => ( |
| | | <Chip |
| | | label={record.name} |
| | | variant="outlined" |
| | | size="small" |
| | | color={getTaskStsChipColor(record.name)} |
| | | sx={{ fontSize: '0.75rem' }} |
| | | /> |
| | | )} /> |
| | | {/* <TextField source="name" /> */} |
| | | </ReferenceField> |
| | | <NumberField source="priority" label="table.field.task.priority" /> |
| | | <DateField source="ioTime" label="table.field.task.ioTime" showTime /> |