| | |
| | | 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); |
| | |
| | | tooltip, |
| | | legend, |
| | | grid: { |
| | | top: '15%', |
| | | top: '20%', |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '5%', |
| | |
| | | |
| | | return ( |
| | | <div> |
| | | <ReactECharts style={{ height: '360px' }} option={option} /> |
| | | <ReactECharts style={{ height: '320px' }} option={option} /> |
| | | </div> |
| | | ); |
| | | }; |