Commit 87e0dd17 authored by wangqinghua's avatar wangqinghua

log

parent ca1517ed
......@@ -95,17 +95,19 @@ export class BasicEditComponent implements OnInit {
this.validateForm.tls_subject = data.tls_subject + '';
this.validateForm.tls_psk = data.tls_psk + '';
this.validateForm.inventory.os = data.inventory.os;
this.validateForm.inventory.name = data.inventory.name;
this.validateForm.inventory.name = data.inventory.invertoryname;
this.validateForm.inventory.serialno_a = data.inventory.serialno_a;
this.validateForm.hostExtend.equipmentType = data.hostExtend.equipmentType +'';
this.validateForm.hostExtend.secondLevelType = data.hostExtend.secondLevelType +'';
this.validateForm.hostExtend.serviceid = data.hostExtend.serviceid +'';
this.validateForm.groups = data.groups;
if(data.parentTemplates){
const tempArr = data.parentTemplates.map(res=>{
return res.templateid;
});
this.validateForm.templates = tempArr;
}
this.interfaceslist = data.interfaces;
this.interfaceslist.forEach(res => {
res.main = res.main + '';
......
......@@ -112,9 +112,8 @@
<tr *ngIf="(item.parent&&item.parent.expand)||!(item.parent)">
<!--父级-->
<ng-container *ngIf="!item.level">
<td [nzIndeterminate]="indeterminate" (nzCheckedChange)="selectChecked($event,item)"
[(nzChecked)]="item.checked"></td>
<td class="cursor" [nzIndentSize]="item.level*20" nzShowExpand
<td></td>
<td class="cursor" [nzIndentSize]="item.level*20" nzShowExpand [nzExpand] ='item.expand'
(nzExpandChange)="getChildren(item)">
<span>{{item.name}}</span>
</td>
......
......@@ -88,11 +88,15 @@ export class BasicComponent implements OnInit {
}
}
convertTreeToList(root: object, groupId: string): TreeNodeInterface[] {
convertTreeToList(root: any, groupId: string,index): TreeNodeInterface[] {
const stack = [];
const array = [];
const hashMap = {};
if(root.host == index){
stack.push({...root, level: 0, expand: true});
}else{
stack.push({...root, level: 0, expand: false});
}
while (stack.length !== 0) {
const node = stack.pop();
......@@ -201,7 +205,7 @@ export class BasicComponent implements OnInit {
this.dataSet[i].host = i;
this.dataSet[i].checked = false;
}
this.toTree();
this.toTree(null);
} else {
this.message.info(res.errMsg);
}
......@@ -218,7 +222,7 @@ export class BasicComponent implements OnInit {
this.dataSet[i].host = i;
this.dataSet[i].checked = false;
}
this.toTree();
this.toTree(null);
} else {
this.message.info(res.errMsg);
}
......@@ -229,9 +233,9 @@ export class BasicComponent implements OnInit {
}
}
toTree() {
toTree(index) {
this.dataSet.forEach(item => {
this.expandDataCache[item.host] = this.convertTreeToList(item, item.id);
this.expandDataCache[item.host] = this.convertTreeToList(item, item.id, index);
});
}
......@@ -338,6 +342,14 @@ export class BasicComponent implements OnInit {
//获取下级list
getChildren(item) {
if(item.list){
if(item.expand){
item.expand = false;
}else{
item.expand = true;
}
return false;
}
const data = {
'groupids': [item.groupid],
'hostExtend': {
......@@ -348,7 +360,7 @@ export class BasicComponent implements OnInit {
(res) => {
if(res.data){
this.dataSet[item.host].list = res.data;
this.toTree();
this.toTree(item.host);
}else{
this.message.info('该分组下无资源');
}
......@@ -365,7 +377,7 @@ export class BasicComponent implements OnInit {
this.overAllSer.findHostByType(data).subscribe(
(res) => {
this.dataSet[item.host].list = res.data;
this.toTree();
this.toTree(null);
}
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment