From 4f1728a730b2cf93e9e9f8cfade46a0559e34287 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期二, 14 五月 2024 15:03:43 +0800 Subject: [PATCH] # --- src/pages/left/components/loc-charts.jsx | 26 ++++++++++++++++---------- 1 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/pages/left/components/loc-charts.jsx b/src/pages/left/components/loc-charts.jsx index 728b666..0029878 100644 --- a/src/pages/left/components/loc-charts.jsx +++ b/src/pages/left/components/loc-charts.jsx @@ -6,23 +6,27 @@ const LocCharts = () => { const [trafficWay, setTrafficWay] = useState([ { - name: 'HG', + name: '绌洪棽', value: 20, }, { - name: 'RG', + name: '鍦ㄥ簱', value: 10, }, { - name: 'MG', + name: '鍏ュ簱', value: 20, }, { - name: 'FM', + name: '鍑哄簱', value: 10, }, { - name: 'PG', + name: '绂佺敤', + value: 30, + }, + { + name: '鍏朵粬', value: 30, }, ]); @@ -30,10 +34,12 @@ useEffect(() => { const timer = setInterval(() => { getLocCharts().then(res => { - // setApiData(res.reverse().map(item => { - // return ["AGV" + item.agvNo, "0000" + Number(item.qrcode), item.angle.toFixed(1) + "掳", item.height] - // })) - console.log(res); + setTrafficWay(res.map(item => { + return { + name: item.name.substr(0, 2), + value: item.count + } + })) }) }, 3000); @@ -139,7 +145,7 @@ itemWidth: 8, orient: 'horizontal', // x: 'left', - data: ['HG', 'RG', 'MG', 'FM', 'PG'], + data: ['绌洪棽', '鍦ㄥ簱', '鍏ュ簱', '鍑哄簱', '绂佺敤', '鍏朵粬'], left: 10, bottom: 20, align: 'left', -- Gitblit v1.9.1