| | |
| | | return res.data.data; |
| | | } |
| | | return Promise.reject(new Error(res.data.msg)); |
| | | } |
| | | |
| | | export async function getInout(_params) { |
| | | const res = await request.get('/digital/charts/inout', _params); |
| | | if (res.data.code === 200) { |
| | | return res.data.data; |
| | | } |
| | | return Promise.reject(new Error(res.data.msg)); |
| | | } |
| | |
| | | import { useEffect, useState } from 'react'; |
| | | import { ScrollBoard } from '@jiaminghi/data-view-react'; |
| | | import { getAgvCharts } from '@/api/report'; |
| | | import { getAgvCharts, getInout } from '@/api/report'; |
| | | |
| | | const InOutCharts = () => { |
| | | |
| | |
| | | |
| | | useEffect(() => { |
| | | const timer = setInterval(() => { |
| | | getAgvCharts().then(res => { |
| | | getInout().then(res => { |
| | | setApiData(res.reverse().map(item => { |
| | | return ["AGV" + item.agvNo, item.loaderTheta + "°", item.forkLength, item.inOutFlag] |
| | | return ["AGV" + item.agvNo, item.name] |
| | | })) |
| | | }) |
| | | }, 1000); |
| | | }, 3000); |
| | | |
| | | return () => { |
| | | clearInterval(timer); |
| | |
| | | return ( |
| | | <ScrollBoard |
| | | config={{ |
| | | header: ['编号', '载货台', '货叉', '作业'], |
| | | header: ['编号', '作业'], |
| | | data: apiData, |
| | | headerBGC: '#00fff138', |
| | | oddRowBGC: '#00000017', |
| | |
| | | setSeriesData(res.data); |
| | | setWeek(res.week); |
| | | }) |
| | | }, 1000); |
| | | }, 60000); |
| | | |
| | | return () => { |
| | | clearInterval(timer); |