|
|
@ -31,13 +31,15 @@ export class UserManageComponent { |
|
|
|
public roleForm = new FormGroup({ |
|
|
|
roleId: new FormControl(""), |
|
|
|
roleName: new FormControl("", [FormValidators.required("请输入角色名称")]), |
|
|
|
items: new FormControl("1"), |
|
|
|
items: new FormControl([]), |
|
|
|
}); |
|
|
|
|
|
|
|
public allPerms: PermItemDTO[] = []; |
|
|
|
|
|
|
|
public userList: UserDTO[] = []; |
|
|
|
|
|
|
|
public currentUserList: UserDTO[] = []; |
|
|
|
|
|
|
|
roleList: UserRoleDTO[] = []; |
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
@ -58,6 +60,7 @@ export class UserManageComponent { |
|
|
|
const role = this.roleList.find((f) => f.id === roleId); |
|
|
|
if (role) { |
|
|
|
this.role = role; |
|
|
|
this.onRoleChange(role.id); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (this.roleList.length > 0) { |
|
|
@ -69,13 +72,17 @@ export class UserManageComponent { |
|
|
|
onRoleChange(roleId: string) { |
|
|
|
const role = this.roleList.find((f) => f.id === roleId); |
|
|
|
if (role) { |
|
|
|
this.role = role; |
|
|
|
this.router.navigate(["/system/user"], { |
|
|
|
queryParams: { |
|
|
|
roleId, |
|
|
|
}, |
|
|
|
queryParamsHandling: "merge", |
|
|
|
}); |
|
|
|
this.router |
|
|
|
.navigate(["/system/user"], { |
|
|
|
queryParams: { |
|
|
|
roleId, |
|
|
|
}, |
|
|
|
queryParamsHandling: "merge", |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
this.role = role; |
|
|
|
this.currentUserList = this.userList.filter((f) => Number(f.roleId) === Number(role.id)); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|