Skip to content

Commit 3feb482

Browse files
committed
!148 【重构】Vue3 管理后台:[基础管理 -> Redis监控] 使用Echart组件实现
1 parent ab7032f commit 3feb482

File tree

2 files changed

+8
-29
lines changed

2 files changed

+8
-29
lines changed

src/router/modules/remaining.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -330,28 +330,6 @@ const remainingRouter: AppRouteRecordRaw[] = [
330330
}
331331
]
332332
},
333-
{
334-
path: '/infra',
335-
component: Layout,
336-
name: 'InfraRedis',
337-
meta: {
338-
hidden: true
339-
},
340-
children: [
341-
{
342-
path: '/infra/redis',
343-
component: () => import('@/views/infra/redis/index.vue'),
344-
name: 'InfraRedis',
345-
meta: {
346-
noCache: true,
347-
hidden: true,
348-
canTo: true,
349-
title: 'REDIS测试测试测试',
350-
activeMenu: 'infra/redis/index'
351-
}
352-
}
353-
]
354-
},
355333
{
356334
path: '/property',
357335
component: Layout,

src/views/infra/redis/index.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ import { GaugeChart } from 'echarts/charts'
6868
import { ToolboxComponent } from 'echarts/components'
6969
import * as RedisApi from '@/api/infra/redis'
7070
import { RedisMonitorInfoVO } from '@/api/infra/redis/types'
71-
echarts.use([ToolboxComponent])
72-
echarts.use([GaugeChart])
7371
const cache = ref<RedisMonitorInfoVO>()
7472
7573
// 基本信息
@@ -145,14 +143,14 @@ const usedmemoryEchartChika = reactive({
145143
fontSize: 15
146144
},
147145
pointer: {
148-
//指针的大小
146+
// 指针的大小
149147
width: 7,
150148
show: true
151149
},
152150
detail: {
153151
textStyle: {
154152
fontWeight: 'normal',
155-
//里面文字下的数值大小(50)
153+
// 里面文字下的数值大小(50)
156154
fontSize: 15,
157155
color: '#FFFFFF'
158156
},
@@ -213,13 +211,13 @@ const commandStatsRefChika = reactive({
213211
214212
/** 加载数据 */
215213
const getSummary = () => {
216-
//初始化命令图表
217-
initcommandStatsChart()
214+
// 初始化命令图表
215+
initCommandStatsChart()
218216
usedMemoryInstance()
219217
}
220218
221219
/** 命令使用情况 */
222-
const initcommandStatsChart = async () => {
220+
const initCommandStatsChart = async () => {
223221
usedmemoryEchartChika.series[0].data = []
224222
// 发起请求
225223
try {
@@ -265,6 +263,9 @@ const usedMemoryInstance = async () => {
265263
266264
/** 初始化 **/
267265
onMounted(() => {
266+
echarts.use([ToolboxComponent])
267+
echarts.use([GaugeChart])
268+
// 读取 redis 信息
268269
readRedisInfo()
269270
// 加载数据
270271
getSummary()

0 commit comments

Comments
 (0)