From 2faa8b59036c1db8f6d5694f7a06e00b48eb4568 Mon Sep 17 00:00:00 2001 From: "382696293@qq.com" <382696293@qq.com> Date: Thu, 11 Jan 2024 17:53:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=EF=BC=9A=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E9=BB=98=E8=AE=A4=E5=BD=93=E5=A4=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flossom-ui/src/views/system/member/index.vue | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/flossom-ui/src/views/system/member/index.vue b/flossom-ui/src/views/system/member/index.vue index 659f1e9..d5084cf 100644 --- a/flossom-ui/src/views/system/member/index.vue +++ b/flossom-ui/src/views/system/member/index.vue @@ -1006,6 +1006,11 @@ export default { }; }, created() { + // 查询条件创建时间默认为当天 + let siteStartTime = this.dateUtil(new Date(new Date().toLocaleDateString())); + let siteEndTime = this.dateUtil(new Date(new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1)); + this.dateRange = [siteStartTime, siteEndTime]; + // 获取用户统计信息 this.getUserCount(); // 获取表单数据 @@ -1028,6 +1033,16 @@ export default { this.loading = false; }); }, + dateUtil(date){ + // 获取年份、月份和日期 + const year = date.getFullYear().toString(); // 四位数表示的年份 + const months = (date.getMonth() + 1).toString().padStart(2, '0'); // 补零后的两位数表示的月份 + const day = date.getDate().toString().padStart(2, '0'); // 补零后的两位数表示的日期 + const hours = date.getHours().toString().padStart(2, '0'); // 补全两位数的小时 + const minutes = date.getMinutes().toString().padStart(2, '0'); // 补全两位数的分钟 + const seconds = date.getSeconds().toString().padStart(2, '0'); + return `${year}-${months}-${day} ${hours}:${minutes}:${seconds}`; + }, getUserCount() { selectUserCount().then(Response => { this.count.userNum = Response.data[0];