vxe-table 4.24.0-beta.2 → 4.24.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all.esm.js +144 -129
- package/dist/all.esm.min.js +3 -3
- package/dist/style.css +66 -26
- package/dist/style.mini.css +1 -1
- package/es/style.css +66 -26
- package/es/style.mini.css +1 -1
- package/es/table/module/export/hook.js +4 -3
- package/es/table/src/body.js +2 -2
- package/es/table/src/cell.js +6 -6
- package/es/table/src/table.js +32 -111
- package/es/table/src/tree.d.ts +6 -0
- package/es/table/src/tree.js +96 -0
- package/es/table/style.css +64 -25
- package/es/table/style.mini.css +1 -1
- package/es/ui/index.js +5 -6
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +64 -25
- package/es/vxe-table/style.mini.css +1 -1
- package/lib/index.umd.js +144 -129
- package/lib/index.umd.min.js +3 -3
- package/lib/style.css +66 -26
- package/lib/style.mini.css +1 -1
- package/lib/table/module/export/hook.js +4 -3
- package/lib/table/src/body.js +2 -2
- package/lib/table/src/cell.js +6 -6
- package/lib/table/src/table.js +32 -111
- package/lib/table/src/tree.d.ts +6 -0
- package/lib/table/src/tree.js +116 -0
- package/lib/table/style/style.css +64 -25
- package/lib/table/style/style.mini.css +1 -1
- package/lib/ui/index.js +5 -6
- package/lib/ui/src/log.js +1 -1
- package/lib/vxe-table/style/style.css +64 -25
- package/lib/vxe-table/style/style.mini.css +1 -1
- package/package.json +1 -1
- package/packages/table/module/export/hook.ts +4 -3
- package/packages/table/src/body.ts +2 -2
- package/packages/table/src/cell.ts +9 -10
- package/packages/table/src/table.ts +32 -129
- package/packages/table/src/tree.ts +112 -0
- package/packages/ui/index.ts +4 -5
- package/styles/components/icon.scss +11 -3
- package/styles/components/old-icon.scss +6 -3
- package/styles/components/table.scss +3 -3
- package/styles/theme/base.scss +3 -1
- /package/dist/{iconfont.1794563906464.ttf → iconfont.1794628313365.ttf} +0 -0
- /package/dist/{iconfont.1794563906464.woff → iconfont.1794628313365.woff} +0 -0
- /package/dist/{iconfont.1794563906464.woff2 → iconfont.1794628313365.woff2} +0 -0
- /package/es/{iconfont.1794563906464.ttf → iconfont.1794628313365.ttf} +0 -0
- /package/es/{iconfont.1794563906464.woff → iconfont.1794628313365.woff} +0 -0
- /package/es/{iconfont.1794563906464.woff2 → iconfont.1794628313365.woff2} +0 -0
- /package/lib/{iconfont.1794563906464.ttf → iconfont.1794628313365.ttf} +0 -0
- /package/lib/{iconfont.1794563906464.woff → iconfont.1794628313365.woff} +0 -0
- /package/lib/{iconfont.1794563906464.woff2 → iconfont.1794628313365.woff2} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxe-table",
|
|
3
|
-
"version": "4.24.0-beta.
|
|
3
|
+
"version": "4.24.0-beta.3",
|
|
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",
|
|
@@ -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 *
|
|
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 *
|
|
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 *
|
|
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
|
|
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 =
|
|
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,
|
|
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
|
|
595
|
+
mode !== 'column' && padding
|
|
596
596
|
? {
|
|
597
|
-
paddingLeft:
|
|
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,
|
|
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
|
-
|
|
681
|
-
|
|
682
|
-
|
|
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 (
|
|
789
|
-
stys['--vxe-ui-table-tree-node-indent'] = toCssUnit(
|
|
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,
|
|
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
|
-
|
|
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:
|
|
2614
|
-
seq,
|
|
2511
|
+
_seq: 0,
|
|
2512
|
+
seq: 0,
|
|
2615
2513
|
index,
|
|
2616
2514
|
$index: -1,
|
|
2617
|
-
_index:
|
|
2515
|
+
_index: 0,
|
|
2618
2516
|
treeIndex: index,
|
|
2619
|
-
_tIndex:
|
|
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,
|
|
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
|
-
|
|
2667
|
-
|
|
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
|
|
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 =
|
|
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
|
+
}
|
package/packages/ui/index.ts
CHANGED
|
@@ -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:
|
|
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
|
|
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
|
|
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
|
|
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
|
}
|
|
@@ -2038,10 +2038,10 @@ $btnThemeList: (
|
|
|
2038
2038
|
background-size: calc(var(--vxe-ui-table-tree-node-line-width) * 2) var(--vxe-ui-table-tree-node-line-width);
|
|
2039
2039
|
}
|
|
2040
2040
|
/*树形节点*/
|
|
2041
|
-
.vxe-tree
|
|
2041
|
+
.vxe-table--tree-node-line {
|
|
2042
2042
|
--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
2043
|
}
|
|
2044
|
-
.vxe-tree
|
|
2044
|
+
.vxe-table--tree-node-line {
|
|
2045
2045
|
position: absolute;
|
|
2046
2046
|
pointer-events: none;
|
|
2047
2047
|
|
|
@@ -2078,7 +2078,7 @@ $btnThemeList: (
|
|
|
2078
2078
|
transform: translateY(-50%);
|
|
2079
2079
|
}
|
|
2080
2080
|
}
|
|
2081
|
-
.vxe-tree
|
|
2081
|
+
.vxe-table--tree-node-line {
|
|
2082
2082
|
// 实线
|
|
2083
2083
|
&.type--solid {
|
|
2084
2084
|
&.v {
|
package/styles/theme/base.scss
CHANGED
|
@@ -34,8 +34,10 @@
|
|
|
34
34
|
--vxe-ui-table-tree-node-indent: 1.5em;
|
|
35
35
|
--vxe-ui-table-tree-node-line-width: 1px;
|
|
36
36
|
--vxe-ui-table-tree-node-line-color:#909399;
|
|
37
|
-
--vxe-ui-table-tree-node-line-style: dotted;
|
|
38
37
|
--vxe-ui-table-header-font-weight: 700;
|
|
38
|
+
|
|
39
|
+
--vxe-ui-table-expand-tree-node-indent: var(--vxe-ui-table-tree-node-indent);
|
|
40
|
+
--vxe-ui-table-row-group-tree-node-indent: var(--vxe-ui-table-tree-node-indent);
|
|
39
41
|
|
|
40
42
|
--vxe-ui-table-row-height-xlarge: 54px;
|
|
41
43
|
--vxe-ui-table-row-height-large: 52px;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|