diff --git a/packages/core/client/src/collection-manager/Configuration/SyncFieldsAction.tsx b/packages/core/client/src/collection-manager/Configuration/SyncFieldsAction.tsx index 98786f22b4..52c0ff3390 100644 --- a/packages/core/client/src/collection-manager/Configuration/SyncFieldsAction.tsx +++ b/packages/core/client/src/collection-manager/Configuration/SyncFieldsAction.tsx @@ -1,6 +1,6 @@ import { PlusOutlined } from '@ant-design/icons'; import { ArrayTable } from '@formily/antd'; -import { useForm } from '@formily/react'; +import { useForm, useField } from '@formily/react'; import { uid } from '@formily/shared'; import { Button } from 'antd'; import { cloneDeep } from 'lodash'; @@ -130,15 +130,19 @@ const useSyncFromDatabase = () => { const { targetKey } = useResourceContext(); const { [targetKey]: filterByTk } = useRecord(); const api = useAPIClient(); + const field = useField(); return { async run() { await form.submit(); + field.data = field.data || {}; + field.data.loading = true; await api.resource(`collections`).setFields({ filterByTk, values: form.values, }); ctx.setVisible(false); await form.reset(); + field.data.loading = false; refresh(); await refreshCM(); },