From 5a51d49437976e2fbb26e33231c00531fa3f8bff Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 14 五月 2024 14:04:28 +0800
Subject: [PATCH] #

---
 src/pages/left/components/loc-charts.jsx |   28 ++++++++++++++++++++++------
 1 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/src/pages/left/components/task-charts.jsx b/src/pages/left/components/loc-charts.jsx
similarity index 83%
rename from src/pages/left/components/task-charts.jsx
rename to src/pages/left/components/loc-charts.jsx
index 44a091a..a4ca30d 100644
--- a/src/pages/left/components/task-charts.jsx
+++ b/src/pages/left/components/loc-charts.jsx
@@ -1,9 +1,9 @@
-import React from 'react';
+import { useEffect, useState } from 'react';
 import ReactECharts from 'echarts-for-react';
 import * as echarts from 'echarts/core';
 
-const TaskCharts = () => {
-  const trafficWay = [
+const LocCharts = () => {
+  const [trafficWay, setTrafficWay] = useState([
     {
       name: 'HG',
       value: 20,
@@ -24,7 +24,23 @@
       name: 'PG',
       value: 30,
     },
-  ];
+  ]);
+
+  useEffect(() => {
+    const timer = setInterval(() => {
+      // getAgvCharts().then(res => {
+      //   setApiData(res.reverse().map(item => {
+      //     return ["AGV" + item.agvNo, "0000" + Number(item.qrcode), item.angle.toFixed(1) + "掳", item.height]
+      //   }))
+      // })
+      console.log("aasadsa");
+    }, 1000);
+
+    return () => {
+      clearInterval(timer);
+    }
+  }, []);
+
 
   const data = [];
   const color = ['#00ffff', '#00cfff', '#006ced', '#ffe000', '#ffa800', '#ff5b00'];
@@ -145,10 +161,10 @@
   return (
     <>
       <div>
-        <ReactECharts style={{ height: '250px' }} option={option} />
+        <ReactECharts style={{ height: '300px' }} option={option} />
       </div>
     </>
   );
 };
 
-export default TaskCharts;
+export default LocCharts;

--
Gitblit v1.9.1