|
|
|
@ -33,6 +33,7 @@ export class UserComponent implements OnInit {
|
|
|
|
|
usersNum: string |
|
|
|
|
OrganizationUnitId |
|
|
|
|
loading: boolean; |
|
|
|
|
organizationsList=[] |
|
|
|
|
getAllUsers() { |
|
|
|
|
this.loading = true |
|
|
|
|
let params = { |
|
|
|
@ -86,28 +87,53 @@ export class UserComponent implements OnInit {
|
|
|
|
|
await new Promise<void>((resolve, reject) => { |
|
|
|
|
this.http.get('/api/services/app/Organization/GetAll', { |
|
|
|
|
params: params |
|
|
|
|
}).subscribe((data: any) => { |
|
|
|
|
}).subscribe(async (data: any) => { |
|
|
|
|
console.log(data,80801); |
|
|
|
|
await this.getuser(data.result.items)
|
|
|
|
|
resolve(data) |
|
|
|
|
this.getAllUsers() |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
async getuser(e) { |
|
|
|
|
let params = { |
|
|
|
|
IsContainsChildren: 'true' |
|
|
|
|
} |
|
|
|
|
await new Promise<void>((resolve, reject) => { |
|
|
|
|
this.http.get('/api/services/app/User/GetCountsByOrganizations', { |
|
|
|
|
params: params |
|
|
|
|
}).subscribe((data: any) => { |
|
|
|
|
resolve(data) |
|
|
|
|
console.log(data,70); |
|
|
|
|
|
|
|
|
|
data.result.items.forEach(element => { |
|
|
|
|
if (element.id == OrganizationUnitId) { |
|
|
|
|
element.parentId = null |
|
|
|
|
this.organizationsList = data.result |
|
|
|
|
|
|
|
|
|
const arrs = e.map(item => { |
|
|
|
|
const data = this.organizationsList.find(i => item.id == i.organizationId) |
|
|
|
|
return { |
|
|
|
|
...item, |
|
|
|
|
// ...data,
|
|
|
|
|
products: data ? data : false |
|
|
|
|
} |
|
|
|
|
element.key = element.id |
|
|
|
|
element.title = element.displayName |
|
|
|
|
//+" 共有"+this.usersNum+"位用户"
|
|
|
|
|
}); |
|
|
|
|
this.nodes = [...this.toTree.toTree(data.result.items)] |
|
|
|
|
resolve(data) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
for (let index = 0; index < arrs.length; index++) { |
|
|
|
|
if(arrs[index].products){ |
|
|
|
|
arrs[index].title=arrs[index].displayName |
|
|
|
|
}else{ |
|
|
|
|
arrs[index].title=arrs[index].displayName |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.nodes = [...this.toTree.toTree(arrs)] |
|
|
|
|
this.defaultExpandedKeys = [this.nodes[0].id] |
|
|
|
|
this.nzSelectedKeys = [this.nodes[0].id] |
|
|
|
|
this.OrganizationUnitId = [this.nodes[0].id] |
|
|
|
|
this.getAllUsers() |
|
|
|
|
console.log(this.nodes,9000); |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//搜索框提交
|
|
|
|
|
submitForm(): void { |
|
|
|
|
for (const i in this.validateForm.controls) { |
|
|
|
|