From 94aa2e61fb9c4db0f86727d24721a454d0d5c70a Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Fri, 22 Sep 2023 16:38:11 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E4=BF=AE=E6=94=B9=E4=BC=81=E6=A0=87?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../standard/EnterpriseStandardList.vue | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/views/enterpriseStandardLibrary/standard/EnterpriseStandardList.vue b/src/views/enterpriseStandardLibrary/standard/EnterpriseStandardList.vue index f535dd11..54a3ace1 100644 --- a/src/views/enterpriseStandardLibrary/standard/EnterpriseStandardList.vue +++ b/src/views/enterpriseStandardLibrary/standard/EnterpriseStandardList.vue @@ -170,7 +170,6 @@ import UserSelectModal from '../../../components/selection/UserSelectModal' // 配置标准弹框 import AllocationStandardDrawer from './modules/AllocationStandardDrawer' import { postDownFile } from '@/api/manage' -import Vue from 'vue' export default { name: 'EnterpriseStandardList', @@ -336,18 +335,18 @@ export default { document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display:none' }) postDownFile(this.url.exportXlsUrl, param).then((data) => { - if (!data || data.size === 0) { - Vue.prototype.$message.warning('文件下载失败') + if (!data) { + this.$message.warning('文件下载失败') return } if (typeof window.navigator.msSaveBlob !== 'undefined') { - window.navigator.msSaveBlob(new Blob([data]), fileName + '.zip') + window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx') } else { - const url = window.URL.createObjectURL(new Blob([data])) + const url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' })) const link = document.createElement('a') link.style.display = 'none' link.href = url - link.setAttribute('download', fileName + '.zip') + link.setAttribute('download', fileName + '.xlsx') document.body.appendChild(link) link.click() document.body.removeChild(link) // 下载完成移除元素