From 96b4ce0d13507cbb133366bd6ebff9f09863b481 Mon Sep 17 00:00:00 2001 From: Xu Zhimeng Date: Thu, 4 Jan 2024 17:45:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A0=B9=E6=8D=AE=E7=8E=B0=E6=9C=89?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9E=84=E5=BB=BA=E8=A1=A8=E6=A0=BC=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../instances/serviceProcess.vue | 136 +++++++++++------- 1 file changed, 84 insertions(+), 52 deletions(-) diff --git a/src/views/abnormalAlarm/serverMonitor/instances/serviceProcess.vue b/src/views/abnormalAlarm/serverMonitor/instances/serviceProcess.vue index f5f109d..9d6d635 100644 --- a/src/views/abnormalAlarm/serverMonitor/instances/serviceProcess.vue +++ b/src/views/abnormalAlarm/serverMonitor/instances/serviceProcess.vue @@ -113,7 +113,7 @@ :canSelect="false" > - + /> --> @@ -142,56 +142,78 @@ import TableList from '../../components/tableList.vue' import dateFormat from '@/components/jeecg/JEasyCron/format-date' import { getAction, postAction, httpAction, deleteAction } from '@/api/manage' import * as echarts from 'echarts' -const columns = [ - { - title: 'STATUS', - align: 'left', - dataIndex: 'status', - // width: 250, - }, - { - title: 'SERVICE NAME', - align: 'left', - dataIndex: 'name', - // width: 250, - }, - { - title: 'ASSOCIATED PROCESS', - align: 'left', - dataIndex: 'process', - // width: 250, - }, - { - title: 'CPU(%)', - align: 'left', - dataIndex: 'cpu', - // width: 250, - }, - { - title: 'MENORY', - align: 'left', - dataIndex: 'menory', - // width: 250, - }, - { - title: 'INSTANCE', - align: 'left', - dataIndex: 'instance', - // width: 250, - }, - { - title: 'THREAD COUNT', - align: 'left', - dataIndex: 'threadCount', - // width: 250, - }, - { - title: 'PROCESSING COUNT', - align: 'left', - dataIndex: 'processongCount', - // width: 250, - }, -] +// const columns = [ +// { +// title: 'STATUS', +// align: 'left', +// dataIndex: 'status', +// // width: 250, +// }, +// { +// title: 'SERVICE NAME', +// align: 'left', +// dataIndex: 'name', +// // width: 250, +// }, +// { +// title: 'ASSOCIATED PROCESS', +// align: 'left', +// dataIndex: 'process', +// // width: 250, +// }, +// { +// title: 'CPU(%)', +// align: 'left', +// dataIndex: 'cpu', +// // width: 250, +// }, +// { +// title: 'MENORY', +// align: 'left', +// dataIndex: 'menory', +// // width: 250, +// }, +// { +// title: 'INSTANCE', +// align: 'left', +// dataIndex: 'instance', +// // width: 250, +// }, +// { +// title: 'THREAD COUNT', +// align: 'left', +// dataIndex: 'threadCount', +// // width: 250, +// }, +// { +// title: 'PROCESSING COUNT', +// align: 'left', +// dataIndex: 'processongCount', +// // width: 250, +// }, +// ] + +const columns = [{ + title: 'Name', + dataIndex: 'name', + width: '20%' +}, { + title: 'Min(%)', + dataIndex: 'min', + width: '20%' +}, { + title: 'Max(%)', + dataIndex: 'max', + width: '20%' +}, { + title: 'Avg(%)', + dataIndex: 'avg', + width: '20%' +}, { + title: 'Now(%)', + dataIndex: 'now', + width: '20%' +}] export default { components: { BoxTitle, @@ -297,6 +319,8 @@ export default { type: this.num === 0 ? 'CPU' : '内存', } + this.setTableData() + let cpu_xData = res.result.cpu[0].list.map((item) => { return dateFormat(new Date(item.date * 1000), 'hh:mm') }) @@ -403,12 +427,20 @@ export default { this.type = 'cpu' this.ranked.content.clear() this.drawRanked() + this.setTableData() }, handleMemory() { this.type = 'memory' this.ranked.content.clear() this.drawRanked() + this.setTableData() }, + + // 设置底部table数据 + setTableData() { + this.dataSource = this.list[this.type] + }, + drawRanked() { this.ranked.content = echarts.init(document.getElementById('ranked')) let xData = this.type === 'cpu' ? this.rankData.cpu_xData : this.rankData.memory_xData