From b10aed3d147765af3f71d8a22df9f5d21ffffe13 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 25 Mar 2025 15:56:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20KPI=E6=80=BB=E8=A7=88=E6=97=A0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=97=B6=E5=B1=95=E7=A4=BAtitle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/perfManage/kpiCReport/index.vue | 64 ++++++++++++++-------- src/views/perfManage/kpiOverView/index.vue | 41 ++++++++++---- 2 files changed, 72 insertions(+), 33 deletions(-) diff --git a/src/views/perfManage/kpiCReport/index.vue b/src/views/perfManage/kpiCReport/index.vue index 060000eb..6db15cce 100644 --- a/src/views/perfManage/kpiCReport/index.vue +++ b/src/views/perfManage/kpiCReport/index.vue @@ -240,34 +240,33 @@ const statsColumns: TableColumnType[] = [ title: t('views.perfManage.kpiOverView.kpiName'), dataIndex: 'title', key: 'title', - width: '65%', - }, - { - title: t('views.perfManage.kpiOverView.totalValue'), - dataIndex: 'total', - key: 'total', - width: '12%', - sortDirections: ['ascend', 'descend'], - }, - { - title: t('views.perfManage.kpiOverView.avgValue'), - dataIndex: 'avg', - key: 'avg', - width: '24%', - sortDirections: ['ascend', 'descend'], }, + // { + // title: t('views.perfManage.kpiOverView.totalValue'), + // dataIndex: 'total', + // key: 'total', + // width: '12%', + // sortDirections: ['ascend', 'descend'], + // }, + // { + // title: t('views.perfManage.kpiOverView.avgValue'), + // dataIndex: 'avg', + // key: 'avg', + // width: '24%', + // sortDirections: ['ascend', 'descend'], + // }, { title: t('views.perfManage.kpiOverView.maxValue'), dataIndex: 'max', key: 'max', - width: '17%', + width: '200px', sortDirections: ['ascend', 'descend'], }, { title: t('views.perfManage.kpiOverView.minValue'), dataIndex: 'min', key: 'min', - width: '17%', + width: '200px', sortDirections: ['ascend', 'descend'], }, ]; @@ -424,8 +423,8 @@ function fnGetList() { duration: 2, }); tableState.data = []; - tableColumns.value = []; - tableColumnsDnd.value = []; + // tableColumns.value = []; + // tableColumnsDnd.value = []; kpiStats.value = []; //清空数据 fnRanderChartData(); return false; @@ -469,6 +468,26 @@ function fnGetList() { total: total, }); } + } else { + kpiStats.value = []; + for (const columns of tableColumns.value) { + if ( + columns.key === 'neName' || + columns.key === 'startIndex' || + columns.key === 'timeGroup' + ) { + continue; + } + kpiStats.value.push({ + kpiId: columns.key, + title: columns.title, + unit: columns.unit, + max: 0, + min: 0, + avg: 0, + total: 0, + }); + } } }); } @@ -757,7 +776,6 @@ const selectedUnit = ref(null); // 添加处理行点击的方法 function handleRowClick(record: any) { const index = selectedRow.value.indexOf(record.kpiId); - console.log(record); // 如果已经选中,取消选中 if (index > -1) { selectedRow.value.splice(index, 1); @@ -891,7 +909,7 @@ onMounted(() => { return; } // 无查询参数neType时 默认选择UPF - const queryNeType = (route.query.neType as string) || 'UPF'; + const queryNeType = (route.query.neType as string) || 'IMS'; const item = neCascaderOptions.value.find( s => s.value === queryNeType ); @@ -954,6 +972,7 @@ onBeforeUnmount(() => { v-model:value="state.neType" :options="neCascaderOptions" :allow-clear="false" + @change="fnGetListTitle()" :placeholder="t('common.selectPlease')" /> @@ -1041,7 +1060,6 @@ onBeforeUnmount(() => { @@ -1129,7 +1147,7 @@ onBeforeUnmount(() => {
{ // 定义要筛选的指标 ID,按网元类型组织 const TARGET_KPI_IDS: Record = { - AMF: ['AMF.02', 'AMF.03', 'AMF.A.07', 'AMF.A.08'], - SMF: ['SMF.02', 'SMF.03', 'SMF.04', 'SMF.05'], - UPF: ['UPF.03', 'UPF.04', 'UPF.05', 'UPF.06'], - MME: ['MME.A.01', 'MME.A.02', 'MME.A.03'], - IMS: ['SCSCF.01', 'SCSCF.02', 'SCSCF.05', 'SCSCF.06'], - SMSC: ['SMSC.A.01', 'SMSC.A.02', 'SMSC.A.03'], + AMF: ['AMF.02', 'AMF.03'], + UPF: ['UPF.04', 'UPF.05'], + IMS: ['SCSCF.03', 'SCSCF.04', 'SCSCF.06', 'SCSCF.08'], + + // AMF: ['AMF.02', 'AMF.03', 'AMF.A.07', 'AMF.A.08'], + // SMF: ['SMF.02', 'SMF.03', 'SMF.04', 'SMF.05'], + // UPF: ['UPF.03', 'UPF.04', 'UPF.05', 'UPF.06'], + // MME: ['MME.A.01', 'MME.A.02', 'MME.A.03'], + // IMS: ['SCSCF.01', 'SCSCF.02', 'SCSCF.05', 'SCSCF.06'], + // SMSC: ['SMSC.A.01', 'SMSC.A.02', 'SMSC.A.03'], }; // 实时数据开关函数 @@ -189,13 +193,15 @@ const wsMessage = (res: Record) => { return; } const { code, data } = res; - if (code === RESULT_CODE_ERROR || !data?.groupId) return; + if (code === RESULT_CODE_ERROR || !data?.groupId) { + tableLoading.value = false; + return; + } handleWebSocketMessage(data.data); }; // 添加数据处理函数 const processChartData = (rawData: any[]) => { const groupedData = new Map(); //数据按时间分组 - rawData.forEach(item => { //合并相同时间点的数据 const timeKey = item.timeGroup; @@ -752,7 +758,22 @@ const kpiStats = ref([]); // 添加一个计算函数来更新统计数据 const updateKpiStats = () => { if (!chartData.value.length || !kpiColumns.value.length) { - kpiStats.value = []; + kpiStats.value = selectedKPIs.value.map(kpiId => { + // 找到对应的KPI标题 + let title = kpiId; + const kpi = kpiColumns.value.find(col => col.kpiId === kpiId); + if (kpi) { + title = kpi.title; + } + return { + kpiId: kpiId, + title: title, + max: 0, + min: 0, + avg: 0, + total: 0, + }; + }); return; } kpiStats.value = selectedKPIs.value