diff --git a/src/views/dashboard/smfCDRByIMSI/index.vue b/src/views/dashboard/smfCDRByIMSI/index.vue index dea8bf0b..7c99e830 100644 --- a/src/views/dashboard/smfCDRByIMSI/index.vue +++ b/src/views/dashboard/smfCDRByIMSI/index.vue @@ -229,7 +229,7 @@ function fnRanderChart() { // 创建 ResizeObserver 实例 监听图表容器大小变化,并在变化时调整图表大小 var observer = new ResizeObserver(entries => { - if (cdrChart) { + if (cdrChart && !cdrChart.isDisposed) { cdrChart.resize(); } }); @@ -295,6 +295,8 @@ let state = reactive({ total: 0, /**表格加载状态 */ loading: false, + /**数据总量 up,down */ + dataUsage: ['0 B', '0 B'], }); /**查询列表, pageNum初始页数 */ @@ -455,6 +457,18 @@ function fnRanderChartDataUpdate() { ], }); cdrChart.hideLoading(); + + // 累加总量 + let uplinkTotal = 0; + let downlinkTotal = 0; + for (let index = 0; index < dataVolumeUplinkYSeriesData.length; index++) { + uplinkTotal += dataVolumeUplinkYSeriesData[index]; + downlinkTotal += dataVolumeDownlinkYSeriesData[index]; + } + state.dataUsage = [ + parseSizeFromByte(uplinkTotal), + parseSizeFromByte(downlinkTotal), + ]; } /** @@ -549,9 +563,9 @@ onMounted(() => { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.data.length > 0) { let arr: Record[] = []; - res.data.forEach(i => { - if (i.neType === 'SMF') { - arr.push({ value: i.neId, label: i.neName }); + res.data.forEach((v: any) => { + if (v.neType === 'SMF') { + arr.push({ value: v.neId, label: v.neName }); } }); neOtions.value = arr; @@ -669,6 +683,15 @@ onBeforeUnmount(() => {
+ + + + {{ state.dataUsage[0] }} + + + {{ state.dataUsage[1] }} + +