From 523d8cf68615134c7780f74933e70a14edb60f01 Mon Sep 17 00:00:00 2001 From: skyouc <958836976@qq.com> Date: 星期五, 05 九月 2025 17:00:39 +0800 Subject: [PATCH] wcs联调功能优化 --- rsf-admin/src/page/task/TaskList.jsx | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 52 insertions(+), 1 deletions(-) diff --git a/rsf-admin/src/page/task/TaskList.jsx b/rsf-admin/src/page/task/TaskList.jsx index 4fa167a..55d5af7 100644 --- a/rsf-admin/src/page/task/TaskList.jsx +++ b/rsf-admin/src/page/task/TaskList.jsx @@ -37,7 +37,10 @@ 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'; @@ -67,7 +70,19 @@ 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(() => { @@ -127,6 +142,8 @@ sort={{ field: "sort", order: "desc" }} actions={( <TopToolbar> + <BulkAutoStartButton autoExce={autoExce} setAutoExce={setAutoExce}/> + <BulkAutoPauseButton autoExce={autoExce} setAutoExce={setAutoExce} /> <FilterButton /> <SelectColumnsButton preferenceKey='task' /> </TopToolbar> @@ -205,6 +222,40 @@ 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 />} /> : <></> + ) +} + + /** * 鎷f枡鍑哄簱 * @returns -- Gitblit v1.9.1