|
|
@ -8,7 +8,7 @@ import ReactECharts from 'echarts-for-react'; |
|
|
|
|
|
|
|
let projectScrollbar; |
|
|
|
|
|
|
|
function SideSheets ({ dispatch, actions, close }) { |
|
|
|
function SideSheets ({ dispatch, actions, close, alarmId }) { |
|
|
|
|
|
|
|
const { problem } = actions; |
|
|
|
const [clickStyle, setclickStyle] = useState(); |
|
|
@ -19,7 +19,8 @@ function SideSheets ({ dispatch, actions, close }) { |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
dispatch(problem.getAlarmDataDetail({ alarmId: "fa7fd145-f251-3657-8176-8f8f04a92a96" })).then((res) => { |
|
|
|
if (alarmId) { |
|
|
|
dispatch(problem.getAlarmDataDetail({ alarmId: alarmId })).then((res) => { |
|
|
|
if (res?.success) { |
|
|
|
console.log(res.payload.data); |
|
|
|
setdataSource(res.payload.data); |
|
|
@ -28,10 +29,10 @@ function SideSheets ({ dispatch, actions, close }) { |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
dispatch(problem.getAlarmDataDetailAgg({ alarmId: "fa7fd145-f251-3657-8176-8f8f04a92a96" })).then((res) => { |
|
|
|
dispatch(problem.getAlarmDataDetailAgg({ alarmId: alarmId })).then((res) => { |
|
|
|
if (res?.success) { |
|
|
|
let dataSort = res.payload.data || [] |
|
|
|
console.log(dataSort); |
|
|
|
// console.log(dataSort); |
|
|
|
// moment.duration(videoAfter?.diff(videoFront))._data.milliseconds; |
|
|
|
dataSort.sort((a, b) => { |
|
|
|
if (moment(a.hours).isBefore(b.hours)) { |
|
|
@ -40,7 +41,7 @@ function SideSheets ({ dispatch, actions, close }) { |
|
|
|
return 1 |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log(dataSort); |
|
|
|
// console.log(dataSort); |
|
|
|
let data = { |
|
|
|
dataZoom: [ |
|
|
|
{ |
|
|
@ -80,11 +81,13 @@ function SideSheets ({ dispatch, actions, close }) { |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
console.log(data); |
|
|
|
// console.log(data); |
|
|
|
setOption(data) |
|
|
|
// setNvrDetails(res.payload.data); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
}, []); |
|
|
|
|
|
|
|
|
|
|
@ -102,7 +105,7 @@ function SideSheets ({ dispatch, actions, close }) { |
|
|
|
rowKey: 'AlarmState', |
|
|
|
render: (_, r, index) => { |
|
|
|
let data = { 0: '首次产生', 1: '持续产生', 2: '等级提升', 3: '自动恢复', 4: '人工恢复' } |
|
|
|
return data[r.AlarmState] |
|
|
|
return data[r.AlarmState] || '' |
|
|
|
}, |
|
|
|
}, { |
|
|
|
title: "告警信息", |
|
|
@ -114,7 +117,7 @@ function SideSheets ({ dispatch, actions, close }) { |
|
|
|
rowKey: 'CurrentLevel', |
|
|
|
render: (_, r, index) => { |
|
|
|
let data = { 1: '一级', 2: '二级', 3: '三级' } |
|
|
|
return data[r.CurrentLevel] |
|
|
|
return data[r.CurrentLevel] || "" |
|
|
|
}, |
|
|
|
}, { |
|
|
|
title: "产生时间", |
|
|
@ -152,7 +155,7 @@ function SideSheets ({ dispatch, actions, close }) { |
|
|
|
} |
|
|
|
}} |
|
|
|
/> |
|
|
|
<div style={{ display: 'flex', alignItems: 'flex-end', justifyContent: 'flex-end', marginTop: 16 }}> |
|
|
|
{dataSource?.length > 0 ? <div style={{ display: 'flex', alignItems: 'flex-end', justifyContent: 'flex-end', marginTop: 16 }}> |
|
|
|
<span style={{ lineHeight: "30px", fontSize: 13 }}> |
|
|
|
共{dataSource?.length || 0}条告警 |
|
|
|
</span> |
|
|
@ -167,7 +170,7 @@ function SideSheets ({ dispatch, actions, close }) { |
|
|
|
setQuery({ pageSize: pageSize, page: currentPage }); |
|
|
|
}} |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> : ""} |
|
|
|
<ReactECharts |
|
|
|
option={option} |
|
|
|
notMerge={true} |
|
|
@ -182,6 +185,7 @@ function SideSheets ({ dispatch, actions, close }) { |
|
|
|
|
|
|
|
</TabPane> |
|
|
|
<TabPane tab="工单信息" itemKey="2"> |
|
|
|
<div>开发中,敬请期待!</div> |
|
|
|
</TabPane> |
|
|
|
</Tabs> |
|
|
|
</SideSheet > |
|
|
|