mirror of
https://gitee.com/dromara/go-view.git
synced 2024-12-03 20:28:40 +08:00
perf: 优化性能,去除组件中多余注册内容
This commit is contained in:
parent
617b940d64
commit
972c92519c
@ -15,14 +15,7 @@ import { mergeTheme } from '@/packages/public/chart'
|
||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||
import { isPreview } from '@/utils'
|
||||
import mapJsonWithoutHainanIsLands from './mapWithoutHainanIsLands.json'
|
||||
import {
|
||||
DatasetComponent,
|
||||
GridComponent,
|
||||
TooltipComponent,
|
||||
LegendComponent,
|
||||
GeoComponent,
|
||||
VisualMapComponent
|
||||
} from 'echarts/components'
|
||||
import { DatasetComponent, GridComponent, TooltipComponent, GeoComponent, VisualMapComponent } from 'echarts/components'
|
||||
|
||||
const props = defineProps({
|
||||
themeSetting: {
|
||||
@ -45,7 +38,6 @@ use([
|
||||
CanvasRenderer,
|
||||
GridComponent,
|
||||
TooltipComponent,
|
||||
LegendComponent,
|
||||
GeoComponent,
|
||||
EffectScatterChart,
|
||||
VisualMapComponent
|
||||
@ -58,7 +50,7 @@ const vChartRef = ref<typeof VChart>()
|
||||
|
||||
//动态获取json注册地图
|
||||
const getGeojson = (regionId: string) => {
|
||||
return new Promise<boolean>((resolve) => {
|
||||
return new Promise<boolean>(resolve => {
|
||||
import(`./mapGeojson/${regionId}.json`).then(data => {
|
||||
registerMap(regionId, { geoJSON: data.default as any, specialAreas: {} })
|
||||
resolve(true)
|
||||
@ -84,7 +76,7 @@ const vEchartsSetOption = () => {
|
||||
}
|
||||
|
||||
// 更新数据处理
|
||||
const dataSetHandle = async (dataset: any) => {
|
||||
const dataSetHandle = async (dataset: any) => {
|
||||
props.chartConfig.option.series.forEach((item: any) => {
|
||||
if (item.type === 'effectScatter' && dataset.point) item.data = dataset.point
|
||||
else if (item.type === 'map' && dataset.map) item.data = dataset.map
|
||||
|
@ -12,7 +12,7 @@ import { mergeTheme } from '@/packages/public/chart'
|
||||
import config, { includes } from './config'
|
||||
import { useChartDataFetch } from '@/hooks'
|
||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent, TitleComponent } from 'echarts/components'
|
||||
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
|
||||
|
||||
const props = defineProps({
|
||||
themeSetting: {
|
||||
@ -29,7 +29,7 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
use([DatasetComponent, CanvasRenderer, PieChart, GridComponent, TooltipComponent, LegendComponent, TitleComponent])
|
||||
use([DatasetComponent, CanvasRenderer, PieChart, GridComponent, TooltipComponent, LegendComponent])
|
||||
|
||||
const option = reactive({
|
||||
value: {}
|
||||
|
@ -15,13 +15,12 @@ import VChart from 'vue-echarts'
|
||||
import 'echarts-wordcloud'
|
||||
import { use } from 'echarts/core'
|
||||
import { CanvasRenderer } from 'echarts/renderers'
|
||||
import { BarChart } from 'echarts/charts'
|
||||
import config, { includes } from './config'
|
||||
import { mergeTheme } from '@/packages/public/chart'
|
||||
import { useChartDataFetch } from '@/hooks'
|
||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||
import { isPreview } from '@/utils'
|
||||
import { GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
|
||||
import { GridComponent, TooltipComponent } from 'echarts/components'
|
||||
import dataJson from './data.json'
|
||||
|
||||
const props = defineProps({
|
||||
@ -39,7 +38,7 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
use([CanvasRenderer, BarChart, GridComponent, TooltipComponent, LegendComponent])
|
||||
use([CanvasRenderer, GridComponent, TooltipComponent])
|
||||
|
||||
const replaceMergeArr = ref<string[]>()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user