diff --git a/core/core-frontend/src/models/chart/editor.d.ts b/core/core-frontend/src/models/chart/editor.d.ts index 64dd622bce..32ae0e39e5 100644 --- a/core/core-frontend/src/models/chart/editor.d.ts +++ b/core/core-frontend/src/models/chart/editor.d.ts @@ -28,6 +28,11 @@ declare type EditorPropertyInner = { [key in EditorProperty]?: string[] } +declare type EditorSelectorSpec = { + [key in EditorProperty]?: { + title: string + } +} /** * 轴类型 */ diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue index e2a1938f3b..7c68da39ff 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue @@ -68,10 +68,18 @@ const props = defineProps({ default: () => { return {} } + }, + selectorSpec: { + type: Object as PropType, + required: false, + default: () => { + return {} + } } }) -const { chart, themes, properties, propertyInnerAll, commonBackgroundPop } = toRefs(props) +const { chart, themes, properties, propertyInnerAll, commonBackgroundPop, selectorSpec } = + toRefs(props) const emit = defineEmits([ 'onColorChange', 'onMiscChange', @@ -316,7 +324,7 @@ watch( :effect="themes" v-if="showProperties('misc-style-selector')" name="size" - title="大小" + :title="selectorSpec['misc-style-selector']?.title" > { v-if="chartStyleShow" :properties="chartViewInstance.properties" :property-inner-all="chartViewInstance.propertyInner" + :selector-spec="chartViewInstance.selectorSpec" :common-background-pop="curComponent?.commonBackground" :chart="view" :themes="themes" diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/radar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/radar.ts index cc4e3828af..9ac62e92dc 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/radar.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/radar.ts @@ -41,6 +41,11 @@ export class Radar extends G2PlotChartView { ], 'legend-selector': ['icon', 'orient', 'color', 'fontSize', 'hPosition', 'vPosition'] } + selectorSpec: EditorSelectorSpec = { + 'misc-style-selector': { + title: `${t('chart.tooltip_axis')}` + } + } axis: AxisType[] = ['xAxis', 'yAxis', 'drill', 'filter', 'extLabel', 'extTooltip'] axisConfig: AxisConfig = { xAxis: { diff --git a/core/core-frontend/src/views/chart/components/js/panel/types/index.ts b/core/core-frontend/src/views/chart/components/js/panel/types/index.ts index f0af8b07ea..b436d593e1 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/types/index.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/types/index.ts @@ -26,6 +26,7 @@ export abstract class AbstractChartView { abstract propertyInner: EditorPropertyInner abstract axis: AxisType[] abstract axisConfig: AxisConfig + abstract selectorSpec: EditorSelectorSpec /** * 在新建和切换图表的时候处理默认值 * @param chart 数据库图表对象 @@ -91,6 +92,11 @@ export abstract class AntVAbstractChartView extends AbstractChartView { limit: 1 } } + selectorDesc: EditorSelectorSpec = { + 'misc-style-selector': { + title: `${t('chart.size')}` + } + } protected constructor(library: ChartLibraryType, name: string, defaultData?: any[]) { super(ChartRenderType.ANT_V, library, name, defaultData) }