From c700ab7d476c25b404eb2f6b9623a7ebd050944f Mon Sep 17 00:00:00 2001 From: vaebe <18137693952@163.com> Date: Tue, 11 Jun 2024 21:46:05 +0800 Subject: [PATCH] =?UTF-8?q?feat(analytics):=201.=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E8=AE=BE=E5=A4=87=E7=BB=9F=E8=AE=A1=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=B1=95=E7=A4=BA=202.=20=E6=A0=B9=E6=8D=AE=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E6=9F=A5=E8=AF=A2=20=E5=A2=9E=E5=8A=A0=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E5=9F=8E=E5=B8=82=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/analytics.ts | 25 ++++++- .../analytics/components/VisitsDevice.vue | 66 +++++++++++++++++-- .../analytics/components/VisitsRegion.vue | 13 ++-- 3 files changed, 91 insertions(+), 13 deletions(-) diff --git a/src/api/analytics.ts b/src/api/analytics.ts index f4fa1cd..c7a2ce4 100644 --- a/src/api/analytics.ts +++ b/src/api/analytics.ts @@ -2,7 +2,7 @@ import Api from './base' import type { ResultData } from './base' export interface AnalyzeParams { - code: string + code?: string dateType: '24h' | '7d' | '30d' } @@ -16,13 +16,32 @@ export function analyzeShortLinkAccessByTime(params: AnalyzeParams): Promise> { +export function analyzeShortLinkAccessByRegion(params: AnalyzeRegionParams): Promise> { return Api.get('/analytics/clicksRegion', { params }) } + +export interface AnalyzeDeviceParams extends AnalyzeParams { + type: 'devices' | 'browsers' | 'os' +} + +export interface AnalyzeShortLinkAccessByDeviceInfo { + clicks: number + name: string +} + +// 根据设备分析短链访问数据 +export function analyzeShortLinkAccessByDevice(params: AnalyzeDeviceParams): Promise> { + return Api.get('/analytics/clicksDevices', { params }) +} diff --git a/src/views/analytics/components/VisitsDevice.vue b/src/views/analytics/components/VisitsDevice.vue index a90c931..3f9a53e 100644 --- a/src/views/analytics/components/VisitsDevice.vue +++ b/src/views/analytics/components/VisitsDevice.vue @@ -1,12 +1,70 @@ diff --git a/src/views/analytics/components/VisitsRegion.vue b/src/views/analytics/components/VisitsRegion.vue index 7510558..ae953e2 100644 --- a/src/views/analytics/components/VisitsRegion.vue +++ b/src/views/analytics/components/VisitsRegion.vue @@ -1,13 +1,16 @@