Browse Source

数据中断与设备异常合并优化

dev
wenlele 1 year ago
parent
commit
3c1d42a347
  1. 2
      web/client/src/sections/control/containers/control.jsx
  2. 12
      web/client/src/sections/problem/components/tableData.jsx
  3. 14
      web/client/src/sections/problem/containers/dataAlarm.jsx

2
web/client/src/sections/control/containers/control.jsx

@ -598,7 +598,7 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject
{ name: '关注的项目', sort: 1, key: 'project', data: workData?.projects || 0, img: 'url(/assets/images/console/lan_1.png)' }, { name: '关注的项目', sort: 1, key: 'project', data: workData?.projects || 0, img: 'url(/assets/images/console/lan_1.png)' },
{ name: '数据告警', sort: 2, key: 'data', data: workData?.dataSurplus || 0, img: 'url(/assets/images/console/lv_1.png)', url: '/problem/dataAlarm/dataLnterrupt' }, { name: '数据告警', sort: 2, key: 'data', data: workData?.dataSurplus || 0, img: 'url(/assets/images/console/lv_1.png)', url: '/problem/dataAlarm/dataLnterrupt' },
{ name: '应用告警', sort: 2, key: 'app', data: workData?.appSurplus || 0, img: 'url(/assets/images/console/hong_1.png)', url: '/problem/useAlarm/useAbnormal' }, { name: '应用告警', sort: 2, key: 'app', data: workData?.appSurplus || 0, img: 'url(/assets/images/console/hong_1.png)', url: '/problem/useAlarm/useAbnormal' },
{ name: '视频告警', sort: 2, key: 'device', data: workData?.videoSurplus || 0, img: 'url(/assets/images/console/hong_1.png)', url: '/problem/deviceAlarm/deviceAbnormal' }, { name: '视频告警', sort: 2, key: 'device', data: workData?.videoSurplus || 0, img: 'url(/assets/images/console/hong_1.png)', url: '/problem/useAlarm/videoAbnormal' },
{ name: '项目里程碑', sort: 1, key: 'milestone', }, { name: '项目里程碑', sort: 1, key: 'milestone', },
{ name: '相关成员', sort: 2, key: 'personnel', }, { name: '相关成员', sort: 2, key: 'personnel', },

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

@ -59,8 +59,8 @@ const TableData = ({ alarmDataGroup, route, dispatch, actions, collectData, setS
case 'videoAbnormal': case 'videoAbnormal':
dispatch(problem.getAlarmVideoList({ ...search.current, pepProjectId: pepProjectId })).then((res) => { dispatch(problem.getAlarmVideoList({ ...search.current, pepProjectId: pepProjectId })).then((res) => {
if (res.success) { if (res.success) {
let tableDatas = res.payload.data?.map(v => ({ let tableDatas = res.payload.data?.map((v, index) => ({
key: v.alarmId, key: v.AlarmId + index,
id: v.alarmId, id: v.alarmId,
StructureName: v.struc, StructureName: v.struc,
projectName: v.pomsProject?.map(r => (r.name ? { id: r.id, name: r.name, state: 'PMOS' } : { projectName: v.pomsProject?.map(r => (r.name ? { id: r.id, name: r.name, state: 'PMOS' } : {
@ -93,13 +93,13 @@ const TableData = ({ alarmDataGroup, route, dispatch, actions, collectData, setS
if (genre?.length > 0 && (route === 'dataAbnormal' ? typeId?.length > 0 : true)) { if (genre?.length > 0 && (route === 'dataAbnormal' ? typeId?.length > 0 : true)) {
dispatch(problem.getAlarmDataList({ dispatch(problem.getAlarmDataList({
...(route === 'dataLnterrupt' ? { timestamps: true } : {}), ...(route === 'dataLnterrupt' ? { timestamps: true } : {}),
...(route === 'dataAbnormal' ? { groupUnitId: typeId?.length > 0 ? typeId?.join(',') : "", } : {}), ...query, ...(search.current || {}), groupId: groupId.current.map(v => v.id).join(), pepProjectId: pepProjectId,
...query, ...(api.current?.getValues() || {}), groupId: groupId.current.map(v => v.id).join(), pepProjectId: pepProjectId, ...((route === 'dataAbnormal' && !search.current?.groupUnitId?.length) ? { groupUnitId: typeId?.length > 0 ? typeId?.join(',') : "", } : {}),
})).then((res) => { })).then((res) => {
if (res.success) { if (res.success) {
setCount(res.payload.data?.count || 0) setCount(res.payload.data?.count || 0)
let tableDatas = res.payload.data?.rows?.map(v => ({ let tableDatas = res.payload.data?.rows?.map((v, index) => ({
key: v.AlarmId, key: v.AlarmId + index,
id: v.AlarmId, id: v.AlarmId,
StructureName: v.StructureName, StructureName: v.StructureName,
projectName: v.pomsProject?.map(r => (r.name ? { id: r.id, name: r.name, state: 'PMOS' } : { projectName: v.pomsProject?.map(r => (r.name ? { id: r.id, name: r.name, state: 'PMOS' } : {

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

@ -82,11 +82,12 @@ const DataAlarm = (props) => {
{ name: '当前', value: 'new' }, { name: '当前', value: 'new' },
{ name: '历史', value: 'histroy' }] { name: '历史', value: 'histroy' }]
}, },
{ // {
name: '异常类型', field: 'onlineState', // name: '', field: 'onlineState',
data: [ // data: [
{ name: '离线', value: 'offline' }] // { name: '线', value: 'offline' }]
}], // }
],
dataAbnormal: [ //(dataAbnormal) dataAbnormal: [ //(dataAbnormal)
{ name: '搜索', field: '1' }, { name: '搜索', field: '1' },
{ {
@ -189,6 +190,9 @@ const DataAlarm = (props) => {
// //
const columnAll = [ const columnAll = [
{
},
{ {
name: "序号", sort: 1, value: "index", render: (_, r, index) => { name: "序号", sort: 1, value: "index", render: (_, r, index) => {
return index + 1; return index + 1;

Loading…
Cancel
Save