From f40ef04e36306e3a3621d91ce6d1ba3371edfd48 Mon Sep 17 00:00:00 2001 From: shijing Date: Tue, 30 Jul 2024 15:00:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=8D=95=E4=BD=8D=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E7=94=B5=E8=80=97=E6=97=A5=E6=9C=9F=E6=9F=A5=E8=AF=A2=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=E6=97=B6=E9=94=99=E8=AF=AF=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/power.vue | 25 +++++++++++++------------ src/views/enm_coalbase/power.vue | 25 +++++++++++++------------ src/views/enm_kiln/power.vue | 25 +++++++++++++------------ src/views/enm_kilnbase/power.vue | 25 +++++++++++++------------ src/views/enm_mill/power.vue | 25 +++++++++++++------------ src/views/enm_rm/power.vue | 25 +++++++++++++------------ src/views/enm_rmbase/power.vue | 24 +++++++++++++----------- src/views/enm_slag/power.vue | 17 +++++++++-------- 8 files changed, 100 insertions(+), 91 deletions(-) diff --git a/src/views/enm_coal/power.vue b/src/views/enm_coal/power.vue index 2dbd55ce..7cf412a7 100644 --- a/src/views/enm_coal/power.vue +++ b/src/views/enm_coal/power.vue @@ -388,19 +388,20 @@ export default { }, dateChange(val) { 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); - } else { - this.getMonthData(val); + 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); + } } - this.searchDate; }, getTableHourData() { let that = this; diff --git a/src/views/enm_coalbase/power.vue b/src/views/enm_coalbase/power.vue index b06655a8..e3459391 100644 --- a/src/views/enm_coalbase/power.vue +++ b/src/views/enm_coalbase/power.vue @@ -336,19 +336,20 @@ export default { }, dateChange(val) { 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); - } else { - this.getMonthData(val); + 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); + } } - this.searchDate; }, getTableHourData() { let that = this; diff --git a/src/views/enm_kiln/power.vue b/src/views/enm_kiln/power.vue index 4f0e48e2..d0345584 100644 --- a/src/views/enm_kiln/power.vue +++ b/src/views/enm_kiln/power.vue @@ -503,19 +503,20 @@ export default { }, dateChange(val) { 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); - } else { - this.getMonthData(val); + 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); + } } - this.searchDate; }, getTableHourData() { let that = this; diff --git a/src/views/enm_kilnbase/power.vue b/src/views/enm_kilnbase/power.vue index 0b1b1833..f41ac3c4 100644 --- a/src/views/enm_kilnbase/power.vue +++ b/src/views/enm_kilnbase/power.vue @@ -340,19 +340,20 @@ export default { }, dateChange(val) { 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); - } else { - this.getMonthData(val); + 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); + } } - this.searchDate; }, getTableHourData() { let that = this; diff --git a/src/views/enm_mill/power.vue b/src/views/enm_mill/power.vue index 732f4eca..3e7ac7e0 100644 --- a/src/views/enm_mill/power.vue +++ b/src/views/enm_mill/power.vue @@ -460,19 +460,20 @@ export default { }, dateChange(val) { 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); - } else { - this.getMonthData(val); + 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); + } } - this.searchDate; }, getTableHourData() { let that = this; diff --git a/src/views/enm_rm/power.vue b/src/views/enm_rm/power.vue index 858c6b61..59535506 100644 --- a/src/views/enm_rm/power.vue +++ b/src/views/enm_rm/power.vue @@ -437,19 +437,20 @@ export default { }, dateChange(val) { 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); - } else { - this.getMonthData(val); + 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); + } } - this.searchDate; }, getTableHourData() { let that = this; diff --git a/src/views/enm_rmbase/power.vue b/src/views/enm_rmbase/power.vue index 7a2440f7..90bf3def 100644 --- a/src/views/enm_rmbase/power.vue +++ b/src/views/enm_rmbase/power.vue @@ -331,17 +331,19 @@ export default { }, dateChange(val) { 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); - } else { - this.getMonthData(val); + 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); + } } }, getTableHourData() { diff --git a/src/views/enm_slag/power.vue b/src/views/enm_slag/power.vue index e436c084..89be1dd6 100644 --- a/src/views/enm_slag/power.vue +++ b/src/views/enm_slag/power.vue @@ -322,15 +322,16 @@ export default { }, dateChange(val) { console.log(val); - 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); + 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); + } } - this.searchDate; }, getTableHourData() { let that = this;