From 33088a9366145cb3f91b12f87dbc1e3f6f8a97dd Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Fri, 28 Feb 2025 19:44:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91=E5=B9=B6=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BD=BF=E7=94=A8=E6=83=85=E5=86=B5=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dashboard/sgwcCDR/index.vue | 4 +-- src/views/dashboard/smfCDRByIMSI/index.vue | 30 +++++++++++++++++++--- 2 files changed, 29 insertions(+), 5 deletions(-) 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] }} + +