This commit is contained in:
leejh 2019-10-31 10:26:55 +09:00
commit 069d39aa8f

View File

@ -5,7 +5,8 @@ import {
ChangeDetectorRef,
ViewChild,
Output,
EventEmitter
EventEmitter,
AfterViewInit
} from '@angular/core';
import { DeptInfo } from '@ucap-webmessenger/protocol-query';
import { MatTreeNestedDataSource, MatTree } from '@angular/material';
@ -45,7 +46,7 @@ export class OraganizationNode {
templateUrl: './tree.component.html',
styleUrls: ['./tree.component.scss']
})
export class TreeComponent implements OnInit {
export class TreeComponent implements OnInit, AfterViewInit {
@Output()
selected = new EventEmitter<DeptInfo>();
@ -82,6 +83,7 @@ export class TreeComponent implements OnInit {
});
this.dataSource.data = rootNodeList;
this.treeControl.expand(this.dataSource.data[0]);
}
@ViewChild('orgranizationTree', { static: true })
@ -104,6 +106,8 @@ export class TreeComponent implements OnInit {
ngOnInit() {}
ngAfterViewInit(): void {}
getChildren = (node: OraganizationNode) => node.children;
hasChildren = (index: number, node: OraganizationNode) =>