mirror of
https://gitee.com/x-extends/vxe-table-plugin-export-xlsx.git
synced 2026-01-21 05:21:33 +08:00
优化导出
This commit is contained in:
8
index.ts
8
index.ts
@@ -117,6 +117,7 @@ function exportXLSX (params: InterceptorExportParams) {
|
||||
const { $vxe, rowHeight, headerAlign: allHeaderAlign, align: allAlign, footerAlign: allFooterAlign } = $table
|
||||
const { modal, t } = $vxe
|
||||
const { message, sheetName, isHeader, isFooter, isMerge, isColgroup, original, useStyle, sheetMethod } = options
|
||||
const _isCustomColumn: boolean = (options as any)._isCustomColumn
|
||||
const showMsg = message !== false
|
||||
const mergeCells = $table.getMergeCells()
|
||||
const colList: any[] = []
|
||||
@@ -162,7 +163,7 @@ function exportXLSX (params: InterceptorExportParams) {
|
||||
beforeRowCount += colList.length
|
||||
}
|
||||
// 处理合并
|
||||
if (isMerge) {
|
||||
if (isMerge && !_isCustomColumn) {
|
||||
mergeCells.forEach(mergeItem => {
|
||||
const { row: mergeRowIndex, rowspan: mergeRowspan, col: mergeColIndex, colspan: mergeColspan } = mergeItem
|
||||
sheetMerges.push({
|
||||
@@ -185,7 +186,7 @@ function exportXLSX (params: InterceptorExportParams) {
|
||||
const footers = getFooterData(options, footerData)
|
||||
const mergeFooterItems = $table.getMergeFooterItems()
|
||||
// 处理合并
|
||||
if (isMerge) {
|
||||
if (isMerge && !_isCustomColumn) {
|
||||
mergeFooterItems.forEach(mergeItem => {
|
||||
const { row: mergeRowIndex, rowspan: mergeRowspan, col: mergeColIndex, colspan: mergeColspan } = mergeItem
|
||||
sheetMerges.push({
|
||||
@@ -282,7 +283,8 @@ function exportXLSX (params: InterceptorExportParams) {
|
||||
})
|
||||
})
|
||||
}
|
||||
if (useStyle && sheetMethod) {
|
||||
// 自定义处理
|
||||
if (sheetMethod) {
|
||||
const sParams = { options: options as any, workbook, worksheet: sheet, columns, colgroups, datas, $table }
|
||||
sheetMethod(sParams)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vxe-table-plugin-export-xlsx",
|
||||
"version": "2.2.3",
|
||||
"version": "2.2.4",
|
||||
"description": "基于 vxe-table 的表格插件,支持导出 xlsx 格式",
|
||||
"scripts": {
|
||||
"lib": "gulp build"
|
||||
|
||||
Reference in New Issue
Block a user