mirror of
https://github.com/nocobase/nocobase
synced 2024-11-16 11:56:47 +00:00
fix: bug
This commit is contained in:
parent
8fb099f5b6
commit
899031e239
@ -74,9 +74,12 @@ export const CollectionFieldInternalFieldV2: React.FC = (props: Props) => {
|
|||||||
const targetCollection = getCollection(collectionField?.target);
|
const targetCollection = getCollection(collectionField?.target);
|
||||||
let fieldNames = {};
|
let fieldNames = {};
|
||||||
if (collectionField?.target && targetCollection) {
|
if (collectionField?.target && targetCollection) {
|
||||||
|
const initField = collectionField?.targetKey || targetCollection.getPrimaryKey();
|
||||||
fieldNames = {
|
fieldNames = {
|
||||||
label: collectionField?.targetKey || targetCollection.getPrimaryKey(),
|
label: targetCollection.getFields()?.find((v) => v.name === field.componentProps.fieldNames?.label)
|
||||||
value: collectionField?.targetKey || targetCollection.getPrimaryKey(),
|
? field.componentProps.fieldNames?.label
|
||||||
|
: initField,
|
||||||
|
value: initField,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const componentProps = merge(originalProps, { ...(field.componentProps || {}), fieldNames });
|
const componentProps = merge(originalProps, { ...(field.componentProps || {}), fieldNames });
|
||||||
|
Loading…
Reference in New Issue
Block a user