From 3606b82610614ae2ee76156965a01617791e56d4 Mon Sep 17 00:00:00 2001 From: CODE <1650192445@qq.com> Date: Thu, 7 Sep 2023 15:13:27 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=B7=AF=E7=94=B1=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/project/group.js | 5 ++--- api/app/lib/routes/project/index.js | 4 ++-- web/client/src/utils/webapi.js | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/api/app/lib/controllers/project/group.js b/api/app/lib/controllers/project/group.js index 175d3ee..5714264 100644 --- a/api/app/lib/controllers/project/group.js +++ b/api/app/lib/controllers/project/group.js @@ -37,7 +37,7 @@ async function groupDetail (ctx) { ctx.status = 200; ctx.body = res } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: error`); + ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.status = 400; ctx.body = { message: typeof error == 'string' ? error : undefined @@ -126,7 +126,6 @@ async function delGroup (ctx) { } async function groupStatistic (ctx) { - console.log('ssssssaqqq',ctx.app.camunda) try { const { models } = ctx.fs.dc; const { userId } = ctx.fs.api @@ -241,7 +240,7 @@ async function groupStatistic (ctx) { strucCount += strucIdArr_.length //所有结构物的告警 const ss = alarmRes.filter(p => strucIdArr_.some(q => q.strucId == p.StructureId)) - todayAlarms= ss.reduce((p, c) => { + todayAlarms = ss.reduce((p, c) => { return p + c.alarmCount }, 0) // diff --git a/api/app/lib/routes/project/index.js b/api/app/lib/routes/project/index.js index 326a814..57da207 100644 --- a/api/app/lib/routes/project/index.js +++ b/api/app/lib/routes/project/index.js @@ -34,8 +34,8 @@ module.exports = function (app, router, opts) { app.fs.api.logAttr['GET/project/group'] = { content: '获取项目分组', visible: true }; router.get('/project/group', projectGroup.groupList); - app.fs.api.logAttr['GET/project/group/:groupId'] = { content: '获取项目分组详情', visible: true }; - router.get('/project/group/:groupId', projectGroup.groupDetail); + app.fs.api.logAttr['GET/project/group/:groupId/detail'] = { content: '获取项目分组详情', visible: true }; + router.get('/project/group/:groupId/detail', projectGroup.groupDetail); app.fs.api.logAttr['PUT/project/group'] = { content: '编辑项目分组', visible: true }; router.put('/project/group', projectGroup.editGroup); diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index 6f72db2..b6391a4 100644 --- a/web/client/src/utils/webapi.js +++ b/web/client/src/utils/webapi.js @@ -42,7 +42,7 @@ export const ApiTable = { groupStatisticOnline: 'project/group/statistic/online', groupStatisticAlarm: 'project/group/statistic/alarm', groupProject: "project/group/list", - groupProjectDetail: "project/group/:groupId", + groupProjectDetail: "project/group/:groupId/detail", //告警 getProjectPoms: 'project/poms', //获取已绑定项目