From a44b9e256c0f4f03a96f033a9c15b7f9d37e3d4c Mon Sep 17 00:00:00 2001 From: xilesun <2013xile@gmail.com> Date: Wed, 3 Apr 2024 20:24:25 +0800 Subject: [PATCH] feat: chart config compile --- .../plugin-data-visualization/src/client/chart/chart.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/plugins/@nocobase/plugin-data-visualization/src/client/chart/chart.ts b/packages/plugins/@nocobase/plugin-data-visualization/src/client/chart/chart.ts index ddccbab7f8..4e6feda080 100644 --- a/packages/plugins/@nocobase/plugin-data-visualization/src/client/chart/chart.ts +++ b/packages/plugins/@nocobase/plugin-data-visualization/src/client/chart/chart.ts @@ -2,7 +2,7 @@ import React from 'react'; import { FieldOption } from '../hooks'; import { QueryProps } from '../renderer'; import { parseField } from '../utils'; -import { ISchema } from '@formily/react'; +import { ISchema, Schema } from '@formily/react'; import configs, { AnySchemaProperties, Config } from './configs'; import { Transformer } from '../block/transformers'; @@ -169,9 +169,10 @@ export class Chart implements ChartType { } render({ data, general, advanced, fieldProps }: RenderProps) { + const config = this.getProps({ data, general, advanced, fieldProps }); return () => React.createElement(this.component, { - ...this.getProps({ data, general, advanced, fieldProps }), + ...Schema.compile(config), }); } }