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() {
|
||||
let targetField;
|
||||
const { getCollectionFields, getInterface, getCollectionJoinField, getCollection } = useCollectionManager();
|
||||
const { getField } = useCollection();
|
||||
const { form } = useFormBlockContext();
|
||||
@ -112,9 +113,11 @@ FormItem.Designer = function Designer() {
|
||||
const IsShowMultipleSwitch = useIsShowMultipleSwitch();
|
||||
|
||||
const collectionField = getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']);
|
||||
const targetField = getCollectionJoinField(
|
||||
`${collectionField?.target}.${fieldSchema['x-component-props'].fieldNames?.label}`,
|
||||
);
|
||||
if (collectionField?.target) {
|
||||
targetField = getCollectionJoinField(
|
||||
`${collectionField.target}.${fieldSchema['x-component-props']?.fieldNames?.label || 'id'}`,
|
||||
);
|
||||
}
|
||||
|
||||
const targetCollection = getCollection(collectionField?.target);
|
||||
const interfaceConfig = getInterface(collectionField?.interface);
|
||||
|
Loading…
Reference in New Issue
Block a user