Browse Source

告警数据

dev
wenlele 2 years ago
parent
commit
167b4c1705
  1. 14
      web/client/src/sections/problem/components/sideSheet.jsx

14
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) => { dispatch(problem.getAlarmDataDetailAgg({ alarmId: "fa7fd145-f251-3657-8176-8f8f04a92a96" })).then((res) => {
if (res?.success) { 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 = { let data = {
xAxis: { xAxis: {
type: 'category', type: 'category',
name:"时间", name: "时间",
show :true, data: dataSort.map(v => v.hour)
data: res.payload.data.map(v=>v.hours)
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
name:"次数", name: "次数",
}, },
series: [ series: [
{ {
data:res.payload.data.map(v=>v.count) , data: dataSort.map(v => v.count),
type: 'line' type: 'line'
} }
] ]

Loading…
Cancel
Save