fix: adding inherited blocks in relation fields under edited operate should only display themselves (#1967)

This commit is contained in:
katherinehhh 2023-06-01 16:21:12 +08:00 committed by GitHub
parent a69e1acbf4
commit 1aad355950
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 16 deletions

View File

@ -4,6 +4,7 @@ import { Input } from 'antd';
import React from 'react';
import { RemoteSelect, RemoteSelectProps } from '../remote-select';
import useServiceOptions from './hooks';
import { RecordProvider } from '../../../';
export type AssociationSelectProps<P = any> = RemoteSelectProps<P> & {
action?: string;
@ -30,6 +31,7 @@ const InternalAssociationSelect = observer((props: AssociationSelectProps) => {
></RemoteSelect>
{isAllowAddNew && (
<RecordProvider record={null}>
<RecursionField
onlyRenderProperties
basePath={field.address}
@ -38,6 +40,7 @@ const InternalAssociationSelect = observer((props: AssociationSelectProps) => {
return s['x-component'] === 'Action';
}}
/>
</RecordProvider>
)}
</Input.Group>
</div>

View File

@ -19,6 +19,7 @@ import { ActionContext } from '../action';
import { useAssociationFieldContext, useFieldNames, useInsertSchema } from './hooks';
import schema from './schema';
import { flatData, getLabelFormatValue, useLabelUiSchema } from './util';
import { RecordProvider } from '../../../';
const useTableSelectorProps = () => {
const field: any = useField();
@ -159,6 +160,7 @@ export const InternalPicker = observer((props: any) => {
/>
</div>
{isAllowAddNew && (
<RecordProvider record={null}>
<RecursionField
onlyRenderProperties
basePath={field.address}
@ -167,6 +169,7 @@ export const InternalPicker = observer((props: any) => {
return s['x-component'] === 'Action';
}}
/>
</RecordProvider>
)}
</Input.Group>
<ActionContext.Provider value={{ openMode: 'drawer', visible: visibleSelector, setVisible: setVisibleSelector }}>