Skip to content

Commit 45ee411

Browse files
committed
fix: echart
1 parent 2bd750a commit 45ee411

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

src/components/Echart/src/Echart.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const props = defineProps({
2727
const isDark = computed(() => appStore.getIsDark)
2828
2929
const theme = computed(() => {
30-
const echartTheme: boolean | string = unref(isDark) ? true : 'auto'
30+
const echartTheme: boolean | string = unref(isDark) ? true : 'inherit'
3131
3232
return echartTheme
3333
})

src/plugins/echarts/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import {
66
PieChart,
77
MapChart,
88
PictorialBarChart,
9-
RadarChart
9+
RadarChart,
10+
GaugeChart
1011
} from 'echarts/charts'
1112

1213
import {
@@ -16,7 +17,8 @@ import {
1617
PolarComponent,
1718
AriaComponent,
1819
ParallelComponent,
19-
LegendComponent
20+
LegendComponent,
21+
ToolboxComponent
2022
} from 'echarts/components'
2123

2224
import { CanvasRenderer } from 'echarts/renderers'
@@ -25,6 +27,7 @@ echarts.use([
2527
LegendComponent,
2628
TitleComponent,
2729
TooltipComponent,
30+
ToolboxComponent,
2831
GridComponent,
2932
PolarComponent,
3033
AriaComponent,
@@ -35,7 +38,8 @@ echarts.use([
3538
MapChart,
3639
CanvasRenderer,
3740
PictorialBarChart,
38-
RadarChart
41+
RadarChart,
42+
GaugeChart
3943
])
4044

4145
export default echarts

src/views/infra/redis/index.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@
6363
</el-scrollbar>
6464
</template>
6565
<script setup lang="ts">
66-
import echarts from '@/plugins/echarts'
67-
import { GaugeChart } from 'echarts/charts'
68-
import { ToolboxComponent } from 'echarts/components'
6966
import * as RedisApi from '@/api/infra/redis'
7067
import { RedisMonitorInfoVO } from '@/api/infra/redis/types'
7168
const cache = ref<RedisMonitorInfoVO>()
@@ -77,7 +74,7 @@ const readRedisInfo = async () => {
7774
}
7875
7976
// 内存使用情况
80-
const usedmemoryEchartChika = reactive({
77+
const usedmemoryEchartChika = reactive<any>({
8178
title: {
8279
// 仪表盘标题。
8380
text: '内存使用情况',
@@ -263,8 +260,6 @@ const usedMemoryInstance = async () => {
263260
264261
/** 初始化 **/
265262
onMounted(() => {
266-
echarts.use([ToolboxComponent])
267-
echarts.use([GaugeChart])
268263
// 读取 redis 信息
269264
readRedisInfo()
270265
// 加载数据

0 commit comments

Comments
 (0)