refactor(图表): 插件初始化优化
This commit is contained in:
parent
fb2c1b0fd9
commit
a4a64ac43a
@ -46,11 +46,14 @@ import ChartEmptyInfo from '@/views/chart/components/views/components/ChartEmpty
|
|||||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||||
import { viewFieldTimeTrans } from '@/utils/viewUtils'
|
import { viewFieldTimeTrans } from '@/utils/viewUtils'
|
||||||
import { CHART_TYPE_CONFIGS } from '@/views/chart/components/editor/util/chart'
|
import { CHART_TYPE_CONFIGS } from '@/views/chart/components/editor/util/chart'
|
||||||
|
import request from '@/config/axios'
|
||||||
|
import { store } from '@/store'
|
||||||
|
|
||||||
const { wsCache } = useCache()
|
const { wsCache } = useCache()
|
||||||
const chartComponent = ref<any>()
|
const chartComponent = ref<any>()
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const dvMainStore = dvMainStoreWithOut()
|
const dvMainStore = dvMainStoreWithOut()
|
||||||
|
const { emitter } = useEmitt()
|
||||||
|
|
||||||
let innerRefreshTimer = null
|
let innerRefreshTimer = null
|
||||||
const appStore = useAppStoreWithOut()
|
const appStore = useAppStoreWithOut()
|
||||||
@ -495,7 +498,7 @@ const calcData = params => {
|
|||||||
const showChartView = (...libs: ChartLibraryType[]) => {
|
const showChartView = (...libs: ChartLibraryType[]) => {
|
||||||
if (view.value?.render && view.value?.type) {
|
if (view.value?.render && view.value?.type) {
|
||||||
const chartView = chartViewManager.getChartView(view.value.render, view.value.type)
|
const chartView = chartViewManager.getChartView(view.value.render, view.value.type)
|
||||||
return libs?.includes(chartView.library)
|
return chartView && libs?.includes(chartView.library)
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -825,13 +828,16 @@ const loadPluginCategory = data => {
|
|||||||
<!--这里去渲染不同图库的图表-->
|
<!--这里去渲染不同图库的图表-->
|
||||||
<div v-if="chartAreaShow" style="flex: 1; overflow: hidden">
|
<div v-if="chartAreaShow" style="flex: 1; overflow: hidden">
|
||||||
<plugin-component
|
<plugin-component
|
||||||
v-if="view.isPlugin"
|
v-if="view.plugin?.isPlugin"
|
||||||
:jsname="view.plugin.staticMap['index']"
|
:jsname="view.plugin.staticMap['index']"
|
||||||
:scale="scale"
|
:scale="scale"
|
||||||
:dynamic-area-id="dynamicAreaId"
|
:dynamic-area-id="dynamicAreaId"
|
||||||
:view="view"
|
:view="view"
|
||||||
:show-position="showPosition"
|
:show-position="showPosition"
|
||||||
:element="element"
|
:element="element"
|
||||||
|
:request="request"
|
||||||
|
:emitter="emitter"
|
||||||
|
:store="store"
|
||||||
ref="chartComponent"
|
ref="chartComponent"
|
||||||
@onChartClick="chartClick"
|
@onChartClick="chartClick"
|
||||||
@onPointClick="onPointClick"
|
@onPointClick="onPointClick"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user