diff --git a/api/.vscode/launch.json b/api/.vscode/launch.json index cab8159..b11f1ba 100644 --- a/api/.vscode/launch.json +++ b/api/.vscode/launch.json @@ -16,14 +16,16 @@ "-p 4600", "-f http://localhost:4600", // 研发 - "-g postgres://postgres:123@10.8.30.32:5432/orational_service", + // "-g postgres://postgres:123@10.8.30.32:5432/orational_service", // 测试 - // "-g postgres://FashionAdmin:123456@10.8.30.156:5432/POMS", + "-g postgres://FashionAdmin:123456@10.8.30.156:5432/POMS", "-k node35:6667,node36:6667,node37:6667", "--redisHost 10.8.30.112", "--redisPort 6379", "--axyApiUrl http://127.0.0.1:4100", - "--apiEmisUrl http://10.8.30.112:14000", + // "--apiEmisUrl http://10.8.30.112:14000", + // 测试 + "--apiEmisUrl http://10.8.30.161:1111", "--godUrl https://restapi.amap.com/v3", "--godKey 21c2d970e1646bb9a795900dd00093ce", "--mqttVideoServer mqtt://10.8.30.71:30883", diff --git a/api/app/lib/controllers/alarm/data.js b/api/app/lib/controllers/alarm/data.js index 2a92164..a466329 100644 --- a/api/app/lib/controllers/alarm/data.js +++ b/api/app/lib/controllers/alarm/data.js @@ -155,12 +155,14 @@ async function list (ctx) { alarmRes.forEach(ar => { - ar.pomsProject = (anxinStruc.find(as => as.strucId == ar.StructureId) || - { - pomsProject: [ - // TODO: 开发临时添加 - ] - }).pomsProject + ar.pomsProject = ( + anxinStruc.find(as => as.strucId == ar.StructureId) || + { + pomsProject: [ + // TODO: 开发临时添加 + ] + } + ).pomsProject // 最新告警详情 - 确认信息 let corConfirmedData = (confirmedAlarmDetailMax.find(cdm => cdm.AlarmId == ar.AlarmId) || {}); @@ -175,6 +177,7 @@ async function list (ctx) { // 告警详情的数量 ar.detailCount = (alarmDetailCount.find(adc => adc.AlarmId == ar.AlarmId) || { count: 0 }).count }) + ctx.status = 200; ctx.body = { count: countAlarm[0].count, rows: alarmRes diff --git a/api/app/lib/utils/dataRange.js b/api/app/lib/utils/dataRange.js index 71dbd21..ddaf991 100644 --- a/api/app/lib/utils/dataRange.js +++ b/api/app/lib/utils/dataRange.js @@ -128,7 +128,7 @@ module.exports = function (app, opts) { for (let s of undelStrucRes) { if (!undelStruc.some(us => us.strucId == s.strucId)) { let pomsProject = [] - for (let br of bindRes) { + for (let { dataValues: br } of bindRes) { if (br.anxinProjectId.some(braId => braId == s.projectId)) { let corPepProject = pepProjectRes.find(pp => pp.id == br.pepProjectId) pomsProject.push({