fix: foreignKey undefined in association field (#2903)

This commit is contained in:
katherinehhh 2023-10-24 16:43:21 +08:00 committed by GitHub
parent 266a4ccb08
commit 6b46b166cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 9 deletions

View File

@ -149,7 +149,7 @@ export default function useServiceOptions(props) {
],
'$or',
);
}, [collectionField?.interface, collectionField.foreignKey, fieldSchema, fieldServiceFilter, sourceValue]);
}, [collectionField?.interface, collectionField?.foreignKey, fieldSchema, fieldServiceFilter, sourceValue]);
return useMemo(() => {
return {

View File

@ -119,14 +119,12 @@ const WithForm = (props: WithFormProps) => {
if (h.targetFields?.length) {
const fields = h.targetFields.join(',');
onFieldInit(`*(${fields})`, (field: any, form) => {
setTimeout(() => {
field['initProperty'] = field?.['initProperty'] ?? {
display: field.display,
required: field.required,
pattern: field.pattern,
value: field.value || field.initialValue,
};
});
field['initProperty'] = field?.['initProperty'] ?? {
display: field.display,
required: field.required,
pattern: field.pattern,
value: field.value || field.initialValue,
};
});
onFieldChange(`*(${fields})`, ['value', 'required', 'pattern', 'display'], (field: any) => {
field.linkageProperty = {