fix: modal app not found
This commit is contained in:
parent
e307b11006
commit
f5a83d48da
@ -67,6 +67,8 @@ import {
|
|||||||
useRecord,
|
useRecord,
|
||||||
useSchemaSettingsItem,
|
useSchemaSettingsItem,
|
||||||
useSortFields,
|
useSortFields,
|
||||||
|
useApp,
|
||||||
|
ApplicationContext,
|
||||||
} from '..';
|
} from '..';
|
||||||
import {
|
import {
|
||||||
BlockRequestContext_deprecated,
|
BlockRequestContext_deprecated,
|
||||||
@ -970,6 +972,7 @@ export const SchemaSettingsModalItem: FC<SchemaSettingsModalItemProps> = (props)
|
|||||||
const record = useCollectionRecord();
|
const record = useCollectionRecord();
|
||||||
const { association } = useDataBlockProps() || {};
|
const { association } = useDataBlockProps() || {};
|
||||||
const formCtx = useFormBlockContext();
|
const formCtx = useFormBlockContext();
|
||||||
|
const app = useApp();
|
||||||
|
|
||||||
// 解决变量`当前对象`值在弹窗中丢失的问题
|
// 解决变量`当前对象`值在弹窗中丢失的问题
|
||||||
const { formValue: subFormValue, collection: subFormCollection } = useSubFormValue();
|
const { formValue: subFormValue, collection: subFormCollection } = useSubFormValue();
|
||||||
@ -988,51 +991,53 @@ export const SchemaSettingsModalItem: FC<SchemaSettingsModalItemProps> = (props)
|
|||||||
{ title: schema.title || title, width },
|
{ title: schema.title || title, width },
|
||||||
() => {
|
() => {
|
||||||
return (
|
return (
|
||||||
<CollectionRecordProvider record={record}>
|
<ApplicationContext.Provider value={app}>
|
||||||
<FormBlockContext.Provider value={formCtx}>
|
<CollectionRecordProvider record={record}>
|
||||||
<SubFormProvider value={{ value: subFormValue, collection: subFormCollection }}>
|
<FormBlockContext.Provider value={formCtx}>
|
||||||
<FormActiveFieldsProvider
|
<SubFormProvider value={{ value: subFormValue, collection: subFormCollection }}>
|
||||||
name="form"
|
<FormActiveFieldsProvider
|
||||||
getActiveFieldsName={upLevelActiveFields?.getActiveFieldsName}
|
name="form"
|
||||||
>
|
getActiveFieldsName={upLevelActiveFields?.getActiveFieldsName}
|
||||||
<Router location={location} navigator={null}>
|
>
|
||||||
<BlockRequestContext_deprecated.Provider value={ctx}>
|
<Router location={location} navigator={null}>
|
||||||
<DataSourceApplicationProvider dataSourceManager={dm} dataSource={dataSourceKey}>
|
<BlockRequestContext_deprecated.Provider value={ctx}>
|
||||||
<AssociationOrCollectionProvider
|
<DataSourceApplicationProvider dataSourceManager={dm} dataSource={dataSourceKey}>
|
||||||
allowNull
|
<AssociationOrCollectionProvider
|
||||||
collection={collection.name}
|
allowNull
|
||||||
association={association}
|
collection={collection.name}
|
||||||
>
|
association={association}
|
||||||
<SchemaComponentOptions scope={options.scope} components={options.components}>
|
>
|
||||||
<FormLayout
|
<SchemaComponentOptions scope={options.scope} components={options.components}>
|
||||||
layout={'vertical'}
|
<FormLayout
|
||||||
className={css`
|
layout={'vertical'}
|
||||||
// screen > 576px
|
className={css`
|
||||||
@media (min-width: 576px) {
|
// screen > 576px
|
||||||
min-width: 520px;
|
@media (min-width: 576px) {
|
||||||
}
|
min-width: 520px;
|
||||||
|
}
|
||||||
|
|
||||||
// screen <= 576px
|
// screen <= 576px
|
||||||
@media (max-width: 576px) {
|
@media (max-width: 576px) {
|
||||||
min-width: 320px;
|
min-width: 320px;
|
||||||
}
|
}
|
||||||
`}
|
`}
|
||||||
>
|
>
|
||||||
<APIClientProvider apiClient={apiClient}>
|
<APIClientProvider apiClient={apiClient}>
|
||||||
<ConfigProvider locale={locale}>
|
<ConfigProvider locale={locale}>
|
||||||
<SchemaComponent components={components} scope={scope} schema={schema} />
|
<SchemaComponent components={components} scope={scope} schema={schema} />
|
||||||
</ConfigProvider>
|
</ConfigProvider>
|
||||||
</APIClientProvider>
|
</APIClientProvider>
|
||||||
</FormLayout>
|
</FormLayout>
|
||||||
</SchemaComponentOptions>
|
</SchemaComponentOptions>
|
||||||
</AssociationOrCollectionProvider>
|
</AssociationOrCollectionProvider>
|
||||||
</DataSourceApplicationProvider>
|
</DataSourceApplicationProvider>
|
||||||
</BlockRequestContext_deprecated.Provider>
|
</BlockRequestContext_deprecated.Provider>
|
||||||
</Router>
|
</Router>
|
||||||
</FormActiveFieldsProvider>
|
</FormActiveFieldsProvider>
|
||||||
</SubFormProvider>
|
</SubFormProvider>
|
||||||
</FormBlockContext.Provider>
|
</FormBlockContext.Provider>
|
||||||
</CollectionRecordProvider>
|
</CollectionRecordProvider>
|
||||||
|
</ApplicationContext.Provider>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
theme,
|
theme,
|
||||||
|
Loading…
Reference in New Issue
Block a user