diff --git a/src/views/classMessage/classMessage/components/edit.vue b/src/views/classMessage/classMessage/components/edit.vue index 1a021bb..5ea6e94 100644 --- a/src/views/classMessage/classMessage/components/edit.vue +++ b/src/views/classMessage/classMessage/components/edit.vue @@ -317,19 +317,21 @@ export default { axios.get(config.httpurl + '/classMessage/excel?CLASS_MESSAGE_ID=' + id, { responseType: 'blob' }).then(res => { - const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }) - const downloadElement = document.createElement('a') - const href = window.URL.createObjectURL(blob) - downloadElement.style.display = 'none' - downloadElement.href = href - downloadElement.download = dayjs().format('YYYY-MM-DD HH:mm:ss') - document.body.appendChild(downloadElement) - downloadElement.click() - document.body.removeChild(downloadElement) - window.URL.revokeObjectURL(href) - this.$emit('getResult', '') - loading.close() - this.close() + setTimeout(() => { + const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }) + const downloadElement = document.createElement('a') + const href = window.URL.createObjectURL(blob) + downloadElement.style.display = 'none' + downloadElement.href = href + downloadElement.download = dayjs().format('YYYY-MM-DD HH:mm:ss') + document.body.appendChild(downloadElement) + downloadElement.click() + document.body.removeChild(downloadElement) + window.URL.revokeObjectURL(href) + this.$emit('getResult', '') + loading.close() + this.close() + }, 2000) }).catch((e) => { console.log(e) loading.close() @@ -362,6 +364,7 @@ export default { }) this.visible = false this.loading = false + this.close() this.$emit('getResult', '') }).catch((e) => { this.loading = false