mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 12:26:22 +00:00
fix(sub-table): allows configuration of "Display association fields" (#2073)
This commit is contained in:
parent
ccfc9b8625
commit
87e37757b3
@ -8,12 +8,13 @@ import {
|
|||||||
useInheritsTableColumnInitializerFields,
|
useInheritsTableColumnInitializerFields,
|
||||||
} from '../utils';
|
} from '../utils';
|
||||||
import { useCompile } from '../../schema-component';
|
import { useCompile } from '../../schema-component';
|
||||||
import { useFieldSchema } from '@formily/react';
|
import { useField, useFieldSchema } from '@formily/react';
|
||||||
|
|
||||||
// 表格列配置
|
// 表格列配置
|
||||||
export const TableColumnInitializers = (props: any) => {
|
export const TableColumnInitializers = (props: any) => {
|
||||||
const { items = [], action = true } = props;
|
const { items = [], action = true } = props;
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const field = useField();
|
||||||
const fieldSchema = useFieldSchema();
|
const fieldSchema = useFieldSchema();
|
||||||
const associatedFields = useAssociatedTableColumnInitializerFields();
|
const associatedFields = useAssociatedTableColumnInitializerFields();
|
||||||
const inheritFields = useInheritsTableColumnInitializerFields();
|
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(
|
fieldItems.push(
|
||||||
{
|
{
|
||||||
type: 'divider',
|
type: 'divider',
|
||||||
|
Loading…
Reference in New Issue
Block a user