Newer
Older
import {Component, EventEmitter, OnInit, Output} from '@angular/core';
import {OverAllService} from '../../overAll/overAll.service';
import {pageSize} from '../../app.constants';
@Component({
selector: 'smart-select-trigger',
templateUrl: './select-trigger.component.html',
styles: []
})
export class SelectTriggerComponent implements OnInit {
@Output() done = new EventEmitter<string>();
isVisiable = false;
isLoading = false;
dataSet;
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
groupList; // 分组列表
hostList; //主机列表
obj = {
groupid:null,
name:null,
hostid:null,
}
constructor(private overAllSer: OverAllService) {
}
ngOnInit() {
this.getGroup();
}
//获取分组
getGroup() {
this.overAllSer.findGroup().subscribe(
(res) => {
if (res.errCode == 10000) {
this.groupList = res.data;
this.obj.groupid = this.groupList[0].groupid + '';
this.getHost();
}
}
);
}
//获取主机列表
getHost() {
const data = {
'groupids': [this.obj.groupid],
'hostExtend': {
'superiorHostid': null
}
};
this.overAllSer.findDetail(data).subscribe(
(res) => {
if (res.errCode == 10000) {
this.hostList = res.data;
this.obj.hostid = this.hostList[0].hostid + '';
}
}
);
}
showModal() {
this.isVisiable = true;
}
//阈值列表
getwebList() {
this.isLoading = true;
const data = {
queryName: this.obj.name,
hostid: this.obj.hostid
};
this.overAllSer.findTri(data).subscribe(
(res) => {
if (res.errCode == 10000) {
}
this.isLoading = false;
}
);
}
set(item) {
this.done.emit(item);
this.isVisiable = false;
}
handleCancel() {
this.isVisiable = false;
}
handleOk() {
this.isVisiable = false;
}