fix:日期查询的时候清空报错改正
This commit is contained in:
parent
a0225cdc72
commit
be2ba954ff
|
@ -638,18 +638,29 @@ export default {
|
||||||
this.searchDate = "";
|
this.searchDate = "";
|
||||||
},
|
},
|
||||||
dateChange(val) {
|
dateChange(val) {
|
||||||
|
let that = this;
|
||||||
console.log(val);
|
console.log(val);
|
||||||
if (this.typeRadio == "day") {
|
if (val !== null) {
|
||||||
let year = val.split("-")[0];
|
if (this.typeRadio == "day") {
|
||||||
let month = val.split("-")[1];
|
let year = val.split("-")[0];
|
||||||
let days = val.split("-")[2];
|
let month = val.split("-")[1];
|
||||||
this.getHourData(year, month, days);
|
let days = val.split("-")[2];
|
||||||
} else if (this.typeRadio == "month") {
|
this.getHourData(year, month, days);
|
||||||
let year = val.split("-")[0];
|
} else if (this.typeRadio == "month") {
|
||||||
let month = val.split("-")[1];
|
let year = val.split("-")[0];
|
||||||
this.getDayData(year, month);
|
let month = val.split("-")[1];
|
||||||
|
this.getDayData(year, month);
|
||||||
|
} else {
|
||||||
|
this.getMonthData(val);
|
||||||
|
}
|
||||||
} else {
|
} 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//获取小时数据
|
//获取小时数据
|
||||||
|
|
|
@ -661,18 +661,29 @@ export default {
|
||||||
this.searchDate = "";
|
this.searchDate = "";
|
||||||
},
|
},
|
||||||
dateChange(val) {
|
dateChange(val) {
|
||||||
|
let that = this;
|
||||||
console.log(val);
|
console.log(val);
|
||||||
if (this.typeRadio == "day") {
|
if (val !== null) {
|
||||||
let year = val.split("-")[0];
|
if (this.typeRadio == "day") {
|
||||||
let month = val.split("-")[1];
|
let year = val.split("-")[0];
|
||||||
let days = val.split("-")[2];
|
let month = val.split("-")[1];
|
||||||
this.getHourData(year, month, days);
|
let days = val.split("-")[2];
|
||||||
} else if (this.typeRadio == "month") {
|
this.getHourData(year, month, days);
|
||||||
let year = val.split("-")[0];
|
} else if (this.typeRadio == "month") {
|
||||||
let month = val.split("-")[1];
|
let year = val.split("-")[0];
|
||||||
this.getDayData(year, month);
|
let month = val.split("-")[1];
|
||||||
|
this.getDayData(year, month);
|
||||||
|
} else {
|
||||||
|
this.getMonthData(val);
|
||||||
|
}
|
||||||
} else {
|
} 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//获取小时数据
|
//获取小时数据
|
||||||
|
|
|
@ -816,18 +816,29 @@ export default {
|
||||||
this.searchDate = "";
|
this.searchDate = "";
|
||||||
},
|
},
|
||||||
dateChange(val) {
|
dateChange(val) {
|
||||||
|
let that = this;
|
||||||
console.log(val);
|
console.log(val);
|
||||||
if (this.typeRadio == "day") {
|
if (val !== null) {
|
||||||
let year = val.split("-")[0];
|
if (this.typeRadio == "day") {
|
||||||
let month = val.split("-")[1];
|
let year = val.split("-")[0];
|
||||||
let days = val.split("-")[2];
|
let month = val.split("-")[1];
|
||||||
this.getHourData(year, month, days);
|
let days = val.split("-")[2];
|
||||||
} else if (this.typeRadio == "month") {
|
this.getHourData(year, month, days);
|
||||||
let year = val.split("-")[0];
|
} else if (this.typeRadio == "month") {
|
||||||
let month = val.split("-")[1];
|
let year = val.split("-")[0];
|
||||||
this.getDayData(year, month);
|
let month = val.split("-")[1];
|
||||||
|
this.getDayData(year, month);
|
||||||
|
} else {
|
||||||
|
this.getMonthData(val);
|
||||||
|
}
|
||||||
} else {
|
} 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//获取小时数据
|
//获取小时数据
|
||||||
|
|
|
@ -902,18 +902,29 @@ export default {
|
||||||
this.searchDate = "";
|
this.searchDate = "";
|
||||||
},
|
},
|
||||||
dateChange(val) {
|
dateChange(val) {
|
||||||
|
let that = this;
|
||||||
console.log(val);
|
console.log(val);
|
||||||
if (this.typeRadio == "day") {
|
if (val !== null) {
|
||||||
let year = val.split("-")[0];
|
if (this.typeRadio == "day") {
|
||||||
let month = val.split("-")[1];
|
let year = val.split("-")[0];
|
||||||
let days = val.split("-")[2];
|
let month = val.split("-")[1];
|
||||||
this.getHourData(year, month, days);
|
let days = val.split("-")[2];
|
||||||
} else if (this.typeRadio == "month") {
|
this.getHourData(year, month, days);
|
||||||
let year = val.split("-")[0];
|
} else if (this.typeRadio == "month") {
|
||||||
let month = val.split("-")[1];
|
let year = val.split("-")[0];
|
||||||
this.getDayData(year, month);
|
let month = val.split("-")[1];
|
||||||
|
this.getDayData(year, month);
|
||||||
|
} else {
|
||||||
|
this.getMonthData(val);
|
||||||
|
}
|
||||||
} else {
|
} 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//获取小时数据
|
//获取小时数据
|
||||||
|
|
|
@ -873,18 +873,29 @@ export default {
|
||||||
this.searchDate = "";
|
this.searchDate = "";
|
||||||
},
|
},
|
||||||
dateChange(val) {
|
dateChange(val) {
|
||||||
|
let that = this;
|
||||||
console.log(val);
|
console.log(val);
|
||||||
if (this.typeRadio == "day") {
|
if (val !== null) {
|
||||||
let year = val.split("-")[0];
|
if (this.typeRadio == "day") {
|
||||||
let month = val.split("-")[1];
|
let year = val.split("-")[0];
|
||||||
let days = val.split("-")[2];
|
let month = val.split("-")[1];
|
||||||
this.getHourData(year, month, days);
|
let days = val.split("-")[2];
|
||||||
} else if (this.typeRadio == "month") {
|
this.getHourData(year, month, days);
|
||||||
let year = val.split("-")[0];
|
} else if (this.typeRadio == "month") {
|
||||||
let month = val.split("-")[1];
|
let year = val.split("-")[0];
|
||||||
this.getDayData(year, month);
|
let month = val.split("-")[1];
|
||||||
|
this.getDayData(year, month);
|
||||||
|
} else {
|
||||||
|
this.getMonthData(val);
|
||||||
|
}
|
||||||
} else {
|
} 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//获取小时数据
|
//获取小时数据
|
||||||
|
|
|
@ -649,13 +649,22 @@ export default {
|
||||||
this.searchDate = "";
|
this.searchDate = "";
|
||||||
},
|
},
|
||||||
dateChange(val) {
|
dateChange(val) {
|
||||||
|
let that = this;
|
||||||
console.log(val);
|
console.log(val);
|
||||||
if (this.typeRadio == "month") {
|
if (val !== null) {
|
||||||
let year = val.split("-")[0];
|
if (this.typeRadio == "month") {
|
||||||
let month = val.split("-")[1];
|
let year = val.split("-")[0];
|
||||||
this.getDayData(year, month);
|
let month = val.split("-")[1];
|
||||||
|
this.getDayData(year, month);
|
||||||
|
} else {
|
||||||
|
this.getMonthData(val);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.getMonthData(val);
|
if (this.typeRadio == "month") {
|
||||||
|
this.getDayData(that.year, that.month);
|
||||||
|
} else {
|
||||||
|
this.getMonthData(that.year);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//获取天数据
|
//获取天数据
|
||||||
|
|
|
@ -813,20 +813,30 @@ export default {
|
||||||
this.searchDate = "";
|
this.searchDate = "";
|
||||||
},
|
},
|
||||||
dateChange(val) {
|
dateChange(val) {
|
||||||
|
let that = this;
|
||||||
console.log(val);
|
console.log(val);
|
||||||
if (this.typeRadio == "day") {
|
if (val !== null) {
|
||||||
let year = val.split("-")[0];
|
if (this.typeRadio == "day") {
|
||||||
let month = val.split("-")[1];
|
let year = val.split("-")[0];
|
||||||
let days = val.split("-")[2];
|
let month = val.split("-")[1];
|
||||||
this.getHourData(year, month, days);
|
let days = val.split("-")[2];
|
||||||
} else if (this.typeRadio == "month") {
|
this.getHourData(year, month, days);
|
||||||
let year = val.split("-")[0];
|
} else if (this.typeRadio == "month") {
|
||||||
let month = val.split("-")[1];
|
let year = val.split("-")[0];
|
||||||
this.getDayData(year, month);
|
let month = val.split("-")[1];
|
||||||
|
this.getDayData(year, month);
|
||||||
|
} else {
|
||||||
|
this.getMonthData(val);
|
||||||
|
}
|
||||||
} else {
|
} 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) {
|
getHourData(year, month, days) {
|
||||||
|
|
|
@ -554,15 +554,23 @@ export default {
|
||||||
this.searchDate = "";
|
this.searchDate = "";
|
||||||
},
|
},
|
||||||
dateChange(val) {
|
dateChange(val) {
|
||||||
|
let that = this;
|
||||||
console.log(val);
|
console.log(val);
|
||||||
if (this.typeRadio == "month") {
|
if (val !== null) {
|
||||||
let year = val.split("-")[0];
|
if (this.typeRadio == "month") {
|
||||||
let month = val.split("-")[1];
|
let year = val.split("-")[0];
|
||||||
this.getDayData(year, month);
|
let month = val.split("-")[1];
|
||||||
|
this.getDayData(year, month);
|
||||||
|
} else {
|
||||||
|
this.getMonthData(val);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.getMonthData(val);
|
if (this.typeRadio == "month") {
|
||||||
|
this.getDayData(that.year, that.month);
|
||||||
|
} else {
|
||||||
|
this.getMonthData(that.year);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.searchDate;
|
|
||||||
},
|
},
|
||||||
//获取天数据
|
//获取天数据
|
||||||
getDayData(year, month) {
|
getDayData(year, month) {
|
||||||
|
|
|
@ -1010,18 +1010,29 @@ export default {
|
||||||
this.searchDate = "";
|
this.searchDate = "";
|
||||||
},
|
},
|
||||||
dateChange(val) {
|
dateChange(val) {
|
||||||
|
let that = this;
|
||||||
console.log(val);
|
console.log(val);
|
||||||
if (this.typeRadio == "day") {
|
if (val !== null) {
|
||||||
let year = val.split("-")[0];
|
if (this.typeRadio == "day") {
|
||||||
let month = val.split("-")[1];
|
let year = val.split("-")[0];
|
||||||
let days = val.split("-")[2];
|
let month = val.split("-")[1];
|
||||||
this.getHourData(year, month, days);
|
let days = val.split("-")[2];
|
||||||
} else if (this.typeRadio == "month") {
|
this.getHourData(year, month, days);
|
||||||
let year = val.split("-")[0];
|
} else if (this.typeRadio == "month") {
|
||||||
let month = val.split("-")[1];
|
let year = val.split("-")[0];
|
||||||
this.getDayData(year, month);
|
let month = val.split("-")[1];
|
||||||
|
this.getDayData(year, month);
|
||||||
|
} else {
|
||||||
|
this.getMonthData(val);
|
||||||
|
}
|
||||||
} else {
|
} 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//获取小时数据
|
//获取小时数据
|
||||||
|
|
|
@ -798,18 +798,29 @@ export default {
|
||||||
this.searchDate = "";
|
this.searchDate = "";
|
||||||
},
|
},
|
||||||
dateChange(val) {
|
dateChange(val) {
|
||||||
|
let that = this;
|
||||||
console.log(val);
|
console.log(val);
|
||||||
if (this.typeRadio == "day") {
|
if (val !== null) {
|
||||||
let year = val.split("-")[0];
|
if (this.typeRadio == "day") {
|
||||||
let month = val.split("-")[1];
|
let year = val.split("-")[0];
|
||||||
let days = val.split("-")[2];
|
let month = val.split("-")[1];
|
||||||
this.getHourData(year, month, days);
|
let days = val.split("-")[2];
|
||||||
} else if (this.typeRadio == "month") {
|
this.getHourData(year, month, days);
|
||||||
let year = val.split("-")[0];
|
} else if (this.typeRadio == "month") {
|
||||||
let month = val.split("-")[1];
|
let year = val.split("-")[0];
|
||||||
this.getDayData(year, month);
|
let month = val.split("-")[1];
|
||||||
|
this.getDayData(year, month);
|
||||||
|
} else {
|
||||||
|
this.getMonthData(val);
|
||||||
|
}
|
||||||
} else {
|
} 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//获取小时数据
|
//获取小时数据
|
||||||
|
|
|
@ -574,13 +574,21 @@ export default {
|
||||||
dateChange(val) {
|
dateChange(val) {
|
||||||
let that = this;
|
let that = this;
|
||||||
console.log(val);
|
console.log(val);
|
||||||
if (this.typeRadio == "month") {
|
if (val !== null) {
|
||||||
let year = val.split("-")[0];
|
if (this.typeRadio == "month") {
|
||||||
let month = val.split("-")[1];
|
let year = val.split("-")[0];
|
||||||
month = Number(month);
|
let month = val.split("-")[1];
|
||||||
this.getDayData(year, month);
|
month = Number(month);
|
||||||
|
this.getDayData(year, month);
|
||||||
|
} else {
|
||||||
|
this.getMonthData(val);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.getMonthData(val);
|
if (this.typeRadio == "month") {
|
||||||
|
this.getDayData(that.year, that.month);
|
||||||
|
} else {
|
||||||
|
this.getMonthData(that.year);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//获取天数据
|
//获取天数据
|
||||||
|
|
Loading…
Reference in New Issue