From 167b4c17054c4f1082bca8a4727783ffd41f3d87 Mon Sep 17 00:00:00 2001 From: wenlele Date: Sat, 24 Sep 2022 17:57:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/problem/components/sideSheet.jsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/web/client/src/sections/problem/components/sideSheet.jsx b/web/client/src/sections/problem/components/sideSheet.jsx index 5cc4b94..e8ac822 100644 --- a/web/client/src/sections/problem/components/sideSheet.jsx +++ b/web/client/src/sections/problem/components/sideSheet.jsx @@ -30,21 +30,23 @@ function SideSheets ({ dispatch, actions, close }) { }); dispatch(problem.getAlarmDataDetailAgg({ alarmId: "fa7fd145-f251-3657-8176-8f8f04a92a96" })).then((res) => { if (res?.success) { - console.log(res.payload.data); + let dataSort = res.payload.data || [] + console.log(dataSort); + // moment.duration(videoAfter?.diff(videoFront))._data.milliseconds; + dataSort.sort((a, b) => moment(a.hours).diff(b.hours)) let data = { xAxis: { type: 'category', - name:"时间", - show :true, - data: res.payload.data.map(v=>v.hours) + name: "时间", + data: dataSort.map(v => v.hour) }, yAxis: { type: 'value', - name:"次数", + name: "次数", }, series: [ { - data:res.payload.data.map(v=>v.count) , + data: dataSort.map(v => v.count), type: 'line' } ]