diff --git a/packages/core/client/src/collection-manager/Configuration/ViewInheritedField.tsx b/packages/core/client/src/collection-manager/Configuration/ViewInheritedField.tsx index 78e15f928..892823bf3 100644 --- a/packages/core/client/src/collection-manager/Configuration/ViewInheritedField.tsx +++ b/packages/core/client/src/collection-manager/Configuration/ViewInheritedField.tsx @@ -3,7 +3,7 @@ import { ISchema } from '@formily/react'; import { uid } from '@formily/shared'; import cloneDeep from 'lodash/cloneDeep'; import set from 'lodash/set'; -import React, { useState } from 'react'; +import React, { useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useAPIClient, useRequest } from '../../api-client'; import { RecordProvider, useRecord } from '../../record-provider'; @@ -65,14 +65,21 @@ export const ViewCollectionField = (props) => { export const ViewFieldAction = (props) => { const { scope, getContainer, item: record, children } = props; - const { getInterface } = useCollectionManager(); + const { getInterface, collections } = useCollectionManager(); const [visible, setVisible] = useState(false); const [schema, setSchema] = useState({}); const api = useAPIClient(); const { t } = useTranslation(); const compile = useCompile(); const [data, setData] = useState({}); - + const currentCollections = useMemo(() => { + return collections.map((v) => { + return { + label: compile(v.title), + value: v.name, + }; + }); + }, []); return ( @@ -113,6 +120,7 @@ export const ViewFieldAction = (props) => { getContainer, showReverseFieldConfig: !data?.reverseField, createOnly: !true, + collections: currentCollections, ...scope, }} />