|  |  | 
 |  |  |     DateInput, | 
 |  |  |     SelectInput, | 
 |  |  |     NumberInput, | 
 |  |  |  | 
 |  |  |     Button, | 
 |  |  | } from 'react-admin'; | 
 |  |  | import { Box, Typography, Card, Stack, Drawer } from '@mui/material'; | 
 |  |  | 
 |  |  |     />, | 
 |  |  | ] | 
 |  |  |  | 
 |  |  | const TaskList = () => { | 
 |  |  | const TaskList = (props) => { | 
 |  |  |     const translate = useTranslate(); | 
 |  |  |     const [drawerVal, setDrawerVal] = useState(false); | 
 |  |  |     return ( | 
 |  |  | 
 |  |  |                 title={"menu.task"} | 
 |  |  |                 empty={false} | 
 |  |  |                 filters={filters} | 
 |  |  |                 sort={{ field: "sort", order: "desc" }} | 
 |  |  |                 sort={{ field: "create_time", order: "desc" }} | 
 |  |  |                 actions={( | 
 |  |  |                     <TopToolbar> | 
 |  |  |                         <FilterButton /> | 
 |  |  | 
 |  |  |                     <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} /> */} | 
 |  |  |                     <TextField source="memo" label="common.field.memo" sortable={false} /> | 
 |  |  |                     <WrapperField cellClassName="opt" label="common.field.opt"> | 
 |  |  |                     <WrapperField cellClassName="opt" label="common.field.opt" onClick={(e) => e.stopPropagation()} > | 
 |  |  |                         <DoneButton sx={{ padding: '1px', fontSize: '.75rem' }} ></DoneButton> | 
 |  |  |                         <CancelButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> | 
 |  |  |                         <SetTopButton sx={{ padding: '1px', fontSize: '.75rem' }} ></SetTopButton> | 
 |  |  | 
 |  |  |  * 完成操作 | 
 |  |  |  * @returns  | 
 |  |  |  */ | 
 |  |  | const DoneButton = () => { | 
 |  |  | const DoneButton = (props) => { | 
 |  |  |     const record = useRecordContext(); | 
 |  |  |     const clickComplete = () => { | 
 |  |  |         completeTask([record]) | 
 |  |  |     const notify = useNotify(); | 
 |  |  |     const refresh = useRefresh(); | 
 |  |  |     const clickComplete = (event) => { | 
 |  |  |         event.stopPropagation(); | 
 |  |  |         completeTask(record) | 
 |  |  |     }; | 
 |  |  |     //完成任务 | 
 |  |  |     const completeTask = async (row) => { } | 
 |  |  |     const completeTask = async (row) => { | 
 |  |  |         console.log(row.id); | 
 |  |  |         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} | 
 |  |  | 
 |  |  |     const record = useRecordContext(); | 
 |  |  |     const notify = useNotify(); | 
 |  |  |     const refresh = useRefresh(); | 
 |  |  |     const clickCancel = () => { | 
 |  |  |     const clickCancel = (event) => { | 
 |  |  |         event.stopPropagation(); | 
 |  |  |         cancleTask(record) | 
 |  |  |     }; | 
 |  |  |     //取消任务 | 
 |  |  | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |     return ( | 
 |  |  |         <Button | 
 |  |  |             onClick={clickCancel} | 
 |  |  |             label="toolbar.cancel"> | 
 |  |  |             <CancelIcon /> | 
 |  |  |         </Button> | 
 |  |  |         record.taskStatus === 1 ? | 
 |  |  |             <Button | 
 |  |  |                 onClick={clickCancel} | 
 |  |  |                 label="toolbar.cancel"> | 
 |  |  |                 <CancelIcon /> | 
 |  |  |             </Button> | 
 |  |  |             : | 
 |  |  |             <></> | 
 |  |  |     ) | 
 |  |  | } | 
 |  |  | /** | 
 |  |  | 
 |  |  |     const record = useRecordContext(); | 
 |  |  |     const notify = useNotify(); | 
 |  |  |     const refresh = useRefresh(); | 
 |  |  |     const clickTop = () => { | 
 |  |  |     const clickTop = (event) => { | 
 |  |  |         event.stopPropagation(); | 
 |  |  |         topTask(record) | 
 |  |  |     }; | 
 |  |  |     //置顶任务 | 
 |  |  | 
 |  |  |         } else { | 
 |  |  |             notify(msg); | 
 |  |  |         } | 
 |  |  |      } | 
 |  |  |     } | 
 |  |  |     return ( | 
 |  |  |         <Button | 
 |  |  |             onClick={clickTop} |