| | |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='task' |
| | | bulkActionButtons={false |
| | | // <> |
| | | // <BulkResortButton /> |
| | | // <BulkCancelButton /> |
| | | // <BulkDeleteButton mutationMode={OPERATE_MODE} /> |
| | | // </> |
| | | } |
| | | bulkActionButtons={false} |
| | | rowClick={false} |
| | | expand={<TaskPanel />} |
| | | expandSingle={true} |
| | |
| | | } |
| | | } |
| | | return ( |
| | | ((record?.taskStatus < 98) || (record?.taskType >= 101 && record?.taskStatus < 198)) || (record?.taskType == 11 && record?.taskStatus == 101) ? (<ConfirmButton label={"toolbar.complete"} color="secondary" startIcon={<TaskAltIcon />} onConfirm={clickComplete} />) : (<></>) |
| | | ((record?.taskStatus < 98) || (record?.taskType >= 101 && record?.taskStatus < 198)) || (record?.taskType == 11 && record?.taskStatus == 101) ? (<ConfirmButton label={"toolbar.complete"} color="secondary" startIcon={<TaskAltIcon />} onConfirm={clickComplete} />) : (<></>) |
| | | ) |
| | | } |
| | | |
| | |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const clickCancel = (event) => { |
| | | event.stopPropagation(); |
| | | const clickCancel = () => { |
| | | cancleTask(record) |
| | | }; |
| | | //取消任务 |
| | | const cancleTask = async (row) => { |
| | | console.log(row); |
| | | const { data: { code, data, msg } } = await request.post(`/task/remove/` + row.id); |
| | | if (code === 200) { |
| | | notify(msg); |
| | |
| | | } |
| | | return ( |
| | | (record.taskStatus == 1 || record.taskStatus == 101) && (record.taskType == 1 || record.taskType == 101 || record.taskType == 10 || record.taskType == 103 || record.taskType == 11) ? |
| | | <Button |
| | | onClick={clickCancel} |
| | | label="toolbar.cancel"> |
| | | <CancelIcon /> |
| | | </Button> |
| | | <ConfirmButton |
| | | onConfirm={clickCancel} |
| | | startIcon={<CancelIcon />} |
| | | label={"toolbar.cancel"}> |
| | | </ConfirmButton> |
| | | : |
| | | <></> |
| | | ) |
| | |
| | | refresh(); |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | } |
| | | return ( |
| | | (record.taskStatus == 1 || record.taskStatus == 101) && (record.taskType == 1 || record.taskType == 101 || record.taskType == 10 || record.taskType == 103 || record.taskType == 11) ? |
| | |
| | | label="toolbar.top"> |
| | | <AlignVerticalTopIcon /> |
| | | </Button> |
| | | : |
| | | <></> |
| | | : |
| | | <></> |
| | | ) |
| | | } |
| | | |