feat: 添加KPI标题映射
This commit is contained in:
@@ -134,6 +134,19 @@ const TARGET_KPI_IDS: Record<NeType, string[]> = {
|
||||
// SMSC: ['SMSC.A.01', 'SMSC.A.02', 'SMSC.A.03'],
|
||||
};
|
||||
|
||||
const KPI_TITLE: Record<string, string> = {
|
||||
'AMF.02': '5G Registration Request',
|
||||
'AMF.03': '5G Registration Success',
|
||||
'UPF.04': 'UPF Downlink Throughput',
|
||||
'UPF.05': 'UPF Uplink Throughput',
|
||||
'SCSCF.03': 'VoNR Registration Success',
|
||||
'SCSCF.04': 'VoNR Registration Request',
|
||||
'SCSCF.05': 'MO Call Success',
|
||||
'SCSCF.06': 'MO Call Attempt',
|
||||
'SCSCF.07': 'MT Call Success',
|
||||
'SCSCF.08': 'MT Call Attempt',
|
||||
};
|
||||
|
||||
// 实时数据开关函数
|
||||
const fnRealTimeSwitch = (bool: boolean) => {
|
||||
if (bool) {
|
||||
@@ -658,13 +671,20 @@ const fetchSpecificKPI = async () => {
|
||||
const res = await getKPITitle(neType.toUpperCase());
|
||||
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
const formattedKPIs = res.data.map(item => ({
|
||||
title: item[`${language}Title`],
|
||||
dataIndex: item.kpiId,
|
||||
key: item.kpiId,
|
||||
kpiId: item.kpiId,
|
||||
neType: neType,
|
||||
}));
|
||||
const titleIDs = Object.values(TARGET_KPI_IDS).flat();
|
||||
const formattedKPIs = res.data.map(item => {
|
||||
let title = item[`${language}Title`];
|
||||
if (titleIDs.includes(item.kpiId)) {
|
||||
title = KPI_TITLE[item.kpiId] || title;
|
||||
}
|
||||
return {
|
||||
title: title,
|
||||
dataIndex: item.kpiId,
|
||||
key: item.kpiId,
|
||||
kpiId: item.kpiId,
|
||||
neType: neType,
|
||||
};
|
||||
});
|
||||
|
||||
allKPIs = [...allKPIs, ...formattedKPIs];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user