update 管理员判断调整

This commit is contained in:
赵霄
2023-11-23 09:48:02 +08:00
parent 95f94b071e
commit 025a1e8a63
5 changed files with 23 additions and 18 deletions
@@ -238,7 +238,6 @@ export default {
moveUpFlag: false,
fullWidth: '',
parameter: {},
administrators: false,
showAction: false,
flag: '4', // 查询要用到
operateSlotName: 'action',
@@ -297,7 +296,12 @@ export default {
*/
return `calc(100vh - ${this.defaultHeight['user-info-height']} - ${this.defaultHeight['breadcrumb-height']} - ${this.defaultHeight.oneLineOperationHeight} - 48px - 48px - 54px - ${this.isBackTitle ? '56px' : '0px'})`
},
...mapGetters(['userInfo'])
...mapGetters(['userInfo']),
administrators () {
const adminRoleList = window._CONFIG.adminRoleCode.split(',')
const userRoleList = this.userInfo.roleCode.split(',')
return userRoleList.some(tt => adminRoleList.includes(tt))
}
},
mounted () {
this.operateColumn.scopedSlots.customRender = 'action'
@@ -313,14 +317,6 @@ export default {
if (this.needFilterTableBtn) {
this.operationList = this.operationList.filter(item => !item.has || isHasPermission(item.has))
}
this.administrators = false
if (this.userInfo.userRoleList && this.userInfo.userRoleList.length > 0) {
this.userInfo.userRoleList.forEach(res => {
if (res.roleCode === 'admin') {
this.administrators = true
}
})
}
this.infoId = this.$route.query.infoId
this.loadMenuData()
},