From 9b2e7af098c1f215b24e06783d8757d64fb165ab Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Wed, 29 Jun 2022 13:48:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system-management/user/user.component.ts | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/app/system-management/user/user.component.ts b/src/app/system-management/user/user.component.ts index 8f3cdf5..3438fb0 100644 --- a/src/app/system-management/user/user.component.ts +++ b/src/app/system-management/user/user.component.ts @@ -17,13 +17,16 @@ export class UserComponent implements OnInit { constructor(private fb: FormBuilder, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService, private http: HttpClient, private toTree: TreeService) { } ngOnInit(): void { + console.log(JSON.parse(sessionStorage.getItem('userdata')).organization.id); + this.validateForm = this.fb.group({ search: [null] }); - this.getAllUsers() + this.getAllOrganization() + // this.getAllUsers() this.getAllRoles() - this.getAllOrganization() + } nzSelectedKeys: any[] = [] defaultExpandedKeys = []; @@ -40,10 +43,10 @@ export class UserComponent implements OnInit { Keyword: this.validateForm.value.search ? this.validateForm.value.search : '', SkipCount: String(this.SkipCount), MaxResultCount: String(this.MaxResultCount), - OrganizaiotnId:this.OrganizaiotnId + OrganizaiotnId: this.OrganizaiotnId } - console.log(this.OrganizaiotnId); - + + this.http.get('/api/services/app/User/GetAll', { params: params }).subscribe((data: any) => { @@ -93,6 +96,9 @@ export class UserComponent implements OnInit { }); this.nodes = [...this.toTree.toTree(data.result.items)] resolve(data) + this.getAllUsers() + this.defaultExpandedKeys = [this.nodes[0].id] + this.defaultExpandedKeys = [...this.defaultExpandedKeys] }) }) } @@ -106,9 +112,9 @@ export class UserComponent implements OnInit { } this.getAllUsers() } - nzClick(event: NzFormatEmitEvent){ + nzClick(event: NzFormatEmitEvent) { console.log(event); - this.OrganizaiotnId=event.node.origin.id + this.OrganizaiotnId = event.node.origin.id this.getAllUsers() } //新增用户