import { observer, useForm } from '@formily/react'; import { action } from '@formily/reactive'; import { useAPIClient, useActionContext, useCollectionFieldFormValues, useCollectionManager, useCompile, useRequest, } from '@nocobase/client'; import { Select, message } from 'antd'; import { lodash } from '@nocobase/utils/client' import React, { useContext, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import { GraphCollectionContext } from './components/CollectionNodeProvder'; export const useValuesFromRecord = (options, data) => { const result = useRequest(() => Promise.resolve({ data }), { ...options, manual: true, }); const ctx = useActionContext(); useEffect(() => { if (ctx.visible) { result.run(); } }, [ctx.visible]); return result; }; export const SourceCollection = observer( () => { const { record } = useContext(GraphCollectionContext); const compile = useCompile(); return (