外显SN,取消点击表头
This commit is contained in:
@@ -108,8 +108,8 @@ let nfInfo: any = reactive({
|
|||||||
obj: 'OMC',
|
obj: 'OMC',
|
||||||
version: appStore.version,
|
version: appStore.version,
|
||||||
status: t('views.index.normal'),
|
status: t('views.index.normal'),
|
||||||
number: '',
|
|
||||||
outTimeDate: '',
|
outTimeDate: '',
|
||||||
|
serialNum: '-',
|
||||||
});
|
});
|
||||||
|
|
||||||
/**表格状态类型 */
|
/**表格状态类型 */
|
||||||
@@ -163,7 +163,7 @@ function fnGetList(one: boolean) {
|
|||||||
tableState.loading = false;
|
tableState.loading = false;
|
||||||
var rightNum = 0;
|
var rightNum = 0;
|
||||||
var errorNum = 0;
|
var errorNum = 0;
|
||||||
|
if (res.length) nfInfo.serialNum = res[0].serialNum;
|
||||||
for (let i = 0; i < res.length; i++) {
|
for (let i = 0; i < res.length; i++) {
|
||||||
if (res[i].status == '正常' || res[i].status == 'Normal') {
|
if (res[i].status == '正常' || res[i].status == 'Normal') {
|
||||||
rightNum++;
|
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 visible = ref(false);
|
||||||
const closeDrawer = () => {
|
const closeDrawer = () => {
|
||||||
@@ -499,9 +374,7 @@ onBeforeUnmount(() => {
|
|||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'status'">
|
<template v-if="column.key === 'status'">
|
||||||
<div v-if="record.status == '正常' || record.status == 'Normal'">
|
<div v-if="record.status == '正常' || record.status == 'Normal'">
|
||||||
<a-tag color="blue" @click="init(record)">{{
|
<a-tag color="blue">{{ record.name }}</a-tag>
|
||||||
record.name
|
|
||||||
}}</a-tag>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<a-tag color="pink">{{ record.name }}</a-tag>
|
<a-tag color="pink">{{ record.name }}</a-tag>
|
||||||
@@ -533,10 +406,13 @@ onBeforeUnmount(() => {
|
|||||||
<a-descriptions-item :label="t('views.index.systemStatus')">{{
|
<a-descriptions-item :label="t('views.index.systemStatus')">{{
|
||||||
nfInfo.status
|
nfInfo.status
|
||||||
}}</a-descriptions-item>
|
}}</a-descriptions-item>
|
||||||
|
<a-descriptions-item :label="t('views.index.serialNum')">{{
|
||||||
|
nfInfo.serialNum
|
||||||
|
}}</a-descriptions-item>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<a-descriptions-item :label="t('views.index.serialNum')">{{
|
<a-descriptions-item :label="t('views.index.serialNum')">{{
|
||||||
nfInfo.number
|
nfInfo.serialNum
|
||||||
}}</a-descriptions-item>
|
}}</a-descriptions-item>
|
||||||
<a-descriptions-item :label="t('views.index.expiryDate')">{{
|
<a-descriptions-item :label="t('views.index.expiryDate')">{{
|
||||||
nfInfo.outTimeDate
|
nfInfo.outTimeDate
|
||||||
|
|||||||
Reference in New Issue
Block a user