From 73f7101e1dcff8fec1b1807af863aea5464ec4c7 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 30 Jan 2024 21:23:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=9C=8B=E6=9D=BF=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=A1=8C=E4=B8=BA=E5=AD=97=E5=85=B8=E6=95=B0=E6=8D=AE=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/UserActivity/index.vue | 88 ++++++++++++++----- .../overview/hooks/useUserActivity.ts | 4 +- 2 files changed, 67 insertions(+), 25 deletions(-) diff --git a/src/views/dashboard/overview/components/UserActivity/index.vue b/src/views/dashboard/overview/components/UserActivity/index.vue index 3836edf3..ed12601f 100644 --- a/src/views/dashboard/overview/components/UserActivity/index.vue +++ b/src/views/dashboard/overview/components/UserActivity/index.vue @@ -2,7 +2,50 @@ import { parseDuration, parseDateToStr } from '@/utils/date-utils'; import { eventData, eventId } from '../../hooks/useUserActivity'; import useI18n from '@/hooks/useI18n'; +import useDictStore from '@/store/modules/dict'; +import { onMounted, reactive } from 'vue'; const { t } = useI18n(); +const { getDict } = useDictStore(); + +/**字典数据 */ +let dict: { + /**CDR SIP响应代码类别类型 */ + cdrSipCode: DictType[]; + /**CDR 呼叫类型 */ + cdrCallType: DictType[]; + /**UE 事件认证代码类型 */ + ueAauthCode: DictType[]; + /**UE 事件认证代码类型 */ + ueEventType: DictType[]; +} = reactive({ + cdrSipCode: [], + cdrCallType: [], + ueAauthCode: [], + ueEventType: [], +}); + +onMounted(() => { + // 初始字典数据 + Promise.allSettled([ + getDict('cdr_sip_code'), + getDict('cdr_call_type'), + getDict('ue_auth_code'), + getDict('ue_event_type'), + ]).then(resArr => { + if (resArr[0].status === 'fulfilled') { + dict.cdrSipCode = resArr[0].value; + } + if (resArr[1].status === 'fulfilled') { + dict.cdrCallType = resArr[1].value; + } + if (resArr[2].status === 'fulfilled') { + dict.ueAauthCode = resArr[2].value; + } + if (resArr[3].status === 'fulfilled') { + dict.ueEventType = resArr[3].value; + } + }); +}); @@ -193,14 +238,12 @@ const { t } = useI18n();