|
|
|
@ -21,6 +21,7 @@ export class UserComponent implements OnInit {
|
|
|
|
|
addUrl |
|
|
|
|
editUrl |
|
|
|
|
deleteUrl |
|
|
|
|
CountsByOrganizations |
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.validateForm = this.fb.group({ |
|
|
|
|
search: [null] |
|
|
|
@ -31,11 +32,13 @@ export class UserComponent implements OnInit {
|
|
|
|
|
this.addUrl = '/api/services/app/User/Create' |
|
|
|
|
this.editUrl = '/api/services/app/User/Update' |
|
|
|
|
this.deleteUrl = '/api/services/app/User/Delete' |
|
|
|
|
this.CountsByOrganizations = '/api/services/app/User/GetCountsByOrganizations' |
|
|
|
|
} else { |
|
|
|
|
this.getAllUrl = '/api/services/app/EdittingUser/GetAll' |
|
|
|
|
this.addUrl = '/api/services/app/EdittingUser/Create' |
|
|
|
|
this.editUrl = '/api/services/app/EdittingUser/Update' |
|
|
|
|
this.deleteUrl = '/api/services/app/EdittingUser/Delete' |
|
|
|
|
this.CountsByOrganizations = '/api/services/app/EdittingUser/GetCountsByOrganizations' |
|
|
|
|
} |
|
|
|
|
this.getAllOrganization() |
|
|
|
|
this.getAllRoles() |
|
|
|
@ -112,11 +115,13 @@ export class UserComponent implements OnInit {
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
async getuser(e) { |
|
|
|
|
let OrganizationUnitId = sessionStorage.getItem('isGasStation') == 'true' ? JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id : JSON.parse(sessionStorage.getItem('userdata')).organization.id |
|
|
|
|
let params = { |
|
|
|
|
IsContainsChildren: 'true' |
|
|
|
|
OrganizationUnitId: OrganizationUnitId, |
|
|
|
|
IsContainsChildren: String(this.IsContainsChildren) |
|
|
|
|
} |
|
|
|
|
await new Promise<void>((resolve, reject) => { |
|
|
|
|
this.http.get('/api/services/app/User/GetCountsByOrganizations', { |
|
|
|
|
this.http.get(this.CountsByOrganizations, { |
|
|
|
|
params: params |
|
|
|
|
}).subscribe((data: any) => { |
|
|
|
|
resolve(data) |
|
|
|
@ -154,6 +159,9 @@ export class UserComponent implements OnInit {
|
|
|
|
|
this.getAllUsers() |
|
|
|
|
} |
|
|
|
|
nzClick(event: NzFormatEmitEvent) { |
|
|
|
|
console.log(event); |
|
|
|
|
this.nzSelectedKeys[0] = event.node.origin.id |
|
|
|
|
this.nzSelectedKeys = [...this.nzSelectedKeys] |
|
|
|
|
this.OrganizationUnitId = event.node.origin.id |
|
|
|
|
this.getAllUsers() |
|
|
|
|
} |
|
|
|
|