@@ -17,7 +17,7 @@ const csvBOM = '\ufeff'
17
17
const enterSymbol = '\r\n'
18
18
19
19
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
21
21
}
22
22
23
23
const getConvertColumns = ( columns : any ) => {
@@ -1178,9 +1178,13 @@ hooks.add('tableExportModule', {
1178
1178
if ( ! mode ) {
1179
1179
mode = selectRecords . length ? 'selected' : 'current'
1180
1180
}
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 => {
1184
1188
const isColGroup = column . children && column . children . length > 0
1185
1189
let isChecked = false
1186
1190
if ( columns && columns . length ) {
@@ -1192,9 +1196,10 @@ hooks.add('tableExportModule', {
1192
1196
}
1193
1197
return isChecked
1194
1198
} , { children : 'children' , mapChildren : 'childNodes' , original : true } )
1199
+ }
1195
1200
const handleOptions : VxeTablePropTypes . ExportHandleOptions = Object . assign ( { } as { data : any [ ] , colgroups : any [ ] , columns : any [ ] } , opts , { filename : '' , sheetName : '' } )
1196
1201
// 如果设置源数据,则默认导出设置了字段的列
1197
- if ( ! customCols && ! columnFilterMethod ) {
1202
+ if ( ! isCustomCol && ! columnFilterMethod ) {
1198
1203
columnFilterMethod = ( { column } ) => {
1199
1204
if ( excludeFields ) {
1200
1205
if ( XEUtils . includes ( excludeFields , column . field ) ) {
0 commit comments