refactor: table column field provider optimize (#2312)
This commit is contained in:
parent
063d7ca693
commit
d8befa75c6
@ -14,10 +14,23 @@ export const ColumnFieldProvider = observer(
|
||||
return buf;
|
||||
}, null);
|
||||
const collectionField = fieldSchema && getCollectionJoinField(fieldSchema['x-collection-field']);
|
||||
if (fieldSchema && record?.__collection && ['select', 'multipleSelect'].includes(collectionField?.interface)) {
|
||||
if (
|
||||
fieldSchema &&
|
||||
record?.__collection &&
|
||||
collectionField &&
|
||||
['select', 'multipleSelect'].includes(collectionField.interface)
|
||||
) {
|
||||
const fieldName = `${record.__collection}.${fieldSchema.name}`;
|
||||
schema.properties[fieldSchema.name]['x-collection-field'] = fieldName;
|
||||
return <RecursionField basePath={basePath} schema={schema} onlyRenderProperties />;
|
||||
const newSchema = {
|
||||
...schema.toJSON(),
|
||||
properties: {
|
||||
[fieldSchema.name]: {
|
||||
...fieldSchema.toJSON(),
|
||||
'x-collection-field': fieldName,
|
||||
},
|
||||
},
|
||||
};
|
||||
return <RecursionField basePath={basePath} schema={newSchema} onlyRenderProperties />;
|
||||
}
|
||||
return props.children;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user