#
luxiaotao1123
2024-08-20 9d71e24e7982f6915e5f832512925bee9b245f35
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>
  );
};