vxe-table 4.7.17-beta.3 → 4.7.18-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/table/module/export/hook.js +17 -11
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +28 -22
- package/lib/index.umd.min.js +1 -1
- package/lib/table/module/export/hook.js +25 -19
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/table/module/export/hook.ts +17 -11
|
@@ -435,7 +435,7 @@ hooks.add('tableExportModule', {
|
|
|
435
435
|
}
|
|
436
436
|
return getLabelData(opts, columns, datas);
|
|
437
437
|
};
|
|
438
|
-
const getFooterCellValue = (opts,
|
|
438
|
+
const getFooterCellValue = (opts, row, column) => {
|
|
439
439
|
const columnOpts = computeColumnOpts.value;
|
|
440
440
|
const renderOpts = column.editRender || column.cellRender;
|
|
441
441
|
let footLabelMethod = column.footerExportMethod;
|
|
@@ -449,8 +449,14 @@ hooks.add('tableExportModule', {
|
|
|
449
449
|
footLabelMethod = columnOpts.footerExportMethod;
|
|
450
450
|
}
|
|
451
451
|
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
452
|
-
|
|
453
|
-
|
|
452
|
+
if (footLabelMethod) {
|
|
453
|
+
return footLabelMethod({ $table: $xeTable, items: row, itemIndex: _columnIndex, row, _columnIndex, column, options: opts });
|
|
454
|
+
}
|
|
455
|
+
// 兼容老模式
|
|
456
|
+
if (XEUtils.isArray(row)) {
|
|
457
|
+
return XEUtils.toValueString(row[_columnIndex]);
|
|
458
|
+
}
|
|
459
|
+
return XEUtils.get(row, column.field);
|
|
454
460
|
};
|
|
455
461
|
const toCsv = (opts, columns, datas) => {
|
|
456
462
|
let content = csvBOM;
|
|
@@ -463,8 +469,8 @@ hooks.add('tableExportModule', {
|
|
|
463
469
|
if (opts.isFooter) {
|
|
464
470
|
const { footerTableData } = reactData;
|
|
465
471
|
const footers = getFooterData(opts, footerTableData);
|
|
466
|
-
footers.forEach((
|
|
467
|
-
content += columns.map((column) => toTxtCellLabel(getFooterCellValue(opts,
|
|
472
|
+
footers.forEach((row) => {
|
|
473
|
+
content += columns.map((column) => toTxtCellLabel(getFooterCellValue(opts, row, column))).join(',') + enterSymbol;
|
|
468
474
|
});
|
|
469
475
|
}
|
|
470
476
|
return content;
|
|
@@ -480,8 +486,8 @@ hooks.add('tableExportModule', {
|
|
|
480
486
|
if (opts.isFooter) {
|
|
481
487
|
const { footerTableData } = reactData;
|
|
482
488
|
const footers = getFooterData(opts, footerTableData);
|
|
483
|
-
footers.forEach((
|
|
484
|
-
content += columns.map((column) => toTxtCellLabel(getFooterCellValue(opts,
|
|
489
|
+
footers.forEach((row) => {
|
|
490
|
+
content += columns.map((column) => toTxtCellLabel(getFooterCellValue(opts, row, column))).join(',') + enterSymbol;
|
|
485
491
|
});
|
|
486
492
|
}
|
|
487
493
|
return content;
|
|
@@ -639,11 +645,11 @@ hooks.add('tableExportModule', {
|
|
|
639
645
|
const footers = getFooterData(opts, footerTableData);
|
|
640
646
|
if (footers.length) {
|
|
641
647
|
tables.push('<tfoot>');
|
|
642
|
-
footers.forEach((
|
|
648
|
+
footers.forEach((row) => {
|
|
643
649
|
tables.push(`<tr>${columns.map((column) => {
|
|
644
650
|
const footAlign = column.footerAlign || column.align || allFooterAlign || allAlign;
|
|
645
651
|
const classNames = hasEllipsis(column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : [];
|
|
646
|
-
const cellValue = getFooterCellValue(opts,
|
|
652
|
+
const cellValue = getFooterCellValue(opts, row, column);
|
|
647
653
|
if (footAlign) {
|
|
648
654
|
classNames.push(`col--${footAlign}`);
|
|
649
655
|
}
|
|
@@ -687,8 +693,8 @@ hooks.add('tableExportModule', {
|
|
|
687
693
|
if (opts.isFooter) {
|
|
688
694
|
const { footerTableData } = reactData;
|
|
689
695
|
const footers = getFooterData(opts, footerTableData);
|
|
690
|
-
footers.forEach((
|
|
691
|
-
xml += `<Row>${columns.map((column) => `<Cell><Data ss:Type="String">${getFooterCellValue(opts,
|
|
696
|
+
footers.forEach((row) => {
|
|
697
|
+
xml += `<Row>${columns.map((column) => `<Cell><Data ss:Type="String">${getFooterCellValue(opts, row, column)}</Data></Cell>`).join('')}</Row>`;
|
|
692
698
|
});
|
|
693
699
|
}
|
|
694
700
|
return `${xml}</Table></Worksheet></Workbook>`;
|
package/es/ui/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VxeUI } from '@vxe-ui/core';
|
|
2
2
|
import { getFuncText } from './src/utils';
|
|
3
|
-
VxeUI.version = "4.7.
|
|
4
|
-
VxeUI.tableVersion = "4.7.
|
|
3
|
+
VxeUI.version = "4.7.18-beta.0";
|
|
4
|
+
VxeUI.tableVersion = "4.7.18-beta.0";
|
|
5
5
|
VxeUI.setConfig({
|
|
6
6
|
emptyCell: ' ',
|
|
7
7
|
table: {
|
package/es/ui/src/log.js
CHANGED
package/lib/index.umd.js
CHANGED
|
@@ -1949,8 +1949,8 @@ function eqEmptyValue(cellValue) {
|
|
|
1949
1949
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
1950
1950
|
|
|
1951
1951
|
|
|
1952
|
-
core_.VxeUI.version = "4.7.
|
|
1953
|
-
core_.VxeUI.tableVersion = "4.7.
|
|
1952
|
+
core_.VxeUI.version = "4.7.18-beta.0";
|
|
1953
|
+
core_.VxeUI.tableVersion = "4.7.18-beta.0";
|
|
1954
1954
|
core_.VxeUI.setConfig({
|
|
1955
1955
|
emptyCell: ' ',
|
|
1956
1956
|
table: {
|
|
@@ -2253,7 +2253,7 @@ var es_array_push = __webpack_require__(4114);
|
|
|
2253
2253
|
const {
|
|
2254
2254
|
log: log_log
|
|
2255
2255
|
} = core_.VxeUI;
|
|
2256
|
-
const version = `table v${"4.7.
|
|
2256
|
+
const version = `table v${"4.7.18-beta.0"}`;
|
|
2257
2257
|
const warnLog = log_log.create('warn', version);
|
|
2258
2258
|
const errLog = log_log.create('error', version);
|
|
2259
2259
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -18408,7 +18408,7 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
18408
18408
|
}
|
|
18409
18409
|
return getLabelData(opts, columns, datas);
|
|
18410
18410
|
};
|
|
18411
|
-
const getFooterCellValue = (opts,
|
|
18411
|
+
const getFooterCellValue = (opts, row, column) => {
|
|
18412
18412
|
const columnOpts = computeColumnOpts.value;
|
|
18413
18413
|
const renderOpts = column.editRender || column.cellRender;
|
|
18414
18414
|
let footLabelMethod = column.footerExportMethod;
|
|
@@ -18422,16 +18422,22 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
18422
18422
|
footLabelMethod = columnOpts.footerExportMethod;
|
|
18423
18423
|
}
|
|
18424
18424
|
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
18425
|
-
|
|
18426
|
-
|
|
18427
|
-
|
|
18428
|
-
|
|
18429
|
-
|
|
18430
|
-
|
|
18431
|
-
|
|
18432
|
-
|
|
18433
|
-
|
|
18434
|
-
|
|
18425
|
+
if (footLabelMethod) {
|
|
18426
|
+
return footLabelMethod({
|
|
18427
|
+
$table: $xeTable,
|
|
18428
|
+
items: row,
|
|
18429
|
+
itemIndex: _columnIndex,
|
|
18430
|
+
row,
|
|
18431
|
+
_columnIndex,
|
|
18432
|
+
column,
|
|
18433
|
+
options: opts
|
|
18434
|
+
});
|
|
18435
|
+
}
|
|
18436
|
+
// 兼容老模式
|
|
18437
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(row)) {
|
|
18438
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(row[_columnIndex]);
|
|
18439
|
+
}
|
|
18440
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
|
|
18435
18441
|
};
|
|
18436
18442
|
const toCsv = (opts, columns, datas) => {
|
|
18437
18443
|
let content = csvBOM;
|
|
@@ -18446,8 +18452,8 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
18446
18452
|
footerTableData
|
|
18447
18453
|
} = reactData;
|
|
18448
18454
|
const footers = getFooterData(opts, footerTableData);
|
|
18449
|
-
footers.forEach(
|
|
18450
|
-
content += columns.map(column => toTxtCellLabel(getFooterCellValue(opts,
|
|
18455
|
+
footers.forEach(row => {
|
|
18456
|
+
content += columns.map(column => toTxtCellLabel(getFooterCellValue(opts, row, column))).join(',') + enterSymbol;
|
|
18451
18457
|
});
|
|
18452
18458
|
}
|
|
18453
18459
|
return content;
|
|
@@ -18465,8 +18471,8 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
18465
18471
|
footerTableData
|
|
18466
18472
|
} = reactData;
|
|
18467
18473
|
const footers = getFooterData(opts, footerTableData);
|
|
18468
|
-
footers.forEach(
|
|
18469
|
-
content += columns.map(column => toTxtCellLabel(getFooterCellValue(opts,
|
|
18474
|
+
footers.forEach(row => {
|
|
18475
|
+
content += columns.map(column => toTxtCellLabel(getFooterCellValue(opts, row, column))).join(',') + enterSymbol;
|
|
18470
18476
|
});
|
|
18471
18477
|
}
|
|
18472
18478
|
return content;
|
|
@@ -18642,11 +18648,11 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
18642
18648
|
const footers = getFooterData(opts, footerTableData);
|
|
18643
18649
|
if (footers.length) {
|
|
18644
18650
|
tables.push('<tfoot>');
|
|
18645
|
-
footers.forEach(
|
|
18651
|
+
footers.forEach(row => {
|
|
18646
18652
|
tables.push(`<tr>${columns.map(column => {
|
|
18647
18653
|
const footAlign = column.footerAlign || column.align || allFooterAlign || allAlign;
|
|
18648
18654
|
const classNames = hasEllipsis(column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : [];
|
|
18649
|
-
const cellValue = getFooterCellValue(opts,
|
|
18655
|
+
const cellValue = getFooterCellValue(opts, row, column);
|
|
18650
18656
|
if (footAlign) {
|
|
18651
18657
|
classNames.push(`col--${footAlign}`);
|
|
18652
18658
|
}
|
|
@@ -18674,8 +18680,8 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
18674
18680
|
footerTableData
|
|
18675
18681
|
} = reactData;
|
|
18676
18682
|
const footers = getFooterData(opts, footerTableData);
|
|
18677
|
-
footers.forEach(
|
|
18678
|
-
xml += `<Row>${columns.map(column => `<Cell><Data ss:Type="String">${getFooterCellValue(opts,
|
|
18683
|
+
footers.forEach(row => {
|
|
18684
|
+
xml += `<Row>${columns.map(column => `<Cell><Data ss:Type="String">${getFooterCellValue(opts, row, column)}</Data></Cell>`).join('')}</Row>`;
|
|
18679
18685
|
});
|
|
18680
18686
|
}
|
|
18681
18687
|
return `${xml}</Table></Worksheet></Workbook>`;
|