fix: getCollection bug (#3656)

This commit is contained in:
jack zhang 2024-03-08 11:18:32 +08:00 committed by GitHub
parent 12ba7cd9d0
commit 2fc13c180c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1273,8 +1273,8 @@ export const useAssociationNames = (dataSource?: string) => {
collectAppends(condition); collectAppends(condition);
}); });
} }
const isTreeCollection =
const isTreeCollection = isAssociationField && getCollection(collectionField.target)?.template === 'tree'; isAssociationField && getCollection(collectionField.target, dataSource)?.template === 'tree';
if (collectionField && (isAssociationField || isAssociationSubfield) && s['x-component'] !== 'TableField') { if (collectionField && (isAssociationField || isAssociationSubfield) && s['x-component'] !== 'TableField') {
const fieldPath = !isAssociationField && isAssociationSubfield ? getAssociationPath(s.name) : s.name; const fieldPath = !isAssociationField && isAssociationSubfield ? getAssociationPath(s.name) : s.name;
const path = prefix === '' || !prefix ? fieldPath : prefix + '.' + fieldPath; const path = prefix === '' || !prefix ? fieldPath : prefix + '.' + fieldPath;