From 3fa7cdec6ce44f07a0dc7e1910511ead606990f3 Mon Sep 17 00:00:00 2001 From: zhang <zc857179121@qq.com> Date: 星期四, 11 九月 2025 08:19:53 +0800 Subject: [PATCH] 1 --- zy-acs-flow/src/map/insight/agv/index.jsx | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/zy-acs-flow/src/map/insight/agv/index.jsx b/zy-acs-flow/src/map/insight/agv/index.jsx index 43b8123..8cd484e 100644 --- a/zy-acs-flow/src/map/insight/agv/index.jsx +++ b/zy-acs-flow/src/map/insight/agv/index.jsx @@ -1,6 +1,7 @@ import React, { useState, useRef, useEffect } from 'react'; import { useTranslate } from "react-admin"; import { Box, Typography, Tabs, Tab, Stack, useTheme, Divider } from '@mui/material'; +import { CUSTOM_PAGES_DATA_INTERVAL } from '@/config/setting'; import AgvMain from './AgvMain'; import AgvControl from './AgvControl'; import JsonShow from '../../JsonShow'; @@ -24,16 +25,23 @@ } useEffect(() => { + let intervalId; if (sprite) { const agvNo = sprite.data.no; if (agvNo) { fetchAgvInfo(agvNo); + intervalId = setInterval(() => { + fetchAgvInfo(agvNo); + }, CUSTOM_PAGES_DATA_INTERVAL); } } return () => { setTitle(null); setCurAgvInfo(null); + if (intervalId) { + clearInterval(intervalId) + } } }, [sprite]) -- Gitblit v1.9.1