From e29475e38f57a0394ed83d9c66376f9b5523780d Mon Sep 17 00:00:00 2001 From: zzc <1761997216@qq.com> Date: Fri, 20 Feb 2026 16:02:54 +0800 Subject: [PATCH] feat:maidian --- src/views/index/components/TrackingCharts.vue | 27 +++++++++++++++++-- src/views/index/utils/index.js | 8 ++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/views/index/components/TrackingCharts.vue b/src/views/index/components/TrackingCharts.vue index c94bb06..2fb6276 100644 --- a/src/views/index/components/TrackingCharts.vue +++ b/src/views/index/components/TrackingCharts.vue @@ -10,6 +10,16 @@ + + + + {{ item.label }} + + {{ item.value }} + + + + @@ -134,7 +144,7 @@ import VChart from 'vue-echarts' import dayjs from 'dayjs' import { groupBy, countBy } from 'lodash' - import { eventNameMap, eventTypeMap, appMap } from '../utils' + import { eventNameMap, eventTypeMap, appMap, userMap } from '../utils' use([CanvasRenderer, LineChart, PieChart, BarChart, GridComponent, TooltipComponent, LegendComponent, TitleComponent]) @@ -148,13 +158,16 @@ eventNameMap, eventTypeMap, appMap, + userMap, loading: false, queryForm: { appId: '69665538a49b8ae3be50fe5d', + userId: '', eventName: '', eventType: '', dateRange: [], }, + userOptions: [], pickerOptions: { shortcuts: [ { @@ -231,6 +244,7 @@ try { const params = { appId: this.queryForm.appId, + userId: this.queryForm.userId || undefined, eventName: this.queryForm.eventName || undefined, eventType: this.queryForm.eventType || undefined, startTime: this.queryForm.dateRange ? this.queryForm.dateRange[0] : undefined, @@ -241,6 +255,14 @@ const { data } = await getTrackingLogsList(params) this.list = data.list || [] + + // 如果没有筛选用户,则更新用户选项列表 + if (!this.queryForm.userId) { + const userIds = this.list.map((item) => item.userId).filter(Boolean) + const uniqueUsers = [...new Set(userIds)] + this.userOptions = uniqueUsers.map((id) => ({ value: id, label: this.userMap[id] || id })) + } + this.filteredList = [...this.list] this.isFiltered = false this.filterText = '' @@ -257,7 +279,8 @@ this.fetchData() }, resetQuery() { - this.queryForm.appId = 'wx2d5351b816654a93' + this.queryForm.appId = '69665538a49b8ae3be50fe5d' + this.queryForm.userId = '' this.queryForm.eventName = '' this.queryForm.eventType = '' const end = new Date() diff --git a/src/views/index/utils/index.js b/src/views/index/utils/index.js index 890a28a..eaa1010 100644 --- a/src/views/index/utils/index.js +++ b/src/views/index/utils/index.js @@ -28,3 +28,11 @@ export const eventTypeMap = { export const appMap = { '69665538a49b8ae3be50fe5d': '新春祝福', } + +export const userMap = { + '697efa4082f6cf96027632b8': '姐夫', + '69886ce32e3c1bb264902e29': '爸爸', + '6985a7c7f76d8026019f4e28': '妈妈', + '697a34996c4283e7b5904dbd': '哎萌', + '6973765449d17414b66970a2': '我', +}