fix: table selector (#612)

This commit is contained in:
金昶 2022-07-10 10:15:12 +08:00 committed by GitHub
parent 451d6ae974
commit 68d35cf597
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,8 +63,10 @@ export const TableSelectorProvider = (props) => {
if (appends?.length) { if (appends?.length) {
params['appends'] = appends; params['appends'] = appends;
} }
console.log('record', record);
if (collectionField) { if (collectionField) {
if (['oho', 'o2m'].includes(collectionField.interface)) { if (['oho', 'o2m'].includes(collectionField.interface)) {
if (record?.[collectionField.sourceKey]) {
params['filter'] = { params['filter'] = {
$or: [{ $or: [{
[collectionField.foreignKey]: { [collectionField.foreignKey]: {
@ -76,10 +78,17 @@ export const TableSelectorProvider = (props) => {
} }
}] }]
} }
} else {
params['filter'] = {
[collectionField.foreignKey]: {
$is: null,
} }
if (['obo'].includes(collectionField.interface)) {
} }
} }
}
// if (['obo'].includes(collectionField.interface)) {
// }
}
return ( return (
<BlockProvider {...props} params={params}> <BlockProvider {...props} params={params}>
<InternalTableSelectorProvider {...props} params={params} /> <InternalTableSelectorProvider {...props} params={params} />