From 7a334a9b52f1ac28180c9b59849efcc3bd78b9a9 Mon Sep 17 00:00:00 2001 From: wenlele Date: Thu, 6 Jul 2023 15:37:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E6=96=B0=E5=8A=A8=E6=80=81=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/control/data.js | 19 +++++++++++++++++++ web/client/src/components/setup.jsx | 2 +- .../sections/control/containers/control.jsx | 3 ++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/api/app/lib/controllers/control/data.js b/api/app/lib/controllers/control/data.js index 5cdd5ad..3c41aa2 100644 --- a/api/app/lib/controllers/control/data.js +++ b/api/app/lib/controllers/control/data.js @@ -300,6 +300,8 @@ async function getLatestDynamic (ctx) { order: [['time', 'desc']], }); + console.log(111111,news); + //查项目名称 查用户名 let pepPojectIds = new Set(), notedUserIds = new Set(), emailSendPomsProjectIds = new Set(); for (let p of news) { @@ -318,6 +320,10 @@ async function getLatestDynamic (ctx) { } } + console.log(222222,notedUserIds); + console.log(333333,emailSendPomsProjectIds); + + // EM 推送的特殊处理 // 查找对应的 projectCorrelation const emailLogProjectCorrelationRes = @@ -328,19 +334,31 @@ async function getLatestDynamic (ctx) { } }) : [] + + console.log(444444,emailLogProjectCorrelationRes); + for (let { dataValues: p } of emailLogProjectCorrelationRes) { if (p.pepProjectId) { pepPojectIds.add(p.pepProjectId) } } + + console.log(555555,pepPojectIds); + let pepProjects = pepPojectIds.size ? await clickHouse.projectManage.query(` SELECT id, project_name FROM t_pim_project WHERE id IN (${[...pepPojectIds].join(',')},-1) `).toPromise() : []; + + console.log(666666,pepProjects); + + let userPepRes = notedUserIds.size ? await clickHouse.pepEmis.query( `SELECT DISTINCT user.id AS id, "user"."name" AS name FROM user WHERE user.id IN (${[...notedUserIds].join(',')},-1) `).toPromise() : [] + console.log(777777,userPepRes); + let appear = [], notice = [], confirm = []; news.map(d => { @@ -381,6 +399,7 @@ async function getLatestDynamic (ctx) { confirm//确认 }; } catch (error) { + console.log(888888,error); ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.status = 400; ctx.body = { diff --git a/web/client/src/components/setup.jsx b/web/client/src/components/setup.jsx index 36254c9..d322197 100644 --- a/web/client/src/components/setup.jsx +++ b/web/client/src/components/setup.jsx @@ -107,7 +107,7 @@ function Setup (props) { key={itm.value} value={itm.value} style={layout == 'long' ? {} : checkboxcss} - disabled={ischeck(itm.value) || ['workbench', 'dynamic', 'handle', 'DeviceAccess','discovery'].includes(itm.value)} + disabled={ischeck(itm.value) || ['workbench', 'dynamic', 'handle', 'DeviceAccess'].includes(itm.value)} > {itm.name} diff --git a/web/client/src/sections/control/containers/control.jsx b/web/client/src/sections/control/containers/control.jsx index 0060703..3bff5df 100644 --- a/web/client/src/sections/control/containers/control.jsx +++ b/web/client/src/sections/control/containers/control.jsx @@ -622,7 +622,8 @@ const Control = ({ dispatch, actions, user, history, loading, socket, pepProject workbench: ['project', 'data', 'app', 'device'], statistical: ['milestone', 'personnel', 'web', 'problem'], analyse: ['dataInterrupt', 'dataAbnormal', 'policyHit', 'videoException', 'appAbnormal', 'deviceAbnormal', 'problemAnalysis'], - dynamic: ['discovery', 'notice', 'confirm'], + // dynamic: ['discovery', 'notice', 'confirm'], + dynamic: [], } let listAll = [