vxe-table 4.19.3 → 4.19.5
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/dist/all.esm.js +165 -27
- package/dist/style.css +1 -1
- package/es/locale/lang/ar-EG.js +2 -2
- package/es/locale/lang/de-DE.js +1 -1
- package/es/locale/lang/en-US.js +1 -1
- package/es/locale/lang/fr-FR.js +2 -2
- package/es/locale/lang/hu-HU.js +1 -1
- package/es/locale/lang/hy-AM.js +1 -1
- package/es/locale/lang/id-ID.js +2 -2
- package/es/locale/lang/it-IT.js +1 -1
- package/es/locale/lang/ko-KR.js +1 -1
- package/es/locale/lang/ms-MY.js +2 -2
- package/es/locale/lang/nb-NO.js +2 -2
- package/es/locale/lang/pt-BR.js +2 -2
- package/es/locale/lang/th-TH.js +1 -1
- package/es/locale/lang/ug-CN.js +1 -1
- package/es/locale/lang/uk-UA.js +1 -1
- package/es/locale/lang/uz-UZ.js +1 -1
- package/es/style.css +1 -1
- package/es/table/module/export/hook.js +73 -13
- package/es/table/src/cell.js +15 -8
- package/es/table/src/columnInfo.js +1 -4
- package/es/table/src/table.js +77 -0
- package/es/table/src/util.js +1 -0
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +127 -51
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +2 -2
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +2 -2
- package/lib/locale/lang/de-DE.js +1 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +1 -1
- package/lib/locale/lang/en-US.js +1 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +1 -1
- package/lib/locale/lang/fr-FR.js +2 -2
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +2 -2
- package/lib/locale/lang/hu-HU.js +1 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +1 -1
- package/lib/locale/lang/hy-AM.js +1 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +1 -1
- package/lib/locale/lang/id-ID.js +2 -2
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +2 -2
- package/lib/locale/lang/it-IT.js +1 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +1 -1
- package/lib/locale/lang/ko-KR.js +1 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +1 -1
- package/lib/locale/lang/ms-MY.js +2 -2
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +2 -2
- package/lib/locale/lang/nb-NO.js +2 -2
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +2 -2
- package/lib/locale/lang/pt-BR.js +2 -2
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -2
- package/lib/locale/lang/th-TH.js +1 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +1 -1
- package/lib/locale/lang/ug-CN.js +1 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +1 -1
- package/lib/locale/lang/uk-UA.js +1 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +1 -1
- package/lib/locale/lang/uz-UZ.js +1 -1
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/export/hook.js +106 -32
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/src/cell.js +14 -9
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -5
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/table.js +3 -3
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +1 -0
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +1 -1
- 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/locale/lang/ar-EG.ts +850 -850
- package/packages/locale/lang/de-DE.ts +850 -850
- package/packages/locale/lang/en-US.ts +850 -850
- package/packages/locale/lang/es-ES.ts +850 -850
- package/packages/locale/lang/fr-FR.ts +850 -850
- package/packages/locale/lang/hu-HU.ts +850 -850
- package/packages/locale/lang/hy-AM.ts +850 -850
- package/packages/locale/lang/id-ID.ts +850 -850
- package/packages/locale/lang/it-IT.ts +850 -850
- package/packages/locale/lang/ja-JP.ts +850 -850
- package/packages/locale/lang/ko-KR.ts +850 -850
- package/packages/locale/lang/ms-MY.ts +850 -850
- package/packages/locale/lang/nb-NO.ts +850 -850
- package/packages/locale/lang/pt-BR.ts +850 -850
- package/packages/locale/lang/ru-RU.ts +850 -850
- package/packages/locale/lang/th-TH.ts +850 -850
- package/packages/locale/lang/ug-CN.ts +850 -850
- package/packages/locale/lang/uk-UA.ts +850 -850
- package/packages/locale/lang/uz-UZ.ts +850 -850
- package/packages/locale/lang/vi-VN.ts +850 -850
- package/packages/locale/lang/zh-CHT.ts +850 -850
- package/packages/table/module/export/hook.ts +71 -13
- package/packages/table/src/cell.ts +14 -8
- package/packages/table/src/columnInfo.ts +1 -5
- package/packages/table/src/table.ts +75 -0
- package/packages/table/src/util.ts +1 -0
- /package/es/{iconfont.1779843543280.ttf → iconfont.1780200147870.ttf} +0 -0
- /package/es/{iconfont.1779843543280.woff → iconfont.1780200147870.woff} +0 -0
- /package/es/{iconfont.1779843543280.woff2 → iconfont.1780200147870.woff2} +0 -0
- /package/lib/{iconfont.1779843543280.ttf → iconfont.1780200147870.ttf} +0 -0
- /package/lib/{iconfont.1779843543280.woff → iconfont.1780200147870.woff} +0 -0
- /package/lib/{iconfont.1779843543280.woff2 → iconfont.1780200147870.woff2} +0 -0
|
@@ -278,7 +278,7 @@ hooks.add('tableExportModule', {
|
|
|
278
278
|
function getHeaderTitle(opts, column) {
|
|
279
279
|
const columnOpts = computeColumnOpts.value;
|
|
280
280
|
const headExportMethod = column.headerExportMethod || columnOpts.headerExportMethod;
|
|
281
|
-
return headExportMethod ? headExportMethod({ column, options: opts, $table: $xeTable }) : ((opts.isTitle ?
|
|
281
|
+
return headExportMethod ? headExportMethod({ column, options: opts, $table: $xeTable }) : ((opts.isTitle ? $xeTable.getHeaderCellLabel(column) : column.field) || '');
|
|
282
282
|
}
|
|
283
283
|
const toBooleanValue = (cellValue) => {
|
|
284
284
|
return XEUtils.isBoolean(cellValue) ? (cellValue ? 'TRUE' : 'FALSE') : cellValue;
|
|
@@ -287,9 +287,10 @@ hooks.add('tableExportModule', {
|
|
|
287
287
|
return eqEmptyValue(cellValue) ? '' : `${cellValue}`;
|
|
288
288
|
};
|
|
289
289
|
const getBodyLabelData = (opts, columns, datas) => {
|
|
290
|
-
const { isTreeAllExpanded, isRowGroupAllExpanded, mode } = opts;
|
|
290
|
+
const { isTreeAllExpanded, isRowGroupAllExpanded, mode: expMode } = opts;
|
|
291
291
|
const { treeConfig } = props;
|
|
292
292
|
const { isRowGroupStatus } = reactData;
|
|
293
|
+
const { fullColumnFieldData } = internalData;
|
|
293
294
|
const radioOpts = computeRadioOpts.value;
|
|
294
295
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
295
296
|
const treeOpts = computeTreeOpts.value;
|
|
@@ -301,7 +302,7 @@ hooks.add('tableExportModule', {
|
|
|
301
302
|
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
302
303
|
if (isRowGroupStatus) {
|
|
303
304
|
// 如果是数据分组
|
|
304
|
-
const { mapChildrenField } = aggregateOpts;
|
|
305
|
+
const { mode: aggMode, showTotal, totalMethod, countFields, contentMethod, formatValuesMethod, mapChildrenField } = aggregateOpts;
|
|
305
306
|
const rest = [];
|
|
306
307
|
const expandMaps = {};
|
|
307
308
|
const useMaps = {};
|
|
@@ -322,8 +323,9 @@ hooks.add('tableExportModule', {
|
|
|
322
323
|
_expand: hasRowChild && $xeTable.isRowExpandByRow(row)
|
|
323
324
|
};
|
|
324
325
|
columns.forEach((column, $columnIndex) => {
|
|
326
|
+
const { field, editRender, cellRender, aggFunc, rowGroupNode } = column;
|
|
325
327
|
let cellValue = '';
|
|
326
|
-
const renderOpts =
|
|
328
|
+
const renderOpts = editRender || cellRender;
|
|
327
329
|
let bodyExportMethod = column.exportMethod || columnOpts.exportMethod;
|
|
328
330
|
if (!bodyExportMethod && renderOpts && renderOpts.name) {
|
|
329
331
|
const compConf = renderer.get(renderOpts.name);
|
|
@@ -341,21 +343,77 @@ hooks.add('tableExportModule', {
|
|
|
341
343
|
switch (column.type) {
|
|
342
344
|
case 'seq': {
|
|
343
345
|
const seqVal = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('');
|
|
344
|
-
cellValue =
|
|
346
|
+
cellValue = expMode === 'all' ? seqVal : getSeq(seqVal, row, $rowIndex, column, $columnIndex);
|
|
345
347
|
break;
|
|
346
348
|
}
|
|
347
|
-
case 'checkbox':
|
|
349
|
+
case 'checkbox': {
|
|
348
350
|
cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row));
|
|
349
351
|
item._checkboxLabel = checkboxOpts.labelField ? XEUtils.get(row, checkboxOpts.labelField) : '';
|
|
350
352
|
item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ $table: $xeTable, row });
|
|
351
353
|
break;
|
|
352
|
-
|
|
354
|
+
}
|
|
355
|
+
case 'radio': {
|
|
353
356
|
cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row));
|
|
354
357
|
item._radioLabel = radioOpts.labelField ? XEUtils.get(row, radioOpts.labelField) : '';
|
|
355
358
|
item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ $table: $xeTable, row });
|
|
356
359
|
break;
|
|
357
|
-
|
|
358
|
-
|
|
360
|
+
}
|
|
361
|
+
default: {
|
|
362
|
+
if (field && row.isAggregate) {
|
|
363
|
+
const aggRow = row;
|
|
364
|
+
const aggData = aggRow.aggData;
|
|
365
|
+
const currAggData = aggData ? aggData[field] : null;
|
|
366
|
+
const groupField = aggRow.groupField;
|
|
367
|
+
const groupContent = aggRow.groupContent;
|
|
368
|
+
const childList = mapChildrenField ? (aggRow[mapChildrenField] || []) : [];
|
|
369
|
+
const childCount = aggRow.childCount;
|
|
370
|
+
const colRest = fullColumnFieldData[groupField] || {};
|
|
371
|
+
const ctParams = {
|
|
372
|
+
$table: $xeTable,
|
|
373
|
+
groupField,
|
|
374
|
+
groupColumn: (colRest ? colRest.column : null),
|
|
375
|
+
column,
|
|
376
|
+
groupValue: groupContent,
|
|
377
|
+
childList,
|
|
378
|
+
childCount,
|
|
379
|
+
aggValue: null,
|
|
380
|
+
/**
|
|
381
|
+
* 已废弃
|
|
382
|
+
* @deprecated
|
|
383
|
+
*/
|
|
384
|
+
children: childList,
|
|
385
|
+
/**
|
|
386
|
+
* 已废弃
|
|
387
|
+
* @deprecated
|
|
388
|
+
*/
|
|
389
|
+
totalValue: childCount
|
|
390
|
+
};
|
|
391
|
+
if (aggMode === 'column' ? field === aggRow.groupField : rowGroupNode) {
|
|
392
|
+
cellValue = groupContent;
|
|
393
|
+
if (contentMethod) {
|
|
394
|
+
cellValue = `${contentMethod(ctParams)}`;
|
|
395
|
+
}
|
|
396
|
+
if (showTotal) {
|
|
397
|
+
cellValue = getI18n('vxe.table.rowGroupContentTotal', [cellValue, totalMethod ? totalMethod(ctParams) : childCount, childCount]);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
else if ($xeTable.getPivotTableAggregateCellAggValue) {
|
|
401
|
+
const aggParams = {
|
|
402
|
+
$table: $xeTable,
|
|
403
|
+
row,
|
|
404
|
+
column
|
|
405
|
+
};
|
|
406
|
+
cellValue = $xeTable.getPivotTableAggregateCellAggValue(aggParams);
|
|
407
|
+
}
|
|
408
|
+
else if (aggFunc === true || (countFields && countFields.includes(field))) {
|
|
409
|
+
cellValue = currAggData ? currAggData.value : childCount;
|
|
410
|
+
ctParams.aggValue = cellValue;
|
|
411
|
+
if (formatValuesMethod) {
|
|
412
|
+
cellValue = formatValuesMethod(ctParams);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
else if (opts.original) {
|
|
359
417
|
cellValue = getCellValue(row, column);
|
|
360
418
|
}
|
|
361
419
|
else {
|
|
@@ -371,6 +429,8 @@ hooks.add('tableExportModule', {
|
|
|
371
429
|
}
|
|
372
430
|
}
|
|
373
431
|
}
|
|
432
|
+
break;
|
|
433
|
+
}
|
|
374
434
|
}
|
|
375
435
|
}
|
|
376
436
|
item[column.id] = toStringValue(cellValue);
|
|
@@ -426,7 +486,7 @@ hooks.add('tableExportModule', {
|
|
|
426
486
|
switch (column.type) {
|
|
427
487
|
case 'seq': {
|
|
428
488
|
const seqVal = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('');
|
|
429
|
-
cellValue =
|
|
489
|
+
cellValue = expMode === 'all' ? seqVal : getSeq(seqVal, row, $rowIndex, column, $columnIndex);
|
|
430
490
|
break;
|
|
431
491
|
}
|
|
432
492
|
case 'checkbox':
|
|
@@ -490,7 +550,7 @@ hooks.add('tableExportModule', {
|
|
|
490
550
|
switch (column.type) {
|
|
491
551
|
case 'seq': {
|
|
492
552
|
const seqValue = $rowIndex + 1;
|
|
493
|
-
cellValue =
|
|
553
|
+
cellValue = expMode === 'all' ? seqValue : getSeq(seqValue, row, $rowIndex, column, $columnIndex);
|
|
494
554
|
break;
|
|
495
555
|
}
|
|
496
556
|
case 'checkbox':
|
|
@@ -872,12 +932,12 @@ hooks.add('tableExportModule', {
|
|
|
872
932
|
const tableTitleMaps = {};
|
|
873
933
|
tableFullColumn.forEach((column) => {
|
|
874
934
|
const field = column.field;
|
|
875
|
-
const title =
|
|
935
|
+
const title = $xeTable.getHeaderCellLabel(column);
|
|
876
936
|
if (field) {
|
|
877
937
|
tableFieldMaps[field] = column;
|
|
878
938
|
}
|
|
879
939
|
if (title) {
|
|
880
|
-
tableTitleMaps[
|
|
940
|
+
tableTitleMaps[title] = column;
|
|
881
941
|
}
|
|
882
942
|
});
|
|
883
943
|
const tableConf = {
|
package/es/table/src/cell.js
CHANGED
|
@@ -356,7 +356,7 @@ export const Cell = {
|
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
return renderTitleContent(params,
|
|
359
|
+
return renderTitleContent(params, $table.getHeaderCellLabel(column));
|
|
360
360
|
},
|
|
361
361
|
renderDefaultHeader(params) {
|
|
362
362
|
return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params));
|
|
@@ -368,7 +368,7 @@ export const Cell = {
|
|
|
368
368
|
const tableInternalData = $table.internalData;
|
|
369
369
|
const { isRowGroupStatus } = tableReactData;
|
|
370
370
|
const { editConfig } = tableProps;
|
|
371
|
-
const { field, slots, editRender, cellRender, rowGroupNode, aggFunc
|
|
371
|
+
const { field, slots, editRender, cellRender, rowGroupNode, aggFunc } = column;
|
|
372
372
|
const isEnableEdit = editConfig && isEnableConf(editConfig);
|
|
373
373
|
const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
|
|
374
374
|
const cellRenderOpts = isEnableConf(cellRender) ? cellRender : null;
|
|
@@ -444,8 +444,9 @@ export const Cell = {
|
|
|
444
444
|
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
|
|
445
445
|
}
|
|
446
446
|
const renderOpts = editRenderOpts || cellRenderOpts;
|
|
447
|
-
//
|
|
448
|
-
|
|
447
|
+
// 如果是编辑表格:renderTableCell > formatter
|
|
448
|
+
// 如果是查看表格:renderTableDefault > formatter
|
|
449
|
+
if (renderOpts) {
|
|
449
450
|
const compConf = renderer.get(renderOpts.name);
|
|
450
451
|
if (compConf) {
|
|
451
452
|
const renderFn = editRenderOpts ? (compConf.renderTableCell || compConf.renderCell) : (compConf.renderTableDefault || compConf.renderDefault);
|
|
@@ -597,7 +598,13 @@ export const Cell = {
|
|
|
597
598
|
const { computeAggregateOpts } = $table.getComputeMaps();
|
|
598
599
|
const aggregateOpts = computeAggregateOpts.value;
|
|
599
600
|
const { mode } = aggregateOpts;
|
|
600
|
-
if (mode === 'column'
|
|
601
|
+
if (mode === 'column') {
|
|
602
|
+
if (row.groupField && column.field === row.groupField) {
|
|
603
|
+
return [Cell.renderRowGroupBtn(params, cellVNodes)];
|
|
604
|
+
}
|
|
605
|
+
return cellVNodes;
|
|
606
|
+
}
|
|
607
|
+
else if (rowGroupNode) {
|
|
601
608
|
return [Cell.renderRowGroupBtn(params, cellVNodes)];
|
|
602
609
|
}
|
|
603
610
|
}
|
|
@@ -610,7 +617,7 @@ export const Cell = {
|
|
|
610
617
|
const { $table, column } = params;
|
|
611
618
|
const { slots } = column;
|
|
612
619
|
const headerSlot = slots ? slots.header : null;
|
|
613
|
-
return renderHeaderCellBaseVNs(params, renderTitleContent(params, headerSlot ? $table.callSlot(headerSlot, params) :
|
|
620
|
+
return renderHeaderCellBaseVNs(params, renderTitleContent(params, headerSlot ? $table.callSlot(headerSlot, params) : $table.getHeaderCellLabel(column)));
|
|
614
621
|
},
|
|
615
622
|
renderSeqCell(params) {
|
|
616
623
|
const { $table, column } = params;
|
|
@@ -645,7 +652,7 @@ export const Cell = {
|
|
|
645
652
|
: [
|
|
646
653
|
h('span', {
|
|
647
654
|
class: 'vxe-radio--label'
|
|
648
|
-
}, titleSlot ? $table.callSlot(titleSlot, params) :
|
|
655
|
+
}, titleSlot ? $table.callSlot(titleSlot, params) : $table.getHeaderCellLabel(column))
|
|
649
656
|
]));
|
|
650
657
|
},
|
|
651
658
|
renderRadioCell(params) {
|
|
@@ -714,7 +721,7 @@ export const Cell = {
|
|
|
714
721
|
const titleSlot = slots ? slots.title : null;
|
|
715
722
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
716
723
|
const { checkStrictly, showHeader, headerTitle } = checkboxOpts;
|
|
717
|
-
const colTitle =
|
|
724
|
+
const colTitle = $table.getHeaderCellLabel(column);
|
|
718
725
|
const ons = {};
|
|
719
726
|
if (!isHidden) {
|
|
720
727
|
ons.onClick = (evnt) => {
|
|
@@ -11,16 +11,13 @@ export class ColumnInfo {
|
|
|
11
11
|
const $xeGrid = $xeTable.xeGrid;
|
|
12
12
|
const $xeGantt = $xeTable.xeGantt;
|
|
13
13
|
const $xeGGWrapper = $xeGrid || $xeGantt;
|
|
14
|
-
const { field, editRender, filterRender
|
|
14
|
+
const { field, editRender, filterRender } = _vm;
|
|
15
15
|
const colId = _vm.colId || XEUtils.uniqueId('col_');
|
|
16
16
|
const formatter = _vm.formatter;
|
|
17
17
|
const visible = XEUtils.isBoolean(_vm.visible) ? _vm.visible : true;
|
|
18
18
|
const flCompConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null;
|
|
19
19
|
const ctFilterOptions = flCompConf ? flCompConf.createTableFilterOptions : null;
|
|
20
20
|
const filters = toFilters(_vm.filters, colId);
|
|
21
|
-
if (headerFormatter) {
|
|
22
|
-
errLog('vxe.error.notProp', ['header-formatter']);
|
|
23
|
-
}
|
|
24
21
|
const types = ['seq', 'checkbox', 'radio', 'expand', 'html'];
|
|
25
22
|
if (_vm.type && types.indexOf(_vm.type) === -1) {
|
|
26
23
|
warnLog('vxe.error.errProp', [`type=${_vm.type}`, types.join(', ')]);
|
package/es/table/src/table.js
CHANGED
|
@@ -4050,6 +4050,7 @@ export default defineVxeComponent({
|
|
|
4050
4050
|
loadScrollXData();
|
|
4051
4051
|
}
|
|
4052
4052
|
});
|
|
4053
|
+
$xeTable.clearHeaderFormatterCache();
|
|
4053
4054
|
$xeTable.clearMergeCells();
|
|
4054
4055
|
$xeTable.clearMergeFooterItems();
|
|
4055
4056
|
$xeTable.handleTableData(true);
|
|
@@ -5291,6 +5292,81 @@ export default defineVxeComponent({
|
|
|
5291
5292
|
}
|
|
5292
5293
|
return nextTick();
|
|
5293
5294
|
},
|
|
5295
|
+
getHeaderCellLabel(fieldOrColumn) {
|
|
5296
|
+
const column = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
5297
|
+
if (!column) {
|
|
5298
|
+
return null;
|
|
5299
|
+
}
|
|
5300
|
+
const { headerFormatter } = column;
|
|
5301
|
+
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
5302
|
+
let cellLabel = column.getTitle();
|
|
5303
|
+
if (headerFormatter) {
|
|
5304
|
+
let formatData;
|
|
5305
|
+
const { headerFullDataColData } = internalData;
|
|
5306
|
+
const colid = column.id;
|
|
5307
|
+
let colRest = headerFullDataColData[colid];
|
|
5308
|
+
if (!colRest) {
|
|
5309
|
+
colRest = headerFullDataColData[colid] = {};
|
|
5310
|
+
}
|
|
5311
|
+
const formatObj = colRest.formatObj;
|
|
5312
|
+
if (formatObj && formatObj.value === cellLabel) {
|
|
5313
|
+
return formatObj.label;
|
|
5314
|
+
}
|
|
5315
|
+
const headFormatParams = {
|
|
5316
|
+
$table: $xeTable,
|
|
5317
|
+
cellTitle: cellLabel,
|
|
5318
|
+
cellValue: cellLabel,
|
|
5319
|
+
column,
|
|
5320
|
+
_columnIndex,
|
|
5321
|
+
columnIndex: $xeTable.getColumnIndex(column)
|
|
5322
|
+
};
|
|
5323
|
+
if (XEUtils.isString(headerFormatter)) {
|
|
5324
|
+
const gFormatOpts = formats.get(headerFormatter);
|
|
5325
|
+
const fcFormatMethod = gFormatOpts ? gFormatOpts.tableHeaderCellFormatMethod : null;
|
|
5326
|
+
cellLabel = XEUtils.toValueString(fcFormatMethod ? fcFormatMethod(headFormatParams) : '');
|
|
5327
|
+
}
|
|
5328
|
+
else if (XEUtils.isArray(headerFormatter)) {
|
|
5329
|
+
const gFormatOpts = formats.get(headerFormatter[0]);
|
|
5330
|
+
const fcFormatMethod = gFormatOpts ? gFormatOpts.tableHeaderCellFormatMethod : null;
|
|
5331
|
+
cellLabel = XEUtils.toValueString(fcFormatMethod ? fcFormatMethod(headFormatParams, ...headerFormatter.slice(1)) : '');
|
|
5332
|
+
}
|
|
5333
|
+
else {
|
|
5334
|
+
cellLabel = XEUtils.toValueString(headerFormatter(headFormatParams));
|
|
5335
|
+
}
|
|
5336
|
+
if (formatData) {
|
|
5337
|
+
colRest.formatObj = { value: cellLabel, label: cellLabel };
|
|
5338
|
+
}
|
|
5339
|
+
}
|
|
5340
|
+
return cellLabel;
|
|
5341
|
+
},
|
|
5342
|
+
updateHeaderCellLabel(fieldOrColumn) {
|
|
5343
|
+
const column = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
5344
|
+
if (!column) {
|
|
5345
|
+
return '';
|
|
5346
|
+
}
|
|
5347
|
+
const { headerFullDataColData } = internalData;
|
|
5348
|
+
const colid = column.id;
|
|
5349
|
+
const colRest = headerFullDataColData[colid];
|
|
5350
|
+
if (colRest) {
|
|
5351
|
+
colRest.formatObj = undefined;
|
|
5352
|
+
}
|
|
5353
|
+
return $xeTable.getHeaderCellLabel(column);
|
|
5354
|
+
},
|
|
5355
|
+
clearHeaderFormatterCache(isUpdate) {
|
|
5356
|
+
const { tableColumn } = reactData;
|
|
5357
|
+
const { headerFullDataColData } = internalData;
|
|
5358
|
+
XEUtils.each(headerFullDataColData, (colRest) => {
|
|
5359
|
+
if (colRest.formatObj) {
|
|
5360
|
+
colRest.formatObj = undefined;
|
|
5361
|
+
}
|
|
5362
|
+
});
|
|
5363
|
+
if (isUpdate) {
|
|
5364
|
+
tableColumn.forEach(column => {
|
|
5365
|
+
$xeTable.getHeaderCellLabel(column);
|
|
5366
|
+
});
|
|
5367
|
+
}
|
|
5368
|
+
return nextTick();
|
|
5369
|
+
},
|
|
5294
5370
|
getFooterCellLabel(row, fieldOrColumn) {
|
|
5295
5371
|
const column = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
5296
5372
|
if (!column) {
|
|
@@ -7502,6 +7578,7 @@ export default defineVxeComponent({
|
|
|
7502
7578
|
footData = visibleColumn.length ? footerMethod({ columns: visibleColumn, data: afterFullData, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }) : [];
|
|
7503
7579
|
}
|
|
7504
7580
|
reactData.footerTableData = footData;
|
|
7581
|
+
$xeTable.clearFooterFormatterCache();
|
|
7505
7582
|
$xeTable.handleUpdateFooterMerge();
|
|
7506
7583
|
$xeTable.dispatchEvent('footer-data-change', {
|
|
7507
7584
|
visibleColumn: internalData.visibleColumn,
|
package/es/table/src/util.js
CHANGED
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED