mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-02 03:02:19 +08:00
fix(data-vi): allows to use foreign keys in query configuration of charts (#5869)
This commit is contained in:
parent
cd5b0dc4d8
commit
de323cf6f8
@ -11,11 +11,8 @@ import { ArrayField } from '@formily/core';
|
|||||||
import { ISchema, Schema, useForm } from '@formily/react';
|
import { ISchema, Schema, useForm } from '@formily/react';
|
||||||
import {
|
import {
|
||||||
CollectionFieldOptions,
|
CollectionFieldOptions,
|
||||||
CollectionFieldOptions_deprecated,
|
|
||||||
CollectionManager,
|
|
||||||
DEFAULT_DATA_SOURCE_KEY,
|
DEFAULT_DATA_SOURCE_KEY,
|
||||||
useACLRoleContext,
|
useACLRoleContext,
|
||||||
useCollectionManager_deprecated,
|
|
||||||
useDataSourceManager,
|
useDataSourceManager,
|
||||||
} from '@nocobase/client';
|
} from '@nocobase/client';
|
||||||
import { useContext, useMemo } from 'react';
|
import { useContext, useMemo } from 'react';
|
||||||
@ -243,7 +240,7 @@ export const useCollectionFieldsOptions = (dataSource: string, collectionName: s
|
|||||||
const fields = collectionFields.filter((v) => !excludes.includes(v.interface));
|
const fields = collectionFields.filter((v) => !excludes.includes(v.interface));
|
||||||
|
|
||||||
const field2option = (field, depth, prefix?) => {
|
const field2option = (field, depth, prefix?) => {
|
||||||
if (!field.interface || field.isForeignKey) {
|
if (!field.interface) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const fieldInterface = fim.getFieldInterface(field.interface);
|
const fieldInterface = fim.getFieldInterface(field.interface);
|
||||||
@ -300,7 +297,7 @@ export const useCollectionFilterOptions = (dataSource: string, collection: strin
|
|||||||
return useMemo(() => {
|
return useMemo(() => {
|
||||||
const fields = cm.getCollectionFields(collection || _collection);
|
const fields = cm.getCollectionFields(collection || _collection);
|
||||||
const field2option = (field, depth) => {
|
const field2option = (field, depth) => {
|
||||||
if (!field.interface || field.isForeignKey) {
|
if (!field.interface) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const fieldInterface = fim.getFieldInterface(field.interface);
|
const fieldInterface = fim.getFieldInterface(field.interface);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user