From 09991ac6c97bccbe30efa4b133fafe1f091304ad Mon Sep 17 00:00:00 2001 From: shijing Date: Tue, 30 Jul 2024 14:55:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=BB=9F=E8=AE=A1=E5=88=86=E6=9E=90-?= =?UTF-8?q?=E7=BB=BC=E5=90=88=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/statistics/total_statistics.vue | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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(); + } + }, }, };