Commit 2f600756 authored by wangqinghua's avatar wangqinghua

确认完成

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