fix: data source add field refresh(T-3253) (#3645)
This commit is contained in:
		
							parent
							
								
									37b97c6e52
								
							
						
					
					
						commit
						de6e8469d3
					
				@ -22,6 +22,7 @@ import {
 | 
				
			|||||||
  useCurrentAppInfo,
 | 
					  useCurrentAppInfo,
 | 
				
			||||||
  useAPIClient,
 | 
					  useAPIClient,
 | 
				
			||||||
  useFieldInterfaceOptions,
 | 
					  useFieldInterfaceOptions,
 | 
				
			||||||
 | 
					  useDataSourceManager,
 | 
				
			||||||
} from '@nocobase/client';
 | 
					} from '@nocobase/client';
 | 
				
			||||||
import { ForeignKey } from './components';
 | 
					import { ForeignKey } from './components';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -157,6 +158,7 @@ const useCreateCollectionField = () => {
 | 
				
			|||||||
  const api = useAPIClient();
 | 
					  const api = useAPIClient();
 | 
				
			||||||
  const record = useRecord();
 | 
					  const record = useRecord();
 | 
				
			||||||
  const { name: dataSourceKey } = useParams();
 | 
					  const { name: dataSourceKey } = useParams();
 | 
				
			||||||
 | 
					  const dm = useDataSourceManager();
 | 
				
			||||||
  return {
 | 
					  return {
 | 
				
			||||||
    async run() {
 | 
					    async run() {
 | 
				
			||||||
      await form.submit();
 | 
					      await form.submit();
 | 
				
			||||||
@ -176,6 +178,7 @@ const useCreateCollectionField = () => {
 | 
				
			|||||||
          data: values,
 | 
					          data: values,
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        ctx.setVisible(false);
 | 
					        ctx.setVisible(false);
 | 
				
			||||||
 | 
					        dm.getDataSource(dataSourceKey).reload();
 | 
				
			||||||
        await form.reset();
 | 
					        await form.reset();
 | 
				
			||||||
        field.data.loading = false;
 | 
					        field.data.loading = false;
 | 
				
			||||||
        refresh();
 | 
					        refresh();
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user