From c8b100e3903ff1cec2ca5b76894c2a93b0dcf124 Mon Sep 17 00:00:00 2001 From: chenos Date: Thu, 7 Apr 2022 20:31:06 +0800 Subject: [PATCH] fix: dynamic component --- .../src/schema-component/antd/filter/FilterItem.tsx | 2 +- .../client/src/schema-component/antd/filter/useValues.ts | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/client/src/schema-component/antd/filter/FilterItem.tsx b/packages/client/src/schema-component/antd/filter/FilterItem.tsx index 7ff918642..e47e6c79c 100644 --- a/packages/client/src/schema-component/antd/filter/FilterItem.tsx +++ b/packages/client/src/schema-component/antd/filter/FilterItem.tsx @@ -43,7 +43,7 @@ export const FilterItem = observer((props: any) => { {!operator?.noValue && React.createElement(DynamicComponent, { value, - schema: {}, + schema, onChange(value) { setValue(value); }, diff --git a/packages/client/src/schema-component/antd/filter/useValues.ts b/packages/client/src/schema-component/antd/filter/useValues.ts index 2ddf9d4f5..acb1b4402 100644 --- a/packages/client/src/schema-component/antd/filter/useValues.ts +++ b/packages/client/src/schema-component/antd/filter/useValues.ts @@ -44,13 +44,7 @@ export const useValues = () => { field.data.dataIndex = dataIndex; field.data.operators = operators; field.data.operator = operator; - field.data.schema = merge(merge(option?.schema, operator?.schema), { - 'x-component-props': { - style: { - minWidth: 150, - }, - }, - }); + field.data.schema = merge(option?.schema, operator?.schema); field.data.value = get(field.value, `${fieldPath}.$${operatorValue}`); console.log('option', operator, field.data.value); };