From c22663505ce3c42f9eff33340dbc9c1ba51619fa Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Thu, 26 Dec 2024 18:39:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20SMF-CDR=E5=8E=BB=E9=99=A4RatingGroup?= =?UTF-8?q?=E5=8C=BA=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/neData/smf.ts | 1 + src/views/dashboard/smfCDR/index.vue | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/api/neData/smf.ts b/src/api/neData/smf.ts index a7d8c3c0..05050abc 100644 --- a/src/api/neData/smf.ts +++ b/src/api/neData/smf.ts @@ -10,6 +10,7 @@ export function listSMFDataCDR(query: Record) { url: '/neData/smf/cdr/list', method: 'get', params: query, + timeout: 60_000, }); } diff --git a/src/views/dashboard/smfCDR/index.vue b/src/views/dashboard/smfCDR/index.vue index 727f262f..b9e41b1c 100644 --- a/src/views/dashboard/smfCDR/index.vue +++ b/src/views/dashboard/smfCDR/index.vue @@ -88,7 +88,7 @@ let tableState: TabeStateType = reactive({ }); /**表格字段列 */ -let tableColumns: ColumnsType = [ +let tableColumns = ref([ { title: t('common.rowId'), dataIndex: 'id', @@ -225,7 +225,7 @@ let tableColumns: ColumnsType = [ key: 'id', align: 'left', }, -]; +]); /**表格分页器参数 */ let tablePagination = reactive({ @@ -780,14 +780,14 @@ onBeforeUnmount(() => {
-
RatingGroup: {{ u.ratingGroup }}
+
- +
Data Total Volume: @@ -801,10 +801,10 @@ onBeforeUnmount(() => { Data Volume Uplink: {{ udata.dataVolumeUplink }}
-
+
From 51a8d6d3a006e320c5fdc68181a24ac2321026c1 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Thu, 26 Dec 2024 18:40:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20SMF-CDR=E7=94=A8=E6=88=B7=E6=B5=81?= =?UTF-8?q?=E9=87=8F=E4=BD=BF=E7=94=A8=E6=83=85=E5=86=B5=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/parse-utils.ts | 27 +- src/views/dashboard/smfCDRByIMSI/index.vue | 664 +++++++++++++++++++++ 2 files changed, 688 insertions(+), 3 deletions(-) create mode 100644 src/views/dashboard/smfCDRByIMSI/index.vue diff --git a/src/utils/parse-utils.ts b/src/utils/parse-utils.ts index e091aa8e..49a89ddd 100644 --- a/src/utils/parse-utils.ts +++ b/src/utils/parse-utils.ts @@ -171,8 +171,8 @@ export function parseSizeFromKbs(sizeByte: number, timeInterval: number): any { } /** - * 字节数转换单位 - * @param bits 字节Bit大小 64009540 = 512.08 MB + * 位数据转换单位 + * @param bits 位Bit大小 64009540 = 512.08 MB * @returns xx B / KB / MB / GB / TB / PB / EB / ZB / YB */ export function parseSizeFromBits(bits: number | string): string { @@ -181,7 +181,28 @@ export function parseSizeFromBits(bits: number | string): string { bits = bits * 8; const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; const unitIndex = Math.floor(Math.log2(bits) / 10); - const value = (bits / Math.pow(1000, unitIndex)).toFixed(2); + const value = bits / Math.pow(1000, unitIndex); const unti = units[unitIndex]; + if (unitIndex > 0) { + return `${value.toFixed(2)} ${unti}`; + } + return `${value} ${unti}`; +} + +/** + * 字节数转换单位 + * @param byte 字节Byte大小 64009540 = 512.08 MB + * @returns xx B / KB / MB / GB / TB / PB / EB / ZB / YB + */ +export function parseSizeFromByte(byte: number | string): string { + byte = Number(byte) || 0; + if (byte <= 0) return '0 B'; + const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; + const unitIndex = Math.floor(Math.log2(byte) / 10); + const unti = units[unitIndex]; + const value = byte / Math.pow(1000, unitIndex); + if (unitIndex > 0) { + return `${value.toFixed(2)} ${unti}`; + } return `${value} ${unti}`; } diff --git a/src/views/dashboard/smfCDRByIMSI/index.vue b/src/views/dashboard/smfCDRByIMSI/index.vue new file mode 100644 index 00000000..976940e3 --- /dev/null +++ b/src/views/dashboard/smfCDRByIMSI/index.vue @@ -0,0 +1,664 @@ + + + + +