Pr@dev v3@fix chart (#16147)

* fix(图表): 修复富文本失效

* fix(图表): 修复图表切换失效
This commit is contained in:
wisonic-s
2025-05-20 11:22:38 +08:00
committed by GitHub
parent 808b6890f6
commit 4e72da93a2
5 changed files with 14 additions and 5 deletions

View File

@@ -2,6 +2,7 @@
import { iconChartMap } from '@/components/icon-group/chart-list'
import icon_down_outlined1 from '@/assets/svg/icon_down_outlined-1.svg'
import { toRefs } from 'vue'
import ChartType from './ChartType.vue'
const props = defineProps({
propValue: {
@@ -74,7 +75,7 @@ const onTypeChange = (render, type) => {
</el-select>
</template>
<template #default>
<chart-type :themes="themes" :type="type" @on-type-change="onTypeChange" />
<ChartType :themes="themes" :type="type" @on-type-change="onTypeChange" />
</template>
</el-popover>
</template>

View File

@@ -1,4 +1,4 @@
import { AbstractChartView, ChartLibraryType, ChartRenderType } from '../../../types'
import { AbstractChartView, ChartLibraryType, ChartRenderType } from '../../types'
import { useI18n } from '@/hooks/web/useI18n'
import { COLOR_CASES } from '@/views/chart/components/editor/util/chart'

View File

@@ -1,4 +1,4 @@
import { AbstractChartView, ChartLibraryType, ChartRenderType } from '../../../types'
import { AbstractChartView, ChartLibraryType, ChartRenderType } from '../../types'
import { useI18n } from '@/hooks/web/useI18n'
const { t } = useI18n()
@@ -6,6 +6,7 @@ const { t } = useI18n()
* 图片组图表
*/
export class PictureGroupView extends AbstractChartView {
selectorSpec: EditorSelectorSpec
properties: EditorProperty[] = ['background-overall-component', 'border-style', 'threshold']
propertyInner: EditorPropertyInner = {
'background-overall-component': ['all'],

View File

@@ -1,4 +1,4 @@
import { AbstractChartView, ChartLibraryType, ChartRenderType } from '../../../types'
import { AbstractChartView, ChartLibraryType, ChartRenderType } from '../../types'
import { useI18n } from '@/hooks/web/useI18n'
const { t } = useI18n()
@@ -6,6 +6,7 @@ const { t } = useI18n()
* 富文本图表
*/
export class RichTextChartView extends AbstractChartView {
selectorSpec: EditorSelectorSpec
properties: EditorProperty[] = [
'background-overall-component',
'border-style',

View File

@@ -20,7 +20,13 @@ class ChartViewManager {
const chartViewManager = new ChartViewManager()
// 批量自动注册图表,只要是 AbstractChartView 的子类都初始化然后存起来
const charts = import.meta.glob(
['./charts/map/*.ts', './charts/table/*.ts', './charts/g2/**/*.ts', '!**/common.ts'],
[
'./charts/map/*.ts',
'./charts/table/*.ts',
'./charts/g2/**/*.ts',
'./charts/others/**/*.ts',
'!**/common.ts'
],
{ eager: true }
)
for (const chart in charts) {