|  |  | 
 |  |  | import TaskPanel from "./TaskPanel"; | 
 |  |  | import MyField from "../components/MyField"; | 
 |  |  | import ConfirmButton from "../components/ConfirmButton"; | 
 |  |  | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; | 
 |  |  | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE, AUTO_RUN_CHECK_ORDERS } from '@/config/setting'; | 
 |  |  | import PlayArrowOutlinedIcon from '@mui/icons-material/PlayArrowOutlined'; | 
 |  |  | import PauseIcon from '@mui/icons-material/Pause'; | 
 |  |  | import PauseCircleOutlineIcon from '@mui/icons-material/PauseCircleOutline'; | 
 |  |  | import * as Common from '@/utils/common'; | 
 |  |  | import ColorizeOutlinedIcon from '@mui/icons-material/ColorizeOutlined'; | 
 |  |  | import GradingOutlinedIcon from '@mui/icons-material/GradingOutlined'; | 
 |  |  | 
 |  |  |     const translate = useTranslate(); | 
 |  |  |     const refresh = useRefresh(); | 
 |  |  |     const [drawerVal, setDrawerVal] = useState(false); | 
 |  |  |     const [autoExce, setAutoExce] = useState(false); | 
 |  |  |     const dict = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_warehouse_type')) || []; | 
 |  |  |  | 
 |  |  |     useEffect(() => { | 
 |  |  |         getConfig() | 
 |  |  |     }, []) | 
 |  |  |  | 
 |  |  |     const getConfig = async () => { | 
 |  |  |         const { data: { code, data, msg } } = await request.get('/config/flag/' + AUTO_RUN_CHECK_ORDERS); | 
 |  |  |         if (code === 200) { | 
 |  |  |             setAutoExce(JSON.parse(data?.val)) | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     // useEffect(() => { | 
 |  |  |     //     const interval = setInterval(() => { | 
 |  |  | 
 |  |  |                 sort={{ field: "sort", order: "desc" }} | 
 |  |  |                 actions={( | 
 |  |  |                     <TopToolbar> | 
 |  |  |                         <BulkAutoStartButton autoExce={autoExce} setAutoExce={setAutoExce}/> | 
 |  |  |                         <BulkAutoPauseButton autoExce={autoExce} setAutoExce={setAutoExce} /> | 
 |  |  |                         <FilterButton /> | 
 |  |  |                         <SelectColumnsButton preferenceKey='task' /> | 
 |  |  |                     </TopToolbar> | 
 |  |  | 
 |  |  |     return (record?.taskStatus == 199 && record?.taskType == 107 ? <ConfirmButton label={"toolbar.check"} startIcon={<GradingOutlinedIcon />} onConfirm={checkClick} /> : <></>) | 
 |  |  | } | 
 |  |  |  | 
 |  |  | /**自动下发任务**/ | 
 |  |  | const BulkAutoStartButton = ({ autoExce, setAutoExce }) => { | 
 |  |  |     const notify = useNotify(); | 
 |  |  |     const startClick = async () => { | 
 |  |  |         setAutoExce(true) | 
 |  |  |         const { data: { code, data, msg } } = await request.post('/config/byFlag', { val: true, flag: 'AUTO_RUN_CHECK_ORDERS' }); | 
 |  |  |         if (code === 200) { | 
 |  |  |             notify(msg); | 
 |  |  |         } else { | 
 |  |  |             notify(msg); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |     return ( | 
 |  |  |         !autoExce ? <Button label="toolbar.autoStartLocs" onClick={startClick} startIcon={<PlayArrowOutlinedIcon />} /> : <></> | 
 |  |  |     ) | 
 |  |  | } | 
 |  |  |  | 
 |  |  | const BulkAutoPauseButton = ({ autoExce, setAutoExce }) => { | 
 |  |  |     const notify = useNotify(); | 
 |  |  |     const pauseClick = async () => { | 
 |  |  |         const { data: { code, data, msg } } = await request.post('/config/byFlag', { val: false, flag: 'AUTO_RUN_CHECK_ORDERS' }); | 
 |  |  |         if (code === 200) { | 
 |  |  |             notify(msg); | 
 |  |  |             setAutoExce(false) | 
 |  |  |         } else { | 
 |  |  |             notify(msg); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |     return ( | 
 |  |  |         autoExce ? <Button label="toolbar.pause" onClick={pauseClick} startIcon={<PauseIcon />} /> : <></> | 
 |  |  |     ) | 
 |  |  | } | 
 |  |  |  | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * 拣料出库 | 
 |  |  |  * @returns  |