fix(client): collection field does not exist
This commit is contained in:
parent
91ae780e4f
commit
345080f92e
@ -25,7 +25,7 @@ FormItem.Designer = () => {
|
|||||||
const compile = useCompile();
|
const compile = useCompile();
|
||||||
const collectionField = getField(fieldSchema['name']);
|
const collectionField = getField(fieldSchema['name']);
|
||||||
const originalTitle = collectionField?.uiSchema?.title;
|
const originalTitle = collectionField?.uiSchema?.title;
|
||||||
const targetFields = collectionField.target ? getCollectionFields(collectionField.target) : [];
|
const targetFields = collectionField?.target ? getCollectionFields(collectionField.target) : [];
|
||||||
const initialValue = {
|
const initialValue = {
|
||||||
title: field.title === originalTitle ? undefined : field.title,
|
title: field.title === originalTitle ? undefined : field.title,
|
||||||
};
|
};
|
||||||
@ -40,6 +40,7 @@ FormItem.Designer = () => {
|
|||||||
}));
|
}));
|
||||||
return (
|
return (
|
||||||
<GeneralSchemaDesigner>
|
<GeneralSchemaDesigner>
|
||||||
|
{collectionField && (
|
||||||
<SchemaSettings.PopupItem
|
<SchemaSettings.PopupItem
|
||||||
title={'编辑'}
|
title={'编辑'}
|
||||||
schema={
|
schema={
|
||||||
@ -127,6 +128,7 @@ FormItem.Designer = () => {
|
|||||||
} as ISchema
|
} as ISchema
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
{collectionField?.target && (
|
{collectionField?.target && (
|
||||||
<SchemaSettings.SelectItem
|
<SchemaSettings.SelectItem
|
||||||
title={'标题字段'}
|
title={'标题字段'}
|
||||||
@ -152,7 +154,7 @@ FormItem.Designer = () => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<SchemaSettings.Divider />
|
{collectionField && <SchemaSettings.Divider />}
|
||||||
<SchemaSettings.Remove
|
<SchemaSettings.Remove
|
||||||
removeParentsIfNoChildren
|
removeParentsIfNoChildren
|
||||||
breakRemoveOn={{
|
breakRemoveOn={{
|
||||||
|
Loading…
Reference in New Issue
Block a user