From 479e397e4f20095ca7c2220fa5570a0869eb3d1b Mon Sep 17 00:00:00 2001 From: lai <371757574@qq.com> Date: Thu, 14 Sep 2023 15:43:49 +0800 Subject: [PATCH] =?UTF-8?q?--=E6=96=B0=E5=A2=9E=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/index.vue | 167 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 133 insertions(+), 34 deletions(-) diff --git a/src/views/index.vue b/src/views/index.vue index cc12ae9b..f1d3bb9f 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -81,11 +81,52 @@ let tableState: TabeStateType = reactive({ /**表格状态 */ let nfInfo: any = reactive({ - obj: 'OMC', - version: '1.6.1', - status: '正常', - number: '', - outTimeDate: '', + obj: "OMC", + version: "1.6.1", + status: "正常", + number: "", + outTimeDate: "", +}); + +/**表格状态类型 */ +type nfStateType = { + /**主机名 */ + hostName: string; + /**操作系统信息 */ + osInfo: string; + /**数据库信息 */ + dbInfo: string; + /**IP地址 */ + ipAddress: string; + /**端口 */ + port: number; + /**版本 */ + version: string; + /**CPU利用率 */ + cpuUse: string; + /**内存使用 */ + memoryUse: string; + /**用户容量 */ + capability: number; + /**序列号 */ + serialNum: string; + /**许可证到期日期 */ +/* selectedRowKeys: (string | number)[];*/ + expiryDate:string +}; +/**网元详细信息 */ +let pronInfo: nfStateType = reactive({ + hostName: '5gc', + osInfo: 'Linux 5gc 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 GNU/Linux', + dbInfo: 'adb v1.0.1', + ipAddress: '-', + port:3030, + version: '-', + cpuUse: '-', + memoryUse:'-', + capability:0 , + serialNum: '-', + expiryDate:"-", }); /**查询网元状态列表 */ @@ -155,9 +196,7 @@ function fnGetList() { /**點擊網元名 */ function init(e: any) { - console.log(toRaw(e)); let realData = toRaw(e); - var chartDom = document.getElementById('echarts-records'); var myChart = echarts.init(chartDom); myChart.clear(); //怕遗留以前得元素 @@ -191,6 +230,7 @@ function init(e: any) { show: true, //指针长度 length: '60%', + }, title: { offsetCenter: [0, '90%'], @@ -275,8 +315,52 @@ function init(e: any) { nfInfo.obj = realData.name; nfInfo.number = realData.serialNum; nfInfo.outTimeDate = realData.expiryDate; + + } +/**抽屉 网元详细信息 */ +const visible = ref(false); +const closeDrawer = () => { + visible.value = false; +}; +/**抽屉 网元详细信息 */ + +/**监听表格行事件*/ +function rowClick(record, index) { + return { + onClick: (event) => { + console.log(toRaw(record), "666"); +/* console.log( index, "666"); + console.log( event, "666");*/ + if (toRaw(record).status=='异常'){ + message.error(`网元状态异常`, 2); + return false; + }else { + 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", + capability:pronData.capability , + serialNum:pronData.serialNum, + expiryDate:pronData.expiryDate, + } + } + visible.value = true; + + }, + }; +} + + onMounted(() => { fnGetList(); }); @@ -284,6 +368,36 @@ onMounted(() => {