外显SN,取消点击表头

This commit is contained in:
lai
2023-12-22 15:40:34 +08:00
parent 61df24059c
commit 04754a022f

View File

@@ -108,8 +108,8 @@ let nfInfo: any = reactive({
obj: 'OMC',
version: appStore.version,
status: t('views.index.normal'),
number: '',
outTimeDate: '',
serialNum: '-',
});
/**表格状态类型 */
@@ -163,7 +163,7 @@ function fnGetList(one: boolean) {
tableState.loading = false;
var rightNum = 0;
var errorNum = 0;
if (res.length) nfInfo.serialNum = res[0].serialNum;
for (let i = 0; i < res.length; i++) {
if (res[i].status == '正常' || res[i].status == 'Normal') {
rightNum++;
@@ -230,131 +230,6 @@ function fnGetList(one: boolean) {
});
}
/**點擊網元名 */
function init(e: any) {
let realData = toRaw(e);
var chartDom: any = document.getElementById('echarts-records');
var existingChart = echarts.getInstanceByDom(chartDom);
var myChart: any;
if (existingChart) {
myChart = existingChart;
myChart.clear(); // 清空图表,重新设置数据
} else {
myChart = echarts.init(chartDom);
}
let cpuUsage = realData.cpuUsage;
let memUsage = realData.memUsage;
var nfMenUsage =
Math.round((memUsage?.nfUsedMem / memUsage?.totalMem) * 10000) / 100.0;
let partitionInfo = realData.diskSpace?.partitionInfo[1];
var nfMaxDiskSpace =
Math.round((partitionInfo?.used / partitionInfo?.total) * 10000) / 100.0;
let option = {
tooltip: {
formatter: '{a} <br/>{b} : {c}%',
},
series: [
{
name: 'Nf Memory usage',
center: ['17%', '50%'],
radius: '80%',
type: 'gauge',
progress: {
show: true,
},
pointer: {
//仪表盘的指针
//这个show属性好像有问题因为在这次开发中需要去掉指正我设置false的时候还是显示指针估计是BUG吧我用的echarts-3.2.3希望改进。最终我把width属性设置为0成功搞定
show: true,
//指针长度
length: '60%',
},
title: {
offsetCenter: [0, '90%'],
},
detail: {
valueAnimation: true,
formatter: '{value}',
textStyle: {
fontSize: 18,
},
offsetCenter: [0, '60%'],
},
data: [
{
value: nfMenUsage,
name: 'MEM',
},
],
},
{
center: ['50%', '50%'],
name: 'Nf CPU usage',
radius: '80%',
type: 'gauge',
progress: {
show: true,
},
title: {
offsetCenter: [0, '90%'],
},
detail: {
valueAnimation: true,
formatter: '{value}',
textStyle: {
fontSize: 18,
},
offsetCenter: [0, '60%'],
},
data: [
{
value: cpuUsage?.nfCpuUsage / 100,
name: 'CPU',
},
],
},
{
center: ['83%', '50%'],
name: 'NF maximum disk usage',
radius: '80%',
type: 'gauge',
progress: {
show: true,
},
title: {
offsetCenter: [0, '90%'],
},
detail: {
valueAnimation: true,
formatter: '{value}',
textStyle: {
fontSize: 18,
},
offsetCenter: [0, '60%'],
},
data: [
{
value: nfMaxDiskSpace,
name: 'DiskSpace',
},
],
},
],
};
option && myChart.setOption(option);
window.onresize = function () {
// echarts 窗口缩放自适应 随着div--echarts-records的大小来适应
myChart.resize();
};
nfInfo.obj = realData.name;
nfInfo.number = realData.serialNum;
nfInfo.outTimeDate = realData.expiryDate;
}
/**抽屉 网元详细信息 */
const visible = ref(false);
const closeDrawer = () => {
@@ -499,9 +374,7 @@ onBeforeUnmount(() => {
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'">
<div v-if="record.status == '正常' || record.status == 'Normal'">
<a-tag color="blue" @click="init(record)">{{
record.name
}}</a-tag>
<a-tag color="blue">{{ record.name }}</a-tag>
</div>
<div v-else>
<a-tag color="pink">{{ record.name }}</a-tag>
@@ -533,10 +406,13 @@ onBeforeUnmount(() => {
<a-descriptions-item :label="t('views.index.systemStatus')">{{
nfInfo.status
}}</a-descriptions-item>
<a-descriptions-item :label="t('views.index.serialNum')">{{
nfInfo.serialNum
}}</a-descriptions-item>
</template>
<template v-else>
<a-descriptions-item :label="t('views.index.serialNum')">{{
nfInfo.number
nfInfo.serialNum
}}</a-descriptions-item>
<a-descriptions-item :label="t('views.index.expiryDate')">{{
nfInfo.outTimeDate