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 }) { function Content({ activeKey }) {
const { loading: collectionsLoading } = useCollectionsContext(); const { designable } = useDesignableSwitchContext();
const { data = {}, loading } = useRequest( const { collections } = useCollectionsContext();
const { data = {}, loading, run } = useRequest(
`ui_schemas:getTree?filter[parentKey]=${activeKey}`, `ui_schemas:getTree?filter[parentKey]=${activeKey}`,
{ {
refreshDeps: [activeKey], refreshDeps: [activeKey, collections, designable],
formatResult: (result) => result?.data, formatResult: (result) => result?.data,
}, },
); );
if (loading || collectionsLoading) { if (loading) {
return <Spin />; return <Spin />;
} }

View File

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