refactor: displayInAssociation

This commit is contained in:
katherinehhh 2024-10-24 22:40:24 +08:00
parent c5a6a17ac8
commit 1ec05fe37e
2 changed files with 5 additions and 1 deletions

View File

@ -276,7 +276,7 @@ export const useCollectionManager_deprecated = (dataSourceName?: string) => {
// 是否可以作为标题字段
const isTitleField = useCallback(
(field) => {
return getInterface(field.interface)?.titleUsable;
return getInterface(field.interface)?.titleUsable && field?.displayInAssociation !== false;
},
[getInterface],
);

View File

@ -109,6 +109,10 @@ export const useFilterFieldOptions = (fields) => {
if (field.filterable === false) {
return;
}
//关系表字段是否支持筛选
if (field.displayInAssociation === false && depth > 1) {
return;
}
const fieldInterface = getInterface(field.interface);
if (!fieldInterface?.filterable) {
return;