| | |
| | | <TextField source="expDesc" label="table.field.task.expDesc" /> |
| | | <NumberField source="sort" label="table.field.task.sort" /> |
| | | <TextField source="expCode" label="table.field.task.expCode" /> |
| | | <TextField source="updateBy$" label="common.field.updateBy"/> |
| | | <TextField source="createBy$" label="common.field.createBy"/> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | {/* <BooleanField source="statusBool" label="common.field.status" sortable={false} /> */} |
| | |
| | | */ |
| | | const DoneButton = () => { |
| | | const record = useRecordContext(); |
| | | const clickComplete = () => { |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const clickComplete = (event) => { |
| | | event.stopPropagation(); |
| | | completeTask([record]) |
| | | }; |
| | | //完成任务 |
| | | const completeTask = async (row) => { } |
| | | const completeTask = async (row) => { |
| | | const { data: { code, data, msg } } = await request.post(`task/complete/` + row.id); |
| | | if (code === 200) { |
| | | notify(msg); |
| | | refresh(); |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | return ( |
| | | <Button |
| | | onClick={clickComplete} |
| | |
| | | cancleTask(record) |
| | | }; |
| | | //取消任务 |
| | | const cancleTask = async (row) => { |
| | | const cancleTask = async (row) => { |
| | | console.log(row); |
| | | const { data: { code, data, msg } } = await request.post(`/task/remove/` + row.id); |
| | | if (code === 200) { |
| | |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | } |
| | | return ( |
| | | <Button |
| | | onClick={clickTop} |