Skip to content

Commit 7a20361

Browse files
committed
releases 4.13.31
1 parent 26e6fb9 commit 7a20361

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vxe-table",
3-
"version": "4.13.30",
3+
"version": "4.13.31",
44
"description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟树、拖拽排序,懒加载、快捷菜单、数据校验、树形结构、打印、导入导出、自定义模板、渲染器、JSON 配置式...",
55
"scripts": {
66
"update": "npm install --legacy-peer-deps",

packages/table/module/export/hook.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const csvBOM = '\ufeff'
1717
const enterSymbol = '\r\n'
1818

1919
function defaultFilterExportColumn (column: VxeTableDefines.ColumnInfo) {
20-
return !!column.field || ['seq', 'checkbox', 'radio'].indexOf(column.type || '') > -1
20+
return !!column.field || ['seq', 'checkbox', 'radio'].indexOf(column.type || '') === -1
2121
}
2222

2323
const getConvertColumns = (columns: any) => {
@@ -1178,9 +1178,13 @@ hooks.add('tableExportModule', {
11781178
if (!mode) {
11791179
mode = selectRecords.length ? 'selected' : 'current'
11801180
}
1181-
const customCols = columns && columns.length
1182-
? columns
1183-
: XEUtils.searchTree(collectColumn, column => {
1181+
let isCustomCol = false
1182+
let customCols = []
1183+
if (columns && columns.length) {
1184+
isCustomCol = true
1185+
customCols = columns
1186+
} else {
1187+
customCols = XEUtils.searchTree(collectColumn, column => {
11841188
const isColGroup = column.children && column.children.length > 0
11851189
let isChecked = false
11861190
if (columns && columns.length) {
@@ -1192,9 +1196,10 @@ hooks.add('tableExportModule', {
11921196
}
11931197
return isChecked
11941198
}, { children: 'children', mapChildren: 'childNodes', original: true })
1199+
}
11951200
const handleOptions: VxeTablePropTypes.ExportHandleOptions = Object.assign({ } as { data: any[], colgroups: any[], columns: any[] }, opts, { filename: '', sheetName: '' })
11961201
// 如果设置源数据,则默认导出设置了字段的列
1197-
if (!customCols && !columnFilterMethod) {
1202+
if (!isCustomCol && !columnFilterMethod) {
11981203
columnFilterMethod = ({ column }) => {
11991204
if (excludeFields) {
12001205
if (XEUtils.includes(excludeFields, column.field)) {

0 commit comments

Comments
 (0)