| | |
| | | width: 90 |
| | | }, |
| | | '& .opt': { |
| | | width: 180 |
| | | width: 210 |
| | | }, |
| | | })); |
| | | |
| | |
| | | const createTask = () => { |
| | | setSiteDialog(true) |
| | | setSource(rows) |
| | | onUnselectItems() |
| | | refresh() |
| | | } |
| | | |
| | |
| | | ) |
| | | } |
| | | |
| | | const BulkActionButtons = () => { |
| | | const CreateTaskRowButton = () => { |
| | | const record = useRecordContext(); |
| | | const refresh = useRefresh(); |
| | | |
| | | const createTask = (event) => { |
| | | event.stopPropagation(); |
| | | setSiteDialog(true) |
| | | setSource([record]) |
| | | refresh() |
| | | } |
| | | |
| | | return ( |
| | | <> |
| | | <Button onClick={(event) => createTask(event)} label={"toolbar.createTask"}> |
| | | <AddIcon /> |
| | | </Button> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.waitPakin"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | empty={false} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | |
| | | bulkActionButtons={ |
| | | <> |
| | | <CreateTaskButton /> |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} /> |
| | | {/* <BulkDeleteButton mutationMode={OPERATE_MODE} /> */} |
| | | </>} |
| | | rowClick='edit' |
| | | rowClick={false} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton label="toolbar.detail" sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | {/* <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> */} |
| | | <CreateTaskRowButton /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | |
| | | export default WaitPakinList; |
| | | |
| | | |
| | | |
| | | |