Browse Source

菜单管理

beijing
陈鹏飞 2 years ago
parent
commit
9b2e7af098
  1. 20
      src/app/system-management/user/user.component.ts

20
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) { } constructor(private fb: FormBuilder, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService, private http: HttpClient, private toTree: TreeService) { }
ngOnInit(): void { ngOnInit(): void {
console.log(JSON.parse(sessionStorage.getItem('userdata')).organization.id);
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
search: [null] search: [null]
}); });
this.getAllUsers() this.getAllOrganization()
// this.getAllUsers()
this.getAllRoles() this.getAllRoles()
this.getAllOrganization()
} }
nzSelectedKeys: any[] = [] nzSelectedKeys: any[] = []
defaultExpandedKeys = []; defaultExpandedKeys = [];
@ -40,10 +43,10 @@ export class UserComponent implements OnInit {
Keyword: this.validateForm.value.search ? this.validateForm.value.search : '', Keyword: this.validateForm.value.search ? this.validateForm.value.search : '',
SkipCount: String(this.SkipCount), SkipCount: String(this.SkipCount),
MaxResultCount: String(this.MaxResultCount), MaxResultCount: String(this.MaxResultCount),
OrganizaiotnId:this.OrganizaiotnId OrganizaiotnId: this.OrganizaiotnId
} }
console.log(this.OrganizaiotnId);
this.http.get('/api/services/app/User/GetAll', { this.http.get('/api/services/app/User/GetAll', {
params: params params: params
}).subscribe((data: any) => { }).subscribe((data: any) => {
@ -93,6 +96,9 @@ export class UserComponent implements OnInit {
}); });
this.nodes = [...this.toTree.toTree(data.result.items)] this.nodes = [...this.toTree.toTree(data.result.items)]
resolve(data) 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() this.getAllUsers()
} }
nzClick(event: NzFormatEmitEvent){ nzClick(event: NzFormatEmitEvent) {
console.log(event); console.log(event);
this.OrganizaiotnId=event.node.origin.id this.OrganizaiotnId = event.node.origin.id
this.getAllUsers() this.getAllUsers()
} }
//新增用户 //新增用户

Loading…
Cancel
Save