fix:日期查询的时候清空报错改正

This commit is contained in:
shijing 2024-07-30 14:46:52 +08:00
parent a0225cdc72
commit be2ba954ff
11 changed files with 210 additions and 98 deletions

View File

@ -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);
}
}
},
//

View File

@ -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);
}
}
},
//

View File

@ -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);
}
}
},
//

View File

@ -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);
}
}
},
//

View File

@ -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);
}
}
},
//

View File

@ -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);
}
}
},
//

View File

@ -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) {

View File

@ -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) {

View File

@ -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);
}
}
},
//

View File

@ -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);
}
}
},
//

View File

@ -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);
}
}
},
//