diff --git a/src/views/dashboard/sgwcCDR/index.vue b/src/views/dashboard/sgwcCDR/index.vue index 4b05d4aa..fc8a2202 100644 --- a/src/views/dashboard/sgwcCDR/index.vue +++ b/src/views/dashboard/sgwcCDR/index.vue @@ -370,8 +370,8 @@ function fnGetList(pageNum?: number) { }); // 取最大值ID用作实时累加 - if (res.total > 0) { - modalState.maxId = Number(res.rows[0].id); + if (total > 0) { + modalState.maxId = Number(rows[0].id); } } tableState.loading = false; diff --git a/src/views/dashboard/smfCDRByIMSI/index.vue b/src/views/dashboard/smfCDRByIMSI/index.vue index 0e975023..f14acbc8 100644 --- a/src/views/dashboard/smfCDRByIMSI/index.vue +++ b/src/views/dashboard/smfCDRByIMSI/index.vue @@ -295,6 +295,8 @@ let state = reactive({ total: 0, /**表格加载状态 */ loading: false, + /**数据总量 up,down */ + dataUsage: ['0 B', '0 B'], }); /**查询列表, pageNum初始页数 */ @@ -330,10 +332,11 @@ function fnGetList(pageNum?: number) { listSMFDataCDR(toRaw(queryParams)) .then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - state.total = res.total; + if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data.rows)) { + const { total, rows } = res.data; + state.total = total; // 遍历处理cdr字符串数据 - state.data = res.rows + state.data = rows .map((item: any) => { let cdrJSON = item.cdrJSON; if (!cdrJSON) { @@ -455,6 +458,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), + ]; } /** @@ -669,6 +684,15 @@ onBeforeUnmount(() => {
+ + + + {{ state.dataUsage[0] }} + + + {{ state.dataUsage[1] }} + +