Browse Source

Merge branch 'dev' of ssh://gitea.anxinyun.cn:2022/gao.zhiyuan/OperationalService into dev

dev
deartibers 2 years ago
parent
commit
2c86c0c5fd
  1. 2
      api/app/lib/controllers/alarm/data.js
  2. 7
      api/app/lib/controllers/organization/index.js
  3. 4
      api/app/lib/controllers/push/config.js
  4. 1215
      web/client/src/sections/install/containers/roles.jsx

2
api/app/lib/controllers/alarm/data.js

@ -40,10 +40,8 @@ async function list (ctx) {
ctx, pepProjectId, keywordTarget, keyword
})
let whereOption = []
// ! 1 开发临时增加
if (anxinStruc.length) {
const anxinStrucIds = anxinStruc.map(a => a.strucId)
// ! 开发临时注释
whereOption.push(`alarms.StructureId IN (${anxinStrucIds.join(",")})`)
if (groupId) {

7
api/app/lib/controllers/organization/index.js

@ -74,7 +74,7 @@ async function editUser (ctx) {
if (existUserRes) {
// 存在且传递id 或者 不传id也存在
// 修改 update
storageData.deleted = false
if (
role.includes('admin')
) {
@ -89,6 +89,8 @@ async function editUser (ctx) {
// 正在修改成员 但是此时还是管理员
storageData.disabled = true
storageData.role = [...role, 'admin']
}else{
storageData.deleted = false
}
await models.User.update(storageData, {
where: {
@ -165,6 +167,9 @@ async function delAdmin (ctx) {
let adminIndex = updateValues.role.findIndex(r => r == 'admin')
if (adminIndex > -1) {
updateValues.role.splice(adminIndex, 1)
if (updateValues.role.length < 1) {
updateValues.deleted = true
}
}
await models.User.update(updateValues, {
where: {

4
api/app/lib/controllers/push/config.js

@ -34,7 +34,7 @@ async function list (ctx) {
if (keywordTarget == 'tactics') {
findOption.where.name = { $like: `%${keyword}%` }
} else if (keywordTarget == 'struc') {
let bindAnixinStrucRes = await clickHouse.projectManage.query(`
let bindAnixinStrucRes = await clickHouse.anxinyun.query(`
SELECT id, name FROM t_structure
WHERE name LIKE '%${keyword}%'
`).toPromise()
@ -144,7 +144,7 @@ async function list (ctx) {
...p,
pomsProject: corBind,
structure: returnStruc,
pushCount: corLogCount ? corLogCount.count : 0,
pushCount: corLogCount ? corLogCount.dataValues.count : 0,
receiverPepUser: corReceiver
})
}

1215
web/client/src/sections/install/containers/roles.jsx

File diff suppressed because it is too large
Loading…
Cancel
Save