mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-08 06:59:26 +08:00
Merge branch 'next' into develop
This commit is contained in:
commit
7e9cda873f
@ -193,9 +193,12 @@ export const TableBlockProvider = withDynamicSchemaProps((props) => {
|
|||||||
const collection = getCollection(props.collection, props.dataSource);
|
const collection = getCollection(props.collection, props.dataSource);
|
||||||
const { treeTable } = fieldSchema?.['x-decorator-props'] || {};
|
const { treeTable } = fieldSchema?.['x-decorator-props'] || {};
|
||||||
const { params, parseVariableLoading } = useTableBlockParamsCompat(props);
|
const { params, parseVariableLoading } = useTableBlockParamsCompat(props);
|
||||||
let childrenColumnName = 'children';
|
// Prevent tables with 'children' field from automatically converting to tree-structured tables
|
||||||
|
let childrenColumnName = '__nochildren__';
|
||||||
|
|
||||||
if (treeTable) {
|
if (treeTable) {
|
||||||
|
childrenColumnName = 'children';
|
||||||
|
|
||||||
if (resourceName?.includes('.')) {
|
if (resourceName?.includes('.')) {
|
||||||
const f = getCollectionField(resourceName);
|
const f = getCollectionField(resourceName);
|
||||||
if (f?.treeChildren) {
|
if (f?.treeChildren) {
|
||||||
@ -209,6 +212,8 @@ export const TableBlockProvider = withDynamicSchemaProps((props) => {
|
|||||||
}
|
}
|
||||||
params['tree'] = true;
|
params['tree'] = true;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
childrenColumnName = '__nochildren__';
|
||||||
}
|
}
|
||||||
const form = useMemo(() => createForm(), [treeTable]);
|
const form = useMemo(() => createForm(), [treeTable]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user