|
|
|
@ -299,6 +299,43 @@ export class BgStationComponent implements OnInit {
|
|
|
|
|
this.getViolateRecordList(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export($event) { |
|
|
|
|
const httpOptions = { |
|
|
|
|
responseType: "blob" as "json", |
|
|
|
|
params: { |
|
|
|
|
ViolateTime: this.validateForm.value.datePicker |
|
|
|
|
? [ |
|
|
|
|
moment(this.validateForm.value.datePicker[0]).format( |
|
|
|
|
"yyyy-MM-DD" |
|
|
|
|
) + " 00:00:00", |
|
|
|
|
moment(this.validateForm.value.datePicker[1]).format( |
|
|
|
|
"yyyy-MM-DD" |
|
|
|
|
) + " 23:59:59", |
|
|
|
|
] |
|
|
|
|
: null, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
this.http |
|
|
|
|
.get(`/api/services/app/ViolateRecordVerification/ExportPositiveRateByStation`, httpOptions) |
|
|
|
|
.subscribe( |
|
|
|
|
(data: any) => { |
|
|
|
|
// console.log('导出成功')
|
|
|
|
|
// 文件名中有中文 则对文件名进行转码
|
|
|
|
|
const link = document.createElement("a"); |
|
|
|
|
const blob = new Blob([data], { type: "application/vnd.ms-excel" }); |
|
|
|
|
link.setAttribute("href", window.URL.createObjectURL(blob)); |
|
|
|
|
link.setAttribute("download", "按照油站统计" + ".xls"); |
|
|
|
|
link.style.visibility = "hidden"; |
|
|
|
|
document.body.appendChild(link); |
|
|
|
|
link.click(); |
|
|
|
|
document.body.removeChild(link); |
|
|
|
|
this.message.create("success", `导出成功`); |
|
|
|
|
}, |
|
|
|
|
(err) => { |
|
|
|
|
this.message.create("error", `导出失败`); |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
//预警类型接口
|
|
|
|
|
warningTypes: any; //预警接口数据
|
|
|
|
|
warningTypesDetails: any; |
|
|
|
|