From 281069d9434aad8e0245be45580402f7a9a798d0 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期五, 29 十一月 2024 15:50:32 +0800 Subject: [PATCH] # --- 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