diff --git a/packages/core/client/src/collection-manager/templates/components/PreviewFields.tsx b/packages/core/client/src/collection-manager/templates/components/PreviewFields.tsx index 49b0dfa95..e6a7dc0cd 100644 --- a/packages/core/client/src/collection-manager/templates/components/PreviewFields.tsx +++ b/packages/core/client/src/collection-manager/templates/components/PreviewFields.tsx @@ -90,9 +90,11 @@ const PreviewCom = (props) => { } }); field.value = fieldsData; - setDataSource(fieldsData); - form.setValuesIn('sources', data.data?.sources); - setSourceCollections(data.data?.sources); + setTimeout(() => { + setDataSource(fieldsData); + form.setValuesIn('sources', data.data?.sources); + setSourceCollections(data.data?.sources); + }); } }).catch; } diff --git a/packages/core/client/src/collection-manager/templates/components/PreviewTable.tsx b/packages/core/client/src/collection-manager/templates/components/PreviewTable.tsx index 199ca1eef..02fd705f4 100644 --- a/packages/core/client/src/collection-manager/templates/components/PreviewTable.tsx +++ b/packages/core/client/src/collection-manager/templates/components/PreviewTable.tsx @@ -71,35 +71,37 @@ export const PreviewTable = (props) => { }); }; return ( - +
- {previewColumns?.length > 0 && [ -
-
- - - -
- : -
, - , - ]} +
+
+ + + +
+ : +
+ {previewColumns?.length > 0 && ( + <> +
+ + )} ); diff --git a/packages/core/client/src/collection-manager/templates/view.tsx b/packages/core/client/src/collection-manager/templates/view.tsx index 9ef26a448..bf5ca5528 100644 --- a/packages/core/client/src/collection-manager/templates/view.tsx +++ b/packages/core/client/src/collection-manager/templates/view.tsx @@ -132,10 +132,13 @@ export const view: ICollectionTemplate = { schema: { 'x-component-props': '{{$form.values}}', //任意层次属性都支持表达式 }, + state: { + visible: `{{$deps[1]?.length > 0}}`, + }, }, }, }, - + ...getConfigurableProperties('category'), }, };