diff --git a/api/app/lib/controllers/analysis/network.js b/api/app/lib/controllers/analysis/network.js index 081b8dc..1f0be9e 100644 --- a/api/app/lib/controllers/analysis/network.js +++ b/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: [] }, diff --git a/web-network/client/src/sections/network/containers/tableShow.js b/web-network/client/src/sections/network/containers/tableShow.js index 6b0eb61..b23afc9 100644 --- a/web-network/client/src/sections/network/containers/tableShow.js +++ b/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)