fix: 主页点击异常
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { PageContainer } from '@ant-design-vue/pro-layout';
|
||||
import { onMounted } from 'vue';
|
||||
import { ColumnsType } from 'ant-design-vue/lib/table';
|
||||
import { reactive, toRaw } from 'vue';
|
||||
import { reactive, toRaw, ref, onMounted } from 'vue';
|
||||
import { listMain } from '@/api/index';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
const { t } = useI18n();
|
||||
import { TooltipComponent } from 'echarts/components';
|
||||
import { GaugeChart } from 'echarts/charts';
|
||||
import { CanvasRenderer } from 'echarts/renderers';
|
||||
@@ -11,6 +12,7 @@ import * as echarts from 'echarts/core';
|
||||
import { TitleComponent, LegendComponent } from 'echarts/components';
|
||||
import { PieChart } from 'echarts/charts';
|
||||
import { LabelLayout } from 'echarts/features';
|
||||
import message from 'ant-design-vue/lib/message';
|
||||
|
||||
echarts.use([
|
||||
TooltipComponent,
|
||||
@@ -201,16 +203,11 @@ function init(e: any) {
|
||||
var myChart = echarts.init(chartDom);
|
||||
myChart.clear(); //怕遗留以前得元素
|
||||
|
||||
var nfMenUsage =
|
||||
Math.round(
|
||||
(realData.memUsage.nfUsedMem / realData.memUsage.totalMem) * 10000
|
||||
) / 100.0;
|
||||
var nfMaxDiskSpace =
|
||||
Math.round(
|
||||
(realData.diskSpace.partitionInfo[1].used /
|
||||
realData.diskSpace.partitionInfo[1].total) *
|
||||
10000
|
||||
) / 100.0;
|
||||
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}%',
|
||||
@@ -272,7 +269,7 @@ function init(e: any) {
|
||||
},
|
||||
data: [
|
||||
{
|
||||
value: realData.cpuUsage.nfCpuUsage / 100,
|
||||
value: cpuUsage?.nfCpuUsage / 100,
|
||||
name: 'CPU',
|
||||
},
|
||||
],
|
||||
@@ -327,9 +324,9 @@ const closeDrawer = () => {
|
||||
/**抽屉 网元详细信息 */
|
||||
|
||||
/**监听表格行事件*/
|
||||
function rowClick(record, index) {
|
||||
function rowClick(record:any, index:any) {
|
||||
return {
|
||||
onClick: (event) => {
|
||||
onClick: () => {
|
||||
console.log(toRaw(record), "666");
|
||||
/* console.log( index, "666");
|
||||
console.log( event, "666");*/
|
||||
@@ -340,15 +337,14 @@ function rowClick(record, index) {
|
||||
let pronData=toRaw(record);
|
||||
//渲染详细信息
|
||||
pronInfo={
|
||||
|
||||
hostName: pronData.hostName,
|
||||
osInfo:pronData.osInfo,
|
||||
dbInfo: pronData.dbInfo,
|
||||
ipAddress:pronData.ipAddress,
|
||||
port:pronData.port,
|
||||
version:pronData.version,
|
||||
cpuUse:pronData.name+":"+pronData.cpuUsage.nfCpuUsage/100+"%; "+"SYS:"+pronData.cpuUsage.sysCpuUsage / 100+"%",
|
||||
memoryUse:"Total:"+pronData.memUsage.totalMem+"KB; "+pronData.name+":"+pronData.memUsage.nfUsedMem+"KB; SYS:"+pronData.memUsage.sysMemUsage+"KB",
|
||||
cpuUse:pronData.name+":"+pronData.cpuUsage?.nfCpuUsage/100+"%; "+"SYS:"+pronData.cpuUsage?.sysCpuUsage / 100+"%",
|
||||
memoryUse:"Total:"+pronData.memUsage?.totalMem+"KB; "+pronData.name+":"+pronData.memUsage?.nfUsedMem+"KB; SYS:"+pronData.memUsage?.sysMemUsage+"KB",
|
||||
capability:pronData.capability ,
|
||||
serialNum:pronData.serialNum,
|
||||
expiryDate:pronData.expiryDate,
|
||||
|
||||
Reference in New Issue
Block a user