diff --git a/packages/core/client/src/schema-component/antd/association-field/Editable.tsx b/packages/core/client/src/schema-component/antd/association-field/Editable.tsx index bf2466e5c6..9a1edc57d4 100644 --- a/packages/core/client/src/schema-component/antd/association-field/Editable.tsx +++ b/packages/core/client/src/schema-component/antd/association-field/Editable.tsx @@ -3,17 +3,17 @@ import { observer, useField, useForm } from '@formily/react'; import React from 'react'; import { SchemaComponentOptions } from '../../'; import { useAssociationCreateActionProps as useCAP } from '../../../block-provider/hooks'; +import { useCollection } from '../../../collection-manager'; import { AssociationFieldProvider } from './AssociationFieldProvider'; import { AssociationSelect } from './AssociationSelect'; import { InternalFileManager } from './FileManager'; +import { InternalCascadeSelect } from './InternalCascadeSelect'; import { InternalNester } from './InternalNester'; import { InternalPicker } from './InternalPicker'; -import { InternalSubTable } from './InternalSubTable'; import { InternaPopoverNester } from './InternalPopoverNester'; -import { InternalCascadeSelect } from './InternalCascadeSelect'; +import { InternalSubTable } from './InternalSubTable'; import { CreateRecordAction } from './components/CreateRecordAction'; import { useAssociationFieldContext } from './hooks'; -import { useCollection } from '../../../collection-manager'; const EditableAssociationField = observer( (props: any) => { diff --git a/packages/core/client/src/schema-component/antd/association-field/InternalCascadeSelect.tsx b/packages/core/client/src/schema-component/antd/association-field/InternalCascadeSelect.tsx index fefa431ac9..b31377f1f4 100644 --- a/packages/core/client/src/schema-component/antd/association-field/InternalCascadeSelect.tsx +++ b/packages/core/client/src/schema-component/antd/association-field/InternalCascadeSelect.tsx @@ -130,8 +130,8 @@ const CascadeSelect = connect((props) => { const data = await handleGetOptions({ parentId: option?.id }); const options = [...selectedOptions]; options.splice(index + 1); - if (value) { - options[index] = { ...options[index], value: option }; + options[index] = { ...options[index], value: option }; + if (option?.id) { options[index + 1] = { key: option?.id, children: data?.length > 0 ? data : null }; } setSelectedOptions(options);