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