feat:告警数据参数调整

This commit is contained in:
zhongzm
2025-08-08 17:15:20 +08:00
parent 8a31265743
commit 2b4ce5f1c4
2 changed files with 21 additions and 16 deletions

View File

@@ -415,10 +415,10 @@ export default {
userTitle:'用户信息',
imsUeNum: "IMS 会话数",
smfUeNum: "Data 会话数",
gnbBase: "5G 基站数",
gnbBase: "5G 基站在线数",
gnbSumBase: "5G 基站总数",
gnbUeNum:'5G 用户数',
enbBase: "4G 基站数",
enbBase: "4G 基站在线数",
enbSumBase: "4G 基站总数",
enbUeNum:'4G 用户数',
baseTitle:'在线信息',

View File

@@ -78,9 +78,9 @@ const alarmTypeType = ref<any>([
/**告警类型Top数据 */
const alarmTypeTypeTop = ref<any>([
{ name: 'AMF', value: 0 },
{ name: 'UDM', value: 0 },
{ name: 'SMF', value: 0 },
{ neType: 'AMF', total: 0 },
{ neType: 'UDM', total: 0 },
{ neType: 'SMF', total: 0 },
]);
//
@@ -92,7 +92,8 @@ function initPicture() {
if (res0.code === RESULT_CODE_SUCCESS && Array.isArray(res0.data)) {
for (const item of res0.data) {
let index = 0;
switch (item.name) {
console.log(res0)
switch (item.severity) {
case 'Critical':
index = 0;
break;
@@ -109,20 +110,24 @@ function initPicture() {
// index = 4;
// break;
}
alarmTypeType.value[index].value = Number(item.value);
alarmTypeType.value[index].value = Number(item.total);
console.log(item)
console.log(alarmTypeType.value[0])
}
}
}
if (resArr[1].status === 'fulfilled') {
const res1 = resArr[1].value;
if (res1.code === RESULT_CODE_SUCCESS && Array.isArray(res1.data)) {
alarmTypeTypeTop.value = alarmTypeTypeTop.value
.concat(res1.data)
.sort((a: any, b: any) => {
return b.value - a.value;
})
console.log(res1.data)
alarmTypeTypeTop.value = res1.data
.sort((a: any, b: any) => b.value - a.value)
.slice(0, 3);
}
console.log(alarmTypeTypeTop.value)
}
})
.then(() => {
@@ -166,7 +171,7 @@ function initPicture() {
realValue = alarmTypeType.value[param.dataIndex]?.value || 0;
} else if (param.seriesIndex === 1) {
// 第二个系列Top3
realValue = alarmTypeTypeTop.value[param.dataIndex]?.value || 0;
realValue = alarmTypeTypeTop.value[param.dataIndex]?.total || 0;
}
return `${param.name}: ${realValue}`;
}
@@ -206,7 +211,7 @@ function initPicture() {
{
type: 'category',
gridIndex: 1,
data: alarmTypeTypeTop.value.map((item: any) => item.name),
data: alarmTypeTypeTop.value.map((item: any) => item.neType),
axisLabel: {
color: '#fff',
fontSize: 12,
@@ -304,11 +309,11 @@ function initPicture() {
fontSize: 14,
formatter: (params: any) => {
// 如果是最小值0.1显示为0
const realValue = alarmTypeTypeTop.value[params.dataIndex]?.value || 0;
const realValue = alarmTypeTypeTop.value[params.dataIndex]?.total || 0;
return `${realValue}`;
}
},
data: alarmTypeTypeTop.value.map((item: any) => Math.max(item.value || 0, 0.1)),
data: alarmTypeTypeTop.value.map((item: any) => Math.max(item.total || 0, 0.1)),
zlevel: 1
}
]