wenlele 1 year ago
parent
commit
fb6147bfcc
  1. 4
      api/app/lib/controllers/analysis/network.js
  2. 6
      web-network/client/src/sections/network/containers/tableShow.js

4
api/app/lib/controllers/analysis/network.js

@ -3,7 +3,7 @@ const moment = require('moment')
const RAW_DATA = 'rawData';
const VBRAW_DATA = 'vbRawData';
const ALARM = 'alarm';
const AlarmState = { Creation: 0, CountUpgrade: 1, LevelUpgrade: 2, AutoElimination: 3, ManElimination: 4 };
async function getOrganizationsStruc (ctx) {
try {
@ -196,7 +196,7 @@ async function findDeviceLastData (ctx, deviceIds) {
async function findSensorLastData (ctx) {
try {
const sensorIds = ctx.request.body.sensorIds;
const sensorIds = ctx.request.body
let rslt = await findDeviceLastData(ctx, sensorIds);
// let rslt = [{ sensorId: "2aa1cad1-a52d-4132-8d84-2475034d5bc8", data: [] },
// { sensorId: "9f1702ff-560d-484e-8572-ef188ef73916", data: [] },

6
web-network/client/src/sections/network/containers/tableShow.js

@ -68,10 +68,10 @@ const Network = props => {
const deviceMetaDeployed = res.payload.data
if (deviceMetaDeployed && dataList && deviceMetaDeployed.devices) {
const sensorsId = []
let alarmSensorId = [] //所有设备的id
let deviceIds = [] //所有设备的id
const sensorsDataItems = {}
for (const id in dataList.instances) {
alarmSensorId.push(id)
deviceIds.push(id)
const instances = dataList.instances[id]
if (instances.type == 's.d' && instances.instance.properties.deviceType == 'sensor') {
@ -91,7 +91,7 @@ const Network = props => {
sensorsId.push(id)
}
}
dispatch(analysis.getDevicesAlarms({ deviceIds: alarmSensorId }, { limit: 5 }))
dispatch(analysis.getDevicesAlarms(deviceIds , { limit: 5 }))
dispatch(analysis.findDevicesCardStatus({ deviceIds: alarmSensorId }))
setSensorsDataItems(sensorsDataItems)
setSensorId(sensorsId)

Loading…
Cancel
Save