From d88c8a73dc62fbb83b9079b1bb2487d02bdddd7e Mon Sep 17 00:00:00 2001 From: zcxlsm Date: Sun, 7 Sep 2025 10:32:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(analytics):=20=E6=9B=B4=E6=96=B0=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E7=9B=98=E9=80=9A=E8=A1=8C=E9=87=8F=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/dashboard/analytics/index.vue | 37 ++++++++++++++++++- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/apps/web-antd/src/views/dashboard/analytics/index.vue b/apps/web-antd/src/views/dashboard/analytics/index.vue index f330e43d..a0c9d5ab 100644 --- a/apps/web-antd/src/views/dashboard/analytics/index.vue +++ b/apps/web-antd/src/views/dashboard/analytics/index.vue @@ -19,11 +19,12 @@ import { getStatisticsCurrDay, getStatistics, } from '#/api/analytics/index'; +import { getVisitorList } from '#/api/property/resident/passRecordManagement'; const overviewItems = ref([ { icon: SvgCardIcon, - title: '今日访客量', - totalTitle: '总访客量', + title: '今日通行量', + totalTitle: '总通行量', totalValue: 0, value: 0, }, @@ -73,6 +74,37 @@ const handleDateChange = (date: any) => { } }; +// 通行量 +async function getPersonCount() { + const date = new Date(); + const nowDate = date + .toLocaleDateString('zh-CN', { + year: 'numeric', + month: '2-digit', + day: '2-digit', + }) + .replace(/\//g, '-'); + + const historyData = { + pageNum: 1, + pageSize: 10, + begTime: '2025-09-01', + endTime: nowDate, + }; + + const todayData = { + pageNum: 1, + pageSize: 10, + begTime: nowDate, + endTime: nowDate, + }; + + const historyTotal = await getVisitorList(historyData); + const todayTotal = await getVisitorList(todayData); + overviewItems.value[0].totalValue = historyTotal.total; + overviewItems.value[0].value = todayTotal.total; +} + // 工单数量 async function getIndex() { const res = await getIndexCount(); @@ -146,6 +178,7 @@ async function getStatisticsCount() { onMounted(() => { getIndex(); getCarCount(); + getPersonCount(); getStatisticsCurrDayCount(); getStatisticsCount(); });