xingyu 1 anno fa
parent
commit
45ee4116b7

+ 1 - 1
src/components/Echart/src/Echart.vue

@@ -27,7 +27,7 @@ const props = defineProps({
 const isDark = computed(() => appStore.getIsDark)
 
 const theme = computed(() => {
-  const echartTheme: boolean | string = unref(isDark) ? true : 'auto'
+  const echartTheme: boolean | string = unref(isDark) ? true : 'inherit'
 
   return echartTheme
 })

+ 7 - 3
src/plugins/echarts/index.ts

@@ -6,7 +6,8 @@ import {
   PieChart,
   MapChart,
   PictorialBarChart,
-  RadarChart
+  RadarChart,
+  GaugeChart
 } from 'echarts/charts'
 
 import {
@@ -16,7 +17,8 @@ import {
   PolarComponent,
   AriaComponent,
   ParallelComponent,
-  LegendComponent
+  LegendComponent,
+  ToolboxComponent
 } from 'echarts/components'
 
 import { CanvasRenderer } from 'echarts/renderers'
@@ -25,6 +27,7 @@ echarts.use([
   LegendComponent,
   TitleComponent,
   TooltipComponent,
+  ToolboxComponent,
   GridComponent,
   PolarComponent,
   AriaComponent,
@@ -35,7 +38,8 @@ echarts.use([
   MapChart,
   CanvasRenderer,
   PictorialBarChart,
-  RadarChart
+  RadarChart,
+  GaugeChart
 ])
 
 export default echarts

+ 1 - 6
src/views/infra/redis/index.vue

@@ -63,9 +63,6 @@
   </el-scrollbar>
 </template>
 <script setup lang="ts">
-import echarts from '@/plugins/echarts'
-import { GaugeChart } from 'echarts/charts'
-import { ToolboxComponent } from 'echarts/components'
 import * as RedisApi from '@/api/infra/redis'
 import { RedisMonitorInfoVO } from '@/api/infra/redis/types'
 const cache = ref<RedisMonitorInfoVO>()
@@ -77,7 +74,7 @@ const readRedisInfo = async () => {
 }
 
 // 内存使用情况
-const usedmemoryEchartChika = reactive({
+const usedmemoryEchartChika = reactive<any>({
   title: {
     // 仪表盘标题。
     text: '内存使用情况',
@@ -263,8 +260,6 @@ const usedMemoryInstance = async () => {
 
 /** 初始化 **/
 onMounted(() => {
-  echarts.use([ToolboxComponent])
-  echarts.use([GaugeChart])
   // 读取 redis 信息
   readRedisInfo()
   // 加载数据