1
0
mirror of synced 2025-12-09 06:48:06 +08:00

优化导出

This commit is contained in:
xuliangzhan
2023-07-08 14:10:47 +08:00
parent 05c3679309
commit f867b8e33b
2 changed files with 7 additions and 5 deletions

View File

@@ -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 }) => {