diff --git a/src/views/statistics/total_statistics.vue b/src/views/statistics/total_statistics.vue index 008272a5..4e458145 100644 --- a/src/views/statistics/total_statistics.vue +++ b/src/views/statistics/total_statistics.vue @@ -148,6 +148,7 @@ export default { query: { date: "", }, + currentDate: "", }; }, mounted() { @@ -160,7 +161,8 @@ export default { month = month < 10 ? "0" + month : month; day = day < 10 ? "0" + day : day; this.day = day; - this.query.date = `${year}-${month}-${day}`; + this.query.date = this.currentDate = `${year}-${month}-${day}`; + console.log(this.query.date); this.getSourceData(); this.bangHeight = @@ -435,6 +437,22 @@ export default { }); }); }, + handleQuery() { + let that = this; + if (that.query.date !== null && that.query.date !== "") { + if (that.query.date !== "") { + that.year = that.query.date.split("-")[0]; + that.month = that.query.date.split("-")[1]; + that.day = that.query.date.split("-")[2]; + } else { + that.year = new Date().getFullYear(); + that.month = new Date().getMonth() + 1; + that.day = new Date().getDate(); + that.query.date = that.currentDate; + } + that.getSourceData(); + } + }, }, };