diff --git a/packages/core/client/src/schema-initializer/components/assigned-field/AssignedField.tsx b/packages/core/client/src/schema-initializer/components/assigned-field/AssignedField.tsx index 5f5601a04..07520ef27 100644 --- a/packages/core/client/src/schema-initializer/components/assigned-field/AssignedField.tsx +++ b/packages/core/client/src/schema-initializer/components/assigned-field/AssignedField.tsx @@ -1,44 +1,48 @@ import { Field } from '@formily/core'; import { useField, useFieldSchema } from '@formily/react'; -import React, { useEffect, useState } from 'react'; +// import { Select, Space } from 'antd'; +import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; -import { CollectionField, useCollection } from '../../../collection-manager'; -import { useCompile, useFilterOptions } from '../../../schema-component'; +import { CollectionField } from '../../../collection-manager'; +import { useCompile } from '../../../schema-component'; export const AssignedField = (props: any) => { const { t } = useTranslation(); const compile = useCompile(); const field = useField(); const fieldSchema = useFieldSchema(); - const [type, setType] = useState('constantValue'); + // const [type, setType] = useState('constantValue'); const [value, setValue] = useState(field?.value?.value ?? ''); - const [options, setOptions] = useState([]); - const { getField } = useCollection(); - const collectionField = getField(fieldSchema.name); - const { uiSchema } = collectionField; - const currentUser = useFilterOptions('users'); - const currentRecord = useFilterOptions(collectionField.collectionName); - - useEffect(() => { - const opt = [ - { - name: 'currentUser', - title: t('Current user'), - children: [...currentUser], - }, - { - name: 'currentRecord', - title: t('Current record'), - children: [...currentRecord], - }, - ]; - setOptions(compile(opt)); - }, []); + // const [options, setOptions] = useState([]); + // const { getField } = useCollection(); + // const collectionField = getField(fieldSchema.name); + // const { uiSchema } = collectionField; + // const currentUser = useFilterOptions('users'); + // const currentRecord = useFilterOptions(collectionField.collectionName); + // useEffect(() => { + // const opt = [ + // { + // name: 'currentUser', + // title: t('Current user'), + // children: [...currentUser], + // }, + // { + // name: 'currentRecord', + // title: t('Current record'), + // children: [...currentRecord], + // }, + // ]; + // setOptions(compile(opt)); + // }, []); const valueChangeHandler = (val) => { setValue(val); }; + // const typeChangeHandler = (val) => { + // setType(val); + // }; + return ; // return (