vxe-table 3.19.6 → 3.19.8
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/es/style.css +1 -1
- package/es/table/src/body.js +9 -19
- package/es/table/src/cell.js +47 -40
- package/es/table/src/footer.js +2 -12
- package/es/table/src/header.js +3 -11
- package/es/table/src/methods.js +51 -56
- package/es/table/src/table.js +89 -6
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +201 -121
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/body.js +7 -20
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +12 -5
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/footer.js +2 -15
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +3 -13
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +56 -59
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +118 -6
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/table/src/body.ts +9 -19
- package/packages/table/src/cell.ts +49 -42
- package/packages/table/src/footer.ts +2 -11
- package/packages/table/src/header.ts +3 -11
- package/packages/table/src/methods.ts +52 -55
- package/packages/table/src/table.ts +89 -6
- package/packages/ui/index.ts +1 -1
- /package/es/{iconfont.1761877353318.ttf → iconfont.1762324067655.ttf} +0 -0
- /package/es/{iconfont.1761877353318.woff → iconfont.1762324067655.woff} +0 -0
- /package/es/{iconfont.1761877353318.woff2 → iconfont.1762324067655.woff2} +0 -0
- /package/lib/{iconfont.1761877353318.ttf → iconfont.1762324067655.ttf} +0 -0
- /package/lib/{iconfont.1761877353318.woff → iconfont.1762324067655.woff} +0 -0
- /package/lib/{iconfont.1761877353318.woff2 → iconfont.1762324067655.woff2} +0 -0
|
@@ -278,27 +278,18 @@ export default {
|
|
|
278
278
|
const _vm = this as any
|
|
279
279
|
const props = _vm
|
|
280
280
|
const $xeTable = _vm.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
281
|
-
const tableProps = $xeTable
|
|
282
281
|
const tableReactData = $xeTable as unknown as TableReactData
|
|
283
282
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
284
283
|
|
|
285
284
|
const { xID } = $xeTable
|
|
286
285
|
|
|
287
286
|
const { fixedType, fixedColumn, tableColumn } = props
|
|
288
|
-
const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = tableProps
|
|
289
287
|
const { visibleColumn, fullColumnIdData } = tableInternalData
|
|
290
288
|
const { isGroup, isColLoading, overflowX, scrollXLoad, dragCol } = tableReactData
|
|
289
|
+
const isFooterRenderOptimize = $xeTable.computeIsFooterRenderOptimize
|
|
291
290
|
|
|
292
291
|
let renderColumnList = tableColumn as VxeTableDefines.ColumnInfo[]
|
|
293
|
-
|
|
294
|
-
// 如果是使用优化模式
|
|
295
|
-
if (scrollXLoad && allColumnFooterOverflow) {
|
|
296
|
-
if (spanMethod || footerSpanMethod) {
|
|
297
|
-
// 如果不支持优化模式
|
|
298
|
-
} else {
|
|
299
|
-
isOptimizeMode = true
|
|
300
|
-
}
|
|
301
|
-
}
|
|
292
|
+
const isOptimizeMode = isFooterRenderOptimize
|
|
302
293
|
|
|
303
294
|
if (!isOptimizeMode || (!isColLoading && (fixedType || !overflowX))) {
|
|
304
295
|
renderColumnList = visibleColumn
|
|
@@ -462,27 +462,19 @@ export default {
|
|
|
462
462
|
const { fixedType, fixedColumn, tableColumn } = props
|
|
463
463
|
const { headerColumn } = _vm
|
|
464
464
|
|
|
465
|
-
const { mouseConfig
|
|
465
|
+
const { mouseConfig } = tableProps
|
|
466
466
|
const { isGroup, isColLoading, overflowX, scrollXLoad, dragCol } = tableReactData
|
|
467
467
|
const { visibleColumn, fullColumnIdData } = tableInternalData
|
|
468
468
|
|
|
469
469
|
const mouseOpts = $xeTable.computeMouseOpts
|
|
470
|
+
const isHeaderRenderOptimize = $xeTable.computeIsHeaderRenderOptimize
|
|
470
471
|
let renderHeaderList = headerColumn as VxeTableDefines.ColumnInfo[][]
|
|
471
472
|
let renderColumnList = tableColumn as VxeTableDefines.ColumnInfo[]
|
|
472
|
-
|
|
473
|
+
const isOptimizeMode = isHeaderRenderOptimize
|
|
473
474
|
|
|
474
475
|
if (isGroup) {
|
|
475
476
|
renderColumnList = visibleColumn
|
|
476
477
|
} else {
|
|
477
|
-
// 如果是使用优化模式
|
|
478
|
-
if (scrollXLoad && allColumnHeaderOverflow) {
|
|
479
|
-
if (spanMethod || footerSpanMethod) {
|
|
480
|
-
// 如果不支持优化模式
|
|
481
|
-
} else {
|
|
482
|
-
isOptimizeMode = true
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
|
|
486
478
|
if (!isOptimizeMode || (!isColLoading && (fixedType || !overflowX))) {
|
|
487
479
|
renderColumnList = visibleColumn
|
|
488
480
|
}
|
|
@@ -530,8 +530,7 @@ function handleVirtualTreeExpand ($xeTable: VxeTableConstructor & VxeTablePrivat
|
|
|
530
530
|
updateAfterDataIndex($xeTable)
|
|
531
531
|
return $xeTable.$nextTick()
|
|
532
532
|
}).then(() => {
|
|
533
|
-
|
|
534
|
-
return handleLazyRecalculate($xeTable, true, true, true)
|
|
533
|
+
return handleRecalculateStyle($xeTable, true, true, true)
|
|
535
534
|
}).then(() => {
|
|
536
535
|
updateTreeLineStyle($xeTable)
|
|
537
536
|
setTimeout(() => {
|
|
@@ -998,8 +997,8 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
998
997
|
const reactData = $xeTable as unknown as TableReactData
|
|
999
998
|
const internalData = $xeTable as unknown as TableInternalData
|
|
1000
999
|
|
|
1001
|
-
const {
|
|
1002
|
-
const { isGroup, currentRow, tableColumn,
|
|
1000
|
+
const { mouseConfig } = props
|
|
1001
|
+
const { isGroup, currentRow, tableColumn, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isColLoading } = reactData
|
|
1003
1002
|
const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData
|
|
1004
1003
|
const $xeGanttView = internalData.xeGanttView
|
|
1005
1004
|
const el = $xeTable.$refs.refElem as HTMLDivElement
|
|
@@ -1007,12 +1006,15 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
1007
1006
|
return
|
|
1008
1007
|
}
|
|
1009
1008
|
const containerList = ['main', 'left', 'right']
|
|
1009
|
+
const { leftList, rightList } = columnStore
|
|
1010
1010
|
let osbWidth = overflowY ? scrollbarWidth : 0
|
|
1011
1011
|
let osbHeight = overflowX ? scrollbarHeight : 0
|
|
1012
1012
|
const emptyPlaceholderElem = $xeTable.$refs.refEmptyPlaceholder as HTMLDivElement
|
|
1013
|
+
const isHeaderRenderOptimize = $xeTable.computeIsHeaderRenderOptimize
|
|
1014
|
+
const isBodyRenderOptimize = $xeTable.computeIsBodyRenderOptimize
|
|
1015
|
+
const isFooterRenderOptimize = $xeTable.computeIsFooterRenderOptimize
|
|
1013
1016
|
const scrollbarOpts = $xeTable.computeScrollbarOpts
|
|
1014
1017
|
const mouseOpts = $xeTable.computeMouseOpts
|
|
1015
|
-
const expandOpts = $xeTable.computeExpandOpts
|
|
1016
1018
|
const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper'])
|
|
1017
1019
|
const bodyTableElem = getRefElem(elemStore['main-body-table'])
|
|
1018
1020
|
if (emptyPlaceholderElem) {
|
|
@@ -1134,7 +1136,7 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
1134
1136
|
let fixedColumn: VxeTableDefines.ColumnInfo[] = []
|
|
1135
1137
|
let fixedWrapperElem: HTMLDivElement
|
|
1136
1138
|
if (fixedType) {
|
|
1137
|
-
fixedColumn = isFixedLeft ?
|
|
1139
|
+
fixedColumn = isFixedLeft ? leftList : rightList
|
|
1138
1140
|
fixedWrapperElem = (isFixedLeft ? $xeTable.$refs.refLeftContainer : $xeTable.$refs.refRightContainer) as HTMLDivElement
|
|
1139
1141
|
}
|
|
1140
1142
|
layoutList.forEach(layout => {
|
|
@@ -1145,20 +1147,11 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
1145
1147
|
// 表头体样式处理
|
|
1146
1148
|
// 横向滚动渲染
|
|
1147
1149
|
let renderColumnList = tableColumn
|
|
1148
|
-
|
|
1150
|
+
const isOptimizeMode = isHeaderRenderOptimize
|
|
1149
1151
|
|
|
1150
1152
|
if (isGroup) {
|
|
1151
1153
|
renderColumnList = visibleColumn
|
|
1152
1154
|
} else {
|
|
1153
|
-
// 如果是使用优化模式
|
|
1154
|
-
if (scrollXLoad && allColumnHeaderOverflow) {
|
|
1155
|
-
if (spanMethod || footerSpanMethod) {
|
|
1156
|
-
// 如果不支持优化模式
|
|
1157
|
-
} else {
|
|
1158
|
-
isOptimizeMode = true
|
|
1159
|
-
}
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
1155
|
if (!isOptimizeMode || (!isColLoading && (fixedType || !overflowX))) {
|
|
1163
1156
|
renderColumnList = visibleColumn
|
|
1164
1157
|
}
|
|
@@ -1215,16 +1208,7 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
1215
1208
|
}
|
|
1216
1209
|
|
|
1217
1210
|
let renderColumnList = tableColumn
|
|
1218
|
-
|
|
1219
|
-
let isOptimizeMode = false
|
|
1220
|
-
// 如果是使用优化模式
|
|
1221
|
-
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
1222
|
-
if ((expandColumn && expandOpts.mode !== 'fixed') || spanMethod || footerSpanMethod) {
|
|
1223
|
-
// 如果不支持优化模式
|
|
1224
|
-
} else {
|
|
1225
|
-
isOptimizeMode = true
|
|
1226
|
-
}
|
|
1227
|
-
}
|
|
1211
|
+
const isOptimizeMode = isBodyRenderOptimize
|
|
1228
1212
|
|
|
1229
1213
|
if (fixedType) {
|
|
1230
1214
|
renderColumnList = visibleColumn
|
|
@@ -1258,15 +1242,7 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
1258
1242
|
}
|
|
1259
1243
|
} else if (layout === 'footer') {
|
|
1260
1244
|
let renderColumnList = tableColumn
|
|
1261
|
-
|
|
1262
|
-
// 如果是使用优化模式
|
|
1263
|
-
if (scrollXLoad && allColumnFooterOverflow) {
|
|
1264
|
-
if (spanMethod || footerSpanMethod) {
|
|
1265
|
-
// 如果不支持优化模式
|
|
1266
|
-
} else {
|
|
1267
|
-
isOptimizeMode = true
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1245
|
+
const isOptimizeMode = isFooterRenderOptimize
|
|
1270
1246
|
|
|
1271
1247
|
if (!isOptimizeMode || (!isColLoading && (fixedType || !overflowX))) {
|
|
1272
1248
|
renderColumnList = visibleColumn
|
|
@@ -2513,20 +2489,31 @@ function autoCellWidth ($xeTable: VxeTableConstructor & VxeTablePrivateMethods)
|
|
|
2513
2489
|
/**
|
|
2514
2490
|
* 计算自适应行高
|
|
2515
2491
|
*/
|
|
2516
|
-
const calcCellAutoHeight = (rowRest: VxeTableDefines.RowCacheItem, wrapperEl: HTMLDivElement) => {
|
|
2517
|
-
const
|
|
2492
|
+
const calcCellAutoHeight = ($xeTable: VxeTableConstructor, rowRest: VxeTableDefines.RowCacheItem, wrapperEl: HTMLDivElement) => {
|
|
2493
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
2494
|
+
|
|
2495
|
+
const { scrollXLoad } = reactData
|
|
2496
|
+
const wrapperElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`)
|
|
2518
2497
|
let colHeight = rowRest.height
|
|
2519
2498
|
let firstCellStyle: CSSStyleDeclaration | null = null
|
|
2520
2499
|
let topBottomPadding = 0
|
|
2521
|
-
for (let i = 0; i <
|
|
2522
|
-
const wrapperElem =
|
|
2500
|
+
for (let i = 0; i < wrapperElemList.length; i++) {
|
|
2501
|
+
const wrapperElem = wrapperElemList[i] as HTMLElement
|
|
2523
2502
|
const cellElem = wrapperElem.parentElement as HTMLTableCellElement
|
|
2524
2503
|
if (!firstCellStyle) {
|
|
2504
|
+
const cellStyle = cellElem.style
|
|
2505
|
+
const orHeight = cellStyle.height
|
|
2506
|
+
if (!scrollXLoad) {
|
|
2507
|
+
cellStyle.height = ''
|
|
2508
|
+
}
|
|
2525
2509
|
firstCellStyle = getComputedStyle(cellElem)
|
|
2526
2510
|
topBottomPadding = firstCellStyle ? Math.ceil(XEUtils.toNumber(firstCellStyle.paddingTop) + XEUtils.toNumber(firstCellStyle.paddingBottom)) : 0
|
|
2511
|
+
if (!scrollXLoad) {
|
|
2512
|
+
cellStyle.height = orHeight
|
|
2513
|
+
}
|
|
2527
2514
|
}
|
|
2528
2515
|
const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0
|
|
2529
|
-
colHeight = Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding))
|
|
2516
|
+
colHeight = scrollXLoad ? Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding)) : Math.ceil(cellHeight + topBottomPadding)
|
|
2530
2517
|
}
|
|
2531
2518
|
return colHeight
|
|
2532
2519
|
}
|
|
@@ -2547,13 +2534,15 @@ const calcCellHeight = ($xeTable: VxeTableConstructor) => {
|
|
|
2547
2534
|
const el = $xeTable.$refs.refElem as HTMLDivElement
|
|
2548
2535
|
if (!isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine)) && el) {
|
|
2549
2536
|
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
2537
|
+
el.setAttribute('data-calc-row', 'Y')
|
|
2550
2538
|
tableData.forEach(row => {
|
|
2551
2539
|
const rowid = handleGetRowId(row)
|
|
2552
2540
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
2553
2541
|
if (rowRest) {
|
|
2554
|
-
const height = calcCellAutoHeight(rowRest, el)
|
|
2542
|
+
const height = calcCellAutoHeight($xeTable, rowRest, el)
|
|
2555
2543
|
rowRest.height = Math.max(defaultRowHeight, scrollXLoad ? Math.max(rowRest.height, height) : height)
|
|
2556
2544
|
}
|
|
2545
|
+
el.removeAttribute('data-calc-row')
|
|
2557
2546
|
})
|
|
2558
2547
|
reactData.calcCellHeightFlag++
|
|
2559
2548
|
}
|
|
@@ -6371,7 +6360,9 @@ const Methods = {
|
|
|
6371
6360
|
return
|
|
6372
6361
|
}
|
|
6373
6362
|
const handleRsHeight = () => {
|
|
6374
|
-
|
|
6363
|
+
el.setAttribute('data-calc-row', 'Y')
|
|
6364
|
+
const resizeHeight = calcCellAutoHeight($xeTable, rowRest, el)
|
|
6365
|
+
el.removeAttribute('data-calc-row')
|
|
6375
6366
|
const resizeParams = { ...params, resizeHeight, resizeRow: row }
|
|
6376
6367
|
reactData.isDragResize = false
|
|
6377
6368
|
internalData._lastResizeTime = Date.now()
|
|
@@ -6457,7 +6448,7 @@ const Methods = {
|
|
|
6457
6448
|
const rowid = XEUtils.isString(row) || XEUtils.isNumber(row) ? row : handleGetRowId(row)
|
|
6458
6449
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
6459
6450
|
if (rowRest) {
|
|
6460
|
-
rowRest.resizeHeight = calcCellAutoHeight(rowRest, el)
|
|
6451
|
+
rowRest.resizeHeight = calcCellAutoHeight($xeTable, rowRest, el)
|
|
6461
6452
|
}
|
|
6462
6453
|
el.removeAttribute('data-calc-row')
|
|
6463
6454
|
})
|
|
@@ -11648,7 +11639,7 @@ const Methods = {
|
|
|
11648
11639
|
const reactData = $xeTable as unknown as TableReactData
|
|
11649
11640
|
const internalData = $xeTable as unknown as TableInternalData
|
|
11650
11641
|
|
|
11651
|
-
const { isAllOverflow, scrollYLoad, expandColumn } = reactData
|
|
11642
|
+
const { isAllOverflow, overflowY, scrollYLoad, scrollYHeight, expandColumn } = reactData
|
|
11652
11643
|
const { scrollYStore, elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData, rowExpandedMaps } = internalData
|
|
11653
11644
|
const $xeGanttView = internalData.xeGanttView
|
|
11654
11645
|
const { startIndex } = scrollYStore
|
|
@@ -11663,13 +11654,13 @@ const Methods = {
|
|
|
11663
11654
|
const rightbodyTableElem = getRefElem(elemStore['right-body-table'])
|
|
11664
11655
|
const containerList = ['main', 'left', 'right']
|
|
11665
11656
|
let ySpaceTop = 0
|
|
11666
|
-
let
|
|
11657
|
+
let sYHeight = scrollYHeight
|
|
11667
11658
|
let isScrollYBig = false
|
|
11668
11659
|
if (scrollYLoad) {
|
|
11669
11660
|
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height
|
|
11670
11661
|
if (!isCustomCellHeight && !expandColumn && isAllOverflow) {
|
|
11671
|
-
|
|
11672
|
-
if (
|
|
11662
|
+
sYHeight = afterFullData.length * defaultRowHeight
|
|
11663
|
+
if (sYHeight > maxYHeight) {
|
|
11673
11664
|
isScrollYBig = true
|
|
11674
11665
|
}
|
|
11675
11666
|
ySpaceTop = Math.max(0, startIndex * defaultRowHeight)
|
|
@@ -11682,18 +11673,21 @@ const Methods = {
|
|
|
11682
11673
|
const lastRow = afterFullData[afterFullData.length - 1]
|
|
11683
11674
|
rowid = getRowid($xeTable, lastRow)
|
|
11684
11675
|
rowRest = fullAllDataRowIdData[rowid] || {}
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
|
|
11676
|
+
// 如果为空时还没计算完数据,保持原高度不变
|
|
11677
|
+
if (rowRest.oTop) {
|
|
11678
|
+
sYHeight = (rowRest.oTop || 0) + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight)
|
|
11679
|
+
// 是否展开行
|
|
11680
|
+
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
11681
|
+
sYHeight += rowRest.expandHeight || expandOpts.height || 0
|
|
11682
|
+
}
|
|
11689
11683
|
}
|
|
11690
|
-
if (
|
|
11684
|
+
if (sYHeight > maxYHeight) {
|
|
11691
11685
|
isScrollYBig = true
|
|
11692
11686
|
}
|
|
11693
11687
|
}
|
|
11694
11688
|
} else {
|
|
11695
11689
|
if (bodyTableElem) {
|
|
11696
|
-
|
|
11690
|
+
sYHeight = bodyTableElem.clientHeight
|
|
11697
11691
|
}
|
|
11698
11692
|
}
|
|
11699
11693
|
let clientHeight = 0
|
|
@@ -11701,7 +11695,7 @@ const Methods = {
|
|
|
11701
11695
|
clientHeight = bodyScrollElem.clientHeight
|
|
11702
11696
|
}
|
|
11703
11697
|
// 虚拟渲染
|
|
11704
|
-
let ySpaceHeight =
|
|
11698
|
+
let ySpaceHeight = sYHeight
|
|
11705
11699
|
let scrollYTop = ySpaceTop
|
|
11706
11700
|
if (isScrollYBig) {
|
|
11707
11701
|
// 触底
|
|
@@ -11712,6 +11706,9 @@ const Methods = {
|
|
|
11712
11706
|
}
|
|
11713
11707
|
ySpaceHeight = maxYHeight
|
|
11714
11708
|
}
|
|
11709
|
+
if (!(scrollYLoad && overflowY)) {
|
|
11710
|
+
scrollYTop = 0
|
|
11711
|
+
}
|
|
11715
11712
|
|
|
11716
11713
|
if (leftBodyTableElem) {
|
|
11717
11714
|
leftBodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`
|
|
@@ -11742,7 +11739,7 @@ const Methods = {
|
|
|
11742
11739
|
rowExpandYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : ''
|
|
11743
11740
|
}
|
|
11744
11741
|
reactData.scrollYTop = scrollYTop
|
|
11745
|
-
reactData.scrollYHeight =
|
|
11742
|
+
reactData.scrollYHeight = ySpaceHeight
|
|
11746
11743
|
reactData.isScrollYBig = isScrollYBig
|
|
11747
11744
|
|
|
11748
11745
|
calcScrollbar($xeTable)
|
|
@@ -1299,6 +1299,89 @@ export default {
|
|
|
1299
1299
|
}
|
|
1300
1300
|
return leftWidth
|
|
1301
1301
|
},
|
|
1302
|
+
computeBodyMergeCoverFixed () {
|
|
1303
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1304
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
1305
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
1306
|
+
|
|
1307
|
+
const { columnStore, mergeBodyFlag } = reactData
|
|
1308
|
+
const { mergeBodyList, visibleColumn } = internalData
|
|
1309
|
+
const { leftList, rightList } = columnStore
|
|
1310
|
+
const rscIndex = visibleColumn.length - rightList.length
|
|
1311
|
+
if (mergeBodyFlag && (leftList.length || rightList.length)) {
|
|
1312
|
+
const lecIndex = leftList.length
|
|
1313
|
+
for (let i = 0; i < mergeBodyList.length; i++) {
|
|
1314
|
+
const { col, colspan } = mergeBodyList[i]
|
|
1315
|
+
if (col < lecIndex || (col + colspan) > rscIndex) {
|
|
1316
|
+
return true
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
return false
|
|
1321
|
+
},
|
|
1322
|
+
computeIsHeaderRenderOptimize () {
|
|
1323
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1324
|
+
const props = $xeTable
|
|
1325
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
1326
|
+
|
|
1327
|
+
const { spanMethod, footerSpanMethod, showHeaderOverflow: allColumnHeaderOverflow } = props
|
|
1328
|
+
const { isGroup, scrollXLoad } = reactData
|
|
1329
|
+
let isOptimizeMode = false
|
|
1330
|
+
if (isGroup) {
|
|
1331
|
+
// 分组表头
|
|
1332
|
+
} else {
|
|
1333
|
+
// 如果是使用优化模式
|
|
1334
|
+
if (scrollXLoad && allColumnHeaderOverflow) {
|
|
1335
|
+
if (spanMethod || footerSpanMethod) {
|
|
1336
|
+
// 如果不支持优化模式
|
|
1337
|
+
} else {
|
|
1338
|
+
isOptimizeMode = true
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
return isOptimizeMode
|
|
1343
|
+
},
|
|
1344
|
+
computeIsBodyRenderOptimize () {
|
|
1345
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1346
|
+
const props = $xeTable
|
|
1347
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
1348
|
+
|
|
1349
|
+
const { spanMethod, footerSpanMethod } = props
|
|
1350
|
+
const { scrollXLoad, scrollYLoad, isAllOverflow, expandColumn } = reactData
|
|
1351
|
+
const bodyMergeCoverFixed = $xeTable.computeBodyMergeCoverFixed
|
|
1352
|
+
const expandOpts = $xeTable.computeExpandOpts
|
|
1353
|
+
let isOptimizeMode = false
|
|
1354
|
+
// 如果是使用优化模式
|
|
1355
|
+
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
1356
|
+
// 如果是展开行,内联模式,不支持优化
|
|
1357
|
+
// 如果是方法合并,不支持优化
|
|
1358
|
+
// 如果固定列且配置式合并,不支持优化
|
|
1359
|
+
if ((expandColumn && expandOpts.mode !== 'fixed') || bodyMergeCoverFixed || spanMethod || footerSpanMethod) {
|
|
1360
|
+
// 如果不支持优化模式
|
|
1361
|
+
} else {
|
|
1362
|
+
isOptimizeMode = true
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
return isOptimizeMode
|
|
1366
|
+
},
|
|
1367
|
+
computeIsFooterRenderOptimize () {
|
|
1368
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1369
|
+
const props = $xeTable
|
|
1370
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
1371
|
+
|
|
1372
|
+
const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = props
|
|
1373
|
+
const { scrollXLoad } = reactData
|
|
1374
|
+
let isOptimizeMode = false
|
|
1375
|
+
// 如果是使用优化模式
|
|
1376
|
+
if (scrollXLoad && allColumnFooterOverflow) {
|
|
1377
|
+
if (spanMethod || footerSpanMethod) {
|
|
1378
|
+
// 如果不支持优化模式
|
|
1379
|
+
} else {
|
|
1380
|
+
isOptimizeMode = true
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
return isOptimizeMode
|
|
1384
|
+
},
|
|
1302
1385
|
exportOpts () {
|
|
1303
1386
|
return this.computeExportOpts
|
|
1304
1387
|
},
|
|
@@ -1709,12 +1792,12 @@ export default {
|
|
|
1709
1792
|
if (props.resizable) {
|
|
1710
1793
|
warnLog('vxe.error.delProp', ['resizable', 'column-config.resizable'])
|
|
1711
1794
|
}
|
|
1712
|
-
if (props.virtualXConfig && props.scrollX) {
|
|
1713
|
-
|
|
1714
|
-
}
|
|
1715
|
-
if (props.virtualYConfig && props.scrollY) {
|
|
1716
|
-
|
|
1717
|
-
}
|
|
1795
|
+
// if (props.virtualXConfig && props.scrollX) {
|
|
1796
|
+
// warnLog('vxe.error.notSupportProp', ['virtual-x-config', 'scroll-x', 'scroll-x=null'])
|
|
1797
|
+
// }
|
|
1798
|
+
// if (props.virtualYConfig && props.scrollY) {
|
|
1799
|
+
// warnLog('vxe.error.notSupportProp', ['virtual-y-config', 'scroll-y', 'scroll-y=null'])
|
|
1800
|
+
// }
|
|
1718
1801
|
if (props.aggregateConfig && props.rowGroupConfig) {
|
|
1719
1802
|
warnLog('vxe.error.notSupportProp', ['aggregate-config', 'row-group-config', 'row-group-config=null'])
|
|
1720
1803
|
}
|
package/packages/ui/index.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|