|
@@ -1,7 +1,7 @@
|
|
<!--
|
|
<!--
|
|
* @Author: Badguy
|
|
* @Author: Badguy
|
|
* @Date: 2022-02-15 11:37:42
|
|
* @Date: 2022-02-15 11:37:42
|
|
- * @LastEditTime: 2022-02-22 13:05:30
|
|
|
|
|
|
+ * @LastEditTime: 2022-02-23 19:24:51
|
|
* @LastEditors: your name
|
|
* @LastEditors: your name
|
|
* @Description: 编辑账号
|
|
* @Description: 编辑账号
|
|
* have a nice day!
|
|
* have a nice day!
|
|
@@ -148,12 +148,13 @@
|
|
<RoleList
|
|
<RoleList
|
|
title="角色列表"
|
|
title="角色列表"
|
|
:role-type="roleType"
|
|
:role-type="roleType"
|
|
- :group-ids="accountGroupTreeCheckedTemp"
|
|
|
|
|
|
+ :group-ids="groupIds"
|
|
:check-box-list="roleListCheckedList"
|
|
:check-box-list="roleListCheckedList"
|
|
:number="8"
|
|
:number="8"
|
|
:active="true"
|
|
:active="true"
|
|
@checkChange="getRoleListChecked"
|
|
@checkChange="getRoleListChecked"
|
|
@checkClick="selectRole"
|
|
@checkClick="selectRole"
|
|
|
|
+ @roleListChange="roleListCheckedChange"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -196,7 +197,7 @@
|
|
<PermissionTree
|
|
<PermissionTree
|
|
title="权限树"
|
|
title="权限树"
|
|
:query-type="queryType"
|
|
:query-type="queryType"
|
|
- :query-ids="accountGroupTreeCheckedTemp"
|
|
|
|
|
|
+ :query-ids="queryIds"
|
|
:checked-keys="permissionTreeChckedKeys"
|
|
:checked-keys="permissionTreeChckedKeys"
|
|
@getTreeData="getPermissionTreeChecked"
|
|
@getTreeData="getPermissionTreeChecked"
|
|
/>
|
|
/>
|
|
@@ -317,9 +318,11 @@ export default {
|
|
roleListCheckedList: [], // 角色列表初始勾选项
|
|
roleListCheckedList: [], // 角色列表初始勾选项
|
|
roleListCheckedTemp: [], // 角色列表当前勾选项
|
|
roleListCheckedTemp: [], // 角色列表当前勾选项
|
|
roleType: '',
|
|
roleType: '',
|
|
|
|
+ queryType: '',
|
|
checkedRoles: [],
|
|
checkedRoles: [],
|
|
currentSelectedRoleId: 0,
|
|
currentSelectedRoleId: 0,
|
|
- queryType: '',
|
|
|
|
|
|
+ groupIds: [],
|
|
|
|
+ queryIds: [],
|
|
// dialogVisible: false,
|
|
// dialogVisible: false,
|
|
formRules: {
|
|
formRules: {
|
|
name: [
|
|
name: [
|
|
@@ -361,13 +364,15 @@ export default {
|
|
this.pwdStruc = PwdStruc
|
|
this.pwdStruc = PwdStruc
|
|
this.pwdLengthBegin = PwdLengthBegin
|
|
this.pwdLengthBegin = PwdLengthBegin
|
|
this.pwdLengthEnd = PwdLengthEnd
|
|
this.pwdLengthEnd = PwdLengthEnd
|
|
- this.openRole && (this.roleType = this.openGroup ? 'roleByUpId' : 'onlyRole')
|
|
|
|
- this.queryType = this.openGroup ? 'group' : 'all'
|
|
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
if (this.doesAccountExist) {
|
|
if (this.doesAccountExist) {
|
|
this.userId = this.$route.query.userId
|
|
this.userId = this.$route.query.userId
|
|
this.getAccountInfo()
|
|
this.getAccountInfo()
|
|
} else {
|
|
} else {
|
|
this.resetPwd()
|
|
this.resetPwd()
|
|
|
|
+ this.roleType = 'onlyRole'
|
|
|
|
+ this.queryType = 'all'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -397,12 +402,14 @@ export default {
|
|
GroupList.forEach(group => {
|
|
GroupList.forEach(group => {
|
|
this.accountGroupTreeCheckedList.push(group.GroupId)
|
|
this.accountGroupTreeCheckedList.push(group.GroupId)
|
|
this.accountGroupTreeCheckedTemp.push(group.GroupId)
|
|
this.accountGroupTreeCheckedTemp.push(group.GroupId)
|
|
|
|
+ this.groupIds.push(group.GroupId)
|
|
|
|
+ this.queryIds.push(group.GroupId)
|
|
})
|
|
})
|
|
|
|
|
|
RoleList &&
|
|
RoleList &&
|
|
RoleList.length &&
|
|
RoleList.length &&
|
|
RoleList.forEach(role => {
|
|
RoleList.forEach(role => {
|
|
- role.IsSelected && (this.roleListCheckedList.push(role.RoleId), this.roleListCheckedTemp.push(role))
|
|
|
|
|
|
+ role.IsSelected && this.roleListCheckedTemp.push(role)
|
|
})
|
|
})
|
|
|
|
|
|
TacList &&
|
|
TacList &&
|
|
@@ -411,7 +418,8 @@ export default {
|
|
tac.IsSelected && this.loginPolicyCheckedList.push(tac)
|
|
tac.IsSelected && this.loginPolicyCheckedList.push(tac)
|
|
tac.IsSelected && this.loginPolicyCheckedTemp.push(tac)
|
|
tac.IsSelected && this.loginPolicyCheckedTemp.push(tac)
|
|
})
|
|
})
|
|
- // console.log(this.loginPolicyCheckedTemp)
|
|
|
|
|
|
+ this.roleType = this.openGroup ? 'roleByUpId' : 'onlyRole'
|
|
|
|
+ this.queryType = this.openGroup ? 'group' : 'all'
|
|
} else {
|
|
} else {
|
|
this.$message.error(res.message)
|
|
this.$message.error(res.message)
|
|
}
|
|
}
|
|
@@ -437,17 +445,33 @@ export default {
|
|
},
|
|
},
|
|
// 获取当前勾选的账号组
|
|
// 获取当前勾选的账号组
|
|
getAccountGroupChecked(arr) {
|
|
getAccountGroupChecked(arr) {
|
|
- if (arr && arr.length) {
|
|
|
|
|
|
+ if (arr && arr.length && arr[0] !== -1) {
|
|
const GroupIds = arr.map(item => item.GroupId)
|
|
const GroupIds = arr.map(item => item.GroupId)
|
|
this.accountGroupTreeCheckedTemp = GroupIds
|
|
this.accountGroupTreeCheckedTemp = GroupIds
|
|
|
|
+ this.roleType = 'roleByUpId'
|
|
|
|
+ this.groupIds = GroupIds
|
|
|
|
+ this.queryType = 'group'
|
|
|
|
+ this.queryIds = GroupIds
|
|
} else {
|
|
} else {
|
|
this.accountGroupTreeCheckedTemp = [-1]
|
|
this.accountGroupTreeCheckedTemp = [-1]
|
|
|
|
+ this.roleType = 'onlyRole'
|
|
|
|
+ this.queryType = 'all'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 获取当前勾选的角色列表
|
|
// 获取当前勾选的角色列表
|
|
getRoleListChecked(arr) {
|
|
getRoleListChecked(arr) {
|
|
this.roleListCheckedTemp = arr
|
|
this.roleListCheckedTemp = arr
|
|
},
|
|
},
|
|
|
|
+ roleListCheckedChange(arr) {
|
|
|
|
+ if (arr && arr.length) {
|
|
|
|
+ this.roleListCheckedTemp = this.roleListCheckedTemp.filter(role =>
|
|
|
|
+ arr.some(data => data.RoleId === role.RoleId)
|
|
|
|
+ )
|
|
|
|
+ } else {
|
|
|
|
+ this.roleListCheckedTemp = []
|
|
|
|
+ }
|
|
|
|
+ this.roleListCheckedList = this.roleListCheckedTemp.map(role => role.RoleId)
|
|
|
|
+ },
|
|
// 点击角色后显示对应权限列表
|
|
// 点击角色后显示对应权限列表
|
|
async selectRole(data) {
|
|
async selectRole(data) {
|
|
if (this.currentSelectedRoleId === data.RoleId) return
|
|
if (this.currentSelectedRoleId === data.RoleId) return
|