| | |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <BulkPauseButton /> |
| | | <ContinueButton /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | |
| | | |
| | | const BulkPauseButton = () => { |
| | | const { data, selectedIds, onUnselectItems } = useListContext(); |
| | | const notify = useNotify() |
| | | const record = useRecordContext(); |
| | | const pauseClick = () => { |
| | | onUnselectItems(); |
| | | const pauseClick = async () => { |
| | | const { data: { code, data, msg } } = await request.post('/waveItem/pause/pub', { wave: waveId, waveItem: selectedIds }); |
| | | if (code === 200) { |
| | | notify(msg); |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | return ( |
| | | record?.exceStatus == 1 ? <Button label="toolbar.pause" onClick={pauseClick} startIcon={<PauseCircleOutlineIcon />} /> : <></> |
| | | ) |
| | | } |
| | | |
| | | const ContinueButton = () => { |
| | | const { data, selectedIds, onUnselectItems } = useListContext(); |
| | | const notify = useNotify() |
| | | const record = useRecordContext(); |
| | | const continueClick = async () => { |
| | | const { data: { code, data, msg } } = await request.post('/waveItem/continue/pub', { wave: waveId, waveItem: selectedIds }); |
| | | if (code === 200) { |
| | | notify(msg); |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | return ( |
| | | record?.exceStatus == 4 ? <Button label="toolbar.continuePub" onClick={continueClick} startIcon={<PauseCircleOutlineIcon />} /> : <></> |
| | | ) |
| | | } |