| | |
| | | DatagridConfigurable, |
| | | SearchInput, |
| | | TopToolbar, |
| | | SelectColumnsButton, |
| | | ColumnsButton, |
| | | FilterButton, |
| | | BulkDeleteButton, |
| | | WrapperField, |
| | |
| | | import * as Common from '@/utils/common'; |
| | | import ColorizeOutlinedIcon from '@mui/icons-material/ColorizeOutlined'; |
| | | import GradingOutlinedIcon from '@mui/icons-material/GradingOutlined'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | | }, |
| | | '& .RaDatagrid-row': { |
| | | cursor: 'auto' |
| | | }, |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 248 |
| | | }, |
| | | '& .MuiTableCell-root': { |
| | | whiteSpace: 'nowrap', |
| | | overflow: 'visible', |
| | | textOverflow: 'unset' |
| | | } |
| | | |
| | | })); |
| | | |
| | | import StickyDataTable from "@/page/components/StickyDataTable"; |
| | | import useTableLayout from '@/utils/useTableLayout'; |
| | | |
| | | const TaskList = (props) => { |
| | | const translate = useTranslate(); |
| | |
| | | ] |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <Box display="flex" sx={{ |
| | | |
| | | }}> |
| | | <List |
| | | queryOptions={{ refetchInterval: 5000 }} |
| | | sx={{ |
| | |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | '& .MuiTableCell-root': { |
| | | whiteSpace: 'nowrap', |
| | | }, |
| | | }} |
| | | title={"menu.task"} |
| | | empty={false} |
| | |
| | | <BulkAutoStartButton autoExce={autoExce} setAutoExce={setAutoExce}/> |
| | | <BulkAutoPauseButton autoExce={autoExce} setAutoExce={setAutoExce} /> |
| | | <FilterButton /> |
| | | <SelectColumnsButton preferenceKey='task' /> |
| | | <ColumnsButton storeKey='task' /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='task' |
| | | <TableItems drawerVal={drawerVal} /> |
| | | </List> |
| | | <PageDrawer |
| | | title='Task Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | ) |
| | | } |
| | | |
| | | export default TaskList; |
| | | |
| | | |
| | | const TableItems = ({ drawerVal }) => { |
| | | const omittedFields = ['id', 'createTime', 'createBy$', 'memo', 'robotCode', 'exceStatus', 'expDesc', 'expCode', 'status', 'warehType$', 'orderType', 'order_type', 'orderType$']; |
| | | const { boxMaxWidth, boxMaxHeight } = useTableLayout(drawerVal); |
| | | return ( |
| | | <Box sx={{ |
| | | position: 'relative', |
| | | maxHeight: boxMaxHeight, |
| | | maxWidth: boxMaxWidth, |
| | | overflowX: 'auto', |
| | | overflowY: 'auto', |
| | | '& .MuiTableCell-root': { |
| | | whiteSpace: 'nowrap', |
| | | } |
| | | }}> |
| | | <StickyDataTable |
| | | stickyRight={['opt']} |
| | | storeKey='task' |
| | | bulkActionButtons={false} |
| | | rowClick={false} |
| | | hiddenColumns={omittedFields} |
| | | expand={<TaskPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy$', 'memo', 'robotCode', 'exceStatus', 'expDesc', 'expCode', 'status','warehType$', 'orderType', 'order_type', 'orderType$']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="taskCode" label="table.field.task.taskCode" /> |
| | |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt" onClick={(e) => e.stopPropagation()} > |
| | | <WrapperField source="opt" cellClassName="opt" label="common.field.opt" onClick={(e) => e.stopPropagation()} > |
| | | <EditButton label="toolbar.detail" /> |
| | | <DoneButton sx={{ padding: '1px', fontSize: '.75rem' }} ></DoneButton> |
| | | <CancelButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | |
| | | <PickButton /> |
| | | <SetTopButton /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <PageDrawer |
| | | title='Task Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </StickyDataTable> |
| | | </Box> |
| | | ) |
| | | } |
| | | |
| | | export default TaskList; |
| | | |
| | | /** |
| | | * 盘点 |