mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 18:52:20 +08:00
fix: fix the issue where oho field block does not request data (#6125)
This commit is contained in:
parent
049b2a542f
commit
76c826150b
@ -19,6 +19,7 @@ import {
|
||||
DataBlockProvider,
|
||||
TableFieldResource,
|
||||
WithoutTableFieldResource,
|
||||
useCollectionManager,
|
||||
useCollectionParentRecord,
|
||||
useCollectionRecord,
|
||||
useCollectionRecordData,
|
||||
@ -294,10 +295,10 @@ export const useFilterByTk = (blockProps?: any) => {
|
||||
const recordIndex = useRecordIndex();
|
||||
const recordData = useCollectionRecordData();
|
||||
const collection = useCollection_deprecated();
|
||||
const { getCollectionField } = useCollectionManager_deprecated();
|
||||
const association = useBlockAssociationContext();
|
||||
const assoc = blockProps?.association || association;
|
||||
const withoutTableFieldResource = useContext(WithoutTableFieldResource);
|
||||
const cm = useCollectionManager();
|
||||
|
||||
if (!withoutTableFieldResource) {
|
||||
if (resource instanceof TableFieldResource || __parent?.block === 'TableField') {
|
||||
@ -306,8 +307,8 @@ export const useFilterByTk = (blockProps?: any) => {
|
||||
}
|
||||
|
||||
if (assoc) {
|
||||
const association = getCollectionField(assoc);
|
||||
return recordData?.[association.targetKey || 'id'];
|
||||
const association = cm.getCollectionField(assoc);
|
||||
return recordData?.[association.targetKey || association.sourceKey || 'id'];
|
||||
}
|
||||
if (isArray(collection.filterTargetKey)) {
|
||||
const filterByTk = {};
|
||||
|
Loading…
x
Reference in New Issue
Block a user