|
|
@ -12,8 +12,7 @@ import '../style.less' |
|
|
|
import { request } from 'screenfull'; |
|
|
|
|
|
|
|
const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
|
|
|
|
const [route, setRoute] = useState('') //子页面路由 |
|
|
|
let route = match.url.substring(match.url.lastIndexOf("/") + 1, match.url.length) |
|
|
|
const [abnormalLenght, setAbnormalLenght] = useState(0) //异常数量 |
|
|
|
const [collect, setCollect] = useState([]) //搜索结构 |
|
|
|
const [setup, setSetup] = useState(false); //表格设置是否显现 |
|
|
@ -33,16 +32,6 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
const tableType = { dataLnterrupt: 'dataLnterrupt', dataAbnormal: 'dataAbnormal', strategyHit: 'strategyHit', videoAbnormal: 'videoAbnormal', useAbnormal: 'useAbnormal', deviceAbnormal: 'deviceAbnormal' } |
|
|
|
const statistic = { dataLnterrupt: '数据中断统计', dataAbnormal: '数据异常统计', strategyHit: '策略命中统计', videoAbnormal: '视频异常统计', useAbnormal: '应用异常统计', deviceAbnormal: '设备异常统计' } |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
setRoute(match.url.substring(match.url.lastIndexOf("/") + 1, match.url.length)) |
|
|
|
// console.log(match.url) |
|
|
|
// console.log(tableType); |
|
|
|
|
|
|
|
|
|
|
|
}, []) |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
|
|
if (route) { |
|
|
@ -57,7 +46,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
: ""; |
|
|
|
} |
|
|
|
attribute(tableType[route], route); |
|
|
|
}, [route]) |
|
|
|
}, []) |
|
|
|
|
|
|
|
|
|
|
|
//搜索结构 |
|
|
@ -285,7 +274,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
console.log(data) |
|
|
|
// console.log(data) |
|
|
|
// let TableDisplay = [] |
|
|
|
|
|
|
|
let TableDisplay = data?.map(v => { |
|
|
@ -295,7 +284,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
console.log(TableDisplay); |
|
|
|
// console.log(TableDisplay); |
|
|
|
|
|
|
|
TableDisplay.push({ |
|
|
|
title: '操作', |
|
|
|