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.
@@ -435,7 +435,7 @@ hooks.add('tableExportModule', {
435
435
  }
436
436
  return getLabelData(opts, columns, datas);
437
437
  };
438
- const getFooterCellValue = (opts, items, column) => {
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
- const cellValue = footLabelMethod ? footLabelMethod({ $table: $xeTable, items, itemIndex: _columnIndex, row: items, _columnIndex, column, options: opts }) : XEUtils.toValueString(items[_columnIndex]);
453
- return cellValue;
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((rows) => {
467
- content += columns.map((column) => toTxtCellLabel(getFooterCellValue(opts, rows, column))).join(',') + enterSymbol;
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((rows) => {
484
- content += columns.map((column) => toTxtCellLabel(getFooterCellValue(opts, rows, column))).join(',') + enterSymbol;
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((rows) => {
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, rows, column);
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((rows) => {
691
- xml += `<Row>${columns.map((column) => `<Cell><Data ss:Type="String">${getFooterCellValue(opts, rows, column)}</Data></Cell>`).join('')}</Row>`;
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.17-beta.3";
4
- VxeUI.tableVersion = "4.7.17-beta.3";
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
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"4.7.17-beta.3"}`;
3
+ const version = `table v${"4.7.18-beta.0"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
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.17-beta.3";
1953
- core_.VxeUI.tableVersion = "4.7.17-beta.3";
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.17-beta.3"}`;
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, items, column) => {
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
- const cellValue = footLabelMethod ? footLabelMethod({
18426
- $table: $xeTable,
18427
- items,
18428
- itemIndex: _columnIndex,
18429
- row: items,
18430
- _columnIndex,
18431
- column,
18432
- options: opts
18433
- }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(items[_columnIndex]);
18434
- return cellValue;
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(rows => {
18450
- content += columns.map(column => toTxtCellLabel(getFooterCellValue(opts, rows, column))).join(',') + enterSymbol;
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(rows => {
18469
- content += columns.map(column => toTxtCellLabel(getFooterCellValue(opts, rows, column))).join(',') + enterSymbol;
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(rows => {
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, rows, column);
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(rows => {
18678
- xml += `<Row>${columns.map(column => `<Cell><Data ss:Type="String">${getFooterCellValue(opts, rows, column)}</Data></Cell>`).join('')}</Row>`;
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>`;