refresh schema

This commit is contained in:
chenos 2021-07-30 21:48:59 +08:00
parent ab81afecfa
commit 57cc9e6081
2 changed files with 6 additions and 5 deletions

View File

@ -107,16 +107,17 @@ function LayoutWithMenu(props: LayoutWithMenuProps) {
}
function Content({ activeKey }) {
const { loading: collectionsLoading } = useCollectionsContext();
const { data = {}, loading } = useRequest(
const { designable } = useDesignableSwitchContext();
const { collections } = useCollectionsContext();
const { data = {}, loading, run } = useRequest(
`ui_schemas:getTree?filter[parentKey]=${activeKey}`,
{
refreshDeps: [activeKey],
refreshDeps: [activeKey, collections, designable],
formatResult: (result) => result?.data,
},
);
if (loading || collectionsLoading) {
if (loading) {
return <Spin />;
}

View File

@ -512,7 +512,7 @@ AddNew.CardItem = observer((props: any) => {
key={view.key}
title={view.title}
>
<Menu.ItemGroup key={`${view.key}-select`} title={'所属数据表'}>
<Menu.ItemGroup className={'display-fields'} key={`${view.key}-select`} title={'所属数据表'}>
{collections?.map((item) => (
<Menu.Item
style={{ minWidth: 150 }}