nz-tree中数据的初始化
1 新建父节点 var nzTreeNode ,并赋值
其中children为[],
2 新建var nzTreeNodeChild
3 通过 nzTreeNode[“children”].push(nzTreeNodeChild) 给父节点的children赋值;
nz-tree选中项的高亮显示
主要是通过selected属性来设置的,将其设置为true时为高亮显示,
比如:this.beamGroupList[0].selected=true;//设置默认选中,并高亮显示
getBeamGroupTreeInfo(patientId: number): void {
try {
this._beamGroupService.getAllBeamGroupTreeByPatientId(patientId)
.pipe()
.subscribe((result: BeamGroupOutput[]) => {
this.beamGoupTreeDtoList = result;
if (this.beamGoupTreeDtoList === null || this.beamGoupTreeDtoList === undefined || this.beamGoupTreeDtoList.length === 0) { return; }
var templist: NzTreeNodeOptions[] = [];
for (let i = 0; i < this.beamGoupTreeDtoList.length; i++) {
var beam