diff --git a/gulpfile.js b/gulpfile.js index f69061c..921e14e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -40,7 +40,7 @@ gulp.task('build_umd', function () { globals: { [pack.name]: exportModuleName, 'xe-utils': 'XEUtils', - 'xlsx': 'XLSX' + 'exceljs': 'ExcelJS' }, exactGlobals: true }] diff --git a/index.ts b/index.ts index aea6d58..3fa7f69 100644 --- a/index.ts +++ b/index.ts @@ -27,13 +27,6 @@ function getFooterData (opts: TableExportConfig, footerData: any[][]) { return footerFilterMethod ? footerData.filter((items, index) => footerFilterMethod({ items, $rowIndex: index })) : footerData } -function toBuffer (wbout: any) { - const buf = new ArrayBuffer(wbout.length) - const view = new Uint8Array(buf) - for (let index = 0; index !== wbout.length; ++index) view[index] = wbout.charCodeAt(index) & 0xFF - return buf -} - function getCellLabel (column: ColumnConfig, cellValue: any) { if (cellValue) { switch (column.cellType) { @@ -283,7 +276,7 @@ function exportXLSX (params: InterceptorExportParams) { }) } if (useStyle && sheetMethod) { - sheetMethod({ options, workbook, worksheet: sheet }) + sheetMethod({ options, workbook, worksheet: sheet, columns, colgroups, datas, $table }) } sheetMerges.forEach(({ s, e }) => { sheet.mergeCells(s.r + 1, s.c + 1, e.r + 1, e.c + 1)