From ae6ea41c5227861e1ed7980894b3696dc16c72af Mon Sep 17 00:00:00 2001 From: chenos Date: Mon, 7 Dec 2020 17:25:36 +0800 Subject: [PATCH] feat: menu sync & refresh --- packages/app/src/components/views/Details.tsx | 11 ++++-- .../src/components/views/Form/DrawerForm.tsx | 2 + .../app/src/components/views/SimpleTable.tsx | 3 ++ .../plugin-pages/src/collections/pages.ts | 1 + packages/plugin-pages/src/server.ts | 37 +++++++++++++++++++ 5 files changed, 51 insertions(+), 3 deletions(-) diff --git a/packages/app/src/components/views/Details.tsx b/packages/app/src/components/views/Details.tsx index c123e5ca2..20e77b3f4 100644 --- a/packages/app/src/components/views/Details.tsx +++ b/packages/app/src/components/views/Details.tsx @@ -26,9 +26,14 @@ export function Details(props: any) { const { actions = [], fields = [] } = props.schema; return ( - { - refresh(); - }} style={{ marginBottom: 14 }} actions={actions}/> + { + refresh(); + }} + style={{ marginBottom: 14 }} + actions={actions} + /> {loading ? : ( {fields.map((field: any) => { diff --git a/packages/app/src/components/views/Form/DrawerForm.tsx b/packages/app/src/components/views/Form/DrawerForm.tsx index e133ce84d..a7065834a 100644 --- a/packages/app/src/components/views/Form/DrawerForm.tsx +++ b/packages/app/src/components/views/Form/DrawerForm.tsx @@ -76,6 +76,8 @@ export const DrawerForm = forwardRef((props: any, ref) => { }); } setVisible(false); + // @ts-ignore + window.routesReload && window.routesReload(); onFinish && onFinish(values); }}>提交 ]} diff --git a/packages/app/src/components/views/SimpleTable.tsx b/packages/app/src/components/views/SimpleTable.tsx index 6bdd5417e..710c0d7e1 100644 --- a/packages/app/src/components/views/SimpleTable.tsx +++ b/packages/app/src/components/views/SimpleTable.tsx @@ -77,6 +77,9 @@ export function SimpleTable(props: SimpleTableProps) { mode={'update'} viewName={rowViewName} reference={drawerRef} + onFinish={() => { + refresh(); + }} />