|
|
@ -22,8 +22,16 @@ async function getWorkbench(ctx) { |
|
|
|
async function getProjectsInfo(ctx) { |
|
|
|
try { |
|
|
|
const { models } = ctx.fs.dc; |
|
|
|
const { clickHouse } = ctx.app.fs |
|
|
|
const { alarmId, limit, page } = ctx.query |
|
|
|
const { clickHouse } = ctx.app.fs; |
|
|
|
const { alarmId, limit, page, projectCorrelationId } = ctx.query; |
|
|
|
const { userInfo } = ctx.fs.api; |
|
|
|
let where = {} |
|
|
|
if (!userInfo.role.includes('SuperAdmin') && !userInfo.role.includes('admin')) { |
|
|
|
where.projectCorrelationId = { $in: userInfo.correlationProject } |
|
|
|
} |
|
|
|
if (projectCorrelationId) {//查指定项目,控制台全局切换
|
|
|
|
where.projectCorrelationId = projectCorrelationId |
|
|
|
} |
|
|
|
ctx.status = 200; |
|
|
|
ctx.body = [] |
|
|
|
} catch (error) { |
|
|
@ -56,11 +64,11 @@ async function getBiAnalysis(ctx) { |
|
|
|
async function getLatestDynamic(ctx) { |
|
|
|
try { |
|
|
|
const { models } = ctx.fs.dc; |
|
|
|
const { limit, page, projectCorrelationId } = ctx.query; |
|
|
|
const { limit, page, projectCorrelationId, types } = ctx.query; |
|
|
|
const { userInfo } = ctx.fs.api; |
|
|
|
const { clickHouse } = ctx.app.fs; |
|
|
|
|
|
|
|
let where = {} |
|
|
|
let where = { type: { $in: types.split(',') } }//传类型选择
|
|
|
|
if (!userInfo.role.includes('SuperAdmin') && !userInfo.role.includes('admin')) { |
|
|
|
where.projectCorrelationId = { $in: userInfo.correlationProject } |
|
|
|
} |
|
|
|