Browse Source

Project Init

yigeren911 1 year ago
parent
commit
7dd56f01fb
1 changed files with 6 additions and 9 deletions
  1. 6 9
      src/utils/excel.js

+ 6 - 9
src/utils/excel.js

@@ -1,16 +1,13 @@
 import * as XLSX from "xlsx";
 
 /**
- * @description:
- * @param {Object} json 服务端发过来的数据
- * @param {String} name 导出Excel文件名字
-
- * @param {Array} titleArr 导出Excel表头
-
- * @param {String} sheetName 导出sheetName名字
- * @return:
+ *
+ * @param json 数据源
+ * @param name 表名
+ * @param titleArr 列名集合
+ * @param sheetName 分页名
  */
-export const exportExcel = (json, name, titleArr, sheetName) => {
+export const exportExcel = (json, name, titleArr, sheetName = "") => {
   /* convert state to workbook */
   let data = new Array();
   let keyArray = new Array();