vxe-table 3.22.2 → 3.22.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 (164) hide show
  1. package/es/locale/lang/ar-EG.js +7 -0
  2. package/es/locale/lang/de-DE.js +7 -0
  3. package/es/locale/lang/en-US.js +7 -0
  4. package/es/locale/lang/es-ES.js +7 -0
  5. package/es/locale/lang/fr-FR.js +7 -0
  6. package/es/locale/lang/hu-HU.js +7 -0
  7. package/es/locale/lang/hy-AM.js +7 -0
  8. package/es/locale/lang/id-ID.js +7 -0
  9. package/es/locale/lang/it-IT.js +7 -0
  10. package/es/locale/lang/ja-JP.js +7 -0
  11. package/es/locale/lang/ko-KR.js +7 -0
  12. package/es/locale/lang/ms-MY.js +7 -0
  13. package/es/locale/lang/nb-NO.js +7 -0
  14. package/es/locale/lang/pt-BR.js +7 -0
  15. package/es/locale/lang/ru-RU.js +7 -0
  16. package/es/locale/lang/th-TH.js +7 -0
  17. package/es/locale/lang/ug-CN.js +7 -0
  18. package/es/locale/lang/uk-UA.js +7 -0
  19. package/es/locale/lang/uz-UZ.js +7 -0
  20. package/es/locale/lang/vi-VN.js +7 -0
  21. package/es/locale/lang/zh-CHT.js +7 -0
  22. package/es/locale/lang/zh-CN.js +7 -0
  23. package/es/style.css +1 -1
  24. package/es/table/module/export/export-panel.js +384 -335
  25. package/es/table/module/export/mixin.js +106 -28
  26. package/es/table/module/export/util.js +1 -1
  27. package/es/table/src/body.js +1 -1
  28. package/es/table/src/footer.js +1 -1
  29. package/es/table/src/header.js +5 -3
  30. package/es/table/src/methods.js +30 -12
  31. package/es/table/src/table.js +24 -24
  32. package/es/table/src/util.js +1 -0
  33. package/es/ui/index.js +2 -1
  34. package/es/ui/src/log.js +1 -1
  35. package/lib/index.umd.js +210 -87
  36. package/lib/index.umd.min.js +1 -1
  37. package/lib/locale/lang/ar-EG.js +7 -0
  38. package/lib/locale/lang/ar-EG.min.js +1 -1
  39. package/lib/locale/lang/ar-EG.umd.js +7 -0
  40. package/lib/locale/lang/de-DE.js +7 -0
  41. package/lib/locale/lang/de-DE.min.js +1 -1
  42. package/lib/locale/lang/de-DE.umd.js +7 -0
  43. package/lib/locale/lang/en-US.js +7 -0
  44. package/lib/locale/lang/en-US.min.js +1 -1
  45. package/lib/locale/lang/en-US.umd.js +7 -0
  46. package/lib/locale/lang/es-ES.js +7 -0
  47. package/lib/locale/lang/es-ES.min.js +1 -1
  48. package/lib/locale/lang/es-ES.umd.js +7 -0
  49. package/lib/locale/lang/fr-FR.js +7 -0
  50. package/lib/locale/lang/fr-FR.min.js +1 -1
  51. package/lib/locale/lang/fr-FR.umd.js +7 -0
  52. package/lib/locale/lang/hu-HU.js +7 -0
  53. package/lib/locale/lang/hu-HU.min.js +1 -1
  54. package/lib/locale/lang/hu-HU.umd.js +7 -0
  55. package/lib/locale/lang/hy-AM.js +7 -0
  56. package/lib/locale/lang/hy-AM.min.js +1 -1
  57. package/lib/locale/lang/hy-AM.umd.js +7 -0
  58. package/lib/locale/lang/id-ID.js +7 -0
  59. package/lib/locale/lang/id-ID.min.js +1 -1
  60. package/lib/locale/lang/id-ID.umd.js +7 -0
  61. package/lib/locale/lang/it-IT.js +7 -0
  62. package/lib/locale/lang/it-IT.min.js +1 -1
  63. package/lib/locale/lang/it-IT.umd.js +7 -0
  64. package/lib/locale/lang/ja-JP.js +7 -0
  65. package/lib/locale/lang/ja-JP.min.js +1 -1
  66. package/lib/locale/lang/ja-JP.umd.js +7 -0
  67. package/lib/locale/lang/ko-KR.js +7 -0
  68. package/lib/locale/lang/ko-KR.min.js +1 -1
  69. package/lib/locale/lang/ko-KR.umd.js +7 -0
  70. package/lib/locale/lang/ms-MY.js +7 -0
  71. package/lib/locale/lang/ms-MY.min.js +1 -1
  72. package/lib/locale/lang/ms-MY.umd.js +7 -0
  73. package/lib/locale/lang/nb-NO.js +7 -0
  74. package/lib/locale/lang/nb-NO.min.js +1 -1
  75. package/lib/locale/lang/nb-NO.umd.js +7 -0
  76. package/lib/locale/lang/pt-BR.js +7 -0
  77. package/lib/locale/lang/pt-BR.min.js +1 -1
  78. package/lib/locale/lang/pt-BR.umd.js +7 -0
  79. package/lib/locale/lang/ru-RU.js +7 -0
  80. package/lib/locale/lang/ru-RU.min.js +1 -1
  81. package/lib/locale/lang/ru-RU.umd.js +7 -0
  82. package/lib/locale/lang/th-TH.js +7 -0
  83. package/lib/locale/lang/th-TH.min.js +1 -1
  84. package/lib/locale/lang/th-TH.umd.js +7 -0
  85. package/lib/locale/lang/ug-CN.js +7 -0
  86. package/lib/locale/lang/ug-CN.min.js +1 -1
  87. package/lib/locale/lang/ug-CN.umd.js +7 -0
  88. package/lib/locale/lang/uk-UA.js +7 -0
  89. package/lib/locale/lang/uk-UA.min.js +1 -1
  90. package/lib/locale/lang/uk-UA.umd.js +7 -0
  91. package/lib/locale/lang/uz-UZ.js +7 -0
  92. package/lib/locale/lang/uz-UZ.min.js +1 -1
  93. package/lib/locale/lang/uz-UZ.umd.js +7 -0
  94. package/lib/locale/lang/vi-VN.js +7 -0
  95. package/lib/locale/lang/vi-VN.min.js +1 -1
  96. package/lib/locale/lang/vi-VN.umd.js +7 -0
  97. package/lib/locale/lang/zh-CHT.js +7 -0
  98. package/lib/locale/lang/zh-CHT.min.js +1 -1
  99. package/lib/locale/lang/zh-CHT.umd.js +7 -0
  100. package/lib/locale/lang/zh-CN.js +7 -0
  101. package/lib/locale/lang/zh-CN.min.js +1 -1
  102. package/lib/locale/lang/zh-CN.umd.js +7 -0
  103. package/lib/style.css +1 -1
  104. package/lib/table/module/export/export-panel.js +50 -22
  105. package/lib/table/module/export/export-panel.min.js +1 -1
  106. package/lib/table/module/export/mixin.js +106 -28
  107. package/lib/table/module/export/mixin.min.js +1 -1
  108. package/lib/table/module/export/util.js +1 -1
  109. package/lib/table/module/export/util.min.js +1 -1
  110. package/lib/table/src/body.js +1 -1
  111. package/lib/table/src/body.min.js +1 -1
  112. package/lib/table/src/footer.js +1 -1
  113. package/lib/table/src/footer.min.js +1 -1
  114. package/lib/table/src/header.js +5 -3
  115. package/lib/table/src/header.min.js +1 -1
  116. package/lib/table/src/methods.js +7 -7
  117. package/lib/table/src/methods.min.js +1 -1
  118. package/lib/table/src/table.js +28 -22
  119. package/lib/table/src/table.min.js +1 -1
  120. package/lib/table/src/util.js +1 -0
  121. package/lib/table/src/util.min.js +1 -1
  122. package/lib/ui/index.js +2 -1
  123. package/lib/ui/index.min.js +1 -1
  124. package/lib/ui/src/log.js +1 -1
  125. package/lib/ui/src/log.min.js +1 -1
  126. package/package.json +2 -2
  127. package/packages/locale/lang/ar-EG.ts +7 -0
  128. package/packages/locale/lang/de-DE.ts +7 -0
  129. package/packages/locale/lang/en-US.ts +7 -0
  130. package/packages/locale/lang/es-ES.ts +7 -0
  131. package/packages/locale/lang/fr-FR.ts +7 -0
  132. package/packages/locale/lang/hu-HU.ts +7 -0
  133. package/packages/locale/lang/hy-AM.ts +7 -0
  134. package/packages/locale/lang/id-ID.ts +7 -0
  135. package/packages/locale/lang/it-IT.ts +7 -0
  136. package/packages/locale/lang/ja-JP.ts +7 -0
  137. package/packages/locale/lang/ko-KR.ts +7 -0
  138. package/packages/locale/lang/ms-MY.ts +7 -0
  139. package/packages/locale/lang/nb-NO.ts +7 -0
  140. package/packages/locale/lang/pt-BR.ts +7 -0
  141. package/packages/locale/lang/ru-RU.ts +7 -0
  142. package/packages/locale/lang/th-TH.ts +7 -0
  143. package/packages/locale/lang/ug-CN.ts +7 -0
  144. package/packages/locale/lang/uk-UA.ts +7 -0
  145. package/packages/locale/lang/uz-UZ.ts +7 -0
  146. package/packages/locale/lang/vi-VN.ts +7 -0
  147. package/packages/locale/lang/zh-CHT.ts +7 -0
  148. package/packages/locale/lang/zh-CN.ts +7 -0
  149. package/packages/table/module/export/export-panel.ts +383 -333
  150. package/packages/table/module/export/mixin.ts +130 -46
  151. package/packages/table/module/export/util.ts +1 -1
  152. package/packages/table/src/body.ts +1 -1
  153. package/packages/table/src/footer.ts +1 -1
  154. package/packages/table/src/header.ts +5 -3
  155. package/packages/table/src/methods.ts +38 -17
  156. package/packages/table/src/table.ts +24 -24
  157. package/packages/table/src/util.ts +3 -2
  158. package/packages/ui/index.ts +1 -0
  159. /package/es/{iconfont.1784122379007.ttf → iconfont.1784366371085.ttf} +0 -0
  160. /package/es/{iconfont.1784122379007.woff → iconfont.1784366371085.woff} +0 -0
  161. /package/es/{iconfont.1784122379007.woff2 → iconfont.1784366371085.woff2} +0 -0
  162. /package/lib/{iconfont.1784122379007.ttf → iconfont.1784366371085.ttf} +0 -0
  163. /package/lib/{iconfont.1784122379007.woff → iconfont.1784366371085.woff} +0 -0
  164. /package/lib/{iconfont.1784122379007.woff2 → iconfont.1784366371085.woff2} +0 -0
@@ -2,7 +2,7 @@ import XEUtils from 'xe-utils'
2
2
  import { VxeUI } from '../../../ui'
3
3
  import { isColumnInfo, getCellValue, createHandleGetRowId } from '../../src/util'
4
4
  import { parseFile, formatText, eqEmptyValue } from '../../../ui/src/utils'
5
- import { hasClass } from '../../../ui/src/dom'
5
+ import { hasClass, toCssUnit } from '../../../ui/src/dom'
6
6
  import { createHtmlPage, getExportBlobByContent } from './util'
7
7
  import { createComponentLog } from '../../../ui/src/log'
8
8
 
@@ -491,6 +491,10 @@ function hasEllipsis ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, co
491
491
  return isEllipsis
492
492
  }
493
493
 
494
+ function getCustomColKey (conf: VxeTableDefines.ColumnInfo<any> | VxeTablePropTypes.ExportOrPrintColumnOption) {
495
+ return `${conf.field || ''}:${conf.type || ''}`
496
+ }
497
+
494
498
  function toHtml ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: VxeTablePropTypes.ExportHandleOptions, columns: VxeTableDefines.ColumnInfo[], datas: any[]) {
495
499
  const props = $xeTable
496
500
  const reactData = $xeTable as unknown as TableReactData
@@ -500,17 +504,103 @@ function toHtml ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: V
500
504
  const { isAllSelected, isIndeterminate } = reactData
501
505
  const { mergeBodyCellMaps, mergeFooterCellMaps } = internalData
502
506
  const treeOpts = $xeTable.computeTreeOpts
503
- const { print: isPrint, isHeader, isFooter, isColgroup, isMerge, colgroups, original } = opts
507
+ const { print: isPrint, widthMode, isHeader, isFooter, isColgroup, isMerge, colgroups, _columnConfs, original } = opts
508
+ const isAutoWidth = widthMode === 'auto'
509
+ const isScaleWidth = widthMode === 'scale'
510
+ const isDefaultWidth = !isAutoWidth && !isScaleWidth
511
+
512
+ const customWidthMaps: Record<string, number | string> = {}
513
+ if (_columnConfs) {
514
+ _columnConfs.forEach(conf => {
515
+ if (!isColumnInfo(conf)) {
516
+ if ((conf.field || conf.type) && conf.width) {
517
+ customWidthMaps[getCustomColKey(conf)] = conf.width
518
+ }
519
+ }
520
+ })
521
+ }
522
+
523
+ // 计算宽度
524
+ const colWidthMaps: Record<string, number> = {}
525
+ const printWidthMaps: Record<string, number> = {}
526
+ if (isPrint) {
527
+ let tableWidth = 0
528
+ columns.forEach(column => {
529
+ tableWidth += column.renderWidth
530
+ })
531
+ if (colgroups) {
532
+ colgroups.forEach((cols) => {
533
+ cols.forEach((column: any) => {
534
+ if (!column.childNodes || !column.childNodes.length) {
535
+ return
536
+ }
537
+ let childWidth = 0
538
+ let countChild = 0
539
+ XEUtils.eachTree([column], item => {
540
+ if (!item.childNodes || !column.childNodes.length) {
541
+ countChild++
542
+ }
543
+ const ptWidth = printWidthMaps[item.id]
544
+ childWidth += ptWidth || 0
545
+ }, { children: 'childNodes' })
546
+ const colWidth = childWidth - countChild
547
+ colWidthMaps[column.id] = colWidth
548
+ printWidthMaps[column.id] = XEUtils.floor(colWidth / tableWidth * 180, 2)
549
+ })
550
+ })
551
+ }
552
+ columns.forEach(column => {
553
+ const colWidth = column.renderWidth
554
+ if (column.width) {
555
+ colWidthMaps[column.id] = colWidth
556
+ }
557
+ printWidthMaps[column.id] = XEUtils.floor(colWidth / tableWidth * 180, 2)
558
+ })
559
+ }
560
+
561
+ const getHeaderWidthStyle = (column: VxeTableDefines.ColumnInfo) => {
562
+ const cmColKey = getCustomColKey(column)
563
+ const cmWidthMaps = customWidthMaps[cmColKey]
564
+ if (cmWidthMaps) {
565
+ return 'width:' + toCssUnit(cmWidthMaps)
566
+ }
567
+ if (isAutoWidth) {
568
+ return ''
569
+ }
570
+ if (isScaleWidth) {
571
+ return printWidthMaps[column.id] ? ('width:' + printWidthMaps[column.id] + 'mm') : ''
572
+ }
573
+ return colWidthMaps[column.id] ? ('width:' + toCssUnit(colWidthMaps[column.id])) : ''
574
+ }
575
+
576
+ const getCellWidthStyle = (column: VxeTableDefines.ColumnInfo) => {
577
+ const cmColKey = getCustomColKey(column)
578
+ const cmWidthMaps = customWidthMaps[cmColKey]
579
+ if (cmWidthMaps) {
580
+ return 'width:' + toCssUnit(cmWidthMaps)
581
+ }
582
+ if (isAutoWidth || isDefaultWidth) {
583
+ return ''
584
+ }
585
+ if (isScaleWidth) {
586
+ return printWidthMaps[column.id] ? ('width:' + printWidthMaps[column.id] + 'mm') : ''
587
+ }
588
+ return colWidthMaps[column.id] ? ('width:' + toCssUnit(colWidthMaps[column.id])) : ''
589
+ }
590
+
504
591
  const allCls = 'check-all'
505
592
  const clss = [
506
593
  'vxe-table',
507
594
  `border--${toTableBorder(border)}`,
508
595
  isPrint ? 'is--print' : '',
596
+ isAutoWidth ? 'is--auto-width' : '',
597
+ isScaleWidth ? 'is--scale-width' : '',
598
+ isDefaultWidth ? 'is--default-width' : '',
509
599
  isHeader ? 'is--header' : ''
510
600
  ].filter(cls => cls)
511
601
  const tables = [
512
602
  `<table class="${clss.join(' ')}" border="0" cellspacing="0" cellpadding="0">`,
513
- `<colgroup>${columns.map(column => `<col style="width:${column.renderWidth}px">`).join('')}</colgroup>`
603
+ `<colgroup>${columns.map((column) => `<col style="${getHeaderWidthStyle(column)}">`).join('')}</colgroup>`
514
604
  ]
515
605
  if (isHeader) {
516
606
  tables.push('<thead>')
@@ -521,22 +611,13 @@ function toHtml ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: V
521
611
  const headAlign = column.headerAlign || column.align || allHeaderAlign || allAlign
522
612
  const classNames = hasEllipsis($xeTable, column, 'showHeaderOverflow', allColumnHeaderOverflow) ? ['col--ellipsis'] : []
523
613
  const cellTitle = getHeaderTitle($xeTable, opts, column)
524
- let childWidth = 0
525
- let countChild = 0
526
- XEUtils.eachTree([column], item => {
527
- if (!item.childNodes || !column.childNodes.length) {
528
- countChild++
529
- }
530
- childWidth += item.renderWidth
531
- }, { children: 'childNodes' })
532
- const cellWidth = childWidth - countChild
533
- if (headAlign) {
614
+ if (headAlign) {
534
615
  classNames.push(`col--${headAlign}`)
535
616
  }
536
617
  if (column.type === 'checkbox') {
537
- 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>`
618
+ 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>`
538
619
  }
539
- 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>`
620
+ return `<th class="${classNames.join(' ')}" colspan="${column._colSpan}" rowspan="${column._rowSpan}" title="${cellTitle}"><div style="${getCellWidthStyle(column)}"><span>${formatText(cellTitle, true)}</span></div></th>`
540
621
  }).join('')}</tr>`
541
622
  )
542
623
  })
@@ -550,9 +631,9 @@ function toHtml ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: V
550
631
  classNames.push(`col--${headAlign}`)
551
632
  }
552
633
  if (column.type === 'checkbox') {
553
- return `<th class="${classNames.join(' ')}"><div ${isPrint ? '' : `style="width: ${column.renderWidth}px"`}><input type="checkbox" class="${allCls}" ${isAllSelected ? 'checked' : ''}><span>${cellTitle}</span></div></th>`
634
+ return `<th class="${classNames.join(' ')}"><div style="${getCellWidthStyle(column)}"><input type="checkbox" class="${allCls}" ${isAllSelected ? 'checked' : ''}><span>${cellTitle}</span></div></th>`
554
635
  }
555
- return `<th class="${classNames.join(' ')}" title="${cellTitle}"><div ${isPrint ? '' : `style="width: ${column.renderWidth}px"`}><span>${formatText(cellTitle, true)}</span></div></th>`
636
+ return `<th class="${classNames.join(' ')}" title="${cellTitle}"><div style="${getCellWidthStyle(column)}"><span>${formatText(cellTitle, true)}</span></div></th>`
556
637
  }).join('')}</tr>`
557
638
  )
558
639
  }
@@ -577,18 +658,18 @@ function toHtml ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: V
577
658
  }
578
659
  classNames.push('vxe-table--tree-node')
579
660
  if (column.type === 'radio') {
580
- 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>`
661
+ 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>`
581
662
  } else if (column.type === 'checkbox') {
582
- 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>`
663
+ 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>`
583
664
  }
584
- 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>`
665
+ 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>`
585
666
  }
586
667
  if (column.type === 'radio') {
587
- 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>`
668
+ 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>`
588
669
  } else if (column.type === 'checkbox') {
589
- 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>`
670
+ return `<td class="${classNames.join(' ')}"><div style="${getCellWidthStyle(column)}"><input type="checkbox" ${item._checkboxDisabled ? 'disabled ' : ''}${getBooleanValue(cellValue) ? 'checked' : ''}><span>${item._checkboxLabel}</span></div></td>`
590
671
  }
591
- return `<td class="${classNames.join(' ')}" title="${cellValue}"><div ${isPrint ? '' : `style="width: ${column.renderWidth}px"`}>${formatText(cellValue, true)}</div></td>`
672
+ return `<td class="${classNames.join(' ')}" title="${cellValue}"><div style="${getCellWidthStyle(column)}">${formatText(cellValue, true)}</div></td>`
592
673
  }).join('') + '</tr>'
593
674
  )
594
675
  })
@@ -623,11 +704,11 @@ function toHtml ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: V
623
704
  classNames.push(`col--${cellAlign}`)
624
705
  }
625
706
  if (column.type === 'radio') {
626
- 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>`
707
+ 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>`
627
708
  } else if (column.type === 'checkbox') {
628
- 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>`
709
+ 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>`
629
710
  }
630
- return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}" title="${cellValue}"><div ${isPrint ? '' : `style="width: ${column.renderWidth}px"`}>${formatText(cellValue, true)}</div></td>`
711
+ return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}" title="${cellValue}"><div style="${getCellWidthStyle(column)}">${formatText(cellValue, true)}</div></td>`
631
712
  }).join('') + '</tr>'
632
713
  )
633
714
  })
@@ -646,28 +727,28 @@ function toHtml ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: V
646
727
  const classNames = hasEllipsis($xeTable, column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : []
647
728
  const cellValue = getFooterCellValue($xeTable, opts, row, column)
648
729
  let rowSpan = 1
649
- let colSpan = 1
650
- if (isMerge) {
651
- const _rowIndex = rIndex
652
- const _columnIndex = $xeTable.getVTColumnIndex(column)
653
- const spanRest = mergeFooterCellMaps[`${_rowIndex}:${_columnIndex}`]
654
- if (spanRest) {
655
- const { rowspan, colspan } = spanRest
656
- if (!rowspan || !colspan) {
657
- return ''
658
- }
659
- if (rowspan > 1) {
660
- rowSpan = rowspan
661
- }
662
- if (colspan > 1) {
663
- colSpan = colspan
664
- }
665
- }
730
+ let colSpan = 1
731
+ if (isMerge) {
732
+ const _rowIndex = rIndex
733
+ const _columnIndex = $xeTable.getVTColumnIndex(column)
734
+ const spanRest = mergeFooterCellMaps[`${_rowIndex}:${_columnIndex}`]
735
+ if (spanRest) {
736
+ const { rowspan, colspan } = spanRest
737
+ if (!rowspan || !colspan) {
738
+ return ''
739
+ }
740
+ if (rowspan > 1) {
741
+ rowSpan = rowspan
666
742
  }
743
+ if (colspan > 1) {
744
+ colSpan = colspan
745
+ }
746
+ }
747
+ }
667
748
  if (footAlign) {
668
749
  classNames.push(`col--${footAlign}`)
669
750
  }
670
- return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}" title="${cellValue}"><div ${isPrint ? '' : `style="width: ${column.renderWidth}px"`}>${formatText(cellValue, true)}</div></td>`
751
+ return `<td class="${classNames.join(' ')}" rowspan="${rowSpan}" colspan="${colSpan}" title="${cellValue}"><div style="${getCellWidthStyle(column)}">${formatText(cellValue, true)}</div></td>`
671
752
  }).join('')}</tr>`
672
753
  )
673
754
  })
@@ -677,7 +758,7 @@ function toHtml ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: V
677
758
  // 是否半选状态
678
759
  const script = !isAllSelected && isIndeterminate ? `<script>(function(){var a=document.querySelector(".${allCls}");if(a){a.indeterminate=true}})()</script>` : ''
679
760
  tables.push('</table>', script)
680
- return isPrint ? tables.join('') : createHtmlPage(opts, tables.join(''))
761
+ return isAutoWidth ? tables.join('') : createHtmlPage(opts, tables.join(''))
681
762
  }
682
763
 
683
764
  function toXML ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: any, columns: any[], datas: any[]) {
@@ -1277,6 +1358,9 @@ function handleExportAndPrint ($xeTable: VxeTableConstructor, options: VxeTableP
1277
1358
  if (!typeList.some(item => item.value === type)) {
1278
1359
  exportParams.type = typeList[0].value
1279
1360
  }
1361
+ if (!exportParams.widthMode) {
1362
+ exportParams.widthMode = ''
1363
+ }
1280
1364
  initStore.export = true
1281
1365
  return $xeTable.$nextTick()
1282
1366
  }
@@ -1421,7 +1505,7 @@ export default {
1421
1505
  return isChecked
1422
1506
  }, { children: 'children', mapChildren: 'childNodes', original: true })
1423
1507
  }
1424
- const handleOptions: VxeTablePropTypes.ExportHandleOptions = Object.assign({ } as { data: any[], colgroups: any[], columns: any[] }, opts, { filename: '', sheetName: '' })
1508
+ const handleOptions: VxeTablePropTypes.ExportHandleOptions = Object.assign({ } as { data: any[], colgroups: any[], columns: any[] }, opts, { filename: '', sheetName: '', _columnConfs: columns })
1425
1509
  // 如果设置源数据,则默认导出设置了字段的列
1426
1510
  if (!isCustomCol && !columnFilterMethod) {
1427
1511
  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;` })
@@ -148,7 +148,7 @@ function renderTdColumn (
148
148
  const cellOverflow = XEUtils.eqNull(showOverflow) ? allShowOverflow : showOverflow
149
149
  const showEllipsis = cellOverflow === 'ellipsis'
150
150
  const showTitle = cellOverflow === 'title'
151
- const showTooltip = cellOverflow === true || cellOverflow === 'tooltip'
151
+ const showTooltip = cellOverflow === true ? tooltipOpts.mode === 'tooltip' : cellOverflow === 'tooltip'
152
152
  const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis
153
153
  const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable))
154
154
  const isCsHeight = !!customCellHeight
@@ -49,7 +49,7 @@ function renderRows (h: CreateElement, _vm: any, isOptimizeMode: boolean, tableC
49
49
  const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign
50
50
  const showEllipsis = footOverflow === 'ellipsis'
51
51
  const showTitle = footOverflow === 'title'
52
- const showTooltip = footOverflow === true || footOverflow === 'tooltip'
52
+ const showTooltip = footOverflow === true ? footerTooltipOpts.mode === 'tooltip' : footOverflow === 'tooltip'
53
53
  const hasEllipsis = showTitle || showTooltip || showEllipsis
54
54
  const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable))
55
55
  const attrs: any = { colid }
@@ -29,6 +29,7 @@ function renderRows (h: CreateElement, _vm: any, isGroup: boolean, isOptimizeMod
29
29
  const virtualXOpts = $xeTable.computeVirtualXOpts
30
30
  const columnOpts = $xeTable.computeColumnOpts
31
31
  const columnDragOpts = $xeTable.computeColumnDragOpts
32
+ const headerTooltipOpts = $xeTable.computeHeaderTooltipOpts
32
33
  const cellOpts = $xeTable.computeCellOpts
33
34
  const defaultRowHeight = $xeTable.computeDefaultRowHeight
34
35
  const headerCellOpts = $xeTable.computeHeaderCellOpts
@@ -46,11 +47,11 @@ function renderRows (h: CreateElement, _vm: any, isGroup: boolean, isOptimizeMod
46
47
  const isColGroup = column.children && column.children.length
47
48
  const fixedHiddenColumn = overflowX && !isColGroup && (fixedType ? column.fixed !== fixedType : !!column.fixed)
48
49
  const isPadding = XEUtils.isBoolean(headerCellOpts.padding) ? headerCellOpts.padding : cellOpts.padding
49
- const headOverflow = XEUtils.isUndefined(showHeaderOverflow) || XEUtils.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow
50
+ const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow
50
51
  const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign
51
52
  const showEllipsis = headOverflow === 'ellipsis'
52
53
  const showTitle = headOverflow === 'title'
53
- const showTooltip = headOverflow === true || headOverflow === 'tooltip'
54
+ const showTooltip = headOverflow === true ? headerTooltipOpts.mode === 'tooltip' : headOverflow === 'tooltip'
54
55
  const hasEllipsis = showTitle || showTooltip || showEllipsis
55
56
  let hasFilter = false
56
57
  let firstFilterOption: VxeColumnPropTypes.FilterItem | null = null
@@ -228,6 +229,7 @@ function renderFilterRows (h: CreateElement, _vm: any, isOptimizeMode: boolean,
228
229
  const { showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign } = tableProps
229
230
  const { currentColumn, overflowX } = tableReactData
230
231
  const { fullColumnIdData } = tableInternalData
232
+ const headerTooltipOpts = $xeTable.computeHeaderTooltipOpts
231
233
  const cellOpts = $xeTable.computeCellOpts
232
234
  const defaultRowHeight = $xeTable.computeDefaultRowHeight
233
235
  const headerCellOpts = $xeTable.computeHeaderCellOpts
@@ -250,7 +252,7 @@ function renderFilterRows (h: CreateElement, _vm: any, isOptimizeMode: boolean,
250
252
  const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign
251
253
  const showEllipsis = headOverflow === 'ellipsis'
252
254
  const showTitle = headOverflow === 'title'
253
- const showTooltip = headOverflow === true || headOverflow === 'tooltip'
255
+ const showTooltip = headOverflow === true ? headerTooltipOpts.mode === 'tooltip' : headOverflow === 'tooltip'
254
256
  const hasEllipsis = showTitle || showTooltip || showEllipsis
255
257
  let hasFilter = false
256
258
  let firstFilterOption: VxeTableDefines.FilterOption | null = null
@@ -3,7 +3,7 @@ import { getTpImg, isPx, isScale, hasClass, addClass, removeClass, wheelScrollLe
3
3
  import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils'
4
4
  import { VxeUI } from '../../ui'
5
5
  import Cell from './cell'
6
- import { getRowUniqueId, createRowId, clearTableAllStatus, getColumnList, toFilters, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getColReMinWidth, getColReMaxWidth, createHandleUpdateRowId, createHandleGetRowId, getRefElem, getCellRestHeight, getLastChildColumn, getRowMaxHeight, handleCustomStoreConfig } from './util'
6
+ import { getRowUniqueId, createRowId, clearTableAllStatus, getColumnList, toFilters, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getColReMinWidth, getColReMaxWidth, createHandleUpdateRowId, createHandleGetRowId, getRefElem, getCellRestHeight, getLastChildColumn, getRowMaxHeight, handleCustomStoreConfig, encodeRowid } from './util'
7
7
  import { getSlotVNs } from '../../ui/src/vn'
8
8
  import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from '../../ui/src/anime'
9
9
  import { createComponentLog } from '../../ui/src/log'
@@ -1390,7 +1390,8 @@ function handleDefaultSelectionChecked ($xeTable: VxeTableConstructor & VxeTable
1390
1390
  handleCheckedAllCheckboxRow($xeTable, true, true)
1391
1391
  } else if (checkRowKeys) {
1392
1392
  const defSelection: any[] = []
1393
- checkRowKeys.forEach((rowid: any) => {
1393
+ checkRowKeys.forEach((rowKey: any) => {
1394
+ const rowid = encodeRowid(rowKey)
1394
1395
  if (fullDataRowIdData[rowid]) {
1395
1396
  defSelection.push(fullDataRowIdData[rowid].row)
1396
1397
  }
@@ -1411,7 +1412,8 @@ function handleDefaultRadioChecked ($xeTable: VxeTableConstructor & VxeTablePriv
1411
1412
  if (radioConfig) {
1412
1413
  const { fullDataRowIdData } = internalData
1413
1414
  const radioOpts = $xeTable.computeRadioOpts
1414
- const { checkRowKey: rowid, reserve } = radioOpts
1415
+ const { checkRowKey: rowKey, reserve } = radioOpts
1416
+ const rowid = rowKey ? encodeRowid(rowKey) : null
1415
1417
  if (rowid) {
1416
1418
  if (fullDataRowIdData[rowid]) {
1417
1419
  handleCheckedRadioRow($xeTable, fullDataRowIdData[rowid].row, true)
@@ -1440,7 +1442,8 @@ function handleDefaultRowExpand ($xeTable: VxeTableConstructor & VxeTablePrivate
1440
1442
  $xeTable.setAllRowExpand(true)
1441
1443
  } else if (expandRowKeys) {
1442
1444
  const defExpandeds: any[] = []
1443
- expandRowKeys.forEach((rowid: any) => {
1445
+ expandRowKeys.forEach((rowKey) => {
1446
+ const rowid = encodeRowid(rowKey)
1444
1447
  if (fullDataRowIdData[rowid]) {
1445
1448
  defExpandeds.push(fullDataRowIdData[rowid].row)
1446
1449
  }
@@ -1714,7 +1717,8 @@ const handleDefaultTreeExpand = ($xeTable: VxeTableConstructor) => {
1714
1717
  $xeTable.setAllTreeExpand(true)
1715
1718
  } else if (expandRowKeys) {
1716
1719
  const defExpandeds: any[] = []
1717
- expandRowKeys.forEach((rowid) => {
1720
+ expandRowKeys.forEach((rowKey) => {
1721
+ const rowid = encodeRowid(rowKey)
1718
1722
  const rowRest = fullAllDataRowIdData[rowid]
1719
1723
  if (rowRest) {
1720
1724
  defExpandeds.push(rowRest.row)
@@ -8700,7 +8704,7 @@ const tableMethods: any = {
8700
8704
  }
8701
8705
  return handleCheckedCheckboxRow($xeTable, rows, checked, true)
8702
8706
  },
8703
- setCheckboxRowKey (keys: any, checked: boolean) {
8707
+ setCheckboxRowByKey (keys: any, checked: boolean) {
8704
8708
  const $xeTable = this
8705
8709
  const internalData = $xeTable as unknown as TableInternalData
8706
8710
 
@@ -8709,7 +8713,8 @@ const tableMethods: any = {
8709
8713
  keys = [keys]
8710
8714
  }
8711
8715
  const rows: any = []
8712
- keys.forEach((rowid: string) => {
8716
+ keys.forEach((rowKey: string) => {
8717
+ const rowid = encodeRowid(rowKey)
8713
8718
  const rowRest = fullAllDataRowIdData[rowid]
8714
8719
  if (rowRest) {
8715
8720
  rows.push(rowRest.row)
@@ -8717,6 +8722,11 @@ const tableMethods: any = {
8717
8722
  })
8718
8723
  return handleCheckedCheckboxRow($xeTable, rows, checked, true)
8719
8724
  },
8725
+ setCheckboxRowKey (keys: any, checked: boolean) {
8726
+ const $xeTable = this
8727
+
8728
+ return $xeTable.setCheckboxRowByKey(keys, checked)
8729
+ },
8720
8730
  isCheckedByCheckboxRow (row: any) {
8721
8731
  const $xeTable = this
8722
8732
  const reactData = $xeTable as unknown as TableReactData
@@ -8731,7 +8741,7 @@ const tableMethods: any = {
8731
8741
  }
8732
8742
  return !!updateCheckboxFlag && !!selectCheckboxMaps[getRowid($xeTable, row)]
8733
8743
  },
8734
- isCheckedByCheckboxRowKey (rowid: string) {
8744
+ isCheckedByCheckboxRowKey (rowKey: string) {
8735
8745
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
8736
8746
  const reactData = $xeTable as unknown as TableReactData
8737
8747
  const internalData = $xeTable as unknown as TableInternalData
@@ -8740,6 +8750,7 @@ const tableMethods: any = {
8740
8750
  const { fullAllDataRowIdData, selectCheckboxMaps } = internalData
8741
8751
  const checkboxOpts = $xeTable.computeCheckboxOpts
8742
8752
  const { checkField } = checkboxOpts
8753
+ const rowid = encodeRowid(rowKey)
8743
8754
  if (checkField) {
8744
8755
  const rowRest = fullAllDataRowIdData[rowid]
8745
8756
  if (rowRest) {
@@ -8756,11 +8767,12 @@ const tableMethods: any = {
8756
8767
  const { treeIndeterminateRowMaps } = internalData
8757
8768
  return !!treeIndeterminateRowMaps[getRowid($xeTable, row)] && !$xeTable.isCheckedByCheckboxRow(row)
8758
8769
  },
8759
- isIndeterminateByCheckboxRowKey (rowid: string) {
8770
+ isIndeterminateByCheckboxRowKey (rowKey: string) {
8760
8771
  const $xeTable = this
8761
8772
  const internalData = $xeTable as unknown as TableInternalData
8762
8773
 
8763
8774
  const { treeIndeterminateRowMaps } = internalData
8775
+ const rowid = encodeRowid(rowKey)
8764
8776
  return !!treeIndeterminateRowMaps[rowid] && !$xeTable.isCheckedByCheckboxRowKey(rowid)
8765
8777
  },
8766
8778
  /**
@@ -9647,8 +9659,8 @@ const tableMethods: any = {
9647
9659
  return this.$nextTick()
9648
9660
  },
9649
9661
  isCheckedByRadioRow (row: any) {
9650
- const $xeTable = this
9651
- const reactData = $xeTable
9662
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
9663
+ const reactData = $xeTable as unknown as TableReactData
9652
9664
 
9653
9665
  const { selectRadioRow } = reactData
9654
9666
  if (row && selectRadioRow) {
@@ -9657,8 +9669,8 @@ const tableMethods: any = {
9657
9669
  return false
9658
9670
  },
9659
9671
  isCheckedByRadioRowKey (key: string) {
9660
- const $xeTable = this
9661
- const reactData = $xeTable
9672
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
9673
+ const reactData = $xeTable as unknown as TableReactData
9662
9674
 
9663
9675
  const { selectRadioRow } = reactData
9664
9676
  if (selectRadioRow) {
@@ -9671,7 +9683,7 @@ const tableMethods: any = {
9671
9683
  * @param {Row} row 行对象
9672
9684
  */
9673
9685
  setRadioRow (row: any) {
9674
- const $xeTable = this
9686
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
9675
9687
 
9676
9688
  return handleCheckedRadioRow($xeTable, row, true)
9677
9689
  },
@@ -9679,17 +9691,23 @@ const tableMethods: any = {
9679
9691
  * 用于单选行,设置某一行为选中状态
9680
9692
  * @param key 行主键
9681
9693
  */
9682
- setRadioRowKey (rowid: any) {
9694
+ setRadioByRowKey (rowKey: any) {
9683
9695
  const $xeTable = this
9684
9696
  const internalData = $xeTable
9685
9697
 
9686
9698
  const { fullAllDataRowIdData } = internalData
9699
+ const rowid = encodeRowid(rowKey)
9687
9700
  const rowRest = fullAllDataRowIdData[rowid]
9688
9701
  if (rowRest) {
9689
9702
  return handleCheckedRadioRow($xeTable, rowRest.row, true)
9690
9703
  }
9691
9704
  return $xeTable.$nextTick()
9692
9705
  },
9706
+ setRadioRowKey (rowKey: any) {
9707
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
9708
+
9709
+ return $xeTable.setRadioByRowKey(rowKey)
9710
+ },
9693
9711
  /**
9694
9712
  * 用于当前行,手动清空当前高亮的状态
9695
9713
  */
@@ -9713,8 +9731,11 @@ const tableMethods: any = {
9713
9731
  * 用于单选行,手动清空用户的选择
9714
9732
  */
9715
9733
  clearRadioRow () {
9716
- this.selectRadioRow = null
9717
- return this.$nextTick()
9734
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
9735
+ const reactData = $xeTable as unknown as TableReactData
9736
+
9737
+ reactData.selectRadioRow = null
9738
+ return $xeTable.$nextTick()
9718
9739
  },
9719
9740
  /**
9720
9741
  * 用于当前行,获取当前行的数据
@@ -2070,35 +2070,35 @@ export default {
2070
2070
  const VxeUILoadingComponent = VxeUI.getComponent('VxeLoading')
2071
2071
  const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip')
2072
2072
 
2073
+ const { showOverflow, showHeaderOverflow, showFooterOverflow } = props
2074
+ const tooltipOpts = $xeTable.computeTooltipOpts
2075
+ const headerTooltipOpts = $xeTable.computeHeaderTooltipOpts
2076
+ const footerTooltipOpts = $xeTable.computeFooterTooltipOpts
2073
2077
  if (props.loading) {
2074
2078
  if (!VxeUILoadingComponent && !this.$scopedSlots.loading) {
2075
- errLog('vxe.error.errProp', ['loading=true', 'loading=false | <template #loading>...</template>'])
2076
2079
  errLog('vxe.error.reqComp', ['vxe-loading'])
2080
+ errLog('vxe.error.errProp', ['loading=true', 'loading=false | <template #loading>...</template>'])
2077
2081
  }
2078
2082
  }
2079
- if ((props.showOverflow === true || props.showOverflow === 'tooltip') ||
2080
- (props.showHeaderOverflow === true || props.showHeaderOverflow === 'tooltip') ||
2081
- (props.showFooterOverflow === true || props.showFooterOverflow === 'tooltip')) {
2082
- if (!VxeUITooltipComponent) {
2083
- if (props.showOverflow === true) {
2084
- errLog('vxe.error.errProp', ['show-overflow=true', 'show-overflow=title'])
2085
- }
2086
- if (props.showOverflow === 'tooltip') {
2087
- errLog('vxe.error.errProp', ['show-overflow=tooltip', 'show-overflow=title'])
2088
- }
2089
- if (props.showHeaderOverflow === true) {
2090
- errLog('vxe.error.errProp', ['show-header-overflow=true', 'show-header-overflow=title'])
2091
- }
2092
- if (props.showHeaderOverflow === 'tooltip') {
2093
- errLog('vxe.error.errProp', ['show-header-overflow=tooltip', 'show-header-overflow=title'])
2094
- }
2095
- if (props.showFooterOverflow === true) {
2096
- errLog('vxe.error.errProp', ['show-footer-overflow=true', 'show-footer-overflow=title'])
2097
- }
2098
- if (props.showFooterOverflow === 'tooltip') {
2099
- errLog('vxe.error.errProp', ['show-footer-overflow=tooltip', 'show-footer-overflow=title'])
2100
- }
2101
- errLog('vxe.error.reqComp', ['vxe-tooltip'])
2083
+ if (!VxeUITooltipComponent) {
2084
+ errLog('vxe.error.reqComp', ['vxe-tooltip'])
2085
+ if (showOverflow === 'tooltip') {
2086
+ errLog('vxe.error.errProp', ['show-overflow=' + showOverflow, 'show-overflow=false,title,ellipsis'])
2087
+ }
2088
+ if (showOverflow === true && tooltipOpts.mode === 'tooltip') {
2089
+ errLog('vxe.error.notSupportProp', ['show-overflow=' + showOverflow, 'tooltip-config.mode=tooltip', 'tooltip-config.mode=title,ellipsis'])
2090
+ }
2091
+ if (showHeaderOverflow === 'tooltip') {
2092
+ errLog('vxe.error.errProp', ['show-header-overflow=' + showHeaderOverflow, 'show-header-overflow=false,title,ellipsis'])
2093
+ }
2094
+ if (showHeaderOverflow === true && headerTooltipOpts.mode === 'tooltip') {
2095
+ errLog('vxe.error.notSupportProp', ['show-header-overflow=' + showHeaderOverflow, 'header-tooltip-config.mode=tooltip', 'header-tooltip-config.mode=title,ellipsis'])
2096
+ }
2097
+ if (showFooterOverflow === 'tooltip') {
2098
+ errLog('vxe.error.errProp', ['show-footer-overflow=' + showFooterOverflow, 'show-footer-overflow=false,title,ellipsis'])
2099
+ }
2100
+ if (showFooterOverflow === true && footerTooltipOpts.mode === 'tooltip') {
2101
+ errLog('vxe.error.notSupportProp', ['show-footer-overflow=' + showFooterOverflow, 'footer-tooltip-config.mode=tooltip', 'footer-tooltip-config.mode=title,ellipsis'])
2102
2102
  }
2103
2103
  }
2104
2104
 
@@ -390,6 +390,7 @@ export function createReactData (): TableReactData {
390
390
  mergeFootFlag: 1,
391
391
 
392
392
  rowHeightStore: {
393
+ xlarge: 54,
393
394
  large: 52,
394
395
  default: 48,
395
396
  medium: 44,
@@ -655,11 +656,11 @@ export function createHandleGetRowId ($xeTable: VxeTableConstructor) {
655
656
  }
656
657
 
657
658
  // 编码行主键
658
- export function encodeRowid (rowVal: string) {
659
+ export function encodeRowid (rowVal: string | number) {
659
660
  return XEUtils.eqNull(rowVal) ? '' : encodeURIComponent(rowVal)
660
661
  }
661
662
 
662
- function getDeepRowIdByKey (row: any, rowKey: string) {
663
+ function getDeepRowIdByKey (row: any, rowKey: string | number) {
663
664
  return XEUtils.get(row, rowKey)
664
665
  }
665
666
 
@@ -73,6 +73,7 @@ VxeUI.setConfig({
73
73
  strict: true
74
74
  },
75
75
  tooltipConfig: {
76
+ mode: 'tooltip',
76
77
  enterable: true,
77
78
  defaultPlacement: 'top'
78
79
  },