wenlele 2 years ago
parent
commit
a60a819961
  1. 36
      web/client/src/sections/problem/components/tableData.jsx
  2. 24
      web/client/src/sections/problem/containers/dataAlarm.jsx

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

@ -6,7 +6,8 @@ import moment from "moment";
const TableData = ({ dispatch, actions, route, collectData, setSetup, exhibition, selected, setSelected, setIfBulk, setConfirm }) => { const TableData = ({ dispatch, actions, route, collectData, setSetup, exhibition,
selected, setSelected, setIfBulk, setConfirm, setGenre }) => {
const { problem } = actions const { problem } = actions
const [tableData, setTableData] = useState([]) // const [tableData, setTableData] = useState([]) //
@ -37,16 +38,40 @@ const TableData = ({ dispatch, actions, route, collectData, setSetup, exhibition
} }
}) })
break; break;
case 'videoAbnormal':
break;
default: default:
dispatch(problem.getAlarmDataGroup()).then((res) => { dispatch(problem.getAlarmDataGroup()).then((res) => {
if (res.success) { if (res.success) {
console.log(res.payload.data); // console.log(res.payload.data);
let routeData = { dataLnterrupt: '数据中断', dataAbnormal: '数据异常', strategyHit: '策略命中', deviceAbnormal: '' }
let data
if (route == 'dataLnterrupt') data = res.payload.data?.filter(v => v.desc == '数据中断')
if (route == 'dataAbnormal') data = res.payload.data?.filter(v => v.desc == '数据异常')
if (route == 'strategyHit') data = res.payload.data?.filter(v => v.desc == '策略命中')
if (route == 'deviceAbnormal') data = res.payload.data?.filter(v => v.desc == '掉线' || v.desc == '不活跃')
console.log(data);
let genreData = []
data?.map(v => {
v?.unit?.map(vv => {
genreData.push({ name: vv.name, value: vv.id })
})
})
console.log(genreData);
setGenre(genreData)
if (data || data[0]?.id) {
dispatch(problem.getAlarmDataList({})).then((res) => {
console.log(res);
})
}
}
}
})
// let tableDatas = res.payload.data?.rows.map(v => ({ // let tableDatas = res.payload.data?.rows.map(v => ({
// key: v.id, // key: v.id,
@ -64,7 +89,7 @@ const TableData = ({ dispatch, actions, route, collectData, setSetup, exhibition
// })) // }))
// console.log(tableDatas); // console.log(tableDatas);
// setTableData(tableDatas) // setTableData(tableDatas)
})
break; break;
} }
@ -105,6 +130,7 @@ const TableData = ({ dispatch, actions, route, collectData, setSetup, exhibition
key={v.field} key={v.field}
style={{ width: 116, marginRight: 10, color: "#F9F9F9", }} style={{ width: 116, marginRight: 10, color: "#F9F9F9", }}
placeholder="全部" placeholder="全部"
filter
showClear showClear
> >
{v.data?.map((item) => { {v.data?.map((item) => {

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

@ -24,6 +24,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
const [ifBulk, setIfBulk] = useState(false); // const [ifBulk, setIfBulk] = useState(false); //
const [content, setContent] = useState(false); // const [content, setContent] = useState(false); //
const [selected, setSelected] = useState([]) // const [selected, setSelected] = useState([]) //
const [genre, setGenre] = useState([]) //
const tableType = { dataLnterrupt: 'dataLnterrupt', dataAbnormal: 'dataAbnormal', strategyHit: 'strategyHit', videoAbnormal: 'videoAbnormal', useAbnormal: 'useAbnormal', deviceAbnormal: 'deviceAbnormal' } const tableType = { dataLnterrupt: 'dataLnterrupt', dataAbnormal: 'dataAbnormal', strategyHit: 'strategyHit', videoAbnormal: 'videoAbnormal', useAbnormal: 'useAbnormal', deviceAbnormal: 'deviceAbnormal' }
const statistic = { dataLnterrupt: '数据中断统计', dataAbnormal: '数据异常统计', strategyHit: '策略命中统计', videoAbnormal: '视频异常统计', useAbnormal: '应用异常统计', deviceAbnormal: '设备异常统计' } const statistic = { dataLnterrupt: '数据中断统计', dataAbnormal: '数据异常统计', strategyHit: '策略命中统计', videoAbnormal: '视频异常统计', useAbnormal: '应用异常统计', deviceAbnormal: '设备异常统计' }
@ -62,10 +63,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
{ name: '搜索', field: '1' }, { name: '搜索', field: '1' },
{ {
name: '中断类型', field: '2', name: '中断类型', field: '2',
data: [ data: genre
{ name: '服务异常', value: '11' },
{ name: '链接中断', value: '22' },
{ name: '设备异常', value: '33' }]
}, },
{ {
name: '中断状态', field: '3', name: '中断状态', field: '3',
@ -77,9 +75,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
{ name: '搜索', field: '1' }, { name: '搜索', field: '1' },
{ {
name: '异常类型', field: '2', name: '异常类型', field: '2',
data: [ data: genre
{ name: '超远程', value: '11' },
{ name: '超限幅', value: '22' }]
}, },
{ {
name: '异常状态', field: '3', name: '异常状态', field: '3',
@ -91,11 +87,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
{ name: '搜索', field: '1' }, { name: '搜索', field: '1' },
{ {
name: '策略类型', field: '2', name: '策略类型', field: '2',
data: [ data:genre
{ name: '超阀值', value: '11' },
{ name: '防驶入告警', value: '22' },
{ name: '设备关闭', value: '33' },
{ name: '超围栏', value: '44' }]
}, },
{ {
name: '命中状态', field: '3', name: '命中状态', field: '3',
@ -137,10 +129,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
{ name: '搜索', field: '1' }, { name: '搜索', field: '1' },
{ {
name: '设备类型', field: '2', name: '设备类型', field: '2',
data: [ data: genre
{ name: '传感器', value: '11' },
{ name: 'DTU', value: '22' },
{ name: '服务器', value: '33' }]
}, },
{ {
name: '异常状态', field: '3', name: '异常状态', field: '3',
@ -292,7 +281,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
</> </>
} }
}) })
console.log(TableDisplay); // console.log(TableDisplay);
// console.log(setup); // console.log(setup);
setExhibition(TableDisplay) setExhibition(TableDisplay)
setTableSetup([{ list: setup }]) setTableSetup([{ list: setup }])
@ -341,6 +330,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
setIfBulk={setIfBulk} setIfBulk={setIfBulk}
selected={selected} selected={selected}
setSelected={setSelected} setSelected={setSelected}
setGenre={setGenre}
/> />
{setup ? ( {setup ? (
<Setup <Setup

Loading…
Cancel
Save