vxe-table 3.21.6 → 3.21.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 +13 -13
- package/es/table/src/group.js +3 -0
- package/es/table/src/methods.js +191 -66
- package/es/table/src/util.js +18 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +73 -34
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/body.js +13 -13
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/group.js +3 -0
- package/lib/table/src/group.min.js +1 -1
- package/lib/table/src/methods.js +37 -18
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/util.js +19 -1
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +1 -1
- 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 +2 -2
- package/packages/table/src/body.ts +15 -15
- package/packages/table/src/group.ts +4 -0
- package/packages/table/src/methods.ts +199 -68
- package/packages/table/src/util.ts +21 -1
- /package/es/{iconfont.1780293000244.ttf → iconfont.1780726754772.ttf} +0 -0
- /package/es/{iconfont.1780293000244.woff → iconfont.1780726754772.woff} +0 -0
- /package/es/{iconfont.1780293000244.woff2 → iconfont.1780726754772.woff2} +0 -0
- /package/lib/{iconfont.1780293000244.ttf → iconfont.1780726754772.ttf} +0 -0
- /package/lib/{iconfont.1780293000244.woff → iconfont.1780726754772.woff} +0 -0
- /package/lib/{iconfont.1780293000244.woff2 → iconfont.1780726754772.woff2} +0 -0
package/es/table/src/body.js
CHANGED
|
@@ -330,23 +330,11 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
|
|
|
330
330
|
class: 'vxe-cell--wrapper vxe-body-cell--wrapper'
|
|
331
331
|
}, column.renderCell(h, cellParams)));
|
|
332
332
|
}
|
|
333
|
-
tdVNs.push(h('div', {
|
|
334
|
-
key: 'tc',
|
|
335
|
-
class: ['vxe-cell', {
|
|
336
|
-
'c--title': showTitle,
|
|
337
|
-
'c--tooltip': showTooltip,
|
|
338
|
-
'c--ellipsis': showEllipsis
|
|
339
|
-
}],
|
|
340
|
-
style: tcStyle,
|
|
341
|
-
attrs: {
|
|
342
|
-
title: showTitle ? $xeTable.getCellLabel(row, column) : null
|
|
343
|
-
}
|
|
344
|
-
}, clVNs));
|
|
345
333
|
if (showValidTip && errorValidItem) {
|
|
346
334
|
const errRule = errorValidItem.rule;
|
|
347
335
|
const validSlot = slots ? slots.valid : null;
|
|
348
336
|
const validParams = Object.assign(Object.assign(Object.assign({}, cellParams), errorValidItem), { rule: errorValidItem });
|
|
349
|
-
|
|
337
|
+
clVNs.push(h('div', {
|
|
350
338
|
key: 'tcv',
|
|
351
339
|
class: ['vxe-cell--valid-error-tip', getClass(validOpts.className, errorValidItem)],
|
|
352
340
|
style: errRule && errRule.maxWidth
|
|
@@ -368,6 +356,18 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
|
|
|
368
356
|
])
|
|
369
357
|
]));
|
|
370
358
|
}
|
|
359
|
+
tdVNs.push(h('div', {
|
|
360
|
+
key: 'tc',
|
|
361
|
+
class: ['vxe-cell', {
|
|
362
|
+
'c--title': showTitle,
|
|
363
|
+
'c--tooltip': showTooltip,
|
|
364
|
+
'c--ellipsis': showEllipsis
|
|
365
|
+
}],
|
|
366
|
+
style: tcStyle,
|
|
367
|
+
attrs: {
|
|
368
|
+
title: showTitle ? $xeTable.getCellLabel(row, column) : null
|
|
369
|
+
}
|
|
370
|
+
}, clVNs));
|
|
371
371
|
}
|
|
372
372
|
let showAreaRowStatus = false;
|
|
373
373
|
if (mouseConfig && mouseOpts.area && !_columnIndex && selectCellToRow) {
|
package/es/table/src/group.js
CHANGED
package/es/table/src/methods.js
CHANGED
|
@@ -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 } 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 } from './util';
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
8
8
|
import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from '../../ui/src/anime';
|
|
9
9
|
import { warnLog, errLog } from '../../ui/src/log';
|
|
@@ -397,12 +397,19 @@ function updateScrollXStatus($xeTable, fullColumn) {
|
|
|
397
397
|
reactData.scrollXLoad = scrollXLoad;
|
|
398
398
|
return scrollXLoad;
|
|
399
399
|
}
|
|
400
|
+
function syncGanttScrollYStatus($xeTable) {
|
|
401
|
+
const reactData = $xeTable;
|
|
402
|
+
const internalData = $xeTable;
|
|
403
|
+
const $xeGanttView = internalData.xeGanttView;
|
|
404
|
+
if ($xeGanttView && $xeGanttView.handleUpdateSYStatus) {
|
|
405
|
+
$xeGanttView.handleUpdateSYStatus(reactData.scrollYLoad);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
400
408
|
function updateScrollYStatus($xeTable, fullData) {
|
|
401
409
|
const props = $xeTable;
|
|
402
410
|
const reactData = $xeTable;
|
|
403
411
|
const internalData = $xeTable;
|
|
404
412
|
const { treeConfig } = props;
|
|
405
|
-
const $xeGanttView = internalData.xeGanttView;
|
|
406
413
|
const virtualYOpts = $xeTable.computeVirtualYOpts;
|
|
407
414
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
408
415
|
const { transform } = treeOpts;
|
|
@@ -410,9 +417,7 @@ function updateScrollYStatus($xeTable, fullData) {
|
|
|
410
417
|
// 如果gt为0,则总是启用
|
|
411
418
|
const scrollYLoad = (transform || !treeConfig) && !!virtualYOpts.enabled && virtualYOpts.gt > -1 && (virtualYOpts.gt === 0 || virtualYOpts.gt < allList.length);
|
|
412
419
|
reactData.scrollYLoad = scrollYLoad;
|
|
413
|
-
|
|
414
|
-
$xeGanttView.handleUpdateSYStatus(scrollYLoad);
|
|
415
|
-
}
|
|
420
|
+
syncGanttScrollYStatus($xeTable);
|
|
416
421
|
return scrollYLoad;
|
|
417
422
|
}
|
|
418
423
|
/**
|
|
@@ -959,6 +964,7 @@ function updateStyle($xeTable) {
|
|
|
959
964
|
const props = $xeTable;
|
|
960
965
|
const reactData = $xeTable;
|
|
961
966
|
const internalData = $xeTable;
|
|
967
|
+
const $xeGantt = $xeTable.$xeGantt;
|
|
962
968
|
const { mouseConfig } = props;
|
|
963
969
|
const { isGroup, tableColumn, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isColLoading } = reactData;
|
|
964
970
|
const { visibleColumn, tableHeight, elemStore, currentRow, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData;
|
|
@@ -996,7 +1002,7 @@ function updateStyle($xeTable) {
|
|
|
996
1002
|
xScrollbarVisible = 'hidden';
|
|
997
1003
|
}
|
|
998
1004
|
let yScrollbarVisible = overflowY ? 'visible' : 'hidden';
|
|
999
|
-
if ((scrollbarYConf.visible === 'hidden' || scrollbarYConf.visible === false) || ($xeGanttView && !scrollbarYToLeft)) {
|
|
1005
|
+
if ((scrollbarYConf.visible === 'hidden' || scrollbarYConf.visible === false) || (($xeGantt && $xeGanttView && $xeGantt.reactData.showRightView) && !scrollbarYToLeft)) {
|
|
1000
1006
|
osbWidth = 0;
|
|
1001
1007
|
yScrollbarVisible = 'hidden';
|
|
1002
1008
|
}
|
|
@@ -2464,35 +2470,39 @@ function autoCellWidth($xeTable) {
|
|
|
2464
2470
|
/**
|
|
2465
2471
|
* 计算自适应行高
|
|
2466
2472
|
*/
|
|
2467
|
-
const calcCellAutoHeight = ($xeTable, rowRest, wrapperEl) => {
|
|
2468
|
-
const
|
|
2469
|
-
const {
|
|
2473
|
+
const calcCellAutoHeight = ($xeTable, rowid, rowRest, wrapperEl) => {
|
|
2474
|
+
const internalData = $xeTable;
|
|
2475
|
+
const { fullCellHeightMaps } = internalData;
|
|
2476
|
+
let chRest = fullCellHeightMaps[rowid];
|
|
2477
|
+
if (!chRest) {
|
|
2478
|
+
chRest = {};
|
|
2479
|
+
fullCellHeightMaps[rowid] = chRest;
|
|
2480
|
+
}
|
|
2470
2481
|
const wrapperElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
|
|
2471
|
-
let colHeight = 0;
|
|
2472
2482
|
let firstCellStyle = null;
|
|
2473
2483
|
let topBottomPadding = 0;
|
|
2484
|
+
let changeCH = false;
|
|
2474
2485
|
for (let i = 0; i < wrapperElemList.length; i++) {
|
|
2475
2486
|
const wrapperElem = wrapperElemList[i];
|
|
2476
2487
|
const cellElem = wrapperElem.parentElement;
|
|
2477
2488
|
const cellStyle = cellElem.style;
|
|
2478
2489
|
const orHeight = cellStyle.height;
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
}
|
|
2490
|
+
const colid = wrapperElem.getAttribute('colid') || '';
|
|
2491
|
+
cellStyle.height = '';
|
|
2482
2492
|
if (!firstCellStyle) {
|
|
2483
2493
|
firstCellStyle = getComputedStyle(cellElem);
|
|
2484
2494
|
topBottomPadding = firstCellStyle ? Math.ceil(XEUtils.toNumber(firstCellStyle.paddingTop) + XEUtils.toNumber(firstCellStyle.paddingBottom)) : 0;
|
|
2485
2495
|
}
|
|
2486
|
-
if (!scrollXLoad) {
|
|
2487
|
-
cellStyle.height = orHeight;
|
|
2488
|
-
}
|
|
2489
2496
|
const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0;
|
|
2490
|
-
colHeight = Math.
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2497
|
+
const colHeight = Math.ceil(cellHeight + topBottomPadding);
|
|
2498
|
+
if (chRest[colid] !== colHeight) {
|
|
2499
|
+
changeCH = true;
|
|
2500
|
+
chRest[colid] = colHeight;
|
|
2501
|
+
}
|
|
2502
|
+
cellStyle.height = orHeight;
|
|
2494
2503
|
}
|
|
2495
|
-
|
|
2504
|
+
const cellMaxHeight = getRowMaxHeight(chRest, changeCH);
|
|
2505
|
+
return cellMaxHeight;
|
|
2496
2506
|
};
|
|
2497
2507
|
/**
|
|
2498
2508
|
* 自适应行高
|
|
@@ -2517,7 +2527,7 @@ const calcCellHeight = ($xeTable) => {
|
|
|
2517
2527
|
const rowid = handleGetRowId(row);
|
|
2518
2528
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
2519
2529
|
if (rowRest) {
|
|
2520
|
-
const height = calcCellAutoHeight($xeTable, rowRest, el);
|
|
2530
|
+
const height = calcCellAutoHeight($xeTable, rowid, rowRest, el);
|
|
2521
2531
|
rowRest.height = Math.max(defaultRowHeight, height);
|
|
2522
2532
|
}
|
|
2523
2533
|
el.removeAttribute('data-calc-row');
|
|
@@ -3008,7 +3018,6 @@ function calcScrollbar($xeTable) {
|
|
|
3008
3018
|
function handleRecalculateStyle($xeTable, reFull, reWidth, reHeight) {
|
|
3009
3019
|
const internalData = $xeTable;
|
|
3010
3020
|
const el = $xeTable.$refs.refElem;
|
|
3011
|
-
internalData.rceRunTime = Date.now();
|
|
3012
3021
|
if (!el || !el.clientWidth) {
|
|
3013
3022
|
return $xeTable.$nextTick();
|
|
3014
3023
|
}
|
|
@@ -3032,6 +3041,7 @@ function handleRecalculateStyle($xeTable, reFull, reWidth, reHeight) {
|
|
|
3032
3041
|
if (reFull) {
|
|
3033
3042
|
updateTreeLineStyle($xeTable);
|
|
3034
3043
|
}
|
|
3044
|
+
internalData.rceRunTime = Date.now();
|
|
3035
3045
|
return computeScrollLoad($xeTable).then(() => {
|
|
3036
3046
|
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
3037
3047
|
if (reWidth) {
|
|
@@ -3052,11 +3062,13 @@ function handleRecalculateStyle($xeTable, reFull, reWidth, reHeight) {
|
|
|
3052
3062
|
if (reFull) {
|
|
3053
3063
|
updateTreeLineStyle($xeTable);
|
|
3054
3064
|
}
|
|
3065
|
+
internalData.rceRunTime = Date.now();
|
|
3055
3066
|
if (reFull) {
|
|
3056
3067
|
return computeScrollLoad($xeTable);
|
|
3057
3068
|
}
|
|
3058
3069
|
});
|
|
3059
3070
|
}
|
|
3071
|
+
const minRunDelay = 50;
|
|
3060
3072
|
function handleLazyRecalculate($xeTable, reFull, reWidth, reHeight) {
|
|
3061
3073
|
const reactData = $xeTable;
|
|
3062
3074
|
const internalData = $xeTable;
|
|
@@ -3065,7 +3077,17 @@ function handleLazyRecalculate($xeTable, reFull, reWidth, reHeight) {
|
|
|
3065
3077
|
const { rceTimeout, rceRunTime } = internalData;
|
|
3066
3078
|
const $xeGanttView = internalData.xeGanttView;
|
|
3067
3079
|
const resizeOpts = $xeTable.computeResizeOpts;
|
|
3068
|
-
|
|
3080
|
+
let rceDelay = internalData.rceDelay;
|
|
3081
|
+
// 如果在500毫秒内频繁执行,则执行次数减缓
|
|
3082
|
+
if (rceRunTime && rceRunTime > Date.now() - 500) {
|
|
3083
|
+
rceDelay += 50;
|
|
3084
|
+
}
|
|
3085
|
+
else {
|
|
3086
|
+
rceDelay = 0;
|
|
3087
|
+
}
|
|
3088
|
+
internalData.rceDelay = rceDelay;
|
|
3089
|
+
const refreshDelay = resizeOpts.refreshDelay || 30;
|
|
3090
|
+
const reDelay = rceDelay + refreshDelay;
|
|
3069
3091
|
const el = $xeTable.$refs.refElem;
|
|
3070
3092
|
if (el && el.clientWidth) {
|
|
3071
3093
|
autoCellWidth($xeTable);
|
|
@@ -3076,7 +3098,7 @@ function handleLazyRecalculate($xeTable, reFull, reWidth, reHeight) {
|
|
|
3076
3098
|
}
|
|
3077
3099
|
if (rceTimeout) {
|
|
3078
3100
|
clearTimeout(rceTimeout);
|
|
3079
|
-
if (rceRunTime && rceRunTime +
|
|
3101
|
+
if (rceRunTime && rceRunTime + minRunDelay < Date.now()) {
|
|
3080
3102
|
resolve(handleRecalculateStyle($xeTable, reFull, reWidth, reHeight));
|
|
3081
3103
|
}
|
|
3082
3104
|
else {
|
|
@@ -3094,7 +3116,7 @@ function handleLazyRecalculate($xeTable, reFull, reWidth, reHeight) {
|
|
|
3094
3116
|
internalData.rceTimeout = setTimeout(() => {
|
|
3095
3117
|
internalData.rceTimeout = undefined;
|
|
3096
3118
|
handleRecalculateStyle($xeTable, reFull, reWidth, reHeight);
|
|
3097
|
-
},
|
|
3119
|
+
}, reDelay);
|
|
3098
3120
|
});
|
|
3099
3121
|
}
|
|
3100
3122
|
function handleResizeEvent($xeTable) {
|
|
@@ -3431,6 +3453,7 @@ function loadTableData($xeTable, datas, isReload, isReset) {
|
|
|
3431
3453
|
reactData.insertRowFlag++;
|
|
3432
3454
|
internalData.removeRowMaps = {};
|
|
3433
3455
|
reactData.removeRowFlag++;
|
|
3456
|
+
internalData.fullCellHeightMaps = {};
|
|
3434
3457
|
const sYLoad = updateScrollYStatus($xeTable, fullData);
|
|
3435
3458
|
// 全量数据
|
|
3436
3459
|
internalData.tableFullData = fullData;
|
|
@@ -3462,6 +3485,7 @@ function loadTableData($xeTable, datas, isReload, isReset) {
|
|
|
3462
3485
|
updateStyle($xeTable);
|
|
3463
3486
|
}).then(() => {
|
|
3464
3487
|
computeScrollLoad($xeTable);
|
|
3488
|
+
syncGanttScrollYStatus($xeTable);
|
|
3465
3489
|
}).then(() => {
|
|
3466
3490
|
const virtualYOpts = $xeTable.computeVirtualYOpts;
|
|
3467
3491
|
// 是否启用了虚拟滚动
|
|
@@ -3521,6 +3545,7 @@ function loadTableData($xeTable, datas, isReload, isReset) {
|
|
|
3521
3545
|
reactData.isRowLoading = false;
|
|
3522
3546
|
handleRecalculateStyle($xeTable, false, false, false);
|
|
3523
3547
|
updateTreeLineStyle($xeTable);
|
|
3548
|
+
syncGanttScrollYStatus($xeTable);
|
|
3524
3549
|
// 如果是自动行高,特殊情况需调用 recalculate 手动刷新
|
|
3525
3550
|
if (!props.showOverflow) {
|
|
3526
3551
|
setTimeout(() => {
|
|
@@ -3803,12 +3828,48 @@ function initColumnHierarchy($xeTable) {
|
|
|
3803
3828
|
internalData.fullColumnIdData = fullColIdData;
|
|
3804
3829
|
internalData.fullColumnFieldData = fullColFieldData;
|
|
3805
3830
|
}
|
|
3806
|
-
function
|
|
3831
|
+
function buildColumnInfo($xeTable) {
|
|
3807
3832
|
const props = $xeTable;
|
|
3808
3833
|
const $xeToolbar = $xeTable.$refs.$xeToolbar;
|
|
3809
3834
|
const reactData = $xeTable;
|
|
3810
3835
|
const internalData = $xeTable;
|
|
3836
|
+
const { scrollXLoad, scrollYLoad, expandColumn } = reactData;
|
|
3811
3837
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
3838
|
+
cacheColumnMap($xeTable);
|
|
3839
|
+
parseColumns($xeTable, true).then(() => {
|
|
3840
|
+
if (reactData.scrollXLoad) {
|
|
3841
|
+
loadScrollXData($xeTable);
|
|
3842
|
+
}
|
|
3843
|
+
});
|
|
3844
|
+
$xeTable.clearHeaderFormatterCache();
|
|
3845
|
+
$xeTable.clearMergeCells();
|
|
3846
|
+
$xeTable.clearMergeFooterItems();
|
|
3847
|
+
$xeTable.handleTableData(true);
|
|
3848
|
+
$xeTable.handleAggregateSummaryData();
|
|
3849
|
+
if ((scrollXLoad || scrollYLoad) && (expandColumn && expandOpts.mode !== 'fixed')) {
|
|
3850
|
+
warnLog('vxe.error.scrollErrProp', ['column.type=expand']);
|
|
3851
|
+
}
|
|
3852
|
+
return $xeTable.$nextTick().then(() => {
|
|
3853
|
+
if ($xeToolbar) {
|
|
3854
|
+
$xeToolbar.syncUpdate({
|
|
3855
|
+
collectColumn: internalData.collectColumn,
|
|
3856
|
+
$table: $xeTable
|
|
3857
|
+
});
|
|
3858
|
+
}
|
|
3859
|
+
if ($xeTable.handleUpdateCustomColumn) {
|
|
3860
|
+
$xeTable.handleUpdateCustomColumn();
|
|
3861
|
+
}
|
|
3862
|
+
const columnOpts = $xeTable.computeColumnOpts;
|
|
3863
|
+
if (props.showCustomHeader && reactData.isGroup && (columnOpts.resizable || props.resizable)) {
|
|
3864
|
+
warnLog('vxe.error.notConflictProp', ['show-custom-header & colgroup', 'column-config.resizable=false']);
|
|
3865
|
+
}
|
|
3866
|
+
reactData.isColLoading = false;
|
|
3867
|
+
return handleLazyRecalculate($xeTable, false, true, true);
|
|
3868
|
+
});
|
|
3869
|
+
}
|
|
3870
|
+
function handleInitColumn($xeTable, collectColumn) {
|
|
3871
|
+
const reactData = $xeTable;
|
|
3872
|
+
const internalData = $xeTable;
|
|
3812
3873
|
internalData.collectColumn = collectColumn;
|
|
3813
3874
|
const tFullColumn = getColumnList(collectColumn);
|
|
3814
3875
|
internalData.tableFullColumn = tFullColumn;
|
|
@@ -3816,38 +3877,7 @@ function handleInitColumn($xeTable, collectColumn) {
|
|
|
3816
3877
|
reactData.isColLoading = true;
|
|
3817
3878
|
initColumnHierarchy($xeTable);
|
|
3818
3879
|
return Promise.resolve(restoreCustomStorage($xeTable)).then(() => {
|
|
3819
|
-
|
|
3820
|
-
cacheColumnMap($xeTable);
|
|
3821
|
-
parseColumns($xeTable, true).then(() => {
|
|
3822
|
-
if (reactData.scrollXLoad) {
|
|
3823
|
-
loadScrollXData($xeTable);
|
|
3824
|
-
}
|
|
3825
|
-
});
|
|
3826
|
-
$xeTable.clearHeaderFormatterCache();
|
|
3827
|
-
$xeTable.clearMergeCells();
|
|
3828
|
-
$xeTable.clearMergeFooterItems();
|
|
3829
|
-
$xeTable.handleTableData(true);
|
|
3830
|
-
$xeTable.handleAggregateSummaryData();
|
|
3831
|
-
if ((scrollXLoad || scrollYLoad) && (expandColumn && expandOpts.mode !== 'fixed')) {
|
|
3832
|
-
warnLog('vxe.error.scrollErrProp', ['column.type=expand']);
|
|
3833
|
-
}
|
|
3834
|
-
return $xeTable.$nextTick().then(() => {
|
|
3835
|
-
if ($xeToolbar) {
|
|
3836
|
-
$xeToolbar.syncUpdate({
|
|
3837
|
-
collectColumn: internalData.collectColumn,
|
|
3838
|
-
$table: $xeTable
|
|
3839
|
-
});
|
|
3840
|
-
}
|
|
3841
|
-
if ($xeTable.handleUpdateCustomColumn) {
|
|
3842
|
-
$xeTable.handleUpdateCustomColumn();
|
|
3843
|
-
}
|
|
3844
|
-
const columnOpts = $xeTable.computeColumnOpts;
|
|
3845
|
-
if (props.showCustomHeader && reactData.isGroup && (columnOpts.resizable || props.resizable)) {
|
|
3846
|
-
warnLog('vxe.error.notConflictProp', ['show-custom-header & colgroup', 'column-config.resizable=false']);
|
|
3847
|
-
}
|
|
3848
|
-
reactData.isColLoading = false;
|
|
3849
|
-
return handleLazyRecalculate($xeTable, false, true, true);
|
|
3850
|
-
});
|
|
3880
|
+
return buildColumnInfo($xeTable);
|
|
3851
3881
|
});
|
|
3852
3882
|
}
|
|
3853
3883
|
/**
|
|
@@ -6189,6 +6219,9 @@ const tableMethods = {
|
|
|
6189
6219
|
warnLog('vxe.error.delFunc', ['resetColumn', 'resetCustom']);
|
|
6190
6220
|
return this.resetCustom(options);
|
|
6191
6221
|
},
|
|
6222
|
+
/**
|
|
6223
|
+
* @private
|
|
6224
|
+
*/
|
|
6192
6225
|
handleCustom() {
|
|
6193
6226
|
const $xeTable = this;
|
|
6194
6227
|
const props = $xeTable;
|
|
@@ -6241,6 +6274,68 @@ const tableMethods = {
|
|
|
6241
6274
|
}
|
|
6242
6275
|
}
|
|
6243
6276
|
},
|
|
6277
|
+
/**
|
|
6278
|
+
* 用于 custom-config,用于手动恢复自定义列设置信息,恢复表格重置为初始状态
|
|
6279
|
+
* @param storeData
|
|
6280
|
+
* @returns
|
|
6281
|
+
*/
|
|
6282
|
+
setCustomStoreData(storeData) {
|
|
6283
|
+
const $xeTable = this;
|
|
6284
|
+
const reactData = $xeTable;
|
|
6285
|
+
const internalData = $xeTable;
|
|
6286
|
+
if (!storeData) {
|
|
6287
|
+
return $xeTable.$nextTick();
|
|
6288
|
+
}
|
|
6289
|
+
const customOpts = $xeTable.computeCustomOpts;
|
|
6290
|
+
const { checkMethod } = customOpts;
|
|
6291
|
+
// 重置状态
|
|
6292
|
+
clearTableAllStatus($xeTable);
|
|
6293
|
+
// 恢复列
|
|
6294
|
+
const allCols = [];
|
|
6295
|
+
XEUtils.eachTree(internalData.collectColumn, (column) => {
|
|
6296
|
+
column.resizeWidth = 0;
|
|
6297
|
+
column.fixed = column.defaultFixed;
|
|
6298
|
+
column.renderSortNumber = column.sortNumber;
|
|
6299
|
+
column.parentId = column.defaultParentId;
|
|
6300
|
+
if (!checkMethod || checkMethod({ $table: $xeTable, column })) {
|
|
6301
|
+
column.visible = column.defaultVisible;
|
|
6302
|
+
}
|
|
6303
|
+
column.aggFunc = column.defaultAggFunc;
|
|
6304
|
+
column.renderAggFn = column.defaultAggFunc;
|
|
6305
|
+
column.renderResizeWidth = column.renderWidth;
|
|
6306
|
+
allCols.push(column);
|
|
6307
|
+
});
|
|
6308
|
+
const newCollectCols = XEUtils.toArrayTree(XEUtils.orderBy(allCols, 'renderSortNumber'), { key: 'id', parentKey: 'parentId', children: 'children' });
|
|
6309
|
+
internalData.collectColumn = newCollectCols;
|
|
6310
|
+
internalData.tableFullColumn = getColumnList(newCollectCols);
|
|
6311
|
+
reactData.updateColFlag++;
|
|
6312
|
+
reactData.isColLoading = true;
|
|
6313
|
+
initColumnHierarchy($xeTable);
|
|
6314
|
+
return Promise.resolve(handleCustomRestore($xeTable, storeData)).then(() => {
|
|
6315
|
+
return buildColumnInfo($xeTable);
|
|
6316
|
+
}).then(() => {
|
|
6317
|
+
// 恢复数据聚合分组
|
|
6318
|
+
const { isRowGroupStatus, rowGroupList } = reactData;
|
|
6319
|
+
if (isRowGroupStatus && !!$xeTable.handlePivotTableAggData) {
|
|
6320
|
+
const rowGroupFields = $xeTable.computeRowGroupFields;
|
|
6321
|
+
if (rowGroupFields ? rowGroupFields.length : rowGroupList.length) {
|
|
6322
|
+
if (rowGroupFields && rowGroupFields.length) {
|
|
6323
|
+
$xeTable.setRowGroups(rowGroupFields);
|
|
6324
|
+
}
|
|
6325
|
+
else {
|
|
6326
|
+
$xeTable.clearRowGroups();
|
|
6327
|
+
}
|
|
6328
|
+
}
|
|
6329
|
+
else {
|
|
6330
|
+
$xeTable.handleUpdateAggData();
|
|
6331
|
+
}
|
|
6332
|
+
}
|
|
6333
|
+
});
|
|
6334
|
+
},
|
|
6335
|
+
/**
|
|
6336
|
+
* 用于 custom-config,用于获取自定义列设置信息,用于自定义保持
|
|
6337
|
+
* @returns
|
|
6338
|
+
*/
|
|
6244
6339
|
getCustomStoreData() {
|
|
6245
6340
|
const $xeTable = this;
|
|
6246
6341
|
const props = $xeTable;
|
|
@@ -6364,6 +6459,9 @@ const tableMethods = {
|
|
|
6364
6459
|
}
|
|
6365
6460
|
return storeData;
|
|
6366
6461
|
},
|
|
6462
|
+
/**
|
|
6463
|
+
* @private
|
|
6464
|
+
*/
|
|
6367
6465
|
saveCustomStore(type) {
|
|
6368
6466
|
const $xeTable = this;
|
|
6369
6467
|
const props = $xeTable;
|
|
@@ -6708,6 +6806,9 @@ const tableMethods = {
|
|
|
6708
6806
|
}
|
|
6709
6807
|
}
|
|
6710
6808
|
},
|
|
6809
|
+
/**
|
|
6810
|
+
* @private
|
|
6811
|
+
*/
|
|
6711
6812
|
handleRowResizeMousedownEvent(evnt, params) {
|
|
6712
6813
|
const $xeTable = this;
|
|
6713
6814
|
const props = $xeTable;
|
|
@@ -6828,6 +6929,9 @@ const tableMethods = {
|
|
|
6828
6929
|
};
|
|
6829
6930
|
updateEvent(evnt);
|
|
6830
6931
|
},
|
|
6932
|
+
/**
|
|
6933
|
+
* @private
|
|
6934
|
+
*/
|
|
6831
6935
|
handleRowResizeDblclickEvent(evnt, params) {
|
|
6832
6936
|
const $xeTable = this;
|
|
6833
6937
|
const reactData = $xeTable;
|
|
@@ -6849,7 +6953,7 @@ const tableMethods = {
|
|
|
6849
6953
|
}
|
|
6850
6954
|
const handleRsHeight = () => {
|
|
6851
6955
|
el.setAttribute('data-calc-row', 'Y');
|
|
6852
|
-
const resizeHeight = calcCellAutoHeight($xeTable, rowRest, el);
|
|
6956
|
+
const resizeHeight = calcCellAutoHeight($xeTable, rowid, rowRest, el);
|
|
6853
6957
|
el.removeAttribute('data-calc-row');
|
|
6854
6958
|
const resizeParams = Object.assign(Object.assign({}, params), { resizeHeight, resizeRow: row });
|
|
6855
6959
|
reactData.isDragResize = false;
|
|
@@ -6935,7 +7039,7 @@ const tableMethods = {
|
|
|
6935
7039
|
const rowid = XEUtils.isString(row) || XEUtils.isNumber(row) ? row : handleGetRowId(row);
|
|
6936
7040
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
6937
7041
|
if (rowRest) {
|
|
6938
|
-
rowRest.resizeHeight = calcCellAutoHeight($xeTable, rowRest, el);
|
|
7042
|
+
rowRest.resizeHeight = calcCellAutoHeight($xeTable, rowid, rowRest, el);
|
|
6939
7043
|
}
|
|
6940
7044
|
el.removeAttribute('data-calc-row');
|
|
6941
7045
|
});
|
|
@@ -7757,7 +7861,14 @@ const tableMethods = {
|
|
|
7757
7861
|
},
|
|
7758
7862
|
handleGlobalPasteEvent(evnt) {
|
|
7759
7863
|
const $xeTable = this;
|
|
7760
|
-
const
|
|
7864
|
+
const props = $xeTable;
|
|
7865
|
+
const internalData = $xeTable;
|
|
7866
|
+
const reactData = $xeTable;
|
|
7867
|
+
const { keyboardConfig, mouseConfig } = props;
|
|
7868
|
+
const { editStore, filterStore } = reactData;
|
|
7869
|
+
const { isActivated } = internalData;
|
|
7870
|
+
const mouseOpts = $xeTable.computeMouseOpts;
|
|
7871
|
+
const keyboardOpts = $xeTable.computeKeyboardOpts;
|
|
7761
7872
|
const { actived } = editStore;
|
|
7762
7873
|
if (isActivated && !filterStore.visible) {
|
|
7763
7874
|
if (!(actived.row || actived.column)) {
|
|
@@ -7770,7 +7881,14 @@ const tableMethods = {
|
|
|
7770
7881
|
},
|
|
7771
7882
|
handleGlobalCopyEvent(evnt) {
|
|
7772
7883
|
const $xeTable = this;
|
|
7773
|
-
const
|
|
7884
|
+
const props = $xeTable;
|
|
7885
|
+
const internalData = $xeTable;
|
|
7886
|
+
const reactData = $xeTable;
|
|
7887
|
+
const { keyboardConfig, mouseConfig } = props;
|
|
7888
|
+
const { editStore, filterStore } = reactData;
|
|
7889
|
+
const { isActivated } = internalData;
|
|
7890
|
+
const mouseOpts = $xeTable.computeMouseOpts;
|
|
7891
|
+
const keyboardOpts = $xeTable.computeKeyboardOpts;
|
|
7774
7892
|
const { actived } = editStore;
|
|
7775
7893
|
if (isActivated && !filterStore.visible) {
|
|
7776
7894
|
if (!(actived.row || actived.column)) {
|
|
@@ -7783,7 +7901,14 @@ const tableMethods = {
|
|
|
7783
7901
|
},
|
|
7784
7902
|
handleGlobalCutEvent(evnt) {
|
|
7785
7903
|
const $xeTable = this;
|
|
7786
|
-
const
|
|
7904
|
+
const props = $xeTable;
|
|
7905
|
+
const internalData = $xeTable;
|
|
7906
|
+
const reactData = $xeTable;
|
|
7907
|
+
const { keyboardConfig, mouseConfig } = props;
|
|
7908
|
+
const { editStore, filterStore } = reactData;
|
|
7909
|
+
const { isActivated } = internalData;
|
|
7910
|
+
const mouseOpts = $xeTable.computeMouseOpts;
|
|
7911
|
+
const keyboardOpts = $xeTable.computeKeyboardOpts;
|
|
7787
7912
|
const { actived } = editStore;
|
|
7788
7913
|
if (isActivated && !filterStore.visible) {
|
|
7789
7914
|
if (!(actived.row || actived.column)) {
|
|
@@ -12342,9 +12467,9 @@ const tableMethods = {
|
|
|
12342
12467
|
return updateStyle($xeTable);
|
|
12343
12468
|
});
|
|
12344
12469
|
},
|
|
12345
|
-
updateScrollYStatus() {
|
|
12470
|
+
updateScrollYStatus(fullData) {
|
|
12346
12471
|
const $xeTable = this;
|
|
12347
|
-
return updateScrollYStatus($xeTable);
|
|
12472
|
+
return updateScrollYStatus($xeTable, fullData);
|
|
12348
12473
|
},
|
|
12349
12474
|
/**
|
|
12350
12475
|
* 如果有滚动条,则滚动到对应的位置
|
package/es/table/src/util.js
CHANGED
|
@@ -83,6 +83,7 @@ export function createInternalData() {
|
|
|
83
83
|
sourceDataRowIdData: {},
|
|
84
84
|
fullColumnIdData: {},
|
|
85
85
|
fullColumnFieldData: {},
|
|
86
|
+
fullCellHeightMaps: {},
|
|
86
87
|
// 当前行
|
|
87
88
|
currentRow: null,
|
|
88
89
|
// 合并表头单元格的数据
|
|
@@ -142,7 +143,8 @@ export function createInternalData() {
|
|
|
142
143
|
inited: false,
|
|
143
144
|
tooltipTimeout: null,
|
|
144
145
|
initStatus: false,
|
|
145
|
-
isActivated: false
|
|
146
|
+
isActivated: false,
|
|
147
|
+
rceDelay: 0
|
|
146
148
|
// _sToTime: null
|
|
147
149
|
};
|
|
148
150
|
}
|
|
@@ -390,6 +392,21 @@ export function createReactData() {
|
|
|
390
392
|
isColLoading: false
|
|
391
393
|
};
|
|
392
394
|
}
|
|
395
|
+
const maxKey = '__max';
|
|
396
|
+
export function getRowMaxHeight(chRest, isForce) {
|
|
397
|
+
if (isForce || !chRest[maxKey]) {
|
|
398
|
+
let max = 0;
|
|
399
|
+
for (const key in chRest) {
|
|
400
|
+
const val = chRest[key];
|
|
401
|
+
if (key !== maxKey && XEUtils.isNumber(val) && val > max) {
|
|
402
|
+
max = val;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
chRest[maxKey] = max;
|
|
406
|
+
return max;
|
|
407
|
+
}
|
|
408
|
+
return chRest[maxKey];
|
|
409
|
+
}
|
|
393
410
|
const getAllConvertColumns = (columns, parentColumn) => {
|
|
394
411
|
const result = [];
|
|
395
412
|
columns.forEach((column) => {
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED