Browse Source

BUG修改

dev
wenlele 2 years ago
parent
commit
23ae9981f6
  1. 24
      web/client/src/sections/problem/components/sideSheet.jsx
  2. 5
      web/client/src/sections/problem/components/tableData.jsx
  3. 22
      web/client/src/sections/problem/containers/dataAlarm.jsx

24
web/client/src/sections/problem/components/sideSheet.jsx

@ -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 >

5
web/client/src/sections/problem/components/tableData.jsx

@ -67,7 +67,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
// console.log(genreData);
setGenre(genreData)
if (data && data[0]?.id) {
dispatch(problem.getAlarmDataList({ ...query, ...search, groupId: '', pepProjectId: '' })).then((res) => {
dispatch(problem.getAlarmDataList({ ...query, ...search, groupId: data.map(v => v.id).join(), pepProjectId: '' })).then((res) => {
console.log(res);
if (res.success) {
setCount(res.payload.data?.count || 0)
@ -75,13 +75,12 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
key: v.AlarmId,
StructureName: v.StructureName,
projectName: v.pepProject?.map(r => r.projectName)?.filter(c => c),
createTime: v.StartTime ? moment(v.StartTime).format("YYYY-MM-DD HH:mm:ss") : "",
updateTime: v.EndTime ? moment(v.EndTime).format("YYYY-MM-DD HH:mm:ss") : "",
confirmTime: v.confirmedTime ? moment(v.confirmedTime).format("YYYY-MM-DD HH:mm:ss") : "",
SourceName: v.SourceName,
AlarmGroupUnit: v.AlarmGroupUnit ? genreData.find(r => r.id == v.AlarmGroupUnit)?.name : "",
Strategy: v.AlarmGroupUnit ? genreData.find(r => r.id == v.AlarmGroupUnit)?.name : "",
Strategy: v.AlarmGroupUnit ? genreData[0]?.unit?.find(r => r.id == v.AlarmGroupUnit)?.name : "",
type: v.AlarmGroupUnit ? genreData.find(r => r.id == v.AlarmGroupUnit)?.name : "",
AlarmCodeName: v.AlarmCodeName,
CurrentLevel: v.CurrentLevel,

22
web/client/src/sections/problem/containers/dataAlarm.jsx

@ -37,7 +37,6 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
if (route) {
//
let data = columns[route]
data.splice(0, 1)
localStorage.getItem(tableType[route]) == null
? localStorage.setItem(
tableType[route],
@ -211,7 +210,18 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
}
},
{ name: '结构物名称', value: 'StructureName' },
{ name: '告警源', value: 'SourceName' },
{
name: '告警源', value: 'SourceName', render: (_, r, index) => {
// let data = ''
// if (route == 'dataLnterrupt' || route == 'dataAbnormal') {
// data = ''
// }
// if (route == 'strategyHit') data = ''
return <>
{/* <div style={{ width: 44, lineHeight: '18px', textAlign: "center", border: '1px solid #0F7EFB', fontWeight: 400, color: '#0F7EFB', fontSize: 12 }}>{data}</div> */}
{r.SourceName}</>
}
},
{ name: '中断类型', value: 'AlarmGroupUnit' },
{ name: '告警信息', value: 'AlarmContent' },
{ name: '常见原因', value: 'AlarmCodeName' },
@ -224,7 +234,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
return data[r.CurrentLevel]
}
},
{ name: '产生次数', value: 'detailCount' },
{ name: '产生次数', value: 'detailCount', render: (_, r, index) => r.detailCount + '次' },
{ name: '确认信息', value: 'confirm', render: (_, r, index) => r.confirm },
{ name: '确认/恢复时间', value: 'confirmTime', },
{
@ -297,7 +307,10 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
}
{route ? ['dataLnterrupt', 'dataAbnormal', 'strategyHit'].includes(route) ? <>
<Button theme='borderless' disabled>已派单</Button>
<Button theme='borderless' onClick={() => (setCheckPop(true))}>查看</Button>
<Button theme='borderless' onClick={() => {
setCheckPop(true)
setAlarmId(r.key)
}}>查看</Button>
</>
: "" : ""
}
@ -415,6 +428,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
{checkPop ?
<SideSheets
alarmId={alarmId}
close={() => {
setCheckPop(false)
}}

Loading…
Cancel
Save