|
@@ -67,8 +67,6 @@
|
|
<RoleList
|
|
<RoleList
|
|
title="角色列表"
|
|
title="角色列表"
|
|
:role-type="roleType"
|
|
:role-type="roleType"
|
|
- :needType="needType"
|
|
|
|
- :queryAll="queryAll"
|
|
|
|
:group-ids="groupIds"
|
|
:group-ids="groupIds"
|
|
:check-box-list="roleListCheckedList"
|
|
:check-box-list="roleListCheckedList"
|
|
:number="8"
|
|
:number="8"
|
|
@@ -174,9 +172,7 @@ export default {
|
|
permissionTreeChckedTemp: [], // 权限树当前勾选项
|
|
permissionTreeChckedTemp: [], // 权限树当前勾选项
|
|
rulesOfCompetency: null, // 当前编辑的权限规则
|
|
rulesOfCompetency: null, // 当前编辑的权限规则
|
|
queryType: '',
|
|
queryType: '',
|
|
- queryAll: '',
|
|
|
|
roleType: '',
|
|
roleType: '',
|
|
- needType: '',
|
|
|
|
groupIds: [],
|
|
groupIds: [],
|
|
queryIds: [],
|
|
queryIds: [],
|
|
currentSelectedRoleId: -1,
|
|
currentSelectedRoleId: -1,
|
|
@@ -219,18 +215,20 @@ export default {
|
|
// console.log(obj)
|
|
// console.log(obj)
|
|
const { OpenRole } = obj
|
|
const { OpenRole } = obj
|
|
this.openRole = OpenRole
|
|
this.openRole = OpenRole
|
|
- this.accountGroupTreeCheckedTemp.push(this.GroupUpId)
|
|
|
|
- this.queryIds.push(this.GroupUpId)
|
|
|
|
|
|
+ this.accountGroupTreeCheckedTemp = [this.GroupUpId]
|
|
|
|
+ this.queryIds = [this.GroupUpId]
|
|
this.doesGroupExist && (this.GroupId = parseInt(this.$route.query.GroupId))
|
|
this.doesGroupExist && (this.GroupId = parseInt(this.$route.query.GroupId))
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- this.GroupUpId !== -1 && this.groupIds.push(this.GroupUpId)
|
|
|
|
|
|
+ if (this.GroupUpId !== -1) {
|
|
|
|
+ this.groupIds = [this.GroupUpId]
|
|
|
|
+ this.roleType = 'group'
|
|
|
|
+ } else {
|
|
|
|
+ this.groupIds = [-1]
|
|
|
|
+ this.roleType = 'onlyRole'
|
|
|
|
+ }
|
|
if (this.doesGroupExist) {
|
|
if (this.doesGroupExist) {
|
|
this.getGroupDetails()
|
|
this.getGroupDetails()
|
|
- } else {
|
|
|
|
- this.roleType = 'onlyRole'
|
|
|
|
- this.needType = 'yes'
|
|
|
|
- this.queryType = 'all'
|
|
|
|
}
|
|
}
|
|
this.accountGroupTreeCheckedList = [this.GroupUpId]
|
|
this.accountGroupTreeCheckedList = [this.GroupUpId]
|
|
},
|
|
},
|
|
@@ -262,14 +260,6 @@ export default {
|
|
this.permissionTreeChckedKeys.push(auth.AuthId)
|
|
this.permissionTreeChckedKeys.push(auth.AuthId)
|
|
this.permissionTreeChckedTemp.push(auth)
|
|
this.permissionTreeChckedTemp.push(auth)
|
|
})
|
|
})
|
|
- if (this.GroupUpId === -1) {
|
|
|
|
- this.needType = 'yes'
|
|
|
|
- this.roleType = 'onlyRole'
|
|
|
|
- this.queryType = 'all'
|
|
|
|
- } else {
|
|
|
|
- this.roleType = 'roleByUpId'
|
|
|
|
- this.queryType = 'group'
|
|
|
|
- }
|
|
|
|
} else {
|
|
} else {
|
|
this.$message.error(res.message)
|
|
this.$message.error(res.message)
|
|
}
|
|
}
|
|
@@ -294,24 +284,23 @@ export default {
|
|
},
|
|
},
|
|
// 获取当前勾选的岗位
|
|
// 获取当前勾选的岗位
|
|
getAccountGroupChecked(arr) {
|
|
getAccountGroupChecked(arr) {
|
|
- if (arr.length === 1 && arr[0] !== -1) {
|
|
|
|
- console.log(arr[0])
|
|
|
|
- const GroupIds = arr.map(item => item.GroupId)
|
|
|
|
- this.accountGroupTreeCheckedTemp = GroupIds
|
|
|
|
- this.needType = ''
|
|
|
|
- this.queryAll = ''
|
|
|
|
- this.roleType = 'groups'
|
|
|
|
- this.groupIds = GroupIds
|
|
|
|
- this.queryType = 'group'
|
|
|
|
- this.queryIds = GroupIds
|
|
|
|
|
|
+ if (arr.length === 1) {
|
|
|
|
+ if (arr[0].GroupId === -1) {
|
|
|
|
+ this.groupIds = [-1]
|
|
|
|
+ this.accountGroupTreeCheckedTemp = [-1]
|
|
|
|
+ this.roleType = 'onlyRole'
|
|
|
|
+ this.queryType = 'all'
|
|
|
|
+ } else {
|
|
|
|
+ const GroupIds = arr.map(item => item.GroupId)
|
|
|
|
+ this.accountGroupTreeCheckedTemp = GroupIds
|
|
|
|
+ this.roleType = 'group'
|
|
|
|
+ this.groupIds = GroupIds
|
|
|
|
+ this.queryType = 'group'
|
|
|
|
+ this.queryIds = GroupIds
|
|
|
|
+ }
|
|
} else if (arr.length === 0) {
|
|
} else if (arr.length === 0) {
|
|
- this.accountGroupTreeCheckedTemp = [-1]
|
|
|
|
this.accountGroupTreeCheckedList = [-1]
|
|
this.accountGroupTreeCheckedList = [-1]
|
|
- this.queryAll = 'yes'
|
|
|
|
- this.needType = 'yes'
|
|
|
|
- this.roleType = 'onlyRole'
|
|
|
|
- this.roleListCheckedList = this.roleListCheckedCopy.map(role => role.RoleId)
|
|
|
|
- this.queryType = 'all'
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 角色选取
|
|
// 角色选取
|
|
@@ -385,7 +374,6 @@ export default {
|
|
GroupUpid: this.accountGroupTreeCheckedTemp[0],
|
|
GroupUpid: this.accountGroupTreeCheckedTemp[0],
|
|
RoleList: this.roleListCheckedTemp
|
|
RoleList: this.roleListCheckedTemp
|
|
}
|
|
}
|
|
-
|
|
|
|
if (this.doesGroupExist) {
|
|
if (this.doesGroupExist) {
|
|
this.saveEditGroup({
|
|
this.saveEditGroup({
|
|
...params,
|
|
...params,
|