feat: association cascader support filter

This commit is contained in:
sealday 2024-03-22 02:54:13 +08:00
parent 436088d7b9
commit e8497f8f8e

View File

@ -18,14 +18,17 @@ const AssociationCascader = connect((props) => {
const titleField = cm.getCollection(collection).titleField; const titleField = cm.getCollection(collection).titleField;
const joinTitleField = cm.getCollection(collection + '.' + associationField).titleField; const joinTitleField = cm.getCollection(collection + '.' + associationField).titleField;
const { data } = useRequest<any>({ const params = {
resource: collection,
action: 'list',
params: {
appends: [associationField], appends: [associationField],
fields: [titleField], fields: [titleField],
pageSize: 99999, pageSize: 99999,
}, filter: props?.params?.filter ? { ...props?.params?.filter } : {},
};
const { data } = useRequest<any>({
resource: collection,
action: 'list',
params,
}); });
const options = useMemo(() => { const options = useMemo(() => {