vxe-table 4.20.2 → 4.20.4

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.
Files changed (162) hide show
  1. package/dist/all.esm.js +231 -114
  2. package/dist/style.css +1 -1
  3. package/es/locale/lang/ar-EG.js +7 -0
  4. package/es/locale/lang/de-DE.js +7 -0
  5. package/es/locale/lang/en-US.js +7 -0
  6. package/es/locale/lang/es-ES.js +7 -0
  7. package/es/locale/lang/fr-FR.js +7 -0
  8. package/es/locale/lang/hu-HU.js +7 -0
  9. package/es/locale/lang/hy-AM.js +7 -0
  10. package/es/locale/lang/id-ID.js +7 -0
  11. package/es/locale/lang/it-IT.js +7 -0
  12. package/es/locale/lang/ja-JP.js +7 -0
  13. package/es/locale/lang/ko-KR.js +7 -0
  14. package/es/locale/lang/ms-MY.js +7 -0
  15. package/es/locale/lang/nb-NO.js +7 -0
  16. package/es/locale/lang/pt-BR.js +7 -0
  17. package/es/locale/lang/ru-RU.js +7 -0
  18. package/es/locale/lang/th-TH.js +7 -0
  19. package/es/locale/lang/ug-CN.js +7 -0
  20. package/es/locale/lang/uk-UA.js +7 -0
  21. package/es/locale/lang/uz-UZ.js +7 -0
  22. package/es/locale/lang/vi-VN.js +7 -0
  23. package/es/locale/lang/zh-CHT.js +7 -0
  24. package/es/locale/lang/zh-CN.js +7 -0
  25. package/es/style.css +1 -1
  26. package/es/table/module/export/export-panel.js +61 -47
  27. package/es/table/module/export/hook.js +105 -27
  28. package/es/table/module/export/util.js +1 -1
  29. package/es/table/src/body.js +1 -1
  30. package/es/table/src/footer.js +1 -1
  31. package/es/table/src/header.js +5 -3
  32. package/es/table/src/table.js +48 -34
  33. package/es/table/src/util.js +1 -0
  34. package/es/ui/index.js +2 -1
  35. package/es/ui/src/log.js +1 -1
  36. package/lib/index.umd.js +164 -55
  37. package/lib/index.umd.min.js +1 -1
  38. package/lib/locale/lang/ar-EG.js +7 -0
  39. package/lib/locale/lang/ar-EG.min.js +1 -1
  40. package/lib/locale/lang/ar-EG.umd.js +7 -0
  41. package/lib/locale/lang/de-DE.js +7 -0
  42. package/lib/locale/lang/de-DE.min.js +1 -1
  43. package/lib/locale/lang/de-DE.umd.js +7 -0
  44. package/lib/locale/lang/en-US.js +7 -0
  45. package/lib/locale/lang/en-US.min.js +1 -1
  46. package/lib/locale/lang/en-US.umd.js +7 -0
  47. package/lib/locale/lang/es-ES.js +7 -0
  48. package/lib/locale/lang/es-ES.min.js +1 -1
  49. package/lib/locale/lang/es-ES.umd.js +7 -0
  50. package/lib/locale/lang/fr-FR.js +7 -0
  51. package/lib/locale/lang/fr-FR.min.js +1 -1
  52. package/lib/locale/lang/fr-FR.umd.js +7 -0
  53. package/lib/locale/lang/hu-HU.js +7 -0
  54. package/lib/locale/lang/hu-HU.min.js +1 -1
  55. package/lib/locale/lang/hu-HU.umd.js +7 -0
  56. package/lib/locale/lang/hy-AM.js +7 -0
  57. package/lib/locale/lang/hy-AM.min.js +1 -1
  58. package/lib/locale/lang/hy-AM.umd.js +7 -0
  59. package/lib/locale/lang/id-ID.js +7 -0
  60. package/lib/locale/lang/id-ID.min.js +1 -1
  61. package/lib/locale/lang/id-ID.umd.js +7 -0
  62. package/lib/locale/lang/it-IT.js +7 -0
  63. package/lib/locale/lang/it-IT.min.js +1 -1
  64. package/lib/locale/lang/it-IT.umd.js +7 -0
  65. package/lib/locale/lang/ja-JP.js +7 -0
  66. package/lib/locale/lang/ja-JP.min.js +1 -1
  67. package/lib/locale/lang/ja-JP.umd.js +7 -0
  68. package/lib/locale/lang/ko-KR.js +7 -0
  69. package/lib/locale/lang/ko-KR.min.js +1 -1
  70. package/lib/locale/lang/ko-KR.umd.js +7 -0
  71. package/lib/locale/lang/ms-MY.js +7 -0
  72. package/lib/locale/lang/ms-MY.min.js +1 -1
  73. package/lib/locale/lang/ms-MY.umd.js +7 -0
  74. package/lib/locale/lang/nb-NO.js +7 -0
  75. package/lib/locale/lang/nb-NO.min.js +1 -1
  76. package/lib/locale/lang/nb-NO.umd.js +7 -0
  77. package/lib/locale/lang/pt-BR.js +7 -0
  78. package/lib/locale/lang/pt-BR.min.js +1 -1
  79. package/lib/locale/lang/pt-BR.umd.js +7 -0
  80. package/lib/locale/lang/ru-RU.js +7 -0
  81. package/lib/locale/lang/ru-RU.min.js +1 -1
  82. package/lib/locale/lang/ru-RU.umd.js +7 -0
  83. package/lib/locale/lang/th-TH.js +7 -0
  84. package/lib/locale/lang/th-TH.min.js +1 -1
  85. package/lib/locale/lang/th-TH.umd.js +7 -0
  86. package/lib/locale/lang/ug-CN.js +7 -0
  87. package/lib/locale/lang/ug-CN.min.js +1 -1
  88. package/lib/locale/lang/ug-CN.umd.js +7 -0
  89. package/lib/locale/lang/uk-UA.js +7 -0
  90. package/lib/locale/lang/uk-UA.min.js +1 -1
  91. package/lib/locale/lang/uk-UA.umd.js +7 -0
  92. package/lib/locale/lang/uz-UZ.js +7 -0
  93. package/lib/locale/lang/uz-UZ.min.js +1 -1
  94. package/lib/locale/lang/uz-UZ.umd.js +7 -0
  95. package/lib/locale/lang/vi-VN.js +7 -0
  96. package/lib/locale/lang/vi-VN.min.js +1 -1
  97. package/lib/locale/lang/vi-VN.umd.js +7 -0
  98. package/lib/locale/lang/zh-CHT.js +7 -0
  99. package/lib/locale/lang/zh-CHT.min.js +1 -1
  100. package/lib/locale/lang/zh-CHT.umd.js +7 -0
  101. package/lib/locale/lang/zh-CN.js +7 -0
  102. package/lib/locale/lang/zh-CN.min.js +1 -1
  103. package/lib/locale/lang/zh-CN.umd.js +7 -0
  104. package/lib/style.css +1 -1
  105. package/lib/table/module/export/export-panel.js +32 -13
  106. package/lib/table/module/export/export-panel.min.js +1 -1
  107. package/lib/table/module/export/hook.js +105 -27
  108. package/lib/table/module/export/hook.min.js +1 -1
  109. package/lib/table/module/export/util.js +1 -1
  110. package/lib/table/module/export/util.min.js +1 -1
  111. package/lib/table/src/body.js +1 -1
  112. package/lib/table/src/body.min.js +1 -1
  113. package/lib/table/src/footer.js +1 -1
  114. package/lib/table/src/footer.min.js +1 -1
  115. package/lib/table/src/header.js +6 -3
  116. package/lib/table/src/header.min.js +1 -1
  117. package/lib/table/src/table.js +7 -7
  118. package/lib/table/src/table.min.js +1 -1
  119. package/lib/table/src/util.js +1 -0
  120. package/lib/table/src/util.min.js +1 -1
  121. package/lib/ui/index.js +2 -1
  122. package/lib/ui/index.min.js +1 -1
  123. package/lib/ui/src/log.js +1 -1
  124. package/lib/ui/src/log.min.js +1 -1
  125. package/package.json +2 -2
  126. package/packages/locale/lang/ar-EG.ts +7 -0
  127. package/packages/locale/lang/de-DE.ts +7 -0
  128. package/packages/locale/lang/en-US.ts +7 -0
  129. package/packages/locale/lang/es-ES.ts +7 -0
  130. package/packages/locale/lang/fr-FR.ts +7 -0
  131. package/packages/locale/lang/hu-HU.ts +7 -0
  132. package/packages/locale/lang/hy-AM.ts +7 -0
  133. package/packages/locale/lang/id-ID.ts +7 -0
  134. package/packages/locale/lang/it-IT.ts +7 -0
  135. package/packages/locale/lang/ja-JP.ts +7 -0
  136. package/packages/locale/lang/ko-KR.ts +7 -0
  137. package/packages/locale/lang/ms-MY.ts +7 -0
  138. package/packages/locale/lang/nb-NO.ts +7 -0
  139. package/packages/locale/lang/pt-BR.ts +7 -0
  140. package/packages/locale/lang/ru-RU.ts +7 -0
  141. package/packages/locale/lang/th-TH.ts +7 -0
  142. package/packages/locale/lang/ug-CN.ts +7 -0
  143. package/packages/locale/lang/uk-UA.ts +7 -0
  144. package/packages/locale/lang/uz-UZ.ts +7 -0
  145. package/packages/locale/lang/vi-VN.ts +7 -0
  146. package/packages/locale/lang/zh-CHT.ts +7 -0
  147. package/packages/locale/lang/zh-CN.ts +7 -0
  148. package/packages/table/module/export/export-panel.ts +120 -105
  149. package/packages/table/module/export/hook.ts +112 -28
  150. package/packages/table/module/export/util.ts +1 -1
  151. package/packages/table/src/body.ts +1 -1
  152. package/packages/table/src/footer.ts +1 -1
  153. package/packages/table/src/header.ts +5 -3
  154. package/packages/table/src/table.ts +48 -34
  155. package/packages/table/src/util.ts +3 -2
  156. package/packages/ui/index.ts +1 -0
  157. /package/es/{iconfont.1784122393131.ttf → iconfont.1784366386890.ttf} +0 -0
  158. /package/es/{iconfont.1784122393131.woff → iconfont.1784366386890.woff} +0 -0
  159. /package/es/{iconfont.1784122393131.woff2 → iconfont.1784366386890.woff2} +0 -0
  160. /package/lib/{iconfont.1784122393131.ttf → iconfont.1784366386890.ttf} +0 -0
  161. /package/lib/{iconfont.1784122393131.woff → iconfont.1784366386890.woff} +0 -0
  162. /package/lib/{iconfont.1784122393131.woff2 → iconfont.1784366386890.woff2} +0 -0
@@ -43,6 +43,14 @@ export default defineVxeComponent({
43
43
  const xInputFilename = ref() as Ref<HTMLInputElement>
44
44
  const xInputSheetname = ref() as Ref<HTMLInputElement>
45
45
 
46
+ const computeColWidthModeOptions = computed(() => {
47
+ return [
48
+ { value: '', label: getI18n('vxe.export.wdModes.default') },
49
+ { value: 'auto', label: getI18n('vxe.export.wdModes.auto') },
50
+ { value: 'scale', label: getI18n('vxe.export.wdModes.scale') }
51
+ ]
52
+ })
53
+
46
54
  const computeCheckedAll = computed(() => {
47
55
  const { storeData } = props
48
56
  return storeData.columns.every((column) => column.checked)
@@ -182,6 +190,7 @@ export default defineVxeComponent({
182
190
  const showSheet = computeShowSheet.value
183
191
  const supportMerge = computeSupportMerge.value
184
192
  const supportStyle = computeSupportStyle.value
193
+ const colWidthModeOptions = computeColWidthModeOptions.value
185
194
  // const supportGroup = computeSupportGroup.value
186
195
  const slots = defaultOptions.slots || {}
187
196
  const topSlot = slots.top
@@ -386,6 +395,22 @@ export default defineVxeComponent({
386
395
  ])
387
396
  ])
388
397
  ]),
398
+ isPrint
399
+ ? h('tr', [
400
+ h('td', getI18n('vxe.export.widthMode')),
401
+ h('td', [
402
+ VxeUISelectComponent
403
+ ? h(VxeUISelectComponent, {
404
+ modelValue: defaultOptions.widthMode,
405
+ options: colWidthModeOptions,
406
+ 'onUpdate:modelValue' (value: any) {
407
+ defaultOptions.widthMode = value
408
+ }
409
+ })
410
+ : renderEmptyElement($xeTable)
411
+ ])
412
+ ])
413
+ : renderEmptyElement($xeTable),
389
414
  h('tr', [
390
415
  h('td', getI18n('vxe.export.expOpts')),
391
416
  parameterSlot
@@ -397,115 +422,105 @@ export default defineVxeComponent({
397
422
  : h('td', [
398
423
  h('div', {
399
424
  class: 'vxe-table-export--panel-option-row'
400
- }, [
401
- VxeUICheckboxComponent
402
- ? h(VxeUICheckboxComponent, {
403
- modelValue: hasEmptyData || isHeader,
404
- disabled: hasEmptyData,
405
- title: getI18n('vxe.export.expHeaderTitle'),
406
- content: getI18n('vxe.export.expOptHeader'),
407
- 'onUpdate:modelValue' (value: any) {
408
- defaultOptions.isHeader = value
409
- }
410
- })
411
- : renderEmptyElement($xeTable),
412
- VxeUICheckboxComponent
413
- ? h(VxeUICheckboxComponent, {
414
- modelValue: defaultOptions.isFooter,
415
- disabled: !storeData.hasFooter,
416
- title: getI18n('vxe.export.expFooterTitle'),
417
- content: getI18n('vxe.export.expOptFooter'),
418
- 'onUpdate:modelValue' (value: any) {
419
- defaultOptions.isFooter = value
420
- }
421
- })
422
- : renderEmptyElement($xeTable),
423
- VxeUICheckboxComponent
424
- ? h(VxeUICheckboxComponent, {
425
- modelValue: isHeader ? defaultOptions.isTitle : false,
426
- disabled: !isHeader,
427
- title: getI18n('vxe.export.expTitleTitle'),
428
- content: getI18n('vxe.export.expOptTitle'),
429
- 'onUpdate:modelValue' (value: any) {
430
- defaultOptions.isTitle = value
431
- }
432
- })
433
- : renderEmptyElement($xeTable),
434
- VxeUICheckboxComponent
435
- ? h(VxeUICheckboxComponent, {
436
- modelValue: isHeader && hasColgroup && supportMerge ? defaultOptions.isColgroup : false,
437
- title: getI18n('vxe.export.expColgroupTitle'),
438
- disabled: !isHeader || !hasColgroup || !supportMerge,
439
- content: getI18n('vxe.export.expOptColgroup'),
440
- 'onUpdate:modelValue' (value: any) {
441
- defaultOptions.isColgroup = value
442
- }
443
- })
444
- : renderEmptyElement($xeTable)
445
- ]),
425
+ }, VxeUICheckboxComponent
426
+ ? [
427
+ h(VxeUICheckboxComponent, {
428
+ modelValue: hasEmptyData || isHeader,
429
+ disabled: hasEmptyData,
430
+ title: getI18n('vxe.export.expHeaderTitle'),
431
+ content: getI18n('vxe.export.expOptHeader'),
432
+ 'onUpdate:modelValue' (value: any) {
433
+ defaultOptions.isHeader = value
434
+ }
435
+ }),
436
+ h(VxeUICheckboxComponent, {
437
+ modelValue: defaultOptions.isFooter,
438
+ disabled: !storeData.hasFooter,
439
+ title: getI18n('vxe.export.expFooterTitle'),
440
+ content: getI18n('vxe.export.expOptFooter'),
441
+ 'onUpdate:modelValue' (value: any) {
442
+ defaultOptions.isFooter = value
443
+ }
444
+ }),
445
+ h(VxeUICheckboxComponent, {
446
+ modelValue: isHeader ? defaultOptions.isTitle : false,
447
+ disabled: !isHeader,
448
+ title: getI18n('vxe.export.expTitleTitle'),
449
+ content: getI18n('vxe.export.expOptTitle'),
450
+ 'onUpdate:modelValue' (value: any) {
451
+ defaultOptions.isTitle = value
452
+ }
453
+ }),
454
+ h(VxeUICheckboxComponent, {
455
+ modelValue: isHeader && hasColgroup && supportMerge ? defaultOptions.isColgroup : false,
456
+ title: getI18n('vxe.export.expColgroupTitle'),
457
+ disabled: !isHeader || !hasColgroup || !supportMerge,
458
+ content: getI18n('vxe.export.expOptColgroup'),
459
+ 'onUpdate:modelValue' (value: any) {
460
+ defaultOptions.isColgroup = value
461
+ }
462
+ })
463
+ ]
464
+ : []),
446
465
  h('div', {
447
466
  class: 'vxe-table-export--panel-option-row'
448
- }, [
449
- VxeUICheckboxComponent
450
- ? h(VxeUICheckboxComponent, {
451
- modelValue: hasEmptyData ? false : defaultOptions.original,
452
- disabled: hasEmptyData,
453
- title: getI18n('vxe.export.expOriginalTitle'),
454
- content: getI18n('vxe.export.expOptOriginal'),
455
- 'onUpdate:modelValue' (value: any) {
456
- defaultOptions.original = value
457
- }
458
- })
459
- : renderEmptyElement($xeTable),
460
- VxeUICheckboxComponent
461
- ? h(VxeUICheckboxComponent, {
462
- modelValue: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false,
463
- title: getI18n('vxe.export.expMergeTitle'),
464
- disabled: hasEmptyData || !hasMerge || !supportMerge || !checkedAll,
465
- content: getI18n('vxe.export.expOptMerge'),
466
- 'onUpdate:modelValue' (value: any) {
467
- defaultOptions.isMerge = value
468
- }
469
- })
470
- : renderEmptyElement($xeTable),
471
- isPrint || !VxeUICheckboxComponent
472
- ? renderEmptyElement($xeTable)
473
- : h(VxeUICheckboxComponent, {
474
- modelValue: supportStyle ? defaultOptions.useStyle : false,
475
- disabled: !supportStyle,
476
- title: getI18n('vxe.export.expUseStyleTitle'),
477
- content: getI18n('vxe.export.expOptUseStyle'),
478
- 'onUpdate:modelValue' (value: any) {
479
- defaultOptions.useStyle = value
480
- }
481
- })
482
- ]),
467
+ }, VxeUICheckboxComponent
468
+ ? [
469
+ h(VxeUICheckboxComponent, {
470
+ modelValue: hasEmptyData ? false : defaultOptions.original,
471
+ disabled: hasEmptyData,
472
+ title: getI18n('vxe.export.expOriginalTitle'),
473
+ content: getI18n('vxe.export.expOptOriginal'),
474
+ 'onUpdate:modelValue' (value: any) {
475
+ defaultOptions.original = value
476
+ }
477
+ }),
478
+ h(VxeUICheckboxComponent, {
479
+ modelValue: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false,
480
+ title: getI18n('vxe.export.expMergeTitle'),
481
+ disabled: hasEmptyData || !hasMerge || !supportMerge || !checkedAll,
482
+ content: getI18n('vxe.export.expOptMerge'),
483
+ 'onUpdate:modelValue' (value: any) {
484
+ defaultOptions.isMerge = value
485
+ }
486
+ }),
487
+ isPrint
488
+ ? renderEmptyElement($xeTable)
489
+ : h(VxeUICheckboxComponent, {
490
+ modelValue: supportStyle ? defaultOptions.useStyle : false,
491
+ disabled: !supportStyle,
492
+ title: getI18n('vxe.export.expUseStyleTitle'),
493
+ content: getI18n('vxe.export.expOptUseStyle'),
494
+ 'onUpdate:modelValue' (value: any) {
495
+ defaultOptions.useStyle = value
496
+ }
497
+ })
498
+ ]
499
+ : []),
483
500
  h('div', {
484
501
  class: 'vxe-table-export--panel-option-row'
485
- }, [
486
- VxeUICheckboxComponent
487
- ? h(VxeUICheckboxComponent, {
488
- modelValue: hasTree ? defaultOptions.isTreeAllExpanded : false,
489
- disabled: hasEmptyData || !hasTree,
490
- title: getI18n('vxe.export.expTreeAllExpandTitle'),
491
- content: getI18n('vxe.export.expOptTreeAllExpand'),
492
- 'onUpdate:modelValue' (value: any) {
493
- defaultOptions.isTreeAllExpanded = value
494
- }
495
- })
496
- : renderEmptyElement($xeTable),
497
- VxeUICheckboxComponent
498
- ? h(VxeUICheckboxComponent, {
499
- modelValue: hasRowGroup ? defaultOptions.isRowGroupAllExpanded : false,
500
- disabled: hasEmptyData || !hasRowGroup,
501
- title: getI18n('vxe.export.expRowGroupAllExpandTitle'),
502
- content: getI18n('vxe.export.expOptRowGroupAllExpand'),
503
- 'onUpdate:modelValue' (value: any) {
504
- defaultOptions.isRowGroupAllExpanded = value
505
- }
506
- })
507
- : renderEmptyElement($xeTable)
508
- ])
502
+ }, VxeUICheckboxComponent
503
+ ? [
504
+ h(VxeUICheckboxComponent, {
505
+ modelValue: hasTree ? defaultOptions.isTreeAllExpanded : false,
506
+ disabled: hasEmptyData || !hasTree,
507
+ title: getI18n('vxe.export.expTreeAllExpandTitle'),
508
+ content: getI18n('vxe.export.expOptTreeAllExpand'),
509
+ 'onUpdate:modelValue' (value: any) {
510
+ defaultOptions.isTreeAllExpanded = value
511
+ }
512
+ }),
513
+ h(VxeUICheckboxComponent, {
514
+ modelValue: hasRowGroup ? defaultOptions.isRowGroupAllExpanded : false,
515
+ disabled: hasEmptyData || !hasRowGroup,
516
+ title: getI18n('vxe.export.expRowGroupAllExpandTitle'),
517
+ content: getI18n('vxe.export.expOptRowGroupAllExpand'),
518
+ 'onUpdate:modelValue' (value: any) {
519
+ defaultOptions.isRowGroupAllExpanded = value
520
+ }
521
+ })
522
+ ]
523
+ : [])
509
524
  ])
510
525
  ])
511
526
  ]
@@ -3,7 +3,7 @@ import XEUtils from 'xe-utils'
3
3
  import { VxeUI } from '../../../ui'
4
4
  import { isColumnInfo, getCellValue, createHandleGetRowId } from '../../src/util'
5
5
  import { parseFile, formatText, eqEmptyValue } from '../../../ui/src/utils'
6
- import { hasClass } from '../../../ui/src/dom'
6
+ import { hasClass, toCssUnit } from '../../../ui/src/dom'
7
7
  import { createHtmlPage, getExportBlobByContent } from './util'
8
8
  import { createComponentLog } from '../../../ui/src/log'
9
9
 
@@ -714,48 +714,129 @@ hooks.add('tableExportModule', {
714
714
  return isEllipsis
715
715
  }
716
716
 
717
+ const getCustomColKey = (conf: VxeTableDefines.ColumnInfo<any> | VxeTablePropTypes.ExportOrPrintColumnOption) => {
718
+ return `${conf.field || ''}:${conf.type || ''}`
719
+ }
720
+
717
721
  const toHtml = (opts: VxeTablePropTypes.ExportHandleOptions, columns: VxeTableDefines.ColumnInfo[], datas: any[]) => {
718
722
  const { id, border, treeConfig, headerAlign: allHeaderAlign, align: allAlign, footerAlign: allFooterAlign, showOverflow: allColumnOverflow, showHeaderOverflow: allColumnHeaderOverflow } = props
719
723
  const { isAllSelected, isIndeterminate } = reactData
720
724
  const { mergeBodyCellMaps, mergeFooterCellMaps } = internalData
721
725
  const treeOpts = computeTreeOpts.value
722
- const { print: isPrint, isHeader, isFooter, isColgroup, isMerge, colgroups, original } = opts
726
+ const { print: isPrint, widthMode, isHeader, isFooter, isColgroup, isMerge, colgroups, _columnConfs, original } = opts
727
+ const isAutoWidth = widthMode === 'auto'
728
+ const isScaleWidth = widthMode === 'scale'
729
+ const isDefaultWidth = !isAutoWidth && !isScaleWidth
730
+
731
+ const customWidthMaps: Record<string, number | string> = {}
732
+ if (_columnConfs) {
733
+ _columnConfs.forEach(conf => {
734
+ if (!isColumnInfo(conf)) {
735
+ if ((conf.field || conf.type) && conf.width) {
736
+ customWidthMaps[getCustomColKey(conf)] = conf.width
737
+ }
738
+ }
739
+ })
740
+ }
741
+
742
+ // 计算宽度
743
+ const colWidthMaps: Record<string, number> = {}
744
+ const printWidthMaps: Record<string, number> = {}
745
+ if (isPrint) {
746
+ let tableWidth = 0
747
+ columns.forEach(column => {
748
+ tableWidth += column.renderWidth
749
+ })
750
+ if (colgroups) {
751
+ colgroups.forEach((cols) => {
752
+ cols.forEach((column: any) => {
753
+ if (!column.childNodes || !column.childNodes.length) {
754
+ return
755
+ }
756
+ let childWidth = 0
757
+ let countChild = 0
758
+ XEUtils.eachTree([column], item => {
759
+ if (!item.childNodes || !column.childNodes.length) {
760
+ countChild++
761
+ }
762
+ const ptWidth = printWidthMaps[item.id]
763
+ childWidth += ptWidth || 0
764
+ }, { children: 'childNodes' })
765
+ const colWidth = childWidth - countChild
766
+ colWidthMaps[column.id] = colWidth
767
+ printWidthMaps[column.id] = XEUtils.floor(colWidth / tableWidth * 180, 2)
768
+ })
769
+ })
770
+ }
771
+ columns.forEach(column => {
772
+ const colWidth = column.renderWidth
773
+ if (column.width) {
774
+ colWidthMaps[column.id] = colWidth
775
+ }
776
+ printWidthMaps[column.id] = XEUtils.floor(colWidth / tableWidth * 180, 2)
777
+ })
778
+ }
779
+
780
+ const getHeaderWidthStyle = (column: VxeTableDefines.ColumnInfo) => {
781
+ const cmColKey = getCustomColKey(column)
782
+ const cmWidthMaps = customWidthMaps[cmColKey]
783
+ if (cmWidthMaps) {
784
+ return 'width:' + toCssUnit(cmWidthMaps)
785
+ }
786
+ if (isAutoWidth) {
787
+ return ''
788
+ }
789
+ if (isScaleWidth) {
790
+ return printWidthMaps[column.id] ? ('width:' + printWidthMaps[column.id] + 'mm') : ''
791
+ }
792
+ return colWidthMaps[column.id] ? ('width:' + toCssUnit(colWidthMaps[column.id])) : ''
793
+ }
794
+
795
+ const getCellWidthStyle = (column: VxeTableDefines.ColumnInfo) => {
796
+ const cmColKey = getCustomColKey(column)
797
+ const cmWidthMaps = customWidthMaps[cmColKey]
798
+ if (cmWidthMaps) {
799
+ return 'width:' + toCssUnit(cmWidthMaps)
800
+ }
801
+ if (isAutoWidth || isDefaultWidth) {
802
+ return ''
803
+ }
804
+ if (isScaleWidth) {
805
+ return printWidthMaps[column.id] ? ('width:' + printWidthMaps[column.id] + 'mm') : ''
806
+ }
807
+ return colWidthMaps[column.id] ? ('width:' + toCssUnit(colWidthMaps[column.id])) : ''
808
+ }
809
+
723
810
  const allCls = 'check-all'
724
811
  const clss = [
725
812
  'vxe-table',
726
813
  `border--${toTableBorder(border)}`,
727
814
  isPrint ? 'is--print' : '',
815
+ isAutoWidth ? 'is--auto-width' : '',
816
+ isScaleWidth ? 'is--scale-width' : '',
817
+ isDefaultWidth ? 'is--default-width' : '',
728
818
  isHeader ? 'is--header' : ''
729
819
  ].filter(cls => cls)
730
820
  const tables = [
731
821
  `<table class="${clss.join(' ')}" border="0" cellspacing="0" cellpadding="0">`,
732
- `<colgroup>${columns.map((column: any) => `<col style="width:${column.renderWidth}px">`).join('')}</colgroup>`
822
+ `<colgroup>${columns.map((column) => `<col style="${getHeaderWidthStyle(column)}">`).join('')}</colgroup>`
733
823
  ]
734
824
  if (isHeader) {
735
825
  tables.push('<thead>')
736
826
  if (isColgroup && !original) {
737
- colgroups.forEach((cols: any) => {
827
+ colgroups.forEach((cols) => {
738
828
  tables.push(
739
829
  `<tr>${cols.map((column: any) => {
740
830
  const headAlign = column.headerAlign || column.align || allHeaderAlign || allAlign
741
831
  const classNames = hasEllipsis(column, 'showHeaderOverflow', allColumnHeaderOverflow) ? ['col--ellipsis'] : []
742
832
  const cellTitle = getHeaderTitle(opts, column)
743
- let childWidth = 0
744
- let countChild = 0
745
- XEUtils.eachTree([column], item => {
746
- if (!item.childNodes || !column.childNodes.length) {
747
- countChild++
748
- }
749
- childWidth += item.renderWidth
750
- }, { children: 'childNodes' })
751
- const cellWidth = childWidth - countChild
752
833
  if (headAlign) {
753
834
  classNames.push(`col--${headAlign}`)
754
835
  }
755
836
  if (column.type === 'checkbox') {
756
- return `<th class="${classNames.join(' ')}" colspan="${column._colSpan}" rowspan="${column._rowSpan}"><div ${isPrint ? '' : `style="width: ${cellWidth}px"`}><input type="checkbox" class="${allCls}" ${isAllSelected ? 'checked' : ''}><span>${cellTitle}</span></div></th>`
837
+ return `<th class="${classNames.join(' ')}" colspan="${column._colSpan}" rowspan="${column._rowSpan}"><div style="${getCellWidthStyle(column)}"><input type="checkbox" class="${allCls}" ${isAllSelected ? 'checked' : ''}><span>${cellTitle}</span></div></th>`
757
838
  }
758
- return `<th class="${classNames.join(' ')}" colspan="${column._colSpan}" rowspan="${column._rowSpan}" title="${cellTitle}"><div ${isPrint ? '' : `style="width: ${cellWidth}px"`}><span>${formatText(cellTitle, true)}</span></div></th>`
839
+ return `<th class="${classNames.join(' ')}" colspan="${column._colSpan}" rowspan="${column._rowSpan}" title="${cellTitle}"><div style="${getCellWidthStyle(column)}"><span>${formatText(cellTitle, true)}</span></div></th>`
759
840
  }).join('')}</tr>`
760
841
  )
761
842
  })
@@ -769,9 +850,9 @@ hooks.add('tableExportModule', {
769
850
  classNames.push(`col--${headAlign}`)
770
851
  }
771
852
  if (column.type === 'checkbox') {
772
- return `<th class="${classNames.join(' ')}"><div ${isPrint ? '' : `style="width: ${column.renderWidth}px"`}><input type="checkbox" class="${allCls}" ${isAllSelected ? 'checked' : ''}><span>${cellTitle}</span></div></th>`
853
+ return `<th class="${classNames.join(' ')}"><div style="${getCellWidthStyle(column)}"><input type="checkbox" class="${allCls}" ${isAllSelected ? 'checked' : ''}><span>${cellTitle}</span></div></th>`
773
854
  }
774
- return `<th class="${classNames.join(' ')}" title="${cellTitle}"><div ${isPrint ? '' : `style="width: ${column.renderWidth}px"`}><span>${formatText(cellTitle, true)}</span></div></th>`
855
+ return `<th class="${classNames.join(' ')}" title="${cellTitle}"><div style="${getCellWidthStyle(column)}"><span>${formatText(cellTitle, true)}</span></div></th>`
775
856
  }).join('')}</tr>`
776
857
  )
777
858
  }
@@ -797,18 +878,18 @@ hooks.add('tableExportModule', {
797
878
  }
798
879
  classNames.push('vxe-table--tree-node')
799
880
  if (column.type === 'radio') {
800
- return `<td class="${classNames.join(' ')}" title="${cellValue}"><div ${isPrint ? '' : `style="width: ${column.renderWidth}px"`}><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level * treeOpts.indent}px"><div class="vxe-table--tree-icon-wrapper">${treeIcon}</div><div class="vxe-table--tree-cell"><input type="radio" name="radio_${id}" ${item._radioDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._radioLabel}</span></div></div></div></td>`
881
+ return `<td class="${classNames.join(' ')}" title="${cellValue}"><div style="${getCellWidthStyle(column)}"><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level * treeOpts.indent}px"><div class="vxe-table--tree-icon-wrapper">${treeIcon}</div><div class="vxe-table--tree-cell"><input type="radio" name="radio_${id}" ${item._radioDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._radioLabel}</span></div></div></div></td>`
801
882
  } else if (column.type === 'checkbox') {
802
- return `<td class="${classNames.join(' ')}" title="${cellValue}"><div ${isPrint ? '' : `style="width: ${column.renderWidth}px"`}><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level * treeOpts.indent}px"><div class="vxe-table--tree-icon-wrapper">${treeIcon}</div><div class="vxe-table--tree-cell"><input type="checkbox" ${item._checkboxDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._checkboxLabel}</span></div></div></div></td>`
883
+ return `<td class="${classNames.join(' ')}" title="${cellValue}"><div style="${getCellWidthStyle(column)}"><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level * treeOpts.indent}px"><div class="vxe-table--tree-icon-wrapper">${treeIcon}</div><div class="vxe-table--tree-cell"><input type="checkbox" ${item._checkboxDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._checkboxLabel}</span></div></div></div></td>`
803
884
  }
804
- return `<td class="${classNames.join(' ')}" title="${cellValue}"><div ${isPrint ? '' : `style="width: ${column.renderWidth}px"`}><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level * treeOpts.indent}px"><div class="vxe-table--tree-icon-wrapper">${treeIcon}</div><div class="vxe-table--tree-cell">${cellValue}</div></div></div></td>`
885
+ return `<td class="${classNames.join(' ')}" title="${cellValue}"><div style="${getCellWidthStyle(column)}"><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level * treeOpts.indent}px"><div class="vxe-table--tree-icon-wrapper">${treeIcon}</div><div class="vxe-table--tree-cell">${cellValue}</div></div></div></td>`
805
886
  }
806
887
  if (column.type === 'radio') {
807
- return `<td class="${classNames.join(' ')}"><div ${isPrint ? '' : `style="width: ${column.renderWidth}px"`}><input type="radio" name="radio_${id}" ${item._radioDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._radioLabel}</span></div></td>`
888
+ return `<td class="${classNames.join(' ')}"><div style="${getCellWidthStyle(column)}"><input type="radio" name="radio_${id}" ${item._radioDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._radioLabel}</span></div></td>`
808
889
  } else if (column.type === 'checkbox') {
809
- return `<td class="${classNames.join(' ')}"><div ${isPrint ? '' : `style="width: ${column.renderWidth}px"`}><input type="checkbox" ${item._checkboxDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._checkboxLabel}</span></div></td>`
890
+ return `<td class="${classNames.join(' ')}"><div style="${getCellWidthStyle(column)}"><input type="checkbox" ${item._checkboxDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._checkboxLabel}</span></div></td>`
810
891
  }
811
- return `<td class="${classNames.join(' ')}" title="${cellValue}"><div ${isPrint ? '' : `style="width: ${column.renderWidth}px"`}>${formatText(cellValue, true)}</div></td>`
892
+ return `<td class="${classNames.join(' ')}" title="${cellValue}"><div style="${getCellWidthStyle(column)}">${formatText(cellValue, true)}</div></td>`
812
893
  }).join('') + '</tr>'
813
894
  )
814
895
  })
@@ -842,11 +923,11 @@ hooks.add('tableExportModule', {
842
923
  classNames.push(`col--${cellAlign}`)
843
924
  }
844
925
  if (column.type === 'radio') {
845
- return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}"><div ${isPrint ? '' : `style="width: ${column.renderWidth}px"`}><input type="radio" name="radio_${id}" ${item._radioDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._radioLabel}</span></div></td>`
926
+ return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}"><div style="${getCellWidthStyle(column)}"><input type="radio" name="radio_${id}" ${item._radioDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._radioLabel}</span></div></td>`
846
927
  } else if (column.type === 'checkbox') {
847
- return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}"><div ${isPrint ? '' : `style="width: ${column.renderWidth}px"`}><input type="checkbox" ${item._checkboxDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._checkboxLabel}</span></div></td>`
928
+ return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}"><div style="${getCellWidthStyle(column)}"><input type="checkbox" ${item._checkboxDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._checkboxLabel}</span></div></td>`
848
929
  }
849
- return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}" title="${cellValue}"><div ${isPrint ? '' : `style="width: ${column.renderWidth}px"`}>${formatText(cellValue, true)}</div></td>`
930
+ return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}" title="${cellValue}"><div style="${getCellWidthStyle(column)}">${formatText(cellValue, true)}</div></td>`
850
931
  }).join('') + '</tr>'
851
932
  )
852
933
  })
@@ -886,7 +967,7 @@ hooks.add('tableExportModule', {
886
967
  if (footAlign) {
887
968
  classNames.push(`col--${footAlign}`)
888
969
  }
889
- return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}" title="${cellValue}"><div ${isPrint ? '' : `style="width: ${column.renderWidth}px"`}>${formatText(cellValue, true)}</div></td>`
970
+ return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}" title="${cellValue}"><div style="${getCellWidthStyle(column)}">${formatText(cellValue, true)}</div></td>`
890
971
  }).join('')}</tr>`
891
972
  )
892
973
  })
@@ -1307,6 +1388,9 @@ hooks.add('tableExportModule', {
1307
1388
  if (!typeList.some(item => item.value === type)) {
1308
1389
  exportParams.type = typeList[0].value
1309
1390
  }
1391
+ if (!exportParams.widthMode) {
1392
+ exportParams.widthMode = ''
1393
+ }
1310
1394
  initStore.export = true
1311
1395
  return nextTick()
1312
1396
  }
@@ -1395,7 +1479,7 @@ hooks.add('tableExportModule', {
1395
1479
  return isChecked
1396
1480
  }, { children: 'children', mapChildren: 'childNodes', original: true })
1397
1481
  }
1398
- const handleOptions: VxeTablePropTypes.ExportHandleOptions = Object.assign({ } as { data: any[], colgroups: any[], columns: any[] }, opts, { filename: '', sheetName: '' })
1482
+ const handleOptions: VxeTablePropTypes.ExportHandleOptions = Object.assign({ } as { data: any[], colgroups: any[], columns: any[] }, opts, { filename: '', sheetName: '', _columnConfs: columns })
1399
1483
  // 如果设置源数据,则默认导出设置了字段的列
1400
1484
  if (!isCustomCol && !columnFilterMethod) {
1401
1485
  columnFilterMethod = ({ column }) => {
@@ -1,7 +1,7 @@
1
1
  import type { VxeTablePropTypes } from '../../../../types'
2
2
 
3
3
  // 默认导出或打印的 HTML 样式
4
- const defaultHtmlStyle = 'body{margin:0;padding: 0 1px;color:#333333;font-size:14px;font-family:"Microsoft YaHei",微软雅黑,"MicrosoftJhengHei",华文细黑,STHeiti,MingLiu}body *{-webkit-box-sizing:border-box;box-sizing:border-box}.vxe-table{border-collapse:collapse;text-align:left;border-spacing:0}.vxe-table:not(.is--print){table-layout:fixed}.vxe-table,.vxe-table th,.vxe-table td,.vxe-table td{border-color:#D0D0D0;border-style:solid;border-width:0}.vxe-table.is--print{width:100%}.border--default,.border--full,.border--outer{border-top-width:1px}.border--default,.border--full,.border--outer{border-left-width:1px}.border--outer,.border--default th,.border--default td,.border--full th,.border--full td,.border--outer th,.border--inner th,.border--inner td{border-bottom-width:1px}.border--default,.border--outer,.border--full th,.border--full td{border-right-width:1px}.border--default th,.border--full th,.border--outer th{background-color:#f8f8f9}.vxe-table td>div,.vxe-table th>div{padding:.5em .4em}.col--center{text-align:center}.col--right{text-align:right}.vxe-table:not(.is--print) .col--ellipsis>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-all}.vxe-table--tree-node{text-align:left}.vxe-table--tree-node-wrapper{position:relative}.vxe-table--tree-icon-wrapper{position:absolute;top:50%;width:1em;height:1em;text-align:center;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.vxe-table--tree-unfold-icon,.vxe-table--tree-fold-icon{position:absolute;width:0;height:0;border-style:solid;border-width:.5em;border-right-color:transparent;border-bottom-color:transparent}.vxe-table--tree-unfold-icon{left:.3em;top:0;border-left-color:#939599;border-top-color:transparent}.vxe-table--tree-fold-icon{left:0;top:.3em;border-left-color:transparent;border-top-color:#939599}.vxe-table--tree-cell{display:block;padding-left:1.5em}.vxe-table input[type="checkbox"]{margin:0}.vxe-table input[type="checkbox"],.vxe-table input[type="radio"],.vxe-table input[type="checkbox"]+span,.vxe-table input[type="radio"]+span{vertical-align:middle;padding-left:0.4em}'
4
+ const defaultHtmlStyle = 'body{padding:0;color:rgba(0,0,0,0.7);font-family:"Microsoft YaHei",微软雅黑,"MicrosoftJhengHei",华文细黑,STHeiti,MingLiu;}body *{-webkit-box-sizing:border-box;box-sizing:border-box;}.vxe-table{border-collapse:collapse;text-align:left;border-spacing:0;}.vxe-table.is--default-width,.vxe-table.is--auto-width{width:100%;}.vxe-table.is--scale-width{table-layout:fixed;}.vxe-table,.vxe-table th,.vxe-table td,.vxe-table td{word-break:break-all;border-color:#D0D0D0;border-style:solid;border-width:0;}.border--default,.border--full,.border--outer{border-top-width:1px;}.border--default,.border--full,.border--outer{border-left-width:1px}.border--outer,.border--default th,.border--default td,.border--full th,.border--full td,.border--outer th,.border--inner th,.border--inner td{border-bottom-width:1px;}.border--default,.border--outer,.border--full th,.border--full td{border-right-width:1px;}.border--default th,.border--full th,.border--outer th{background-color:#f8f8f9;}.vxe-table td>div,.vxe-table th>div{padding:0.5em 0.4em;}.col--center{text-align:center;}.col--right{text-align:right;}.vxe-table .col--ellipsis>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-all;}.vxe-table--tree-node{text-align:left;}.vxe-table--tree-node-wrapper{position:relative;}.vxe-table--tree-icon-wrapper{position:absolute;top:50%;width:1em;height:1em;text-align:center;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;}.vxe-table--tree-unfold-icon,.vxe-table--tree-fold-icon{position:absolute;width:0;height:0;border-style:solid;border-width:0.5em;border-right-color:transparent;border-bottom-color:transparent;}.vxe-table--tree-unfold-icon{left:.3em;top:0;border-left-color:#939599;border-top-color:transparent;}.vxe-table--tree-fold-icon{left:0;top:.3em;border-left-color:transparent;border-top-color:#939599;}.vxe-table--tree-cell{display:block;padding-left:1.5em;}.vxe-table input[type="checkbox"]{margin:0;}.vxe-table input[type="checkbox"],.vxe-table input[type="radio"],.vxe-table input[type="checkbox"]+span,.vxe-table input[type="radio"]+span{vertical-align:middle;padding-left:0.4em}'
5
5
 
6
6
  export function getExportBlobByContent (content: string, options: { type: string }) {
7
7
  return new Blob([content], { type: `text/${options.type};charset=utf-8;` })
@@ -163,7 +163,7 @@ export default defineVxeComponent({
163
163
  const cellOverflow = XEUtils.eqNull(showOverflow) ? allShowOverflow : showOverflow
164
164
  const showEllipsis = cellOverflow === 'ellipsis'
165
165
  const showTitle = cellOverflow === 'title'
166
- const showTooltip = cellOverflow === true || cellOverflow === 'tooltip'
166
+ const showTooltip = cellOverflow === true ? tooltipOpts.mode === 'tooltip' : cellOverflow === 'tooltip'
167
167
  const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis
168
168
  const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable))
169
169
  const isCsHeight = !!customCellHeight
@@ -76,7 +76,7 @@ export default defineVxeComponent({
76
76
  const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign
77
77
  const showEllipsis = footOverflow === 'ellipsis'
78
78
  const showTitle = footOverflow === 'title'
79
- const showTooltip = footOverflow === true || footOverflow === 'tooltip'
79
+ const showTooltip = footOverflow === true ? footerTooltipOpts.mode === 'tooltip' : footOverflow === 'tooltip'
80
80
  const hasEllipsis = showTitle || showTooltip || showEllipsis
81
81
  const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable))
82
82
  const attrs: any = { colid }
@@ -29,7 +29,7 @@ export default defineVxeComponent({
29
29
  const $xeTable = inject('$xeTable', {} as VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods)
30
30
 
31
31
  const { xID, props: tableProps, reactData: tableReactData, internalData: tableInternalData } = $xeTable
32
- const { computeColumnOpts, computeColumnDragOpts, computeCellOpts, computeMouseOpts, computeHeaderCellOpts, computeDefaultRowHeight, computeVirtualXOpts, computeFloatingFilterOpts, computeIsHeaderRenderOptimize } = $xeTable.getComputeMaps()
32
+ const { computeColumnOpts, computeColumnDragOpts, computeCellOpts, computeMouseOpts, computeHeaderCellOpts, computeDefaultRowHeight, computeVirtualXOpts, computeFloatingFilterOpts, computeIsHeaderRenderOptimize, computeHeaderTooltipOpts } = $xeTable.getComputeMaps()
33
33
 
34
34
  const headerColumn = ref<VxeTableDefines.ColumnInfo[][]>([])
35
35
 
@@ -69,6 +69,7 @@ export default defineVxeComponent({
69
69
  const virtualXOpts = computeVirtualXOpts.value
70
70
  const columnOpts = computeColumnOpts.value
71
71
  const columnDragOpts = computeColumnDragOpts.value
72
+ const headerTooltipOpts = computeHeaderTooltipOpts.value
72
73
  const cellOpts = computeCellOpts.value
73
74
  const defaultRowHeight = computeDefaultRowHeight.value
74
75
  const headerCellOpts = computeHeaderCellOpts.value
@@ -89,7 +90,7 @@ export default defineVxeComponent({
89
90
  const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign
90
91
  const showEllipsis = headOverflow === 'ellipsis'
91
92
  const showTitle = headOverflow === 'title'
92
- const showTooltip = headOverflow === true || headOverflow === 'tooltip'
93
+ const showTooltip = headOverflow === true ? headerTooltipOpts.mode === 'tooltip' : headOverflow === 'tooltip'
93
94
  const hasEllipsis = showTitle || showTooltip || showEllipsis
94
95
  let hasFilter = false
95
96
  let firstFilterOption: VxeTableDefines.FilterOption | null = null
@@ -262,6 +263,7 @@ export default defineVxeComponent({
262
263
  const { showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign } = tableProps
263
264
  const { currentColumn, overflowX } = tableReactData
264
265
  const { fullColumnIdData } = tableInternalData
266
+ const headerTooltipOpts = computeHeaderTooltipOpts.value
265
267
  const cellOpts = computeCellOpts.value
266
268
  const defaultRowHeight = computeDefaultRowHeight.value
267
269
  const headerCellOpts = computeHeaderCellOpts.value
@@ -284,7 +286,7 @@ export default defineVxeComponent({
284
286
  const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign
285
287
  const showEllipsis = headOverflow === 'ellipsis'
286
288
  const showTitle = headOverflow === 'title'
287
- const showTooltip = headOverflow === true || headOverflow === 'tooltip'
289
+ const showTooltip = headOverflow === true ? headerTooltipOpts.mode === 'tooltip' : headOverflow === 'tooltip'
288
290
  const hasEllipsis = showTitle || showTooltip || showEllipsis
289
291
  let hasFilter = false
290
292
  let firstFilterOption: VxeTableDefines.FilterOption | null = null