fix: SMSC-CDR添加结果原因说明

This commit is contained in:
TsMask
2025-09-28 18:16:53 +08:00
parent 4bb5a99b37
commit 79830b752a

View File

@@ -34,10 +34,10 @@ const queue = new PQueue({ concurrency: 1, autoStart: true });
/**字典数据 */
let dict: {
/**CDR 响应原因代码类别类型 */
cdrCauseCode: DictType[];
/**CDR SMSC 响应原因代码类别类型 */
cdrSMSCCauseCode: DictType[];
} = reactive({
cdrCauseCode: [],
cdrSMSCCauseCode: [],
});
/**网元可选 */
@@ -177,12 +177,19 @@ let tableColumns: ColumnsType = [
},
{
title: t('views.dashboard.cdr.result'),
title: t('views.dashboard.cdr.resultCode'),
dataIndex: 'cdrJSON',
key: 'cause',
align: 'left',
width: 200,
},
{
title: t('views.dashboard.cdr.resultCause'),
dataIndex: 'cdrJSON',
key: 'result',
align: 'left',
width: 200,
},
{
title: t('views.dashboard.cdr.time'),
dataIndex: 'cdrJSON',
@@ -475,9 +482,9 @@ function wsMessage(res: Record<string, any>) {
onMounted(() => {
// 初始字典数据
Promise.allSettled([getDict('cdr_cause_code')]).then(resArr => {
Promise.allSettled([getDict('cdr_cause_smsc')]).then(resArr => {
if (resArr[0].status === 'fulfilled') {
dict.cdrCauseCode = resArr[0].value;
dict.cdrSMSCCauseCode = resArr[0].value;
}
});
// 获取网元网元列表
@@ -744,17 +751,15 @@ onBeforeUnmount(() => {
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'cause'">
<span v-if="record.cdrJSON.result === 0">
{{ t('views.dashboard.cdr.resultFail') }},
<DictTag
:options="dict.cdrCauseCode"
:value="record.cdrJSON.cause"
value-default="0"
/>
</span>
<span v-else>
{{ t('views.dashboard.cdr.resultOk') }}
</span>
<span v-if="record.cdrJSON.result === 0"> FAILED </span>
<span v-else> SUCCESS </span>
</template>
<template v-if="column.key === 'result'">
<DictTag
:options="dict.cdrSMSCCauseCode"
:value="record.cdrJSON.cause"
value-default="0"
/>
</template>
<template v-if="column.key === 'id'">
<a-space :size="8" align="center">
@@ -826,18 +831,19 @@ onBeforeUnmount(() => {
<span>{{ record.cdrJSON.calledParty }}</span>
</div>
<div>
<span>{{ t('views.dashboard.cdr.result') }}: </span>
<span v-if="record.cdrJSON.result === 0">
{{ t('views.dashboard.cdr.resultFail') }},
<span>Result Code: </span>
<span v-if="record.cdrJSON.result === 0"> FAILED </span>
<span v-else> SUCCESS </span>
</div>
<div>
<span>Result Cause: </span>
<span>
<DictTag
:options="dict.cdrCauseCode"
:options="dict.cdrSMSCCauseCode"
:value="record.cdrJSON.cause"
value-default="0"
/>
</span>
<span v-else>
{{ t('views.dashboard.cdr.resultOk') }}
</span>
</div>
</a-col>
<a-col