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. 7
      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 ctx, pepProjectId, keywordTarget, keyword
}) })
let whereOption = [] let whereOption = []
// ! 1 开发临时增加
if (anxinStruc.length) { if (anxinStruc.length) {
const anxinStrucIds = anxinStruc.map(a => a.strucId) const anxinStrucIds = anxinStruc.map(a => a.strucId)
// ! 开发临时注释
whereOption.push(`alarms.StructureId IN (${anxinStrucIds.join(",")})`) whereOption.push(`alarms.StructureId IN (${anxinStrucIds.join(",")})`)
if (groupId) { if (groupId) {

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

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

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

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

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

@ -344,6 +344,8 @@ const Roles = (props) => {
const mylimits = useRef(); // const mylimits = useRef(); //
const [pepList, setPepList] = useState([])// const [pepList, setPepList] = useState([])//
const [pomsList, setPomsList] = useState([])// const [pomsList, setPomsList] = useState([])//
const userAdmin = user?.pomsUserInfo?.role.includes('admin') //
useEffect(() => { useEffect(() => {
getUserList(); getUserList();
}, [query, roleChoose]); }, [query, roleChoose]);
@ -367,6 +369,7 @@ const Roles = (props) => {
for (let i = 0; i < notCreatedNum; i++) { for (let i = 0; i < notCreatedNum; i++) {
notCreatedArr.push('') notCreatedArr.push('')
} }
if (userAdmin) notCreatedArr = []
setRoleAssignment(res.payload.data.admin.concat(notCreatedArr)) setRoleAssignment(res.payload.data.admin.concat(notCreatedArr))
setLimits(res.payload.data.users.count) setLimits(res.payload.data.users.count)
mylimits.current = res.payload.data.users.rows.length mylimits.current = res.payload.data.users.rows.length
@ -462,7 +465,7 @@ const Roles = (props) => {
) )
} }
<div style={{ marginLeft: 4, cursor: "pointer", }} onClick={() => { {userAdmin ? "" : <><div style={{ marginLeft: 4, cursor: "pointer", }} onClick={() => {
if (item.id) { if (item.id) {
setEditObj(item) setEditObj(item)
setAdminEdit(true) setAdminEdit(true)
@ -492,7 +495,7 @@ const Roles = (props) => {
</Popconfirm> </Popconfirm>
) : ('') ) : ('')
} }</>}
</div> </div>
<div style={{ fontSize: 12, color: '#969799', marginTop: 28, marginLeft: 50 }}>角色说明拥有全平台的权限</div> <div style={{ fontSize: 12, color: '#969799', marginTop: 28, marginLeft: 50 }}>角色说明拥有全平台的权限</div>

Loading…
Cancel
Save