Skip to content

Commit

Permalink
fix: 导入完成后未刷新数据
Browse files Browse the repository at this point in the history
  • Loading branch information
kanyxmo committed Apr 10, 2024
1 parent 8f6f6b0 commit eae4745
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/ma-crud/components/import.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ma-crud/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
</template>
</ma-form>

<ma-import ref="crudImportRef" />
<ma-import ref="crudImportRef" @success="refresh"/>

<ma-context-menu ref="crudContextMenuRef" @execCommand="execContextMenuCommand" />

Expand Down

0 comments on commit eae4745

Please sign in to comment.