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();