feat:告警数据参数调整
This commit is contained in:
@@ -415,10 +415,10 @@ export default {
|
|||||||
userTitle:'用户信息',
|
userTitle:'用户信息',
|
||||||
imsUeNum: "IMS 会话数",
|
imsUeNum: "IMS 会话数",
|
||||||
smfUeNum: "Data 会话数",
|
smfUeNum: "Data 会话数",
|
||||||
gnbBase: "5G 基站数",
|
gnbBase: "5G 基站在线数",
|
||||||
gnbSumBase: "5G 基站总数",
|
gnbSumBase: "5G 基站总数",
|
||||||
gnbUeNum:'5G 用户数',
|
gnbUeNum:'5G 用户数',
|
||||||
enbBase: "4G 基站数",
|
enbBase: "4G 基站在线数",
|
||||||
enbSumBase: "4G 基站总数",
|
enbSumBase: "4G 基站总数",
|
||||||
enbUeNum:'4G 用户数',
|
enbUeNum:'4G 用户数',
|
||||||
baseTitle:'在线信息',
|
baseTitle:'在线信息',
|
||||||
|
|||||||
@@ -78,9 +78,9 @@ const alarmTypeType = ref<any>([
|
|||||||
|
|
||||||
/**告警类型Top数据 */
|
/**告警类型Top数据 */
|
||||||
const alarmTypeTypeTop = ref<any>([
|
const alarmTypeTypeTop = ref<any>([
|
||||||
{ name: 'AMF', value: 0 },
|
{ neType: 'AMF', total: 0 },
|
||||||
{ name: 'UDM', value: 0 },
|
{ neType: 'UDM', total: 0 },
|
||||||
{ name: 'SMF', value: 0 },
|
{ neType: 'SMF', total: 0 },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -92,7 +92,8 @@ function initPicture() {
|
|||||||
if (res0.code === RESULT_CODE_SUCCESS && Array.isArray(res0.data)) {
|
if (res0.code === RESULT_CODE_SUCCESS && Array.isArray(res0.data)) {
|
||||||
for (const item of res0.data) {
|
for (const item of res0.data) {
|
||||||
let index = 0;
|
let index = 0;
|
||||||
switch (item.name) {
|
console.log(res0)
|
||||||
|
switch (item.severity) {
|
||||||
case 'Critical':
|
case 'Critical':
|
||||||
index = 0;
|
index = 0;
|
||||||
break;
|
break;
|
||||||
@@ -109,20 +110,24 @@ function initPicture() {
|
|||||||
// index = 4;
|
// index = 4;
|
||||||
// break;
|
// 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') {
|
if (resArr[1].status === 'fulfilled') {
|
||||||
const res1 = resArr[1].value;
|
const res1 = resArr[1].value;
|
||||||
if (res1.code === RESULT_CODE_SUCCESS && Array.isArray(res1.data)) {
|
if (res1.code === RESULT_CODE_SUCCESS && Array.isArray(res1.data)) {
|
||||||
alarmTypeTypeTop.value = alarmTypeTypeTop.value
|
console.log(res1.data)
|
||||||
.concat(res1.data)
|
alarmTypeTypeTop.value = res1.data
|
||||||
.sort((a: any, b: any) => {
|
.sort((a: any, b: any) => b.value - a.value)
|
||||||
return b.value - a.value;
|
|
||||||
})
|
|
||||||
.slice(0, 3);
|
.slice(0, 3);
|
||||||
}
|
}
|
||||||
|
console.log(alarmTypeTypeTop.value)
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@@ -166,7 +171,7 @@ function initPicture() {
|
|||||||
realValue = alarmTypeType.value[param.dataIndex]?.value || 0;
|
realValue = alarmTypeType.value[param.dataIndex]?.value || 0;
|
||||||
} else if (param.seriesIndex === 1) {
|
} else if (param.seriesIndex === 1) {
|
||||||
// 第二个系列(Top3)
|
// 第二个系列(Top3)
|
||||||
realValue = alarmTypeTypeTop.value[param.dataIndex]?.value || 0;
|
realValue = alarmTypeTypeTop.value[param.dataIndex]?.total || 0;
|
||||||
}
|
}
|
||||||
return `${param.name}: ${realValue}`;
|
return `${param.name}: ${realValue}`;
|
||||||
}
|
}
|
||||||
@@ -206,7 +211,7 @@ function initPicture() {
|
|||||||
{
|
{
|
||||||
type: 'category',
|
type: 'category',
|
||||||
gridIndex: 1,
|
gridIndex: 1,
|
||||||
data: alarmTypeTypeTop.value.map((item: any) => item.name),
|
data: alarmTypeTypeTop.value.map((item: any) => item.neType),
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
color: '#fff',
|
color: '#fff',
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
@@ -304,11 +309,11 @@ function initPicture() {
|
|||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
formatter: (params: any) => {
|
formatter: (params: any) => {
|
||||||
// 如果是最小值0.1,显示为0
|
// 如果是最小值0.1,显示为0
|
||||||
const realValue = alarmTypeTypeTop.value[params.dataIndex]?.value || 0;
|
const realValue = alarmTypeTypeTop.value[params.dataIndex]?.total || 0;
|
||||||
return `${realValue}`;
|
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
|
zlevel: 1
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user