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', '$or',
); );
}, [collectionField?.interface, collectionField.foreignKey, fieldSchema, fieldServiceFilter, sourceValue]); }, [collectionField?.interface, collectionField?.foreignKey, fieldSchema, fieldServiceFilter, sourceValue]);
return useMemo(() => { return useMemo(() => {
return { return {

View File

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