From 55fa5dd09bb9f1b1da2e8e8d75ba0f428aa228c8 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Wed, 23 Nov 2022 10:08:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?EM=E6=8E=A8=E9=80=81=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/push/config.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/api/app/lib/controllers/push/config.js b/api/app/lib/controllers/push/config.js index 9fb0997..9d11e33 100644 --- a/api/app/lib/controllers/push/config.js +++ b/api/app/lib/controllers/push/config.js @@ -8,23 +8,11 @@ async function list (ctx) { const { clickHouse } = ctx.app.fs const { utils: { anxinStrucIdRange, pomsProjectRange } } = ctx.app.fs const { keyword, keywordTarget, alarmType, state, tactics, pomsProjectId } = ctx.query - - // let projectCorrelationWhere = { - // del: false, - // } - // if (state == 'notYet') { - // projectCorrelationWhere.pepProjectId = { $ne: null } - // } let findOption = { where: { del: false }, order: [['id', 'desc']], - // includes: [{ - // model: models.ProjectCorrelation, - // where: projectCorrelationWhere, - // required: true - // }] } let anxinStrucsRange = await anxinStrucIdRange({ @@ -120,7 +108,7 @@ async function list (ctx) { continue } } - } else if(state == 'notYet'){ + } else if (state == 'notYet') { continue } filterBinds.push(corBind) From 4dde555dc5625ba318deab013a0a1dfee3007d86 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Wed, 23 Nov 2022 10:38:27 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=9A=8F=E7=BB=93=E6=9E=84=E7=89=A9?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=9B=91=E6=B5=8B=E5=9B=A0=E7=B4=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/project/index.js | 26 ++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/api/app/lib/controllers/project/index.js b/api/app/lib/controllers/project/index.js index c2807a3..3b47b76 100644 --- a/api/app/lib/controllers/project/index.js +++ b/api/app/lib/controllers/project/index.js @@ -231,7 +231,9 @@ async function strucWithPomsProject (ctx) { ` SELECT t_structure.id AS strucId, - t_structure.name AS strucName + t_structure.name AS strucName, + t_factor.id AS factorId, + t_factor.name AS factorName FROM t_project LEFT JOIN @@ -254,6 +256,10 @@ async function strucWithPomsProject (ctx) { ON t_structure.id = t_project_structure.structure OR t_structure.id = t_structuregroup_structure.structure OR t_structure.id = t_structure_site.structid + LEFT JOIN t_structure_factor + ON t_structure_factor.structure = t_structure.id + LEFT JOIN t_factor + ON t_structure_factor.factor = t_factor.id WHERE project_state != -1 AND @@ -263,11 +269,27 @@ async function strucWithPomsProject (ctx) { ).toPromise() : [] for (let s of undelStrucRes) { - if (!undelStruc.some(us => us.id == s.strucId)) { + let corStrut = undelStruc.find(us => us.id == s.strucId) + if (!corStrut) { + let nextFacor = [] + if (s.factorId) { + nextFacor.push({ + id: s.factorId, + name: s.factorName + }) + } undelStruc.push({ id: s.strucId, name: s.strucName, + factor: nextFacor }) + } else { + if (s.factorId) { + corStrut.factor.push({ + id: s.factorId, + name: s.factorName + }) + } } } } From 6473d6dbaf15050946f80a8c4447588afaae094a Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Wed, 23 Nov 2022 11:47:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?debug=20=E5=91=8A=E8=AD=A6=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=B1=95=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sections/problem/components/tableData.jsx | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/web/client/src/sections/problem/components/tableData.jsx b/web/client/src/sections/problem/components/tableData.jsx index 5eb1177..4393be6 100644 --- a/web/client/src/sections/problem/components/tableData.jsx +++ b/web/client/src/sections/problem/components/tableData.jsx @@ -379,12 +379,23 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition placeholder={SkeletonScreen()} > {(() => { - // console.log(tableData); + console.log(tableData); + console.log(route == 'useAbnormal' || route == 'videoAbnormal' ? + tableData.slice(query.page * query.limit, (query.page + 1) * query.limit) || [] + : tableData); return 暂无告警数据} + empty={ +
+ 暂无告警数据 +
+ } style={{}} pagination={false} onRow={(record, index) => { @@ -457,7 +468,6 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition pageSizeOpts={[10, 20, 30, 40]} onChange={(currentPage, pageSize) => { setQuery({ limit: pageSize, page: currentPage - 1 }); - }} /> : ""} @@ -472,7 +482,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition } -function mapStateToProps(state) { +function mapStateToProps (state) { const { auth, global, members } = state; // console.log(global); return {