vxe-table 4.24.0-beta.2 → 4.24.0-beta.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 (54) hide show
  1. package/dist/all.esm.js +144 -129
  2. package/dist/all.esm.min.js +3 -3
  3. package/dist/style.css +90 -34
  4. package/dist/style.mini.css +1 -1
  5. package/es/style.css +90 -34
  6. package/es/style.mini.css +1 -1
  7. package/es/table/module/export/hook.js +4 -3
  8. package/es/table/src/body.js +2 -2
  9. package/es/table/src/cell.js +6 -6
  10. package/es/table/src/table.js +32 -111
  11. package/es/table/src/tree.d.ts +6 -0
  12. package/es/table/src/tree.js +96 -0
  13. package/es/table/style.css +78 -26
  14. package/es/table/style.mini.css +1 -1
  15. package/es/ui/index.js +5 -6
  16. package/es/ui/src/log.js +1 -1
  17. package/es/vxe-table/style.css +78 -26
  18. package/es/vxe-table/style.mini.css +1 -1
  19. package/lib/index.umd.js +144 -129
  20. package/lib/index.umd.min.js +3 -3
  21. package/lib/style.css +90 -34
  22. package/lib/style.mini.css +1 -1
  23. package/lib/table/module/export/hook.js +4 -3
  24. package/lib/table/src/body.js +2 -2
  25. package/lib/table/src/cell.js +6 -6
  26. package/lib/table/src/table.js +32 -111
  27. package/lib/table/src/tree.d.ts +6 -0
  28. package/lib/table/src/tree.js +116 -0
  29. package/lib/table/style/style.css +78 -26
  30. package/lib/table/style/style.mini.css +1 -1
  31. package/lib/ui/index.js +5 -6
  32. package/lib/ui/src/log.js +1 -1
  33. package/lib/vxe-table/style/style.css +78 -26
  34. package/lib/vxe-table/style/style.mini.css +1 -1
  35. package/package.json +2 -2
  36. package/packages/table/module/export/hook.ts +4 -3
  37. package/packages/table/src/body.ts +2 -2
  38. package/packages/table/src/cell.ts +9 -10
  39. package/packages/table/src/table.ts +32 -129
  40. package/packages/table/src/tree.ts +112 -0
  41. package/packages/ui/index.ts +4 -5
  42. package/styles/components/icon.scss +11 -3
  43. package/styles/components/old-icon.scss +6 -3
  44. package/styles/components/table.scss +14 -4
  45. package/styles/theme/base.scss +13 -9
  46. /package/dist/{iconfont.1794563906464.ttf → iconfont.1794794325954.ttf} +0 -0
  47. /package/dist/{iconfont.1794563906464.woff → iconfont.1794794325954.woff} +0 -0
  48. /package/dist/{iconfont.1794563906464.woff2 → iconfont.1794794325954.woff2} +0 -0
  49. /package/es/{iconfont.1794563906464.ttf → iconfont.1794794325954.ttf} +0 -0
  50. /package/es/{iconfont.1794563906464.woff → iconfont.1794794325954.woff} +0 -0
  51. /package/es/{iconfont.1794563906464.woff2 → iconfont.1794794325954.woff2} +0 -0
  52. /package/lib/{iconfont.1794563906464.ttf → iconfont.1794794325954.ttf} +0 -0
  53. /package/lib/{iconfont.1794563906464.woff → iconfont.1794794325954.woff} +0 -0
  54. /package/lib/{iconfont.1794563906464.woff2 → iconfont.1794794325954.woff2} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-table",
3
- "version": "4.24.0-beta.2",
3
+ "version": "4.24.0-beta.4",
4
4
  "description": "A PC-end table component based on Vxe UI, supporting copy-paste, data pivot table, and high-performance virtual list table solution.",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -75,7 +75,7 @@
75
75
  "typescript": "~5.9.3",
76
76
  "vue": "3.4.27",
77
77
  "vue-router": "~4.5.1",
78
- "vxe-pc-ui": "4.21.0"
78
+ "vxe-pc-ui": "4.21.1"
79
79
  },
80
80
  "allowScripts": {
81
81
  "esbuild": true,
@@ -763,6 +763,7 @@ hooks.add('tableExportModule', {
763
763
  const { isAllSelected, isIndeterminate } = reactData
764
764
  const { mergeBodyCellMaps, mergeFooterCellMaps } = internalData
765
765
  const treeOpts = computeTreeOpts.value
766
+ const treeIndent = treeOpts.indent || 20
766
767
  const { print: isPrint, widthMode, isHeader, isFooter, isColgroup, isMerge, colgroups, _columnConfs, original } = opts
767
768
  const isAutoWidth = widthMode === 'auto'
768
769
  const isScaleWidth = widthMode === 'scale'
@@ -917,11 +918,11 @@ hooks.add('tableExportModule', {
917
918
  }
918
919
  classNames.push('vxe-table--tree-node')
919
920
  if (column.type === 'radio') {
920
- 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>`
921
+ return `<td class="${classNames.join(' ')}" title="${cellValue}"><div style="${getCellWidthStyle(column)}"><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level * treeIndent}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>`
921
922
  } else if (column.type === 'checkbox') {
922
- 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>`
923
+ return `<td class="${classNames.join(' ')}" title="${cellValue}"><div style="${getCellWidthStyle(column)}"><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level * treeIndent}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>`
923
924
  }
924
- 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>`
925
+ return `<td class="${classNames.join(' ')}" title="${cellValue}"><div style="${getCellWidthStyle(column)}"><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level * treeIndent}px"><div class="vxe-table--tree-icon-wrapper">${treeIcon}</div><div class="vxe-table--tree-cell">${cellValue}</div></div></div></td>`
925
926
  }
926
927
  if (column.type === 'radio') {
927
928
  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>`
@@ -91,7 +91,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
91
91
  lineVNs.push(
92
92
  h('span', {
93
93
  key: 'le' + i,
94
- class: ['vxe-tree--line', `type--${lineType || 'solid'}`, item.type],
94
+ class: ['vxe-table--tree-node-line', `type--${lineType || 'solid'}`, item.type],
95
95
  style: item.style
96
96
  })
97
97
  )
@@ -697,7 +697,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
697
697
  cellStyle.height = `${expandHeight}px`
698
698
  }
699
699
  if (treeConfig) {
700
- cellStyle.paddingLeft = `${rowLevel * treeOpts.indent + 30}px`
700
+ cellStyle.paddingLeft = `calc(${rowLevel} * var(--vxe-ui-table-tree-node-indent) + 30px)`
701
701
  }
702
702
  const { showOverflow } = expandColumn || {}
703
703
  const colid = expandColumn.id
@@ -579,7 +579,7 @@ export const Cell = {
579
579
  const { rowGroupExpandedFlag } = tableReactData
580
580
  const { rowGroupExpandedMaps } = tableInternalData
581
581
  const aggregateOpts = computeAggregateOpts.value
582
- const { mode, padding, indent, showIcon, iconOpen, iconClose } = aggregateOpts
582
+ const { mode, padding, showIcon, iconOpen, iconClose } = aggregateOpts
583
583
  const rowid = getRowid($table, row)
584
584
  const isExpand = !!rowGroupExpandedFlag && !!rowGroupExpandedMaps[rowid]
585
585
  return h(
@@ -592,9 +592,9 @@ export const Cell = {
592
592
  }
593
593
  ],
594
594
  style:
595
- mode !== 'column' && padding && indent
595
+ mode !== 'column' && padding
596
596
  ? {
597
- paddingLeft: `${level * indent}px`
597
+ paddingLeft: `calc(${level} * var(--vxe-ui-table-row-group-tree-node-indent))`
598
598
  }
599
599
  : undefined
600
600
  },
@@ -642,7 +642,7 @@ export const Cell = {
642
642
  const { treeExpandedFlag } = tableReactData
643
643
  const { fullAllDataRowIdData, treeExpandedMaps, treeExpandLazyLoadedMaps } = tableInternalData
644
644
  const treeOpts = computeTreeOpts.value
645
- const { padding, indent, lazy, trigger, visibleMethod, iconLoaded, showIcon, iconOpen, iconClose } = treeOpts
645
+ const { padding, lazy, trigger, visibleMethod, iconLoaded, showIcon, iconOpen, iconClose } = treeOpts
646
646
  const childrenField = treeOpts.children || treeOpts.childrenField
647
647
  const hasChildField = treeOpts.hasChild || treeOpts.hasChildField
648
648
  const rowChilds = row[childrenField]
@@ -676,12 +676,11 @@ export const Cell = {
676
676
  'is--active': isActive
677
677
  }
678
678
  ],
679
- style:
680
- padding && indent
681
- ? {
682
- paddingLeft: `${level * indent}px`
683
- }
684
- : undefined
679
+ style: padding
680
+ ? {
681
+ paddingLeft: `calc(${level} * var(--vxe-ui-table-tree-node-indent))`
682
+ }
683
+ : undefined
685
684
  },
686
685
  [
687
686
  showIcon && (lazy ? (isLazyLoaded ? hasChild : hasChild || hasLazyChilds) : hasChild) && (!visibleMethod || visibleMethod(params))
@@ -38,6 +38,7 @@ import {
38
38
  } from './util'
39
39
  import { getSlotVNs } from '../../ui/src/vn'
40
40
  import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from '../../ui/src/anime'
41
+ import { getTreeNodeLines } from './tree'
41
42
  import { createComponentLog } from '../../ui/src/log'
42
43
  import { getCrossTableDragRowInfo } from './store'
43
44
  import Cell from './cell'
@@ -773,11 +774,14 @@ export default /* define-vxe-component start */ defineVxeComponent({
773
774
  })
774
775
 
775
776
  const computeTableStyle = computed(() => {
776
- const { treeConfig } = props
777
777
  const barWidth = computeScrollYWidth.value
778
778
  const barHeight = computeScrollXHeight.value
779
779
  const treeOpts = computeTreeOpts.value
780
- const { indent, lineWidth, lineColor } = treeOpts
780
+ const { indent: treeIndent, lineWidth, lineColor } = treeOpts
781
+ const expandOpts = computeExpandOpts.value
782
+ const { indent: edIndent } = expandOpts
783
+ const aggregateOpts = computeAggregateOpts.value
784
+ const { indent: rgIndent } = aggregateOpts
781
785
  const stys: VxeComponentStyleType = {}
782
786
  if (barWidth || barHeight) {
783
787
  stys['--vxe-ui-table-view-scrollbar-width'] = toCssUnit(barWidth || barHeight)
@@ -785,8 +789,14 @@ export default /* define-vxe-component start */ defineVxeComponent({
785
789
  stys['--vxe-ui-table-view-scrollbar-height'] = toCssUnit(barHeight || barWidth)
786
790
  stys['--vxe-ui-scrollbar-x-height'] = toCssUnit(barHeight || barWidth)
787
791
  }
788
- if (treeConfig) {
789
- stys['--vxe-ui-table-tree-node-indent'] = toCssUnit(indent)
792
+ if (edIndent) {
793
+ stys['--vxe-ui-table-expand-tree-node-indent'] = toCssUnit(edIndent)
794
+ }
795
+ if (rgIndent) {
796
+ stys['--vxe-ui-table-row-group-tree-node-indent'] = toCssUnit(rgIndent)
797
+ }
798
+ if (treeIndent) {
799
+ stys['--vxe-ui-table-tree-node-indent'] = toCssUnit(treeIndent)
790
800
  }
791
801
  if (lineWidth) {
792
802
  stys['--vxe-ui-table-tree-node-line-width'] = toCssUnit(lineWidth)
@@ -1060,6 +1070,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
1060
1070
  computeExpandOpts,
1061
1071
  computeTreeOpts,
1062
1072
  computeShowTreeLine,
1073
+ computeShowTreeRootLine,
1063
1074
  computeEmptyOpts,
1064
1075
  computeLoadingOpts,
1065
1076
  computeCellOffsetWidth,
@@ -2471,127 +2482,17 @@ export default /* define-vxe-component start */ defineVxeComponent({
2471
2482
  }
2472
2483
  }
2473
2484
 
2474
- /**
2475
- * 分配树节点的连接线
2476
- * 类名(cut-full / cut-top / cut-bottom)
2477
- */
2478
- function getTreeNodeLines(isExpandable: boolean, depth: number, linesMask: number, isFirstRow: boolean, isLastRow: boolean, showRootLine: boolean) {
2479
- const lines: VxeTableDefines.RowCacheTreeLineData[] = []
2480
-
2481
- for (let col = 1; col <= depth; col++) {
2482
- const leftVal = `var(--vxe-ui-table-tree-node-btn-width) + var(--vxe-ui-table-tree-node-indent) * ${(col - 1)}`
2483
- const through = (linesMask & (1 << (col - 1))) !== 0
2484
-
2485
- if (col === 1 && !showRootLine) {
2486
- continue
2487
- }
2488
-
2489
- if (col < depth) {
2490
- // 普通列(贯穿线)
2491
- if (through) {
2492
- let top = '0'
2493
- let height = '100%'
2494
- if (isFirstRow) {
2495
- top = '50%'
2496
- height = '50%'
2497
- } else if (isLastRow) {
2498
- top = '0'
2499
- height = '50%'
2500
- }
2501
-
2502
- lines.push({
2503
- type: 'v',
2504
- style: {
2505
- left: `calc(${leftVal})`,
2506
- top,
2507
- height
2508
- }
2509
- })
2510
- }
2511
- } else {
2512
- // 肘部列
2513
- let vTop = '0'
2514
- let vHeight = through ? '100%' : '50%'
2515
-
2516
- if (isFirstRow && isLastRow) {
2517
- vTop = '50%'
2518
- vHeight = '0px'
2519
- } else if (isFirstRow) {
2520
- vTop = '50%'
2521
- vHeight = '50%'
2522
- } else if (isLastRow) {
2523
- vTop = '0'
2524
- vHeight = '50%'
2525
- }
2526
-
2527
- if (isExpandable && vHeight !== '0px') {
2528
- // 元素切割:根据头和尾的情况分配不同的类名
2529
- let cutType = 'v cut'
2530
- if (vTop === '0' && vHeight === '50%') {
2531
- cutType = 'v cut-top'
2532
- } else if (vTop === '50%' && vHeight === '50%') {
2533
- cutType = 'v cut-bottom'
2534
- } else if (vHeight === '100%') {
2535
- cutType = 'v cut-full'
2536
- }
2537
-
2538
- lines.push({
2539
- type: cutType,
2540
- style: {
2541
- left: `calc(${leftVal})`,
2542
- top: vTop,
2543
- height: vHeight
2544
- }
2545
- })
2546
- } else {
2547
- // 正常竖线
2548
- if (vHeight !== '0px') {
2549
- lines.push({
2550
- type: 'v',
2551
- style: {
2552
- left: `calc(${leftVal})`,
2553
- top: vTop,
2554
- height: vHeight
2555
- }
2556
- })
2557
- }
2558
- }
2559
-
2560
- // 横线处理:如果可展开,横线从图标右侧开始画;否则正常画
2561
- if (isExpandable) {
2562
- lines.push({
2563
- type: 'h',
2564
- style: {
2565
- left: `calc(${leftVal} + var(--vxe-ui-table-tree-node-btn-width) / 2 + 1px)`,
2566
- top: '50%',
2567
- width: 'calc(var(--vxe-ui-table-tree-node-indent) - var(--vxe-ui-table-tree-node-btn-width) - 0.25em)'
2568
- }
2569
- })
2570
- } else {
2571
- lines.push({
2572
- type: 'h',
2573
- style: {
2574
- left: `calc(${leftVal})`,
2575
- top: '50%',
2576
- width: 'calc(var(--vxe-ui-table-tree-node-indent) - var(--vxe-ui-table-tree-node-btn-width))'
2577
- }
2578
- })
2579
- }
2580
- }
2581
- }
2582
- return lines
2583
- }
2584
-
2585
2485
  const updateAfterTreeIndex = () => {
2586
2486
  const { fullDataRowIdData, fullAllDataRowIdData, afterFullData, afterTreeFullData } = internalData
2587
2487
  const treeOpts = computeTreeOpts.value
2588
- const { lazy, transform, showRootLine, mapChildrenField } = treeOpts
2488
+ const { lazy, transform, mapChildrenField } = treeOpts
2589
2489
  const childrenField = treeOpts.children || treeOpts.childrenField
2590
2490
  const hasChildField = treeOpts.hasChild || treeOpts.hasChildField
2591
2491
  const showTreeLine = computeShowTreeLine.value
2492
+ const showTreeRootLine = computeShowTreeRootLine.value
2592
2493
  const fullMaps: Record<string, any> = {}
2593
2494
  const treeFullSize = afterTreeFullData.length
2594
- const rowNum = 0
2495
+ let rowNum = 0
2595
2496
  const { handleGetRowId } = createHandleGetRowId($xeTable)
2596
2497
 
2597
2498
  function handleTreeDFS(row: any, index: number, items: any[], parentRow: any, depth: number, isFirstRow: boolean, isLastRow: boolean, isLastChild: boolean, stackMask: number, seq: string) {
@@ -2601,22 +2502,19 @@ export default /* define-vxe-component start */ defineVxeComponent({
2601
2502
 
2602
2503
  if (rowRest) {
2603
2504
  rowRest.seq = seq
2604
- rowRest._seq = rowNum
2605
2505
  rowRest.items = items
2606
2506
  rowRest.treeIndex = index
2607
- rowRest._index = rowNum
2608
- rowRest._tIndex = rowNum
2609
2507
  } else {
2610
2508
  rowRest = {
2611
2509
  row,
2612
2510
  rowid,
2613
- _seq: rowNum,
2614
- seq,
2511
+ _seq: 0,
2512
+ seq: 0,
2615
2513
  index,
2616
2514
  $index: -1,
2617
- _index: rowNum,
2515
+ _index: 0,
2618
2516
  treeIndex: index,
2619
- _tIndex: rowNum,
2517
+ _tIndex: 0,
2620
2518
  items,
2621
2519
  parent: parentRow,
2622
2520
  level: 0,
@@ -2638,6 +2536,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
2638
2536
 
2639
2537
  rowRest.seq = seq
2640
2538
  rowRest._seq = rowNum
2539
+ rowRest._index = rowNum
2540
+ rowRest._tIndex = rowNum
2641
2541
 
2642
2542
  rowRest.level = depth - 1
2643
2543
  rowRest.linesMask = linesMask
@@ -2652,7 +2552,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
2652
2552
  }
2653
2553
  const isExpandable = (lazy ? (isLazyLoaded ? hasChild : hasChild || hasLazyChilds) : hasChild)
2654
2554
 
2655
- rowRest.treeLines = showTreeLine && treeFullSize > 1 ? getTreeNodeLines(isExpandable, depth, linesMask, isFirstRow, isLastRow, showRootLine) : []
2555
+ rowRest.treeLines = showTreeLine && treeFullSize > 1 ? getTreeNodeLines(isExpandable, depth, linesMask, isFirstRow, isLastRow, showTreeRootLine) : []
2656
2556
 
2657
2557
  // 计算传给子节点的状态
2658
2558
  let nextStackMask = stackMask
@@ -2660,11 +2560,14 @@ export default /* define-vxe-component start */ defineVxeComponent({
2660
2560
  nextStackMask |= (1 << depth)
2661
2561
  }
2662
2562
 
2563
+ rowNum++
2663
2564
  fullMaps[rowid] = row
2664
2565
 
2665
2566
  // 递归子节点
2666
- for (let i = 0; i < rowChilds.length; i++) {
2667
- handleTreeDFS(rowChilds[i], i, rowChilds, row, depth + 1, false, false, i === rowChilds.length - 1, nextStackMask, `${seq}.${i + 1}`)
2567
+ if (rowChilds) {
2568
+ for (let i = 0; i < rowChilds.length; i++) {
2569
+ handleTreeDFS(rowChilds[i], i, rowChilds, row, depth + 1, false, false, i === rowChilds.length - 1, nextStackMask, `${seq}.${i + 1}`)
2570
+ }
2668
2571
  }
2669
2572
  }
2670
2573
 
@@ -14699,7 +14602,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
14699
14602
  const { handleGetRowId } = createHandleGetRowId($xeTable)
14700
14603
  tableRowExpandedList.forEach((row) => {
14701
14604
  const expandOpts = computeExpandOpts.value
14702
- const { height: expandHeight, padding, indent } = expandOpts
14605
+ const { height: expandHeight, padding } = expandOpts
14703
14606
  const { fullAllDataRowIdData, fullColumnIdData } = internalData
14704
14607
  const treeOpts = computeTreeOpts.value
14705
14608
  const { transform, seqMode } = treeOpts
@@ -14729,7 +14632,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
14729
14632
  cellStyle.height = `${expandHeight}px`
14730
14633
  }
14731
14634
  if (isRowGroupStatus || treeConfig) {
14732
- cellStyle.paddingLeft = `${rowLevel * (XEUtils.isNumber(indent) ? indent : treeOpts.indent) + 30}px`
14635
+ cellStyle.paddingLeft = `calc(${rowLevel} * var(--vxe-ui-table-expand-tree-node-indent) + 30px)`
14733
14636
  }
14734
14637
  let columnIndex = -1
14735
14638
  let $columnIndex = -1
@@ -0,0 +1,112 @@
1
+ import type { VxeTableDefines } from '../../../types'
2
+
3
+ /**
4
+ * 分配树节点的连接线
5
+ * 类名(cut-full / cut-top / cut-bottom)
6
+ */
7
+ export function getTreeNodeLines(isExpandable: boolean, depth: number, linesMask: number, isFirstRow: boolean, isLastRow: boolean, showRootLine: boolean | undefined) {
8
+ const lines: VxeTableDefines.RowCacheTreeLineData[] = []
9
+
10
+ for (let col = 1; col <= depth; col++) {
11
+ const leftVal = `var(--vxe-ui-table-tree-node-btn-width) + var(--vxe-ui-table-tree-node-indent) * ${(col - 1)}`
12
+ const through = (linesMask & (1 << (col - 1))) !== 0
13
+
14
+ if (col === 1 && !showRootLine) {
15
+ continue
16
+ }
17
+
18
+ if (col < depth) {
19
+ // 普通列(贯穿线)
20
+ if (through) {
21
+ let top = '0'
22
+ let height = '100%'
23
+ if (isFirstRow) {
24
+ top = '50%'
25
+ height = '50%'
26
+ } else if (isLastRow) {
27
+ top = '0'
28
+ height = '50%'
29
+ }
30
+
31
+ lines.push({
32
+ type: 'v',
33
+ style: {
34
+ left: `calc(${leftVal})`,
35
+ top,
36
+ height
37
+ }
38
+ })
39
+ }
40
+ } else {
41
+ // 肘部列
42
+ let vTop = '0'
43
+ let vHeight = through ? '100%' : '50%'
44
+
45
+ if (isFirstRow && isLastRow) {
46
+ vTop = '50%'
47
+ vHeight = '0px'
48
+ } else if (isFirstRow) {
49
+ vTop = '50%'
50
+ vHeight = '50%'
51
+ } else if (isLastRow) {
52
+ vTop = '0'
53
+ vHeight = '50%'
54
+ }
55
+
56
+ if (isExpandable && vHeight !== '0px') {
57
+ // 元素切割:根据头和尾的情况分配不同的类名
58
+ let cutType = 'v cut'
59
+ if (vTop === '0' && vHeight === '50%') {
60
+ cutType = 'v cut-top'
61
+ } else if (vTop === '50%' && vHeight === '50%') {
62
+ cutType = 'v cut-bottom'
63
+ } else if (vHeight === '100%') {
64
+ cutType = 'v cut-full'
65
+ }
66
+
67
+ lines.push({
68
+ type: cutType,
69
+ style: {
70
+ left: `calc(${leftVal})`,
71
+ top: vTop,
72
+ height: vHeight
73
+ }
74
+ })
75
+ } else {
76
+ // 正常竖线
77
+ if (vHeight !== '0px') {
78
+ lines.push({
79
+ type: 'v',
80
+ style: {
81
+ left: `calc(${leftVal})`,
82
+ top: vTop,
83
+ height: vHeight
84
+ }
85
+ })
86
+ }
87
+ }
88
+
89
+ // 横线处理:如果可展开,横线从图标右侧开始画;否则正常画
90
+ if (isExpandable) {
91
+ lines.push({
92
+ type: 'h',
93
+ style: {
94
+ left: `calc(${leftVal} + var(--vxe-ui-table-tree-node-btn-width) / 2 + 1px)`,
95
+ top: '50%',
96
+ width: 'calc(var(--vxe-ui-table-tree-node-indent) - var(--vxe-ui-table-tree-node-btn-width) - 0.2em)'
97
+ }
98
+ })
99
+ } else {
100
+ lines.push({
101
+ type: 'h',
102
+ style: {
103
+ left: `calc(${leftVal})`,
104
+ top: '50%',
105
+ width: 'calc(var(--vxe-ui-table-tree-node-indent) - var(--vxe-ui-table-tree-node-btn-width) / 2 - 0.1em)'
106
+ }
107
+ })
108
+ }
109
+ }
110
+ }
111
+ return lines
112
+ }
@@ -184,7 +184,6 @@ VxeUI.setConfig({
184
184
  parentField: '_X_ROW_PARENT_KEY',
185
185
  childrenField: '_X_ROW_CHILDREN',
186
186
  mapChildrenField: '_X_ROW_CHILD_LIST',
187
- indent: 28,
188
187
  showIcon: true,
189
188
  maxGroupSize: 4,
190
189
  showAggFuncTitle: true
@@ -196,7 +195,7 @@ VxeUI.setConfig({
196
195
  childrenField: 'children',
197
196
  hasChildField: 'hasChild',
198
197
  mapChildrenField: '_X_ROW_CHILD',
199
- indent: 28,
198
+ // indent: 20,
200
199
  showIcon: true,
201
200
  // lineType: 'dashed',
202
201
  showRootLine: true
@@ -350,10 +349,10 @@ VxeUI.setIcon({
350
349
  TABLE_TITLE_PREFIX: iconPrefix + 'question-circle-fill',
351
350
  TABLE_TITLE_SUFFIX: iconPrefix + 'question-circle-fill',
352
351
  TABLE_TREE_LOADED: iconPrefix + 'spinner roll',
353
- TABLE_TREE_OPEN: iconPrefix + 'caret-right rotate90',
352
+ TABLE_TREE_OPEN: iconPrefix + 'caret-right rotate-90',
354
353
  TABLE_TREE_CLOSE: iconPrefix + 'caret-right',
355
354
  TABLE_EXPAND_LOADED: iconPrefix + 'spinner roll',
356
- TABLE_EXPAND_OPEN: iconPrefix + 'arrow-right rotate90',
355
+ TABLE_EXPAND_OPEN: iconPrefix + 'arrow-right rotate-90',
357
356
  TABLE_EXPAND_CLOSE: iconPrefix + 'arrow-right',
358
357
  TABLE_CHECKBOX_CHECKED: iconPrefix + 'checkbox-checked-fill',
359
358
  TABLE_CHECKBOX_UNCHECKED: iconPrefix + 'checkbox-unchecked',
@@ -382,7 +381,7 @@ VxeUI.setIcon({
382
381
  TABLE_DRAG_STATUS_AGG_VALUES: iconPrefix + 'values',
383
382
  TABLE_DRAG_STATUS_COLUMN: iconPrefix + 'swap',
384
383
  TABLE_DRAG_DISABLED: iconPrefix + 'no-drop',
385
- TABLE_ROW_GROUP_OPEN: iconPrefix + 'arrow-right rotate90',
384
+ TABLE_ROW_GROUP_OPEN: iconPrefix + 'arrow-right rotate-90',
386
385
  TABLE_ROW_GROUP_CLOSE: iconPrefix + 'arrow-right',
387
386
  TABLE_AGGREGATE_GROUPING: iconPrefix + 'grouping',
388
387
  TABLE_AGGREGATE_VALUES: iconPrefix + 'values',
@@ -58,18 +58,26 @@ $btnThemeList: (
58
58
  &.animat {
59
59
  transition: transform 0.25s ease-in-out;
60
60
  }
61
- &.rotate45 {
61
+ &.rotate45,
62
+ &.rotate-45 {
62
63
  transform: rotate(45deg);
63
64
  }
64
- &.rotate90 {
65
+ &.rotate90,
66
+ &.rotate-90 {
65
67
  transform: rotate(90deg);
66
68
  }
67
- &.rotate180 {
69
+ &.rotate180,
70
+ &.rotate-180 {
68
71
  transform: rotate(180deg);
69
72
  }
70
73
  &.roll {
71
74
  animation: rollCircle 1s infinite linear;
72
75
  }
76
+ @for $i from 6 through 18 {
77
+ &.fs-#{$i} {
78
+ font-size: #{$i}px;
79
+ }
80
+ }
73
81
  @for $index from 0 to list.length($btnThemeList) {
74
82
  $item: list.nth($btnThemeList, $index + 1);
75
83
  &.theme--#{map.get($item, name)} {
@@ -6,13 +6,16 @@
6
6
  font-family: Verdana,Arial,Tahoma;
7
7
  font-weight: normal;
8
8
  user-select: none;
9
- &.rotate45 {
9
+ &.rotate45,
10
+ &.rotate-45 {
10
11
  transform: rotate(45deg);
11
12
  }
12
- &.rotate90 {
13
+ &.rotate90,
14
+ &.rotate-90 {
13
15
  transform: rotate(90deg);
14
16
  }
15
- &.rotate180 {
17
+ &.rotate180,
18
+ &.rotate-180 {
16
19
  transform: rotate(180deg);
17
20
  }
18
21
  }
@@ -11,30 +11,36 @@
11
11
  --vxe-ui-table-current-cell-padding: var(--vxe-ui-table-cell-padding-default);
12
12
  --vxe-ui-table-current-row-line-height: var(--vxe-ui-table-row-line-height);
13
13
  --vxe-ui-table-current-row-height: var(--vxe-ui-table-row-height-default);
14
+ --vxe-ui-table-current-tree-node-indent: var(--vxe-ui-table-tree-node-indent-default);
14
15
  &.size--xlarge {
15
16
  --vxe-ui-table-current-font-size: var(--vxe-ui-font-size-xlarge);
16
17
  --vxe-ui-table-current-cell-padding: var(--vxe-ui-table-cell-padding-xlarge);
17
18
  --vxe-ui-table-current-row-height: var(--vxe-ui-table-row-height-xlarge);
19
+ --vxe-ui-table-current-tree-node-indent: var(--vxe-ui-table-tree-node-indent-xlarge);
18
20
  }
19
21
  &.size--large {
20
22
  --vxe-ui-table-current-font-size: var(--vxe-ui-font-size-large);
21
23
  --vxe-ui-table-current-cell-padding: var(--vxe-ui-table-cell-padding-large);
22
24
  --vxe-ui-table-current-row-height: var(--vxe-ui-table-row-height-large);
25
+ --vxe-ui-table-current-tree-node-indent: var(--vxe-ui-table-tree-node-indent-large);
23
26
  }
24
27
  &.size--medium {
25
28
  --vxe-ui-table-current-font-size: var(--vxe-ui-font-size-medium);
26
29
  --vxe-ui-table-current-cell-padding: var(--vxe-ui-table-cell-padding-medium);
27
30
  --vxe-ui-table-current-row-height: var(--vxe-ui-table-row-height-medium);
31
+ --vxe-ui-table-current-tree-node-indent: var(--vxe-ui-table-tree-node-indent-medium);
28
32
  }
29
33
  &.size--small {
30
34
  --vxe-ui-table-current-font-size: var(--vxe-ui-font-size-small);
31
35
  --vxe-ui-table-current-cell-padding: var(--vxe-ui-table-cell-padding-small);
32
36
  --vxe-ui-table-current-row-height: var(--vxe-ui-table-row-height-small);
37
+ --vxe-ui-table-current-tree-node-indent: var(--vxe-ui-table-tree-node-indent-small);
33
38
  }
34
39
  &.size--mini {
35
40
  --vxe-ui-table-current-font-size: var(--vxe-ui-font-size-mini);
36
41
  --vxe-ui-table-current-cell-padding: var(--vxe-ui-table-cell-padding-mini);
37
42
  --vxe-ui-table-current-row-height: var(--vxe-ui-table-row-height-mini);
43
+ --vxe-ui-table-current-tree-node-indent: var(--vxe-ui-table-tree-node-indent-mini);
38
44
  }
39
45
  }
40
46
 
@@ -97,6 +103,9 @@ $btnThemeList: (
97
103
  }
98
104
  }
99
105
 
106
+ .vxe-table {
107
+ --vxe-ui-table-tree-node-indent: var(--vxe-ui-table-current-tree-node-indent);
108
+ }
100
109
  .vxe-table--print-frame {
101
110
  position: fixed;
102
111
  bottom: -100%;
@@ -2038,10 +2047,10 @@ $btnThemeList: (
2038
2047
  background-size: calc(var(--vxe-ui-table-tree-node-line-width) * 2) var(--vxe-ui-table-tree-node-line-width);
2039
2048
  }
2040
2049
  /*树形节点*/
2041
- .vxe-tree--line {
2050
+ .vxe-table--tree-node-line {
2042
2051
  --vxe-ui-table-current-line-gap: calc((var(--vxe-ui-table-cell-height, var(--vxe-ui-table-current-row-height)) - var(--vxe-ui-table-tree-node-btn-width)) / 2);
2043
2052
  }
2044
- .vxe-tree--line {
2053
+ .vxe-table--tree-node-line {
2045
2054
  position: absolute;
2046
2055
  pointer-events: none;
2047
2056
 
@@ -2078,7 +2087,7 @@ $btnThemeList: (
2078
2087
  transform: translateY(-50%);
2079
2088
  }
2080
2089
  }
2081
- .vxe-tree--line {
2090
+ .vxe-table--tree-node-line {
2082
2091
  // 实线
2083
2092
  &.type--solid {
2084
2093
  &.v {
@@ -2732,7 +2741,8 @@ $btnThemeList: (
2732
2741
  .vxe-body--row {
2733
2742
  .vxe-table--column {
2734
2743
  .vxe-cell {
2735
- .vxe-cell--wrapper {
2744
+ .vxe-cell--wrapper,
2745
+ .vxe-tree-cell {
2736
2746
  %ReusekeepControl {
2737
2747
  position: absolute;
2738
2748
  width: 0;