|
@@ -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-21 15:13:47
|
|
|
|
|
|
+ * @LastEditTime: 2022-02-21 17:26:19
|
|
* @LastEditors: your name
|
|
* @LastEditors: your name
|
|
* @Description: 编辑账号
|
|
* @Description: 编辑账号
|
|
* have a nice day!
|
|
* have a nice day!
|
|
@@ -114,8 +114,6 @@
|
|
<RulesOfCompetency
|
|
<RulesOfCompetency
|
|
title="权限规则"
|
|
title="权限规则"
|
|
margin-b="20px"
|
|
margin-b="20px"
|
|
- :auth-list="authList"
|
|
|
|
- :auth-to="authTo"
|
|
|
|
@getData="getRulesOfCompetency"
|
|
@getData="getRulesOfCompetency"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
@@ -164,7 +162,7 @@
|
|
<PermissionList
|
|
<PermissionList
|
|
title="权限列表"
|
|
title="权限列表"
|
|
class="permission-list"
|
|
class="permission-list"
|
|
- :role-list="selectedRoles"
|
|
|
|
|
|
+ :role-list="checkedRoles"
|
|
:check="true"
|
|
:check="true"
|
|
@Competen="Competen"
|
|
@Competen="Competen"
|
|
/>
|
|
/>
|
|
@@ -209,8 +207,6 @@
|
|
<RulesOfCompetency
|
|
<RulesOfCompetency
|
|
title="权限规则"
|
|
title="权限规则"
|
|
margin-b="20px"
|
|
margin-b="20px"
|
|
- :auth-list="authList"
|
|
|
|
- :auth-to="authTo"
|
|
|
|
@getData="getRulesOfCompetency"
|
|
@getData="getRulesOfCompetency"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
@@ -244,7 +240,7 @@
|
|
<div class="content-card content-card-lg">
|
|
<div class="content-card content-card-lg">
|
|
<PermissionList
|
|
<PermissionList
|
|
title="权限列表"
|
|
title="权限列表"
|
|
- :role-list="selectedRoles"
|
|
|
|
|
|
+ :role-list="checkedRoles"
|
|
:check="true"
|
|
:check="true"
|
|
class="permission-list"
|
|
class="permission-list"
|
|
@Competen="Competen"
|
|
@Competen="Competen"
|
|
@@ -311,8 +307,6 @@ export default {
|
|
pwdStruc: '',
|
|
pwdStruc: '',
|
|
pwdLengthBegin: 0,
|
|
pwdLengthBegin: 0,
|
|
pwdLengthEnd: 0,
|
|
pwdLengthEnd: 0,
|
|
- authTo: {},
|
|
|
|
- authList: [],
|
|
|
|
permissionTreeChckedKeys: [], // 权限树初始勾选项
|
|
permissionTreeChckedKeys: [], // 权限树初始勾选项
|
|
permissionTreeChckedTemp: [], // 权限树当前勾选项
|
|
permissionTreeChckedTemp: [], // 权限树当前勾选项
|
|
rulesOfCompetency: null, // 当前编辑的权限规则
|
|
rulesOfCompetency: null, // 当前编辑的权限规则
|
|
@@ -323,7 +317,7 @@ export default {
|
|
roleListCheckedList: [], // 角色列表初始勾选项
|
|
roleListCheckedList: [], // 角色列表初始勾选项
|
|
roleListCheckedTemp: [], // 角色列表当前勾选项
|
|
roleListCheckedTemp: [], // 角色列表当前勾选项
|
|
roleType: '',
|
|
roleType: '',
|
|
- selectedRoles: [],
|
|
|
|
|
|
+ checkedRoles: [],
|
|
currentSelectedRoleId: 0,
|
|
currentSelectedRoleId: 0,
|
|
queryType: '',
|
|
queryType: '',
|
|
// dialogVisible: false,
|
|
// dialogVisible: false,
|
|
@@ -347,7 +341,7 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
- ...mapGetters(['systemSet', 'authArrs']),
|
|
|
|
|
|
+ ...mapGetters(['systemSet']),
|
|
pageTitle() {
|
|
pageTitle() {
|
|
return this.doesAccountExist ? '编辑账号' : '新增账号'
|
|
return this.doesAccountExist ? '编辑账号' : '新增账号'
|
|
}
|
|
}
|
|
@@ -389,28 +383,27 @@ export default {
|
|
this.accountForm.name = UserName
|
|
this.accountForm.name = UserName
|
|
this.accountForm.desc = UserDesc
|
|
this.accountForm.desc = UserDesc
|
|
this.accountForm.status = Status
|
|
this.accountForm.status = Status
|
|
- this.$store.dispatch('auth/changeAuthList', AuthList)
|
|
|
|
|
|
|
|
AuthList &&
|
|
AuthList &&
|
|
AuthList.length &&
|
|
AuthList.length &&
|
|
- (AuthList.forEach(auth => {
|
|
|
|
|
|
+ AuthList.forEach(auth => {
|
|
this.permissionTreeChckedKeys.push(auth.AuthId)
|
|
this.permissionTreeChckedKeys.push(auth.AuthId)
|
|
- }),
|
|
|
|
- (this.authTo = AuthList[0]),
|
|
|
|
- (this.authList = this._.cloneDeep(AuthList)))
|
|
|
|
- this.permissionTreeChckedTemp = this.permissionTreeChckedKeys
|
|
|
|
|
|
+ this.permissionTreeChckedTemp.push(auth)
|
|
|
|
+ })
|
|
|
|
+
|
|
GroupList &&
|
|
GroupList &&
|
|
GroupList.length &&
|
|
GroupList.length &&
|
|
GroupList.forEach(group => {
|
|
GroupList.forEach(group => {
|
|
this.accountGroupTreeCheckedList.push(group.GroupId)
|
|
this.accountGroupTreeCheckedList.push(group.GroupId)
|
|
})
|
|
})
|
|
this.accountGroupTreeCheckedTemp = this.accountGroupTreeCheckedList
|
|
this.accountGroupTreeCheckedTemp = this.accountGroupTreeCheckedList
|
|
|
|
+
|
|
RoleList &&
|
|
RoleList &&
|
|
RoleList.length &&
|
|
RoleList.length &&
|
|
RoleList.forEach(role => {
|
|
RoleList.forEach(role => {
|
|
- role.IsSelected && this.roleListCheckedList.push(role.RoleId)
|
|
|
|
|
|
+ role.IsSelected && (this.roleListCheckedList.push(role.RoleId), this.roleListCheckedTemp.push(role))
|
|
})
|
|
})
|
|
- this.roleListCheckedTemp = RoleList
|
|
|
|
|
|
+
|
|
TacList &&
|
|
TacList &&
|
|
TacList &&
|
|
TacList &&
|
|
TacList.forEach(tac => {
|
|
TacList.forEach(tac => {
|
|
@@ -464,7 +457,7 @@ export default {
|
|
}
|
|
}
|
|
const result = await RoleAuths(params)
|
|
const result = await RoleAuths(params)
|
|
if (result.code === 0) {
|
|
if (result.code === 0) {
|
|
- this.selectedRoles = result.returnData
|
|
|
|
|
|
+ this.checkedRoles = result.returnData
|
|
this.currentSelectedRoleId = data.RoleId
|
|
this.currentSelectedRoleId = data.RoleId
|
|
} else {
|
|
} else {
|
|
this.$message.error(result.message)
|
|
this.$message.error(result.message)
|
|
@@ -489,9 +482,15 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
handleSaveEdit() {
|
|
handleSaveEdit() {
|
|
- const AuthList = this.permissionTreeChckedTemp.map(auth => auth.AuthList)
|
|
|
|
|
|
+ // console.log(this.permissionTreeChckedTemp)
|
|
|
|
+ const AuthList = this.permissionTreeChckedTemp.map(auth => {
|
|
|
|
+ return {
|
|
|
|
+ ...auth.AuthList,
|
|
|
|
+ AuthName: auth.AuthName
|
|
|
|
+ }
|
|
|
|
+ })
|
|
const params = {
|
|
const params = {
|
|
- AuthList,
|
|
|
|
|
|
+ AuthList: AuthList,
|
|
GroupList: this.accountGroupTreeCheckedTemp.map(groupId => ({ GroupId: groupId })),
|
|
GroupList: this.accountGroupTreeCheckedTemp.map(groupId => ({ GroupId: groupId })),
|
|
RoleList: this.roleListCheckedTemp,
|
|
RoleList: this.roleListCheckedTemp,
|
|
TacList: this.loginPolicyCheckedTemp,
|
|
TacList: this.loginPolicyCheckedTemp,
|