mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-06 05:59:25 +08:00
refactor: code improve
This commit is contained in:
parent
3a4857b070
commit
e2b1fdf963
@ -52,7 +52,7 @@ export const useCollectionState = (currentCollectionName: string) => {
|
|||||||
type: 'duplicate',
|
type: 'duplicate',
|
||||||
tag: compile(field.uiSchema?.title) || field.name,
|
tag: compile(field.uiSchema?.title) || field.name,
|
||||||
};
|
};
|
||||||
const option = {
|
const option: any = {
|
||||||
...node,
|
...node,
|
||||||
title: React.createElement(TreeNode, node),
|
title: React.createElement(TreeNode, node),
|
||||||
key: prefix ? `${prefix}.${field.name}` : field.name,
|
key: prefix ? `${prefix}.${field.name}` : field.name,
|
||||||
@ -73,6 +73,7 @@ export const useCollectionState = (currentCollectionName: string) => {
|
|||||||
});
|
});
|
||||||
} else if (['hasOne', 'hasMany'].includes(field.type)) {
|
} else if (['hasOne', 'hasMany'].includes(field.type)) {
|
||||||
option.isLeaf = false;
|
option.isLeaf = false;
|
||||||
|
option.disabled = true;
|
||||||
option['children'] = traverseFields(field.target, {
|
option['children'] = traverseFields(field.target, {
|
||||||
depth: depth + 1,
|
depth: depth + 1,
|
||||||
maxDepth,
|
maxDepth,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user