From 7b311ff6738157ca899ac7cd9b644068dd8ee67e Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Mon, 9 Sep 2024 19:11:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20SMSC=E6=B7=BB=E5=8A=A0CDR=E5=93=8D?= =?UTF-8?q?=E5=BA=94=E9=94=99=E8=AF=AF=E5=8E=9F=E5=9B=A0=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dashboard/smscCDR/index.vue | 51 ++++++++++++++++++++------- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/src/views/dashboard/smscCDR/index.vue b/src/views/dashboard/smscCDR/index.vue index f253d6fe..736269d3 100644 --- a/src/views/dashboard/smscCDR/index.vue +++ b/src/views/dashboard/smscCDR/index.vue @@ -5,6 +5,7 @@ import { message, Modal } from 'ant-design-vue/lib'; import { SizeType } from 'ant-design-vue/lib/config-provider'; import { MenuInfo } from 'ant-design-vue/lib/menu/src/interface'; import { ColumnsType } from 'ant-design-vue/lib/table'; +import useDictStore from '@/store/modules/dict'; import useI18n from '@/hooks/useI18n'; import { RESULT_CODE_ERROR, @@ -16,14 +17,23 @@ import { exportSMSCDataCDR, listSMSCDataCDR, } from '@/api/neData/smsc'; -import { parseDateToStr, parseDuration } from '@/utils/date-utils'; +import { parseDateToStr } from '@/utils/date-utils'; import { OptionsType, WS } from '@/plugins/ws-websocket'; import saveAs from 'file-saver'; import PQueue from 'p-queue'; +const { getDict } = useDictStore(); const { t } = useI18n(); const ws = new WS(); const queue = new PQueue({ concurrency: 1, autoStart: true }); +/**字典数据 */ +let dict: { + /**CDR 响应原因代码类别类型 */ + cdrCauseCode: DictType[]; +} = reactive({ + cdrCauseCode: [], +}); + /**网元可选 */ let neOtions = ref[]>([]); @@ -158,12 +168,6 @@ let tableColumns: ColumnsType = [ key: 'cause', align: 'left', width: 120, - customRender(opt) { - const cdrJSON = opt.value; - return +cdrJSON.result - ? t('views.dashboard.cdr.resultOk') - : t('views.dashboard.cdr.resultFail'); - }, }, { title: t('views.dashboard.cdr.time'), @@ -426,6 +430,12 @@ function wsMessage(res: Record) { } onMounted(() => { + // 初始字典数据 + Promise.allSettled([getDict('cdr_cause_code')]).then(resArr => { + if (resArr[0].status === 'fulfilled') { + dict.cdrCauseCode = resArr[0].value; + } + }); // 获取网元网元列表 useNeInfoStore() .fnNelist() @@ -661,6 +671,18 @@ onBeforeUnmount(() => { }" >