From 87e37757b34763f6841bad3a4a7e7706a0e473c6 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Fri, 23 Jun 2023 00:10:39 +0800 Subject: [PATCH] fix(sub-table): allows configuration of "Display association fields" (#2073) --- .../schema-initializer/buttons/TableColumnInitializers.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/client/src/schema-initializer/buttons/TableColumnInitializers.tsx b/packages/core/client/src/schema-initializer/buttons/TableColumnInitializers.tsx index 10f468802..06d96d0f8 100644 --- a/packages/core/client/src/schema-initializer/buttons/TableColumnInitializers.tsx +++ b/packages/core/client/src/schema-initializer/buttons/TableColumnInitializers.tsx @@ -8,12 +8,13 @@ import { useInheritsTableColumnInitializerFields, } from '../utils'; import { useCompile } from '../../schema-component'; -import { useFieldSchema } from '@formily/react'; +import { useField, useFieldSchema } from '@formily/react'; // 表格列配置 export const TableColumnInitializers = (props: any) => { const { items = [], action = true } = props; const { t } = useTranslation(); + const field = useField(); const fieldSchema = useFieldSchema(); const associatedFields = useAssociatedTableColumnInitializerFields(); const inheritFields = useInheritsTableColumnInitializerFields(); @@ -41,7 +42,7 @@ export const TableColumnInitializers = (props: any) => { ); }); } - if (associatedFields?.length > 0 && !isSubTable) { + if (associatedFields?.length > 0 && field.readPretty) { fieldItems.push( { type: 'divider',