From ae2f9a18e28a7e223e8831fef82e14fd94e26193 Mon Sep 17 00:00:00 2001
From: vincentlu <t1341870251@gmail.com>
Date: 星期一, 07 四月 2025 16:37:54 +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