diff --git a/src/mes/common/siderInfoComponent/index.js b/src/mes/common/siderInfoComponent/index.js index c524046..5d5845d 100644 --- a/src/mes/common/siderInfoComponent/index.js +++ b/src/mes/common/siderInfoComponent/index.js @@ -618,14 +618,17 @@ const DeviceTargetInfoComponent = () => { const settingId = useRef(`settingId_${commonUtils.createSid()}`); const timer = useRef(null); + const isFirstLoad = useRef(true); useEffect( () => { if (bPopup && iPopDuration) { - const restTime = Math.max( - iPopDuration * 60 * 1000 - dProduceHour * 1000, - 0 - ); + // 首次加载时立即弹窗,之后按照restTime轮询 + const restTime = isFirstLoad.current + ? 0 + : Math.max(iPopDuration * 60 * 1000 - dProduceHour * 1000, 0); + isFirstLoad.current = false; + clearTimeout(timer.current); timer.current = null; timer.current = setTimeout(() => {