Commit 87e0dd17 authored by wangqinghua's avatar wangqinghua

log

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