mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-05 13:47:45 +08:00
Merge branch 'main' into next
This commit is contained in:
commit
bcd154453f
@ -122,7 +122,7 @@ export const DataBlockContext = createContext<DataBlockContextValue<any>>({} as
|
||||
DataBlockContext.displayName = 'DataBlockContext';
|
||||
|
||||
const DataBlockResourceContext = createContext<{ rerenderDataBlock: () => void }>(null);
|
||||
const RerenderDataBlockProvider: FC = ({ children }) => {
|
||||
export const RerenderDataBlockProvider: FC = ({ children }) => {
|
||||
const [hidden, setHidden] = React.useState(false);
|
||||
const value = useMemo(() => {
|
||||
return {
|
||||
|
@ -18,6 +18,7 @@ import {
|
||||
FormBlockContext,
|
||||
FormV2,
|
||||
RecordProvider,
|
||||
RerenderDataBlockProvider,
|
||||
useAPIClient,
|
||||
useAssociationNames,
|
||||
useBlockRequestContext,
|
||||
@ -82,16 +83,18 @@ export function FormBlockProvider(props) {
|
||||
<CollectionManagerProvider dataSource={dataSource}>
|
||||
<CollectionProvider_deprecated collection={props.collection}>
|
||||
<RecordProvider record={values} parent={null}>
|
||||
<FormActiveFieldsProvider name="form">
|
||||
<BlockRequestContext_deprecated.Provider
|
||||
value={{ block: 'form', props, field, service, resource, __parent }}
|
||||
>
|
||||
<FormBlockContext.Provider value={formBlockValue}>
|
||||
<FormV2.Templates style={{ marginBottom: token.margin }} form={form} />
|
||||
<div ref={formBlockRef}>{props.children}</div>
|
||||
</FormBlockContext.Provider>
|
||||
</BlockRequestContext_deprecated.Provider>
|
||||
</FormActiveFieldsProvider>
|
||||
<RerenderDataBlockProvider>
|
||||
<FormActiveFieldsProvider name="form">
|
||||
<BlockRequestContext_deprecated.Provider
|
||||
value={{ block: 'form', props, field, service, resource, __parent }}
|
||||
>
|
||||
<FormBlockContext.Provider value={formBlockValue}>
|
||||
<FormV2.Templates style={{ marginBottom: token.margin }} form={form} />
|
||||
<div ref={formBlockRef}>{props.children}</div>
|
||||
</FormBlockContext.Provider>
|
||||
</BlockRequestContext_deprecated.Provider>
|
||||
</FormActiveFieldsProvider>
|
||||
</RerenderDataBlockProvider>
|
||||
</RecordProvider>
|
||||
</CollectionProvider_deprecated>
|
||||
</CollectionManagerProvider>
|
||||
|
@ -19,6 +19,7 @@ import {
|
||||
CollectionManagerProvider,
|
||||
CollectionProvider,
|
||||
FormProvider,
|
||||
RerenderDataBlockProvider,
|
||||
SchemaComponent,
|
||||
SchemaComponentOptions,
|
||||
SchemaComponentProvider,
|
||||
@ -57,8 +58,7 @@ export function AssignedFieldsFormSchemaConfig(props) {
|
||||
const { setFormValueChanged } = useActionContext();
|
||||
const api = useAPIClient();
|
||||
const scope = useWorkflowVariableOptions();
|
||||
const nodeForm = useForm();
|
||||
const { values, setValuesIn } = nodeForm;
|
||||
const { values, setValuesIn, disabled } = useForm();
|
||||
const params = toJS(values.params);
|
||||
const [dataSourceName, collectionName] = parseCollectionName(values.collection);
|
||||
|
||||
@ -121,17 +121,19 @@ export function AssignedFieldsFormSchemaConfig(props) {
|
||||
<Card>
|
||||
<CollectionManagerProvider dataSource={dataSourceName}>
|
||||
<CollectionProvider name={collectionName}>
|
||||
<FormProvider form={form}>
|
||||
<FormLayout layout={'vertical'}>
|
||||
<VariableScopeProvider scope={scope}>
|
||||
<SchemaComponentProvider form={form} designable={!nodeForm.disabled}>
|
||||
<SchemaComponentOptions {...schemaOptions}>
|
||||
<SchemaComponent schema={schema} onChange={onChange} />
|
||||
</SchemaComponentOptions>
|
||||
</SchemaComponentProvider>
|
||||
</VariableScopeProvider>
|
||||
</FormLayout>
|
||||
</FormProvider>
|
||||
<RerenderDataBlockProvider>
|
||||
<FormProvider form={form}>
|
||||
<FormLayout layout={'vertical'}>
|
||||
<VariableScopeProvider scope={scope}>
|
||||
<SchemaComponentProvider form={form} designable={!disabled}>
|
||||
<SchemaComponentOptions {...schemaOptions}>
|
||||
<SchemaComponent schema={schema} onChange={onChange} />
|
||||
</SchemaComponentOptions>
|
||||
</SchemaComponentProvider>
|
||||
</VariableScopeProvider>
|
||||
</FormLayout>
|
||||
</FormProvider>
|
||||
</RerenderDataBlockProvider>
|
||||
</CollectionProvider>
|
||||
</CollectionManagerProvider>
|
||||
</Card>
|
||||
|
Loading…
Reference in New Issue
Block a user