diff --git a/src/components/ma-crud/components/import.vue b/src/components/ma-crud/components/import.vue index 27c07799..99ccfcdc 100644 --- a/src/components/ma-crud/components/import.vue +++ b/src/components/ma-crud/components/import.vue @@ -37,6 +37,7 @@ import { Message } from '@arco-design/web-vue' const visible = ref(false) const options = inject('options') +const emit = defineEmits(['success']) const open = () => visible.value = true const close = () => visible.value = false @@ -46,8 +47,9 @@ const upload = (fileOption) => { const dataForm = new FormData() dataForm.append('file', fileOption.fileItem.file) - commonApi.importExcel(options.import.url, dataForm).then( res => { + commonApi.importExcel(options.import.url, dataForm).then( async res => { res.success && Message.success(res.message || '导入成功') + emit('success') close() }) } diff --git a/src/components/ma-crud/index.vue b/src/components/ma-crud/index.vue index 589d6568..a6507099 100644 --- a/src/components/ma-crud/index.vue +++ b/src/components/ma-crud/index.vue @@ -244,7 +244,7 @@ - +