diff --git a/api/app/lib/controllers/project/index.js b/api/app/lib/controllers/project/index.js index 19acbd8..2659964 100644 --- a/api/app/lib/controllers/project/index.js +++ b/api/app/lib/controllers/project/index.js @@ -52,16 +52,39 @@ async function pomsProject (ctx) { let pepProjectIds = new Set() let anxinProjectIds = new Set() + let createUsers = new Set() for (let p of proRes.rows) { if (p.pepProjectId) { pepProjectIds.add(p.pepProjectId) } + if(p.createUser){ + createUsers.add(p.createUser) + } for (let ap of p.anxinProjectId) { if (ap) { anxinProjectIds.add(ap) } } } + const pomsUser = await models.User.findAll({ + where: { + id: { $in: [...createUsers]} + } + }) + let pepUserIds = new Set() + for (let p of pomsUser) { + if (p.pepUserId) { + pepUserIds.add(p.pepUserId) + } + } + const pepcaUser = pepUserIds.size ? + await clickHouse.pepEmis.query( + ` + SELECT * FROM user + WHERE id IN (${[...pepUserIds].join(',')}, -1) + ` + ).toPromise() : + [] const pepProjectRes = pepProjectIds.size ? await clickHouse.projectManage.query( ` @@ -89,6 +112,7 @@ async function pomsProject (ctx) { for (let p of proRes.rows) { const corPro = pepProjectRes.find(pp => pp.id == p.pepProjectId) || {} + const pepUserName = (pepcaUser.find(qq => qq.id == (pomsUser.find(oo => oo.id == p.createUser)||{}).pepUserId)||{}).name ||'' p.dataValues.pepProjectName = corPro.project_name p.dataValues.pepProjectIsDelete = corPro.isdelete p.dataValues.constructionStatusId = corPro.construction_status_id @@ -96,6 +120,7 @@ async function pomsProject (ctx) { let nextAnxinProject = anxinProjectRes.filter(ap => p.anxinProjectId.includes(ap.id)) p.dataValues.anxinProject = nextAnxinProject + p.dataValues.pepUserName = pepUserName delete p.dataValues.anxinProjectId } ctx.status = 200; diff --git a/web/client/src/sections/install/containers/system.jsx b/web/client/src/sections/install/containers/system.jsx index c4f8fad..d0c83fe 100644 --- a/web/client/src/sections/install/containers/system.jsx +++ b/web/client/src/sections/install/containers/system.jsx @@ -231,6 +231,22 @@ const Example = (props) => { return moment(row.createTime).format("YYYY-MM-DD HH:mm:ss"); } }, + { + title: '修改时间', + dataIndex: "updateTime", + key: 'updateTime', + render: (_, row) => { + return moment(row.updateTime).format("YYYY-MM-DD HH:mm:ss"); + } + }, + { + title: '添加人员', + dataIndex: "pepUserName", + key: 'pepUserName', + render: (_, row) => { + return row.pepUserName + } + }, { title: "管理", width: "20%",