From 9d71e24e7982f6915e5f832512925bee9b245f35 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 20 八月 2024 16:13:26 +0800
Subject: [PATCH] #

---
 src/pages/right/components/task-charts.jsx |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/pages/right/components/task-charts.jsx b/src/pages/right/components/task-charts.jsx
index 91639b7..2924334 100644
--- a/src/pages/right/components/task-charts.jsx
+++ b/src/pages/right/components/task-charts.jsx
@@ -14,13 +14,18 @@
   const [week, setWeek] = useState(['鍛ㄤ竴', '鍛ㄤ簩', '鍛ㄤ笁', '鍛ㄥ洓', '鍛ㄤ簲', '鍛ㄥ叚', '鍛ㄦ棩']);
 
   useEffect(() => {
-    const timer = setInterval(() => {
+    const fetchTaskCharts = () => {
       getTaskCharts().then(res => {
         setSeriesData(res.data);
         setWeek(res.week);
-        console.log(res);
       })
-    }, 1000);
+    }
+
+    fetchTaskCharts();
+
+    const timer = setInterval(() => {
+      fetchTaskCharts();
+    }, 60000);
 
     return () => {
       clearInterval(timer);
@@ -98,7 +103,7 @@
     tooltip,
     legend,
     grid: {
-      top: '15%',
+      top: '20%',
       left: '3%',
       right: '4%',
       bottom: '5%',
@@ -148,7 +153,7 @@
 
   return (
     <div>
-      <ReactECharts style={{ height: '360px' }} option={option} />
+      <ReactECharts style={{ height: '320px' }} option={option} />
     </div>
   );
 };

--
Gitblit v1.9.1