Browse Source

增加项企项目在映射关系中,新增映射关系时,已被映射过的PEP项目不能再被查看的功能

dev
巴林闲侠 2 years ago
parent
commit
b25f39a02f
  1. 13
      api/app/lib/controllers/project/index.js
  2. 9
      web/client/src/sections/install/components/systemModal.jsx

13
api/app/lib/controllers/project/index.js

@ -129,11 +129,24 @@ async function projectAnxincloud (ctx) {
async function projectPManage (ctx) {
try {
const models = ctx.fs.dc.models;
const { clickHouse } = ctx.app.fs
const { includeDelete } = ctx.query
const projectRes = await clickHouse.projectManage.query(`SELECT id, project_name, isdelete FROM t_pim_project WHERE isdelete=0 ${includeDelete == 1 ? 'OR isdelete=1' : ''} ORDER BY id DESC`).toPromise()
const bindedPRes = await models.ProjectCorrelation.findAll({
where: {
pepProjectId: { $ne: null }
}
})
for (let p of projectRes) {
if (bindedPRes.some(bp => bp.pepProjectId == p.id)) {
p.binded = true
}
}
ctx.status = 200;
ctx.body = projectRes
} catch (error) {

9
web/client/src/sections/install/components/systemModal.jsx

@ -152,13 +152,16 @@ function adminModal (props) {
showClear
>
{
peplist.map((item, index) => {
return (
peplist.reduce((arr, item) => {
if (!item.binded) {
arr.push(
<Form.Select.Option key={item.id} value={item.id}>
{item.project_name}
</Form.Select.Option>
)
})
}
return arr
}, [])
}
</Form.Select>
</div>

Loading…
Cancel
Save