From 5372d4d754ef9d3154e9da85538545df0176dfc0 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Wed, 29 Jun 2022 14:17:43 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E5=AE=8C=E5=96=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../analysis-of-the-host.component.ts | 3 +++ src/app/system-management/user/user.component.ts | 12 +++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts b/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts index 2ea2c2f..41b15d6 100644 --- a/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts +++ b/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts @@ -37,6 +37,9 @@ export class AnalysisOfTheHostComponent implements OnInit { }).subscribe((data: any) => { this.totalCount = data.result.totalCount data.result.items.forEach(element => { + if (element.id == OrganizationUnitId) { + element.parentId = null + } element.key = element.id element.title = element.displayName element.selectable = false diff --git a/src/app/system-management/user/user.component.ts b/src/app/system-management/user/user.component.ts index dce54c0..3416dd2 100644 --- a/src/app/system-management/user/user.component.ts +++ b/src/app/system-management/user/user.component.ts @@ -45,8 +45,6 @@ export class UserComponent implements OnInit { MaxResultCount: String(this.MaxResultCount), OrganizaiotnId: this.OrganizaiotnId } - - this.http.get('/api/services/app/User/GetAll', { params: params }).subscribe((data: any) => { @@ -91,16 +89,17 @@ export class UserComponent implements OnInit { params: params }).subscribe((data: any) => { data.result.items.forEach(element => { + if (element.id == OrganizationUnitId) { + element.parentId = null + } element.key = element.id element.title = element.displayName }); this.nodes = [...this.toTree.toTree(data.result.items)] resolve(data) - this.getAllUsers() - console.log(this.nodes); - this.defaultExpandedKeys = [this.nodes[0].id] - this.defaultExpandedKeys = [...this.defaultExpandedKeys] + this.nzSelectedKeys = [this.nodes[0].id] + this.getAllUsers() }) }) } @@ -115,7 +114,6 @@ export class UserComponent implements OnInit { this.getAllUsers() } nzClick(event: NzFormatEmitEvent) { - console.log(event); this.OrganizaiotnId = event.node.origin.id this.getAllUsers() }