diff --git a/src/utils/export.js b/src/utils/export.js index 7498ce435..b390e8d0b 100644 --- a/src/utils/export.js +++ b/src/utils/export.js @@ -1,5 +1,12 @@ const Excel = require('exceljs') +import { Loading } from 'element-ui'; export async function exportSheetExcel(luckysheet,name="file") { // 参数为luckysheet.getluckysheetfile()获取的对象 + let loadingInstance = Loading.service({ + lock: true, + text: 'Loading', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); // 1.创建工作簿,可以为工作簿添加属性 const workbook = new Excel.Workbook(); // 2.创建表格,第二个参数可以配置创建什么样的工作表 @@ -17,6 +24,7 @@ export async function exportSheetExcel(luckysheet,name="file") { // 参数为lu const buffer = await workbook.xlsx.writeBuffer(); // 5.保存为文件 saveFile(buffer,name); + await loadingInstance.close(); } var saveFile = function(buf,name) {