| | |
| | | } |
| | | return Promise.reject(new Error(res.data.msg)); |
| | | } |
| | | |
| | | export async function getLocCharts(_params) { |
| | | const res = await request.get('/digital/charts/loccharts', _params); |
| | | if (res.data.code === 200) { |
| | | return res.data.data; |
| | | } |
| | | return Promise.reject(new Error(res.data.msg)); |
| | | } |
| | |
| | | import { useEffect, useState } from 'react'; |
| | | import ReactECharts from 'echarts-for-react'; |
| | | import * as echarts from 'echarts/core'; |
| | | import { getLocCharts } from '@/api/report'; |
| | | |
| | | const LocCharts = () => { |
| | | const [trafficWay, setTrafficWay] = useState([ |
| | |
| | | |
| | | useEffect(() => { |
| | | const timer = setInterval(() => { |
| | | // getAgvCharts().then(res => { |
| | | getLocCharts().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); |
| | | console.log(res); |
| | | }) |
| | | }, 3000); |
| | | |
| | | return () => { |
| | | clearInterval(timer); |