From 4aa60d9e08ed3e9bcd787d17cc771e50f8555a8a Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期日, 29 九月 2024 10:41:25 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/page/mission/MissionListContent.jsx |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/zy-acs-flow/src/page/mission/MissionListContent.jsx b/zy-acs-flow/src/page/mission/MissionListContent.jsx
index 8c4626a..a6244d7 100644
--- a/zy-acs-flow/src/page/mission/MissionListContent.jsx
+++ b/zy-acs-flow/src/page/mission/MissionListContent.jsx
@@ -1,7 +1,6 @@
 import { useEffect, useState } from 'react';
 import { DragDropContext } from '@hello-pangea/dnd';
-import { Box } from '@mui/material';
-import isEqual from 'lodash/isEqual';
+import { Box, LinearProgress } from '@mui/material';
 import {
     useDataProvider,
     useListContext,
@@ -11,19 +10,16 @@
 } from 'react-admin';
 import { MissionColumn } from './MissionColumn';
 import request from '@/utils/request';
+import { CUSTOM_PAGES_DATA_INTERVAL } from '@/config/setting';
 
 export const MissionListContent = () => {
     const translate = useTranslate();
     const notify = useNotify();
     const refresh = useRefresh();
-    const { data, isPending, refetch } = useListContext();
     const dataProvider = useDataProvider();
+    const { data, isPending, refetch } = useListContext();
 
     const [stages, setStages] = useState([]);
-
-    // const [dealsByStage, setDealsByStage] = useState(
-    //     getDealsByStage([], dealStages)
-    // );
 
     useEffect(() => {
         const httpStages = async () => {
@@ -39,7 +35,15 @@
             })
         }
         httpStages();
-    }, []);
+    }, [notify]);
+
+    useEffect(() => {
+        const intervalId = setInterval(() => {
+            refetch();
+        }, CUSTOM_PAGES_DATA_INTERVAL);
+
+        return () => clearInterval(intervalId);
+    }, [refetch])
 
     useEffect(() => {
         // if (data) {
@@ -51,7 +55,7 @@
         // eslint-disable-next-line react-hooks/exhaustive-deps
     }, [data]);
 
-    if (isPending) return null;
+    if (isPending) return <LinearProgress />;
 
     const onDragEnd = result => {
         const { destination, source } = result;

--
Gitblit v1.9.1