From 12486908588aea021ad4f4f0d27de9177155036a Mon Sep 17 00:00:00 2001 From: code_nan <1677408957@qq.com> Date: Mon, 8 Jan 2024 20:43:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E8=A7=86=E5=8C=96=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/monitoring/audit-log.vue | 29 +- src/views/modules/monitoring/chart-test.vue | 38 +++ src/views/modules/monitoring/chart-test2.vue | 266 +++++++++++++++++++ 3 files changed, 331 insertions(+), 2 deletions(-) create mode 100644 src/views/modules/monitoring/chart-test.vue create mode 100644 src/views/modules/monitoring/chart-test2.vue diff --git a/src/views/modules/monitoring/audit-log.vue b/src/views/modules/monitoring/audit-log.vue index 32557ee..6128853 100644 --- a/src/views/modules/monitoring/audit-log.vue +++ b/src/views/modules/monitoring/audit-log.vue @@ -16,6 +16,9 @@ + + + @@ -32,9 +35,27 @@ logs: [ // 这里可以根据需要从后台获取真实数据 { id: 1, message: "日志1", timestamp: "2024-01-05 10:30:00" }, { id: 2, message: "日志2", timestamp: "2024-01-05 11:15:00" }, - ] + ], + chartOptions: { + title: { + text: '柱状图示例' + }, + tooltip: {}, + xAxis: { + data: ['类别1', '类别2', '类别3', '类别4', '类别5'] + }, + yAxis: {}, + series: [{ + name: '数量', + type: 'bar', + data: [5, 20, 36, 10, 10] + }] + } }; }, + mounted() { + this.renderChart() + }, methods: { fetchLogs() { // 模拟从后端获取日志数据的过程 @@ -57,7 +78,11 @@ // 将返回的日志数据赋值给logs数组 this.logs = response.data; }, 1000); - } + }, + renderChart() { + const myChart = echarts.init(this.$refs.myChart) + myChart.setOption(this.chartOptions) + } } }; diff --git a/src/views/modules/monitoring/chart-test.vue b/src/views/modules/monitoring/chart-test.vue new file mode 100644 index 0000000..4e1c60a --- /dev/null +++ b/src/views/modules/monitoring/chart-test.vue @@ -0,0 +1,38 @@ + + + + + + 数据上报 + {{ lineCardTitle }} + + 运行情况 + 应用情况 + + + + + + + + + + + + +