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
@@ -119,6 +119,7 @@ function exportXLSX (params: VxeGlobalInterceptorHandles.InterceptorExportParams
|
||||
const { headerAlign: allHeaderAlign, align: allAlign, footerAlign: allFooterAlign } = props
|
||||
const { rowHeight } = reactData
|
||||
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[] = []
|
||||
@@ -164,7 +165,7 @@ function exportXLSX (params: VxeGlobalInterceptorHandles.InterceptorExportParams
|
||||
beforeRowCount += colList.length
|
||||
}
|
||||
// 处理合并
|
||||
if (isMerge) {
|
||||
if (isMerge && !_isCustomColumn) {
|
||||
mergeCells.forEach(mergeItem => {
|
||||
const { row: mergeRowIndex, rowspan: mergeRowspan, col: mergeColIndex, colspan: mergeColspan } = mergeItem
|
||||
sheetMerges.push({
|
||||
@@ -187,7 +188,7 @@ function exportXLSX (params: VxeGlobalInterceptorHandles.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({
|
||||
@@ -288,7 +289,8 @@ function exportXLSX (params: VxeGlobalInterceptorHandles.InterceptorExportParams
|
||||
})
|
||||
})
|
||||
}
|
||||
if (useStyle && sheetMethod) {
|
||||
// 自定义处理
|
||||
if (sheetMethod) {
|
||||
sheetMethod({ options: options, workbook, worksheet: sheet, columns, colgroups, datas, $table })
|
||||
}
|
||||
sheetMerges.forEach(({ s, e }) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vxe-table-plugin-export-xlsx",
|
||||
"version": "3.0.5",
|
||||
"version": "3.0.7",
|
||||
"description": "基于 vxe-table 的表格插件,支持导出 xlsx 格式",
|
||||
"scripts": {
|
||||
"lib": "gulp build"
|
||||
@@ -50,7 +50,7 @@
|
||||
"sass": "^1.55.0",
|
||||
"typescript": "^4.6.4",
|
||||
"vue": "^3.3.4",
|
||||
"vxe-table": "^4.4.5",
|
||||
"vxe-table": "^4.4.6",
|
||||
"xe-utils": "^3.5.11"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
Reference in New Issue
Block a user