mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 12:06:47 +00:00
fix: avoid error (#2060)
This commit is contained in:
parent
d0632d73fd
commit
457afe3e06
@ -100,6 +100,7 @@ export const FormItem: any = observer(
|
|||||||
);
|
);
|
||||||
|
|
||||||
FormItem.Designer = function Designer() {
|
FormItem.Designer = function Designer() {
|
||||||
|
let targetField;
|
||||||
const { getCollectionFields, getInterface, getCollectionJoinField, getCollection } = useCollectionManager();
|
const { getCollectionFields, getInterface, getCollectionJoinField, getCollection } = useCollectionManager();
|
||||||
const { getField } = useCollection();
|
const { getField } = useCollection();
|
||||||
const { form } = useFormBlockContext();
|
const { form } = useFormBlockContext();
|
||||||
@ -112,9 +113,11 @@ FormItem.Designer = function Designer() {
|
|||||||
const IsShowMultipleSwitch = useIsShowMultipleSwitch();
|
const IsShowMultipleSwitch = useIsShowMultipleSwitch();
|
||||||
|
|
||||||
const collectionField = getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']);
|
const collectionField = getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']);
|
||||||
const targetField = getCollectionJoinField(
|
if (collectionField?.target) {
|
||||||
`${collectionField?.target}.${fieldSchema['x-component-props'].fieldNames?.label}`,
|
targetField = getCollectionJoinField(
|
||||||
|
`${collectionField.target}.${fieldSchema['x-component-props']?.fieldNames?.label || 'id'}`,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const targetCollection = getCollection(collectionField?.target);
|
const targetCollection = getCollection(collectionField?.target);
|
||||||
const interfaceConfig = getInterface(collectionField?.interface);
|
const interfaceConfig = getInterface(collectionField?.interface);
|
||||||
|
Loading…
Reference in New Issue
Block a user