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 + }) + } } } } 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) diff --git a/web/client/src/sections/problem/components/tableData.jsx b/web/client/src/sections/problem/components/tableData.jsx index 7993c9f..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(route); + console.log(tableData); + console.log(route == 'useAbnormal' || route == 'videoAbnormal' ? + tableData.slice(query.page * query.limit, (query.page + 1) * query.limit) || [] + : tableData); return