|
|
@ -23,11 +23,9 @@ export class EdituserComponent implements OnInit { |
|
|
|
role: [null, [Validators.required]], |
|
|
|
role: [null, [Validators.required]], |
|
|
|
phonenum: [null, [Validators.required]] |
|
|
|
phonenum: [null, [Validators.required]] |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
Promise.all([this.getAllRoles(), this.getAllOrganization()]).then(()=>{ |
|
|
|
|
|
|
|
this.modal.containerInstance.config.nzOkLoading = false |
|
|
|
console.log(this.data) |
|
|
|
}) |
|
|
|
this.getAllRoles() |
|
|
|
|
|
|
|
this.getAllOrganization() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
destroyModal(): void { |
|
|
|
destroyModal(): void { |
|
|
|
this.modal.destroy({ data: 'this the result data' }); |
|
|
|
this.modal.destroy({ data: 'this the result data' }); |
|
|
@ -36,29 +34,33 @@ export class EdituserComponent implements OnInit { |
|
|
|
listOfData: any[] = []; |
|
|
|
listOfData: any[] = []; |
|
|
|
|
|
|
|
|
|
|
|
//获取角色列表
|
|
|
|
//获取角色列表
|
|
|
|
getAllRoles() { |
|
|
|
async getAllRoles() { |
|
|
|
this.http.get('/api/services/app/Role/GetAll').subscribe((data: any) => { |
|
|
|
await new Promise<void>((resolve, reject) => { |
|
|
|
console.log('角色列表', data.result.items) |
|
|
|
this.http.get('/api/services/app/Role/GetAll').subscribe((data: any) => { |
|
|
|
this.listOfData = data.result.items |
|
|
|
resolve(data) |
|
|
|
|
|
|
|
this.listOfData = data.result.items |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
//获取所有组织机构
|
|
|
|
//获取所有组织机构
|
|
|
|
nodes:any = [] |
|
|
|
nodes: any = [] |
|
|
|
getAllOrganization() { |
|
|
|
async getAllOrganization() { |
|
|
|
let OrganizationUnitId = sessionStorage.getItem('isGasStation') == 'true' ? JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id : JSON.parse(sessionStorage.getItem('userdata')).organization.id |
|
|
|
let OrganizationUnitId = sessionStorage.getItem('isGasStation') == 'true' ? JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id : JSON.parse(sessionStorage.getItem('userdata')).organization.id |
|
|
|
let params = { |
|
|
|
let params = { |
|
|
|
OrganizationUnitId: OrganizationUnitId, |
|
|
|
OrganizationUnitId: OrganizationUnitId, |
|
|
|
IsContainsChildren: "true" |
|
|
|
IsContainsChildren: "true" |
|
|
|
} |
|
|
|
} |
|
|
|
this.http.get('/api/services/app/Organization/GetAll', { |
|
|
|
await new Promise<void>((resolve, reject) => { |
|
|
|
params: params |
|
|
|
this.http.get('/api/services/app/Organization/GetAll', { |
|
|
|
}).subscribe((data: any) => { |
|
|
|
params: params |
|
|
|
data.result.items.forEach(element => { |
|
|
|
}).subscribe((data: any) => { |
|
|
|
element.key = element.id |
|
|
|
data.result.items.forEach(element => { |
|
|
|
element.title = element.displayName |
|
|
|
element.key = element.id |
|
|
|
}); |
|
|
|
element.title = element.displayName |
|
|
|
this.nodes = [...this.toTree.toTree(data.result.items)] |
|
|
|
}); |
|
|
|
|
|
|
|
this.nodes = [...this.toTree.toTree(data.result.items)] |
|
|
|
|
|
|
|
resolve(data) |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|