Commit 2f600756 authored by wangqinghua's avatar wangqinghua

确认完成

parent 123e74cc
......@@ -24,21 +24,23 @@ import {WorkService} from '../../work/work.service';
padding: 2px 4px;
border-radius: 4px;
}
.tag-warn span.select-border {
border: 1px solid #1626e2;
border-radius: 5px;
padding: 2px;
margin-right: 5px;
}
:host ::ng-deep .tag-warn .ant-tag{
:host ::ng-deep .tag-warn .ant-tag {
margin-right: 0px;
}
`
]
})
export class NowAlarmComponent implements OnInit, OnDestroy {
@ViewChild('sendLog') sendLog:SendLogComponent;
@ViewChild('warnList') warnList:WarnListComponent;
@ViewChild('sendLog') sendLog: SendLogComponent;
@ViewChild('warnList') warnList: WarnListComponent;
color = color;
alarmTotal;
......@@ -51,78 +53,80 @@ export class NowAlarmComponent implements OnInit, OnDestroy {
selectHostId;
isDownload;
obj = {
name: ''
};
constructor(public alarmSer: AlarmService, public message: NzMessageService,private workSer:WorkService,
public overAllSer:OverAllService,private commonSer:CommonService) {
constructor(public alarmSer: AlarmService, public message: NzMessageService, private workSer: WorkService,
public overAllSer: OverAllService, private commonSer: CommonService) {
}
ngOnInit() {
this.getType();
this.search(null);
this.time_ = setInterval(()=>{
this.search(null);
},2*60*1000);
this.search();
this.time_ = setInterval(() => {
this.search();
}, 2 * 60 * 1000);
}
ngOnDestroy(){
ngOnDestroy() {
clearInterval(this.time_);
}
search(hostid){
this.selectHostId = hostid;
search() {
const obj = {
isWaring:'yes',
hostid:hostid,
isWaring: 'yes',
name: this.obj.name,
};
this.warnList.outGet(obj);
}
getType(){
getType() {
this.overAllSer.findHostWarningCount().subscribe(
(res)=>{
if(res.errCode == 10000){
(res) => {
if (res.errCode == 10000) {
this.warnCountList = res.data;
}else{
} else {
this.message.info(res.errMsg);
}
}
)
);
}
change(e){
change(e) {
this.pageNum = e;
}
//打开modal
showModal(data){
showModal(data) {
this.sendLog.showModal(data);
}
getTotal(num){
getTotal(num) {
this.alarmTotal = num;
}
//导出文件
downLoadExcel(){
downLoadExcel() {
this.isDownload = true;
const data = {
isWaring:'yes',
hostid:this.selectHostId,
isWaring: 'yes',
hostid: this.selectHostId,
};
this.alarmSer.getExportUrlEvent(data).subscribe(
(res)=>{
if(res.errCode == 10000){
this.workSer.downloadTemplate('alarm',res.data).subscribe(
(data)=>{
(res) => {
if (res.errCode == 10000) {
this.workSer.downloadTemplate('alarm', res.data).subscribe(
(data) => {
this.isDownload = false;
this.commonSer.downloadFile('当前告警.xlsx',data);
this.commonSer.downloadFile('当前告警.xlsx', data);
}
)
}else{
);
} else {
this.message.error(res.errMsg);
}
this.isDownload = false;
}
)
);
}
}
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