From 25809071d43e27cff2e7a0b10ff96755c5fbab6a Mon Sep 17 00:00:00 2001 From: renpy Date: Tue, 18 Jul 2023 13:53:52 +0800 Subject: [PATCH] =?UTF-8?q?alerts=E3=80=81rmssoh=E3=80=81met=20=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=A2=9E=E5=8A=A0=E5=AF=BC=E5=87=BAexcel=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/statistics/imsData/met/index.vue | 27 ++++++++++++++-- .../radionuclide/particulate/blankphd.vue | 4 +-- .../imsData/stateOfHealth/alerts.vue | 32 +++++++++++++++++-- .../imsData/stateOfHealth/rmssoh.vue | 27 ++++++++++++++-- 4 files changed, 82 insertions(+), 8 deletions(-) diff --git a/src/views/statistics/imsData/met/index.vue b/src/views/statistics/imsData/met/index.vue index 5d384b7..41efe98 100644 --- a/src/views/statistics/imsData/met/index.vue +++ b/src/views/statistics/imsData/met/index.vue @@ -3,7 +3,7 @@ - + Excel @@ -92,7 +92,7 @@ const columns = [ ] import { compareDate } from "../../commom" import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import { getAction } from '../../../../api/manage' +import { getAction, getFileAction } from '../../../../api/manage' import dateFormat from '../../../../components/jeecg/JEasyCron/format-date' export default { name: 'menuTree', @@ -122,6 +122,29 @@ export default { this.findStationList() }, methods: { + handleExcel() { + if (this.dataSource.length>0) { + let params = { + ...this.queryParam, + } + getFileAction("/webStatistics/metExport", params).then(res => { + if (res.code && res.code == 500) { + this.$message.warning("This operation fails. Contact your system administrator") + } else { + const blob = new Blob([res], { type: "application/vnd.ms-excel" }) + let link = document.createElement('a') + link.href = window.URL.createObjectURL(blob) + link.download = "ALERTS" + document.body.appendChild(link) + link.click() + URL.revokeObjectURL(link.href) + document.body.removeChild(link) + } + }) + } else { + this.$message.warning("No downloadable data") + } + }, searchQueryData() { let days = compareDate(this.queryParam.startTime, this.queryParam.endTime) if (days <= 10) { diff --git a/src/views/statistics/imsData/radionuclide/particulate/blankphd.vue b/src/views/statistics/imsData/radionuclide/particulate/blankphd.vue index f2f631b..4bd1c46 100644 --- a/src/views/statistics/imsData/radionuclide/particulate/blankphd.vue +++ b/src/views/statistics/imsData/radionuclide/particulate/blankphd.vue @@ -4,7 +4,7 @@ - + Excel @@ -79,7 +79,7 @@ const columns = [ }, ] import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import { getAction,getFileAction } from '../../../../../api/manage' +import { getAction, getFileAction } from '../../../../../api/manage' import dateFormat from '../../../../../components/jeecg/JEasyCron/format-date' import Detail from "../../../detail.vue" export default { diff --git a/src/views/statistics/imsData/stateOfHealth/alerts.vue b/src/views/statistics/imsData/stateOfHealth/alerts.vue index e1c72f0..1190c3c 100644 --- a/src/views/statistics/imsData/stateOfHealth/alerts.vue +++ b/src/views/statistics/imsData/stateOfHealth/alerts.vue @@ -3,7 +3,7 @@ - + Excel @@ -76,7 +76,7 @@ const columns = [ ] import { compareDate } from "../../commom" import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import { getAction } from '../../../../api/manage' +import { getAction, getFileAction } from '../../../../api/manage' import dateFormat from '../../../../components/jeecg/JEasyCron/format-date' export default { name: 'menuTree', @@ -106,6 +106,34 @@ export default { this.findStationList() }, methods: { + handleExcel() { + if (this.dataSource.length>0) { + // this.queryParam = { + // startTime: "2023-07-17", + // endTime: "2023-07-17", + // stationIds: [1] + // } + let params = { + ...this.queryParam, + } + getFileAction("/webStatistics/alertsExport", params).then(res => { + if (res.code && res.code == 500) { + this.$message.warning("This operation fails. Contact your system administrator") + } else { + const blob = new Blob([res], { type: "application/vnd.ms-excel" }) + let link = document.createElement('a') + link.href = window.URL.createObjectURL(blob) + link.download = "ALERTS" + document.body.appendChild(link) + link.click() + URL.revokeObjectURL(link.href) + document.body.removeChild(link) + } + }) + } else { + this.$message.warning("No downloadable data") + } + }, searchQueryData() { let days = compareDate(this.queryParam.startTime, this.queryParam.endTime) if (days <= 10) { diff --git a/src/views/statistics/imsData/stateOfHealth/rmssoh.vue b/src/views/statistics/imsData/stateOfHealth/rmssoh.vue index 634c7f4..dcd845d 100644 --- a/src/views/statistics/imsData/stateOfHealth/rmssoh.vue +++ b/src/views/statistics/imsData/stateOfHealth/rmssoh.vue @@ -3,7 +3,7 @@ - + Excel @@ -74,7 +74,7 @@ const columns = [ ] import { compareDate } from "../../commom" import { JeecgListMixin } from '@/mixins/JeecgListMixin' -import { getAction } from '../../../../api/manage' +import { getAction, getFileAction } from '../../../../api/manage' import dateFormat from '../../../../components/jeecg/JEasyCron/format-date' import FileDetail from "../../fileDetail.vue" export default { @@ -110,6 +110,29 @@ export default { this.findStationList() }, methods: { + handleExcel() { + if (this.dataSource.length>0) { + let params = { + ...this.queryParam, + } + getFileAction("/webStatistics/sohExport", params).then(res => { + if (res.code && res.code == 500) { + this.$message.warning("This operation fails. Contact your system administrator") + } else { + const blob = new Blob([res], { type: "application/vnd.ms-excel" }) + let link = document.createElement('a') + link.href = window.URL.createObjectURL(blob) + link.download = "ALERTS" + document.body.appendChild(link) + link.click() + URL.revokeObjectURL(link.href) + document.body.removeChild(link) + } + }) + } else { + this.$message.warning("No downloadable data") + } + }, handleBack(flag) { this.isFileDetail = flag },