Newer
Older
import {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core';
import {AlarmService} from '../alarm.service';
import {pageSize} from '../../app.constants';
import {WarnListComponent} from '../../modal/warn-list/warn-list.component';
import {OverAllService} from '../../overAll/overAll.service';
import {NzMessageService} from 'ng-zorro-antd';
import {CommonService} from '../../shared/common/common.service';
import {WorkService} from '../../work/work.service';
selector: 'smart-alarm-list',
templateUrl: './alarm-list.component.html',
border: 1px solid #ccc;
margin-right: 10px;
display: inline-block;
margin-bottom: 10px;
padding: 2px 4px;
border-radius: 4px;
}
priorityName: null,
groupid: null,
equipmentType: null,
startTime: '',
endTime: '',
name: ''
constructor(public alarmSer: AlarmService, public overAllSer: OverAllService, public message: NzMessageService,
private monitorSer: MonitorService,
public datePipe: DatePipe, private commonSer: CommonService, private workSer: WorkService) {
const obj = this.commonSer.getTimeByType(e);
this.obj.startTime = obj.startTime;
this.obj.endTime = obj.endTime;
this.obj.startTime = this.datePipe.transform(this.dateBegin, 'yyyy-MM-dd HH:mm:ss');
this.obj.endTime = this.datePipe.transform(this.dateEnd, 'yyyy-MM-dd HH:mm:ss');
}
this.isDownload = true;
this.alarmSer.getExportUrlEvent(this.obj).subscribe(
(res) => {
if (res.errCode == 10000) {
this.workSer.downloadTemplate('alarm', res.data).subscribe(
(data) => {
);
}
monitorAlarm() {
const data =
{
'module': 'PEMS',
'data': {
'D04': {
'告警': '正常1.0',
'告警数据': '空1.0'
}
}
};
this.monitorSer.data(data).subscribe(
(res)=>{
}