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
|
@@ -326,7 +326,7 @@ hooks.add('tableExportModule', {
|
|
|
326
326
|
function getHeaderTitle (opts: VxeTablePropTypes.ExportHandleOptions, column: VxeTableDefines.ColumnInfo) {
|
|
327
327
|
const columnOpts = computeColumnOpts.value
|
|
328
328
|
const headExportMethod = column.headerExportMethod || columnOpts.headerExportMethod
|
|
329
|
-
return headExportMethod ? headExportMethod({ column, options: opts, $table: $xeTable }) : ((opts.isTitle ?
|
|
329
|
+
return headExportMethod ? headExportMethod({ column, options: opts, $table: $xeTable }) : ((opts.isTitle ? $xeTable.getHeaderCellLabel(column) : column.field) || '')
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
const toBooleanValue = (cellValue: any) => {
|
|
@@ -338,9 +338,10 @@ hooks.add('tableExportModule', {
|
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
const getBodyLabelData = (opts: VxeTablePropTypes.ExportHandleOptions, columns: VxeTableDefines.ColumnInfo[], datas: any[]) => {
|
|
341
|
-
const { isTreeAllExpanded, isRowGroupAllExpanded, mode } = opts
|
|
341
|
+
const { isTreeAllExpanded, isRowGroupAllExpanded, mode: expMode } = opts
|
|
342
342
|
const { treeConfig } = props
|
|
343
343
|
const { isRowGroupStatus } = reactData
|
|
344
|
+
const { fullColumnFieldData } = internalData
|
|
344
345
|
const radioOpts = computeRadioOpts.value
|
|
345
346
|
const checkboxOpts = computeCheckboxOpts.value
|
|
346
347
|
const treeOpts = computeTreeOpts.value
|
|
@@ -352,7 +353,7 @@ hooks.add('tableExportModule', {
|
|
|
352
353
|
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
353
354
|
if (isRowGroupStatus) {
|
|
354
355
|
// 如果是数据分组
|
|
355
|
-
const { mapChildrenField } = aggregateOpts
|
|
356
|
+
const { mode: aggMode, showTotal, totalMethod, countFields, contentMethod, formatValuesMethod, mapChildrenField } = aggregateOpts
|
|
356
357
|
const rest: any[] = []
|
|
357
358
|
const expandMaps: Record<string, boolean> = {}
|
|
358
359
|
const useMaps: Record<string, boolean> = {}
|
|
@@ -373,8 +374,9 @@ hooks.add('tableExportModule', {
|
|
|
373
374
|
_expand: hasRowChild && $xeTable.isRowExpandByRow(row)
|
|
374
375
|
}
|
|
375
376
|
columns.forEach((column, $columnIndex) => {
|
|
377
|
+
const { field, editRender, cellRender, aggFunc, rowGroupNode } = column
|
|
376
378
|
let cellValue: string | number | boolean | null = ''
|
|
377
|
-
const renderOpts =
|
|
379
|
+
const renderOpts = editRender || cellRender
|
|
378
380
|
let bodyExportMethod: VxeColumnPropTypes.ExportMethod | undefined = column.exportMethod || columnOpts.exportMethod
|
|
379
381
|
if (!bodyExportMethod && renderOpts && renderOpts.name) {
|
|
380
382
|
const compConf = renderer.get(renderOpts.name)
|
|
@@ -391,21 +393,75 @@ hooks.add('tableExportModule', {
|
|
|
391
393
|
switch (column.type) {
|
|
392
394
|
case 'seq': {
|
|
393
395
|
const seqVal = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('')
|
|
394
|
-
cellValue =
|
|
396
|
+
cellValue = expMode === 'all' ? seqVal : getSeq(seqVal, row, $rowIndex, column, $columnIndex)
|
|
395
397
|
break
|
|
396
398
|
}
|
|
397
|
-
case 'checkbox':
|
|
399
|
+
case 'checkbox': {
|
|
398
400
|
cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row))
|
|
399
401
|
item._checkboxLabel = checkboxOpts.labelField ? XEUtils.get(row, checkboxOpts.labelField) : ''
|
|
400
402
|
item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ $table: $xeTable, row })
|
|
401
403
|
break
|
|
402
|
-
|
|
404
|
+
}
|
|
405
|
+
case 'radio': {
|
|
403
406
|
cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row))
|
|
404
407
|
item._radioLabel = radioOpts.labelField ? XEUtils.get(row, radioOpts.labelField) : ''
|
|
405
408
|
item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ $table: $xeTable, row })
|
|
406
409
|
break
|
|
407
|
-
|
|
408
|
-
|
|
410
|
+
}
|
|
411
|
+
default: {
|
|
412
|
+
if (field && row.isAggregate) {
|
|
413
|
+
const aggRow: VxeTableDefines.AggregateRowInfo = row
|
|
414
|
+
const aggData = aggRow.aggData
|
|
415
|
+
const currAggData = aggData ? aggData[field] : null
|
|
416
|
+
const groupField = aggRow.groupField
|
|
417
|
+
const groupContent = aggRow.groupContent
|
|
418
|
+
const childList = mapChildrenField ? (aggRow[mapChildrenField] || []) : []
|
|
419
|
+
const childCount = aggRow.childCount
|
|
420
|
+
const colRest = fullColumnFieldData[groupField] || {}
|
|
421
|
+
const ctParams = {
|
|
422
|
+
$table: $xeTable,
|
|
423
|
+
groupField,
|
|
424
|
+
groupColumn: (colRest ? colRest.column : null) as VxeTableDefines.ColumnInfo,
|
|
425
|
+
column,
|
|
426
|
+
groupValue: groupContent,
|
|
427
|
+
childList,
|
|
428
|
+
childCount,
|
|
429
|
+
aggValue: null as any,
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* 已废弃
|
|
433
|
+
* @deprecated
|
|
434
|
+
*/
|
|
435
|
+
children: childList,
|
|
436
|
+
/**
|
|
437
|
+
* 已废弃
|
|
438
|
+
* @deprecated
|
|
439
|
+
*/
|
|
440
|
+
totalValue: childCount
|
|
441
|
+
}
|
|
442
|
+
if (aggMode === 'column' ? field === aggRow.groupField : rowGroupNode) {
|
|
443
|
+
cellValue = groupContent
|
|
444
|
+
if (contentMethod) {
|
|
445
|
+
cellValue = `${contentMethod(ctParams)}`
|
|
446
|
+
}
|
|
447
|
+
if (showTotal) {
|
|
448
|
+
cellValue = getI18n('vxe.table.rowGroupContentTotal', [cellValue, totalMethod ? totalMethod(ctParams) : childCount, childCount])
|
|
449
|
+
}
|
|
450
|
+
} else if ($xeTable.getPivotTableAggregateCellAggValue) {
|
|
451
|
+
const aggParams = {
|
|
452
|
+
$table: $xeTable,
|
|
453
|
+
row,
|
|
454
|
+
column
|
|
455
|
+
}
|
|
456
|
+
cellValue = $xeTable.getPivotTableAggregateCellAggValue(aggParams)
|
|
457
|
+
} else if (aggFunc === true || (countFields && countFields.includes(field))) {
|
|
458
|
+
cellValue = currAggData ? currAggData.value : childCount
|
|
459
|
+
ctParams.aggValue = cellValue
|
|
460
|
+
if (formatValuesMethod) {
|
|
461
|
+
cellValue = formatValuesMethod(ctParams)
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
} else if (opts.original) {
|
|
409
465
|
cellValue = getCellValue(row, column)
|
|
410
466
|
} else {
|
|
411
467
|
cellValue = $xeTable.getCellLabel(row, column)
|
|
@@ -419,6 +475,8 @@ hooks.add('tableExportModule', {
|
|
|
419
475
|
}
|
|
420
476
|
}
|
|
421
477
|
}
|
|
478
|
+
break
|
|
479
|
+
}
|
|
422
480
|
}
|
|
423
481
|
}
|
|
424
482
|
item[column.id] = toStringValue(cellValue)
|
|
@@ -473,7 +531,7 @@ hooks.add('tableExportModule', {
|
|
|
473
531
|
switch (column.type) {
|
|
474
532
|
case 'seq': {
|
|
475
533
|
const seqVal = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('')
|
|
476
|
-
cellValue =
|
|
534
|
+
cellValue = expMode === 'all' ? seqVal : getSeq(seqVal, row, $rowIndex, column, $columnIndex)
|
|
477
535
|
break
|
|
478
536
|
}
|
|
479
537
|
case 'checkbox':
|
|
@@ -534,7 +592,7 @@ hooks.add('tableExportModule', {
|
|
|
534
592
|
switch (column.type) {
|
|
535
593
|
case 'seq': {
|
|
536
594
|
const seqValue = $rowIndex + 1
|
|
537
|
-
cellValue =
|
|
595
|
+
cellValue = expMode === 'all' ? seqValue : getSeq(seqValue, row, $rowIndex, column, $columnIndex)
|
|
538
596
|
break
|
|
539
597
|
}
|
|
540
598
|
case 'checkbox':
|
|
@@ -936,12 +994,12 @@ hooks.add('tableExportModule', {
|
|
|
936
994
|
const tableTitleMaps: Record<string, VxeTableDefines.ColumnInfo> = {}
|
|
937
995
|
tableFullColumn.forEach((column) => {
|
|
938
996
|
const field = column.field
|
|
939
|
-
const title =
|
|
997
|
+
const title = $xeTable.getHeaderCellLabel(column)
|
|
940
998
|
if (field) {
|
|
941
999
|
tableFieldMaps[field] = column
|
|
942
1000
|
}
|
|
943
1001
|
if (title) {
|
|
944
|
-
tableTitleMaps[
|
|
1002
|
+
tableTitleMaps[title] = column
|
|
945
1003
|
}
|
|
946
1004
|
})
|
|
947
1005
|
const tableConf = {
|
|
@@ -387,7 +387,7 @@ export const Cell = {
|
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
-
return renderTitleContent(params,
|
|
390
|
+
return renderTitleContent(params, $table.getHeaderCellLabel(column))
|
|
391
391
|
},
|
|
392
392
|
renderDefaultHeader (params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
393
393
|
return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params))
|
|
@@ -399,7 +399,7 @@ export const Cell = {
|
|
|
399
399
|
const tableInternalData = $table.internalData
|
|
400
400
|
const { isRowGroupStatus } = tableReactData
|
|
401
401
|
const { editConfig } = tableProps
|
|
402
|
-
const { field, slots, editRender, cellRender, rowGroupNode, aggFunc
|
|
402
|
+
const { field, slots, editRender, cellRender, rowGroupNode, aggFunc } = column
|
|
403
403
|
const isEnableEdit = editConfig && isEnableConf(editConfig)
|
|
404
404
|
const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null
|
|
405
405
|
const cellRenderOpts = isEnableConf(cellRender) ? cellRender : null
|
|
@@ -473,8 +473,9 @@ export const Cell = {
|
|
|
473
473
|
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params))
|
|
474
474
|
}
|
|
475
475
|
const renderOpts = editRenderOpts || cellRenderOpts
|
|
476
|
-
//
|
|
477
|
-
|
|
476
|
+
// 如果是编辑表格:renderTableCell > formatter
|
|
477
|
+
// 如果是查看表格:renderTableDefault > formatter
|
|
478
|
+
if (renderOpts) {
|
|
478
479
|
const compConf = renderer.get(renderOpts.name)
|
|
479
480
|
if (compConf) {
|
|
480
481
|
const renderFn = editRenderOpts ? (compConf.renderTableCell || compConf.renderCell) : (compConf.renderTableDefault || compConf.renderDefault)
|
|
@@ -631,7 +632,12 @@ export const Cell = {
|
|
|
631
632
|
const { computeAggregateOpts } = $table.getComputeMaps()
|
|
632
633
|
const aggregateOpts = computeAggregateOpts.value
|
|
633
634
|
const { mode } = aggregateOpts
|
|
634
|
-
if (mode === 'column'
|
|
635
|
+
if (mode === 'column') {
|
|
636
|
+
if (row.groupField && column.field === row.groupField) {
|
|
637
|
+
return [Cell.renderRowGroupBtn(params, cellVNodes)]
|
|
638
|
+
}
|
|
639
|
+
return cellVNodes
|
|
640
|
+
} else if (rowGroupNode) {
|
|
635
641
|
return [Cell.renderRowGroupBtn(params, cellVNodes)]
|
|
636
642
|
}
|
|
637
643
|
}
|
|
@@ -645,7 +651,7 @@ export const Cell = {
|
|
|
645
651
|
const { $table, column } = params
|
|
646
652
|
const { slots } = column
|
|
647
653
|
const headerSlot = slots ? slots.header : null
|
|
648
|
-
return renderHeaderCellBaseVNs(params, renderTitleContent(params, headerSlot ? $table.callSlot(headerSlot, params) :
|
|
654
|
+
return renderHeaderCellBaseVNs(params, renderTitleContent(params, headerSlot ? $table.callSlot(headerSlot, params) : $table.getHeaderCellLabel(column)))
|
|
649
655
|
},
|
|
650
656
|
renderSeqCell (params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
651
657
|
const { $table, column } = params
|
|
@@ -682,7 +688,7 @@ export const Cell = {
|
|
|
682
688
|
: [
|
|
683
689
|
h('span', {
|
|
684
690
|
class: 'vxe-radio--label'
|
|
685
|
-
}, titleSlot ? $table.callSlot(titleSlot, params) :
|
|
691
|
+
}, titleSlot ? $table.callSlot(titleSlot, params) : $table.getHeaderCellLabel(column))
|
|
686
692
|
])
|
|
687
693
|
)
|
|
688
694
|
},
|
|
@@ -760,7 +766,7 @@ export const Cell = {
|
|
|
760
766
|
const titleSlot = slots ? slots.title : null
|
|
761
767
|
const checkboxOpts = computeCheckboxOpts.value
|
|
762
768
|
const { checkStrictly, showHeader, headerTitle } = checkboxOpts
|
|
763
|
-
const colTitle =
|
|
769
|
+
const colTitle = $table.getHeaderCellLabel(column)
|
|
764
770
|
const ons: Record<string, any> = {}
|
|
765
771
|
if (!isHidden) {
|
|
766
772
|
ons.onClick = (evnt: MouseEvent) => {
|
|
@@ -16,7 +16,7 @@ export class ColumnInfo {
|
|
|
16
16
|
const $xeGantt = $xeTable.xeGantt
|
|
17
17
|
const $xeGGWrapper = $xeGrid || $xeGantt
|
|
18
18
|
|
|
19
|
-
const { field, editRender, filterRender
|
|
19
|
+
const { field, editRender, filterRender } = _vm
|
|
20
20
|
|
|
21
21
|
const colId = _vm.colId || XEUtils.uniqueId('col_')
|
|
22
22
|
|
|
@@ -28,10 +28,6 @@ export class ColumnInfo {
|
|
|
28
28
|
|
|
29
29
|
const filters = toFilters(_vm.filters, colId)
|
|
30
30
|
|
|
31
|
-
if (headerFormatter) {
|
|
32
|
-
errLog('vxe.error.notProp', ['header-formatter'])
|
|
33
|
-
}
|
|
34
|
-
|
|
35
31
|
const types = ['seq', 'checkbox', 'radio', 'expand', 'html']
|
|
36
32
|
if (_vm.type && types.indexOf(_vm.type) === -1) {
|
|
37
33
|
warnLog('vxe.error.errProp', [`type=${_vm.type}`, types.join(', ')])
|
|
@@ -4218,6 +4218,7 @@ export default defineVxeComponent({
|
|
|
4218
4218
|
loadScrollXData()
|
|
4219
4219
|
}
|
|
4220
4220
|
})
|
|
4221
|
+
$xeTable.clearHeaderFormatterCache()
|
|
4221
4222
|
$xeTable.clearMergeCells()
|
|
4222
4223
|
$xeTable.clearMergeFooterItems()
|
|
4223
4224
|
$xeTable.handleTableData(true)
|
|
@@ -5473,6 +5474,79 @@ export default defineVxeComponent({
|
|
|
5473
5474
|
}
|
|
5474
5475
|
return nextTick()
|
|
5475
5476
|
},
|
|
5477
|
+
getHeaderCellLabel (fieldOrColumn) {
|
|
5478
|
+
const column = handleFieldOrColumn($xeTable, fieldOrColumn)
|
|
5479
|
+
if (!column) {
|
|
5480
|
+
return null
|
|
5481
|
+
}
|
|
5482
|
+
const { headerFormatter } = column
|
|
5483
|
+
const _columnIndex = $xeTable.getVTColumnIndex(column)
|
|
5484
|
+
let cellLabel = column.getTitle()
|
|
5485
|
+
if (headerFormatter) {
|
|
5486
|
+
let formatData: Record<string, VxeTableDefines.RowCacheFormatObj> | undefined
|
|
5487
|
+
const { headerFullDataColData } = internalData
|
|
5488
|
+
const colid = column.id
|
|
5489
|
+
let colRest = headerFullDataColData[colid]
|
|
5490
|
+
if (!colRest) {
|
|
5491
|
+
colRest = headerFullDataColData[colid] = {}
|
|
5492
|
+
}
|
|
5493
|
+
const formatObj = colRest.formatObj
|
|
5494
|
+
if (formatObj && formatObj.value === cellLabel) {
|
|
5495
|
+
return formatObj.label
|
|
5496
|
+
}
|
|
5497
|
+
const headFormatParams = {
|
|
5498
|
+
$table: $xeTable,
|
|
5499
|
+
cellTitle: cellLabel,
|
|
5500
|
+
cellValue: cellLabel,
|
|
5501
|
+
column,
|
|
5502
|
+
_columnIndex,
|
|
5503
|
+
columnIndex: $xeTable.getColumnIndex(column)
|
|
5504
|
+
}
|
|
5505
|
+
if (XEUtils.isString(headerFormatter)) {
|
|
5506
|
+
const gFormatOpts = formats.get(headerFormatter)
|
|
5507
|
+
const fcFormatMethod = gFormatOpts ? gFormatOpts.tableHeaderCellFormatMethod : null
|
|
5508
|
+
cellLabel = XEUtils.toValueString(fcFormatMethod ? fcFormatMethod(headFormatParams) : '')
|
|
5509
|
+
} else if (XEUtils.isArray(headerFormatter)) {
|
|
5510
|
+
const gFormatOpts = formats.get(headerFormatter[0])
|
|
5511
|
+
const fcFormatMethod = gFormatOpts ? gFormatOpts.tableHeaderCellFormatMethod : null
|
|
5512
|
+
cellLabel = XEUtils.toValueString(fcFormatMethod ? fcFormatMethod(headFormatParams, ...headerFormatter.slice(1)) : '')
|
|
5513
|
+
} else {
|
|
5514
|
+
cellLabel = XEUtils.toValueString(headerFormatter(headFormatParams))
|
|
5515
|
+
}
|
|
5516
|
+
if (formatData) {
|
|
5517
|
+
colRest.formatObj = { value: cellLabel, label: cellLabel }
|
|
5518
|
+
}
|
|
5519
|
+
}
|
|
5520
|
+
return cellLabel
|
|
5521
|
+
},
|
|
5522
|
+
updateHeaderCellLabel (fieldOrColumn) {
|
|
5523
|
+
const column = handleFieldOrColumn($xeTable, fieldOrColumn)
|
|
5524
|
+
if (!column) {
|
|
5525
|
+
return ''
|
|
5526
|
+
}
|
|
5527
|
+
const { headerFullDataColData } = internalData
|
|
5528
|
+
const colid = column.id
|
|
5529
|
+
const colRest = headerFullDataColData[colid]
|
|
5530
|
+
if (colRest) {
|
|
5531
|
+
colRest.formatObj = undefined
|
|
5532
|
+
}
|
|
5533
|
+
return $xeTable.getHeaderCellLabel(column)
|
|
5534
|
+
},
|
|
5535
|
+
clearHeaderFormatterCache (isUpdate) {
|
|
5536
|
+
const { tableColumn } = reactData
|
|
5537
|
+
const { headerFullDataColData } = internalData
|
|
5538
|
+
XEUtils.each(headerFullDataColData, (colRest: VxeTableDefines.HeaderColCacheItem) => {
|
|
5539
|
+
if (colRest.formatObj) {
|
|
5540
|
+
colRest.formatObj = undefined
|
|
5541
|
+
}
|
|
5542
|
+
})
|
|
5543
|
+
if (isUpdate) {
|
|
5544
|
+
tableColumn.forEach(column => {
|
|
5545
|
+
$xeTable.getHeaderCellLabel(column)
|
|
5546
|
+
})
|
|
5547
|
+
}
|
|
5548
|
+
return nextTick()
|
|
5549
|
+
},
|
|
5476
5550
|
getFooterCellLabel (row, fieldOrColumn) {
|
|
5477
5551
|
const column = handleFieldOrColumn($xeTable, fieldOrColumn)
|
|
5478
5552
|
if (!column) {
|
|
@@ -7670,6 +7744,7 @@ export default defineVxeComponent({
|
|
|
7670
7744
|
footData = visibleColumn.length ? footerMethod({ columns: visibleColumn, data: afterFullData, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }) : []
|
|
7671
7745
|
}
|
|
7672
7746
|
reactData.footerTableData = footData
|
|
7747
|
+
$xeTable.clearFooterFormatterCache()
|
|
7673
7748
|
$xeTable.handleUpdateFooterMerge()
|
|
7674
7749
|
$xeTable.dispatchEvent('footer-data-change', {
|
|
7675
7750
|
visibleColumn: internalData.visibleColumn,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|