fix: association scope inherit (#1806)

This commit is contained in:
katherinehhh 2023-05-06 21:44:01 +08:00 committed by GitHub
parent 54432a4314
commit 8aee0eef9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -159,9 +159,9 @@ export const useCollectionFilterOptions = (collectionName: string) => {
}; };
const options = getOptions(fields, 1); const options = getOptions(fields, 1);
const compile = useCompile(); const compile = useCompile();
const { getChildrenCollections } = useCollectionManager(); const { getChildrenCollections, getCollection } = useCollectionManager();
const collection = useCollection(); const collection = getCollection(collectionName);
const childrenCollections = getChildrenCollections(collection.name); const childrenCollections = getChildrenCollections(collectionName);
if (childrenCollections.length > 0 && !options.find((v) => v.name == 'tableoid')) { if (childrenCollections.length > 0 && !options.find((v) => v.name == 'tableoid')) {
options.push({ options.push({
name: 'tableoid', name: 'tableoid',
@ -169,7 +169,7 @@ export const useCollectionFilterOptions = (collectionName: string) => {
title: '{{t("Table OID(Inheritance)")}}', title: '{{t("Table OID(Inheritance)")}}',
schema: { schema: {
'x-component': 'Select', 'x-component': 'Select',
enum: [{ value: collection.name, label: compile(collection.title) }].concat( enum: [{ value: collectionName, label: compile(collection.title) }].concat(
childrenCollections.map((v) => { childrenCollections.map((v) => {
return { return {
value: v.name, value: v.name,

View File

@ -47,7 +47,7 @@ export const FilterItem = observer((props: any) => {
/> />
{!operator?.noValue && {!operator?.noValue &&
React.createElement(DynamicComponent, { React.createElement(DynamicComponent, {
value, value: value ? value : undefined,
schema, schema,
onChange(value) { onChange(value) {
setValue(value); setValue(value);