From be2ba954ff6429c75dd3c669da0c3d6423269ad9 Mon Sep 17 00:00:00 2001 From: shijing Date: Tue, 30 Jul 2024 14:46:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=97=A5=E6=9C=9F=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E6=B8=85=E7=A9=BA=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E6=94=B9=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/enm_coal/report.vue | 31 +++++++++++++++++--------- src/views/enm_coalbase/report.vue | 31 +++++++++++++++++--------- src/views/enm_cogeneration/report.vue | 31 +++++++++++++++++--------- src/views/enm_kiln/report.vue | 31 +++++++++++++++++--------- src/views/enm_kilnbase/report.vue | 31 +++++++++++++++++--------- src/views/enm_limestone/report.vue | 19 +++++++++++----- src/views/enm_mill/report.vue | 32 ++++++++++++++++++--------- src/views/enm_pack/report.vue | 20 ++++++++++++----- src/views/enm_rm/report.vue | 31 +++++++++++++++++--------- src/views/enm_rmbase/report.vue | 31 +++++++++++++++++--------- src/views/enm_slag/report.vue | 20 ++++++++++++----- 11 files changed, 210 insertions(+), 98 deletions(-) diff --git a/src/views/enm_coal/report.vue b/src/views/enm_coal/report.vue index 87321185..bfee0086 100644 --- a/src/views/enm_coal/report.vue +++ b/src/views/enm_coal/report.vue @@ -638,18 +638,29 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "day") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - let days = val.split("-")[2]; - this.getHourData(year, month, days); - } else if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "day") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + let days = val.split("-")[2]; + this.getHourData(year, month, days); + } else if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "day") { + that.getHourData(that.year, that.month, that.days); + } else if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } }, //获取小时数据 diff --git a/src/views/enm_coalbase/report.vue b/src/views/enm_coalbase/report.vue index 356e730c..48651ce3 100644 --- a/src/views/enm_coalbase/report.vue +++ b/src/views/enm_coalbase/report.vue @@ -661,18 +661,29 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "day") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - let days = val.split("-")[2]; - this.getHourData(year, month, days); - } else if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "day") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + let days = val.split("-")[2]; + this.getHourData(year, month, days); + } else if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "day") { + that.getHourData(that.year, that.month, that.days); + } else if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } }, //获取小时数据 diff --git a/src/views/enm_cogeneration/report.vue b/src/views/enm_cogeneration/report.vue index 832a3cee..4c68f0a1 100644 --- a/src/views/enm_cogeneration/report.vue +++ b/src/views/enm_cogeneration/report.vue @@ -816,18 +816,29 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "day") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - let days = val.split("-")[2]; - this.getHourData(year, month, days); - } else if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "day") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + let days = val.split("-")[2]; + this.getHourData(year, month, days); + } else if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "day") { + that.getHourData(that.year, that.month, that.days); + } else if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } }, //获取小时数据 diff --git a/src/views/enm_kiln/report.vue b/src/views/enm_kiln/report.vue index 4b9ebbb2..34590649 100644 --- a/src/views/enm_kiln/report.vue +++ b/src/views/enm_kiln/report.vue @@ -902,18 +902,29 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "day") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - let days = val.split("-")[2]; - this.getHourData(year, month, days); - } else if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "day") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + let days = val.split("-")[2]; + this.getHourData(year, month, days); + } else if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "day") { + that.getHourData(that.year, that.month, that.days); + } else if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } }, //获取小时数据 diff --git a/src/views/enm_kilnbase/report.vue b/src/views/enm_kilnbase/report.vue index b85d11aa..325e56d9 100644 --- a/src/views/enm_kilnbase/report.vue +++ b/src/views/enm_kilnbase/report.vue @@ -873,18 +873,29 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "day") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - let days = val.split("-")[2]; - this.getHourData(year, month, days); - } else if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "day") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + let days = val.split("-")[2]; + this.getHourData(year, month, days); + } else if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "day") { + that.getHourData(that.year, that.month, that.days); + } else if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } }, //获取小时数据 diff --git a/src/views/enm_limestone/report.vue b/src/views/enm_limestone/report.vue index 596bd1fe..6dd171f0 100644 --- a/src/views/enm_limestone/report.vue +++ b/src/views/enm_limestone/report.vue @@ -649,13 +649,22 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } }, //获取天数据 diff --git a/src/views/enm_mill/report.vue b/src/views/enm_mill/report.vue index 9d3c935f..5d21cacb 100644 --- a/src/views/enm_mill/report.vue +++ b/src/views/enm_mill/report.vue @@ -813,20 +813,30 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "day") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - let days = val.split("-")[2]; - this.getHourData(year, month, days); - } else if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "day") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + let days = val.split("-")[2]; + this.getHourData(year, month, days); + } else if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "day") { + that.getHourData(that.year, that.month, that.days); + } else if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } - this.searchDate; }, //获取小时数据 getHourData(year, month, days) { diff --git a/src/views/enm_pack/report.vue b/src/views/enm_pack/report.vue index d47879ac..b55f1af7 100644 --- a/src/views/enm_pack/report.vue +++ b/src/views/enm_pack/report.vue @@ -554,15 +554,23 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } - this.searchDate; }, //获取天数据 getDayData(year, month) { diff --git a/src/views/enm_rm/report.vue b/src/views/enm_rm/report.vue index 6cad020f..e946a1bf 100644 --- a/src/views/enm_rm/report.vue +++ b/src/views/enm_rm/report.vue @@ -1010,18 +1010,29 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "day") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - let days = val.split("-")[2]; - this.getHourData(year, month, days); - } else if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "day") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + let days = val.split("-")[2]; + this.getHourData(year, month, days); + } else if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "day") { + that.getHourData(that.year, that.month, that.days); + } else if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } }, //获取小时数据 diff --git a/src/views/enm_rmbase/report.vue b/src/views/enm_rmbase/report.vue index b8fc34c1..b1c23d11 100644 --- a/src/views/enm_rmbase/report.vue +++ b/src/views/enm_rmbase/report.vue @@ -798,18 +798,29 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "day") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - let days = val.split("-")[2]; - this.getHourData(year, month, days); - } else if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "day") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + let days = val.split("-")[2]; + this.getHourData(year, month, days); + } else if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "day") { + that.getHourData(that.year, that.month, that.days); + } else if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } }, //获取小时数据 diff --git a/src/views/enm_slag/report.vue b/src/views/enm_slag/report.vue index 49efafce..0be86eca 100644 --- a/src/views/enm_slag/report.vue +++ b/src/views/enm_slag/report.vue @@ -574,13 +574,21 @@ export default { dateChange(val) { let that = this; console.log(val); - if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - month = Number(month); - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + month = Number(month); + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } }, //获取天数据