vxe-table 4.19.6 → 4.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/dist/all.esm.js +203 -75
- package/dist/style.css +1 -1
- package/es/grid/src/grid.js +1 -1
- package/es/style.css +1 -1
- package/es/table/src/body.js +11 -11
- package/es/table/src/group.js +3 -0
- package/es/table/src/table.js +169 -61
- 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/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +70 -31
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/body.js +11 -11
- 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/table.js +35 -16
- package/lib/table/src/table.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/grid/src/grid.ts +1 -1
- package/packages/table/src/body.ts +13 -13
- package/packages/table/src/group.ts +4 -0
- package/packages/table/src/table.ts +175 -63
- package/packages/table/src/util.ts +21 -1
- /package/es/{iconfont.1780293024194.ttf → iconfont.1780726776354.ttf} +0 -0
- /package/es/{iconfont.1780293024194.woff → iconfont.1780726776354.woff} +0 -0
- /package/es/{iconfont.1780293024194.woff2 → iconfont.1780726776354.woff2} +0 -0
- /package/lib/{iconfont.1780293024194.ttf → iconfont.1780726776354.ttf} +0 -0
- /package/lib/{iconfont.1780293024194.woff → iconfont.1780726776354.woff} +0 -0
- /package/lib/{iconfont.1780293024194.woff2 → iconfont.1780726776354.woff2} +0 -0
package/dist/all.esm.js
CHANGED
|
@@ -44,7 +44,7 @@ function eqEmptyValue(cellValue) {
|
|
|
44
44
|
return cellValue === '' || XEUtils.eqNull(cellValue);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
const version$1 = "4.19.
|
|
47
|
+
const version$1 = "4.19.8";
|
|
48
48
|
VxeUI.version = version$1;
|
|
49
49
|
VxeUI.tableVersion = version$1;
|
|
50
50
|
VxeUI.setConfig({
|
|
@@ -556,7 +556,7 @@ const modal = {
|
|
|
556
556
|
const defineVxeComponent = defineComponent;
|
|
557
557
|
|
|
558
558
|
const { log } = VxeUI;
|
|
559
|
-
const version = `table v${"4.19.
|
|
559
|
+
const version = `table v${"4.19.8"}`;
|
|
560
560
|
const warnLog = log.create('warn', version);
|
|
561
561
|
const errLog = log.create('error', version);
|
|
562
562
|
|
|
@@ -1019,6 +1019,7 @@ function createInternalData$3() {
|
|
|
1019
1019
|
sourceDataRowIdData: {},
|
|
1020
1020
|
fullColumnIdData: {},
|
|
1021
1021
|
fullColumnFieldData: {},
|
|
1022
|
+
fullCellHeightMaps: {},
|
|
1022
1023
|
// 当前行
|
|
1023
1024
|
currentRow: null,
|
|
1024
1025
|
// 合并表头单元格的数据
|
|
@@ -1079,7 +1080,8 @@ function createInternalData$3() {
|
|
|
1079
1080
|
inited: false,
|
|
1080
1081
|
tooltipTimeout: null,
|
|
1081
1082
|
initStatus: false,
|
|
1082
|
-
isActivated: false
|
|
1083
|
+
isActivated: false,
|
|
1084
|
+
rceDelay: 0
|
|
1083
1085
|
// _sToTime: null
|
|
1084
1086
|
};
|
|
1085
1087
|
}
|
|
@@ -1327,6 +1329,21 @@ function createReactData$2() {
|
|
|
1327
1329
|
isColLoading: false
|
|
1328
1330
|
};
|
|
1329
1331
|
}
|
|
1332
|
+
const maxKey = '__max';
|
|
1333
|
+
function getRowMaxHeight(chRest, isForce) {
|
|
1334
|
+
if (isForce || !chRest[maxKey]) {
|
|
1335
|
+
let max = 0;
|
|
1336
|
+
for (const key in chRest) {
|
|
1337
|
+
const val = chRest[key];
|
|
1338
|
+
if (key !== maxKey && XEUtils.isNumber(val) && val > max) {
|
|
1339
|
+
max = val;
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
chRest[maxKey] = max;
|
|
1343
|
+
return max;
|
|
1344
|
+
}
|
|
1345
|
+
return chRest[maxKey];
|
|
1346
|
+
}
|
|
1330
1347
|
const getAllConvertColumns = (columns, parentColumn) => {
|
|
1331
1348
|
const result = [];
|
|
1332
1349
|
columns.forEach((column) => {
|
|
@@ -3400,6 +3417,9 @@ var VxeColgroupComponent = defineVxeComponent({
|
|
|
3400
3417
|
if (slots.header) {
|
|
3401
3418
|
columnSlots.header = slots.header;
|
|
3402
3419
|
}
|
|
3420
|
+
if (slots.title) {
|
|
3421
|
+
columnSlots.title = slots.title;
|
|
3422
|
+
}
|
|
3403
3423
|
columnConfig.slots = columnSlots;
|
|
3404
3424
|
columnConfig.children = [];
|
|
3405
3425
|
watchColumn($xeTable, props, columnConfig);
|
|
@@ -4286,21 +4306,11 @@ var TableBodyComponent = defineVxeComponent({
|
|
|
4286
4306
|
class: 'vxe-cell--wrapper vxe-body-cell--wrapper'
|
|
4287
4307
|
}, column.renderCell(cellParams)));
|
|
4288
4308
|
}
|
|
4289
|
-
tdVNs.push(h('div', {
|
|
4290
|
-
key: 'tc',
|
|
4291
|
-
class: ['vxe-cell', {
|
|
4292
|
-
'c--title': showTitle,
|
|
4293
|
-
'c--tooltip': showTooltip,
|
|
4294
|
-
'c--ellipsis': showEllipsis
|
|
4295
|
-
}],
|
|
4296
|
-
style: tcStyle,
|
|
4297
|
-
title: showTitle ? $xeTable.getCellLabel(row, column) : null
|
|
4298
|
-
}, clVNs));
|
|
4299
4309
|
if (showValidTip && errorValidItem) {
|
|
4300
4310
|
const errRule = errorValidItem.rule;
|
|
4301
4311
|
const validSlot = slots ? slots.valid : null;
|
|
4302
4312
|
const validParams = Object.assign(Object.assign(Object.assign({}, cellParams), errorValidItem), { rule: errorValidItem });
|
|
4303
|
-
|
|
4313
|
+
clVNs.push(h('div', {
|
|
4304
4314
|
key: 'tcv',
|
|
4305
4315
|
class: ['vxe-cell--valid-error-tip', getPropClass(validOpts.className, validParams)],
|
|
4306
4316
|
style: errRule && errRule.maxWidth
|
|
@@ -4322,6 +4332,16 @@ var TableBodyComponent = defineVxeComponent({
|
|
|
4322
4332
|
])
|
|
4323
4333
|
]));
|
|
4324
4334
|
}
|
|
4335
|
+
tdVNs.push(h('div', {
|
|
4336
|
+
key: 'tc',
|
|
4337
|
+
class: ['vxe-cell', {
|
|
4338
|
+
'c--title': showTitle,
|
|
4339
|
+
'c--tooltip': showTooltip,
|
|
4340
|
+
'c--ellipsis': showEllipsis
|
|
4341
|
+
}],
|
|
4342
|
+
style: tcStyle,
|
|
4343
|
+
title: showTitle ? $xeTable.getCellLabel(row, column) : null
|
|
4344
|
+
}, clVNs));
|
|
4325
4345
|
}
|
|
4326
4346
|
let showAreaRowStatus = false;
|
|
4327
4347
|
if (mouseConfig && mouseOpts.area && !_columnIndex && selectCellToRow) {
|
|
@@ -16621,34 +16641,38 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
16621
16641
|
/**
|
|
16622
16642
|
* 计算自适应行高
|
|
16623
16643
|
*/
|
|
16624
|
-
const calcCellAutoHeight = (rowRest, wrapperEl) => {
|
|
16625
|
-
const {
|
|
16644
|
+
const calcCellAutoHeight = (rowid, rowRest, wrapperEl) => {
|
|
16645
|
+
const { fullCellHeightMaps } = internalData;
|
|
16646
|
+
let chRest = fullCellHeightMaps[rowid];
|
|
16647
|
+
if (!chRest) {
|
|
16648
|
+
chRest = {};
|
|
16649
|
+
fullCellHeightMaps[rowid] = chRest;
|
|
16650
|
+
}
|
|
16626
16651
|
const wrapperElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
|
|
16627
|
-
let colHeight = 0;
|
|
16628
16652
|
let firstCellStyle = null;
|
|
16629
16653
|
let topBottomPadding = 0;
|
|
16654
|
+
let changeCH = false;
|
|
16630
16655
|
for (let i = 0; i < wrapperElemList.length; i++) {
|
|
16631
16656
|
const wrapperElem = wrapperElemList[i];
|
|
16632
16657
|
const cellElem = wrapperElem.parentElement;
|
|
16633
16658
|
const cellStyle = cellElem.style;
|
|
16634
16659
|
const orHeight = cellStyle.height;
|
|
16635
|
-
|
|
16636
|
-
|
|
16637
|
-
}
|
|
16660
|
+
const colid = wrapperElem.getAttribute('colid') || '';
|
|
16661
|
+
cellStyle.height = '';
|
|
16638
16662
|
if (!firstCellStyle) {
|
|
16639
16663
|
firstCellStyle = getComputedStyle(cellElem);
|
|
16640
16664
|
topBottomPadding = firstCellStyle ? Math.ceil(XEUtils.toNumber(firstCellStyle.paddingTop) + XEUtils.toNumber(firstCellStyle.paddingBottom)) : 0;
|
|
16641
16665
|
}
|
|
16642
|
-
if (!scrollXLoad) {
|
|
16643
|
-
cellStyle.height = orHeight;
|
|
16644
|
-
}
|
|
16645
16666
|
const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0;
|
|
16646
|
-
colHeight = Math.
|
|
16647
|
-
|
|
16648
|
-
|
|
16649
|
-
|
|
16667
|
+
const colHeight = Math.ceil(cellHeight + topBottomPadding);
|
|
16668
|
+
if (chRest[colid] !== colHeight) {
|
|
16669
|
+
changeCH = true;
|
|
16670
|
+
chRest[colid] = colHeight;
|
|
16671
|
+
}
|
|
16672
|
+
cellStyle.height = orHeight;
|
|
16650
16673
|
}
|
|
16651
|
-
|
|
16674
|
+
const cellMaxHeight = getRowMaxHeight(chRest, changeCH);
|
|
16675
|
+
return cellMaxHeight;
|
|
16652
16676
|
};
|
|
16653
16677
|
/**
|
|
16654
16678
|
* 自适应行高
|
|
@@ -16670,7 +16694,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
16670
16694
|
const rowid = handleGetRowId(row);
|
|
16671
16695
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
16672
16696
|
if (rowRest) {
|
|
16673
|
-
const reHeight = calcCellAutoHeight(rowRest, el);
|
|
16697
|
+
const reHeight = calcCellAutoHeight(rowid, rowRest, el);
|
|
16674
16698
|
rowRest.height = Math.max(defaultRowHeight, reHeight);
|
|
16675
16699
|
}
|
|
16676
16700
|
el.removeAttribute('data-calc-row');
|
|
@@ -17096,7 +17120,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
17096
17120
|
xScrollbarVisible = 'hidden';
|
|
17097
17121
|
}
|
|
17098
17122
|
let yScrollbarVisible = overflowY ? 'visible' : 'hidden';
|
|
17099
|
-
if ((scrollbarYConf.visible === 'hidden' || scrollbarYConf.visible === false) || ($xeGanttView && !scrollbarYToLeft)) {
|
|
17123
|
+
if ((scrollbarYConf.visible === 'hidden' || scrollbarYConf.visible === false) || (($xeGantt && $xeGanttView && $xeGantt.reactData.showRightView) && !scrollbarYToLeft)) {
|
|
17100
17124
|
osbWidth = 0;
|
|
17101
17125
|
yScrollbarVisible = 'hidden';
|
|
17102
17126
|
}
|
|
@@ -17940,7 +17964,6 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
17940
17964
|
};
|
|
17941
17965
|
const handleRecalculateStyle = (reFull, reWidth, reHeight) => {
|
|
17942
17966
|
const el = refElem.value;
|
|
17943
|
-
internalData.rceRunTime = Date.now();
|
|
17944
17967
|
if (!el || !el.clientWidth) {
|
|
17945
17968
|
return nextTick();
|
|
17946
17969
|
}
|
|
@@ -17964,6 +17987,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
17964
17987
|
if (reFull) {
|
|
17965
17988
|
updateTreeLineStyle();
|
|
17966
17989
|
}
|
|
17990
|
+
internalData.rceRunTime = Date.now();
|
|
17967
17991
|
return computeScrollLoad().then(() => {
|
|
17968
17992
|
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
17969
17993
|
if (reWidth) {
|
|
@@ -17984,18 +18008,30 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
17984
18008
|
if (reFull) {
|
|
17985
18009
|
updateTreeLineStyle();
|
|
17986
18010
|
}
|
|
18011
|
+
internalData.rceRunTime = Date.now();
|
|
17987
18012
|
if (reFull) {
|
|
17988
18013
|
return computeScrollLoad();
|
|
17989
18014
|
}
|
|
17990
18015
|
});
|
|
17991
18016
|
};
|
|
18017
|
+
const minRunDelay = 50;
|
|
17992
18018
|
const handleLazyRecalculate = (reFull, reWidth, reHeight) => {
|
|
17993
18019
|
return new Promise(resolve => {
|
|
17994
18020
|
const $xeGanttView = internalData.xeGanttView;
|
|
17995
18021
|
const { customStore } = reactData;
|
|
17996
18022
|
const { rceTimeout, rceRunTime } = internalData;
|
|
17997
18023
|
const resizeOpts = computeResizeOpts.value;
|
|
17998
|
-
|
|
18024
|
+
let rceDelay = internalData.rceDelay;
|
|
18025
|
+
// 如果在500毫秒内频繁执行,则执行次数减缓
|
|
18026
|
+
if (rceRunTime && rceRunTime > Date.now() - 500) {
|
|
18027
|
+
rceDelay += 50;
|
|
18028
|
+
}
|
|
18029
|
+
else {
|
|
18030
|
+
rceDelay = 0;
|
|
18031
|
+
}
|
|
18032
|
+
internalData.rceDelay = rceDelay;
|
|
18033
|
+
const refreshDelay = resizeOpts.refreshDelay || 30;
|
|
18034
|
+
const reDelay = rceDelay + refreshDelay;
|
|
17999
18035
|
const el = refElem.value;
|
|
18000
18036
|
if (el && el.clientWidth) {
|
|
18001
18037
|
autoCellWidth();
|
|
@@ -18006,7 +18042,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
18006
18042
|
}
|
|
18007
18043
|
if (rceTimeout) {
|
|
18008
18044
|
clearTimeout(rceTimeout);
|
|
18009
|
-
if (rceRunTime && rceRunTime +
|
|
18045
|
+
if (rceRunTime && rceRunTime + minRunDelay < Date.now()) {
|
|
18010
18046
|
resolve(handleRecalculateStyle(reFull, reWidth, reHeight));
|
|
18011
18047
|
}
|
|
18012
18048
|
else {
|
|
@@ -18024,11 +18060,23 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
18024
18060
|
internalData.rceTimeout = setTimeout(() => {
|
|
18025
18061
|
internalData.rceTimeout = undefined;
|
|
18026
18062
|
handleRecalculateStyle(reFull, reWidth, reHeight);
|
|
18027
|
-
|
|
18063
|
+
if ($xeGanttView && $xeGanttView.handleLazyRecalculate) {
|
|
18064
|
+
$xeGanttView.handleLazyRecalculate();
|
|
18065
|
+
}
|
|
18066
|
+
}, reDelay);
|
|
18028
18067
|
});
|
|
18029
18068
|
};
|
|
18069
|
+
let resizePending = false;
|
|
18030
18070
|
const handleResizeEvent = () => {
|
|
18031
|
-
|
|
18071
|
+
if (resizePending) {
|
|
18072
|
+
return;
|
|
18073
|
+
}
|
|
18074
|
+
resizePending = true;
|
|
18075
|
+
handleLazyRecalculate(true, true, true).then(() => {
|
|
18076
|
+
resizePending = false;
|
|
18077
|
+
}).catch(() => {
|
|
18078
|
+
resizePending = false;
|
|
18079
|
+
});
|
|
18032
18080
|
};
|
|
18033
18081
|
const handleUpdateAggValues = () => {
|
|
18034
18082
|
const { visibleColumn } = internalData;
|
|
@@ -18372,6 +18420,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
18372
18420
|
reactData.insertRowFlag++;
|
|
18373
18421
|
internalData.removeRowMaps = {};
|
|
18374
18422
|
reactData.removeRowFlag++;
|
|
18423
|
+
internalData.fullCellHeightMaps = {};
|
|
18375
18424
|
const sYLoad = updateScrollYStatus(fullData);
|
|
18376
18425
|
// 全量数据
|
|
18377
18426
|
internalData.tableFullData = fullData;
|
|
@@ -18403,6 +18452,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
18403
18452
|
updateStyle();
|
|
18404
18453
|
}).then(() => {
|
|
18405
18454
|
computeScrollLoad();
|
|
18455
|
+
syncGanttScrollYStatus();
|
|
18406
18456
|
}).then(() => {
|
|
18407
18457
|
const virtualYOpts = computeVirtualYOpts.value;
|
|
18408
18458
|
// 是否启用了虚拟滚动
|
|
@@ -18462,6 +18512,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
18462
18512
|
reactData.isRowLoading = false;
|
|
18463
18513
|
handleRecalculateStyle(false, false, false);
|
|
18464
18514
|
updateTreeLineStyle();
|
|
18515
|
+
syncGanttScrollYStatus();
|
|
18465
18516
|
// 如果是自动行高,特殊情况需调用 recalculate 手动刷新
|
|
18466
18517
|
if (!props.showOverflow) {
|
|
18467
18518
|
setTimeout(() => {
|
|
@@ -18730,8 +18781,42 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
18730
18781
|
internalData.fullColumnIdData = fullColIdData;
|
|
18731
18782
|
internalData.fullColumnFieldData = fullColFieldData;
|
|
18732
18783
|
};
|
|
18733
|
-
const
|
|
18784
|
+
const buildColumnInfo = () => {
|
|
18785
|
+
const { scrollXLoad, scrollYLoad, expandColumn } = reactData;
|
|
18734
18786
|
const expandOpts = computeExpandOpts.value;
|
|
18787
|
+
cacheColumnMap();
|
|
18788
|
+
parseColumns(true).then(() => {
|
|
18789
|
+
if (reactData.scrollXLoad) {
|
|
18790
|
+
loadScrollXData();
|
|
18791
|
+
}
|
|
18792
|
+
});
|
|
18793
|
+
$xeTable.clearHeaderFormatterCache();
|
|
18794
|
+
$xeTable.clearMergeCells();
|
|
18795
|
+
$xeTable.clearMergeFooterItems();
|
|
18796
|
+
$xeTable.handleTableData(true);
|
|
18797
|
+
$xeTable.handleAggregateSummaryData();
|
|
18798
|
+
if ((scrollXLoad || scrollYLoad) && (expandColumn && expandOpts.mode !== 'fixed')) {
|
|
18799
|
+
warnLog('vxe.error.scrollErrProp', ['column.type=expand']);
|
|
18800
|
+
}
|
|
18801
|
+
return nextTick().then(() => {
|
|
18802
|
+
if ($xeToolbar) {
|
|
18803
|
+
$xeToolbar.syncUpdate({
|
|
18804
|
+
collectColumn: internalData.collectColumn,
|
|
18805
|
+
$table: $xeTable
|
|
18806
|
+
});
|
|
18807
|
+
}
|
|
18808
|
+
if ($xeTable.handleUpdateCustomColumn) {
|
|
18809
|
+
$xeTable.handleUpdateCustomColumn();
|
|
18810
|
+
}
|
|
18811
|
+
const columnOpts = computeColumnOpts.value;
|
|
18812
|
+
if (props.showCustomHeader && reactData.isGroup && (columnOpts.resizable || props.resizable)) {
|
|
18813
|
+
warnLog('vxe.error.notConflictProp', ['show-custom-header & colgroup', 'column-config.resizable=false']);
|
|
18814
|
+
}
|
|
18815
|
+
reactData.isColLoading = false;
|
|
18816
|
+
return handleLazyRecalculate(false, true, true);
|
|
18817
|
+
});
|
|
18818
|
+
};
|
|
18819
|
+
const handleInitColumn = (collectColumn) => {
|
|
18735
18820
|
internalData.collectColumn = collectColumn;
|
|
18736
18821
|
const tFullColumn = getColumnList(collectColumn);
|
|
18737
18822
|
internalData.tableFullColumn = tFullColumn;
|
|
@@ -18739,38 +18824,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
18739
18824
|
reactData.isColLoading = true;
|
|
18740
18825
|
initColumnHierarchy();
|
|
18741
18826
|
return Promise.resolve(restoreCustomStorage()).then(() => {
|
|
18742
|
-
|
|
18743
|
-
cacheColumnMap();
|
|
18744
|
-
parseColumns(true).then(() => {
|
|
18745
|
-
if (reactData.scrollXLoad) {
|
|
18746
|
-
loadScrollXData();
|
|
18747
|
-
}
|
|
18748
|
-
});
|
|
18749
|
-
$xeTable.clearHeaderFormatterCache();
|
|
18750
|
-
$xeTable.clearMergeCells();
|
|
18751
|
-
$xeTable.clearMergeFooterItems();
|
|
18752
|
-
$xeTable.handleTableData(true);
|
|
18753
|
-
$xeTable.handleAggregateSummaryData();
|
|
18754
|
-
if ((scrollXLoad || scrollYLoad) && (expandColumn && expandOpts.mode !== 'fixed')) {
|
|
18755
|
-
warnLog('vxe.error.scrollErrProp', ['column.type=expand']);
|
|
18756
|
-
}
|
|
18757
|
-
return nextTick().then(() => {
|
|
18758
|
-
if ($xeToolbar) {
|
|
18759
|
-
$xeToolbar.syncUpdate({
|
|
18760
|
-
collectColumn: internalData.collectColumn,
|
|
18761
|
-
$table: $xeTable
|
|
18762
|
-
});
|
|
18763
|
-
}
|
|
18764
|
-
if ($xeTable.handleUpdateCustomColumn) {
|
|
18765
|
-
$xeTable.handleUpdateCustomColumn();
|
|
18766
|
-
}
|
|
18767
|
-
const columnOpts = computeColumnOpts.value;
|
|
18768
|
-
if (props.showCustomHeader && reactData.isGroup && (columnOpts.resizable || props.resizable)) {
|
|
18769
|
-
warnLog('vxe.error.notConflictProp', ['show-custom-header & colgroup', 'column-config.resizable=false']);
|
|
18770
|
-
}
|
|
18771
|
-
reactData.isColLoading = false;
|
|
18772
|
-
return handleLazyRecalculate(false, true, true);
|
|
18773
|
-
});
|
|
18827
|
+
return buildColumnInfo();
|
|
18774
18828
|
});
|
|
18775
18829
|
};
|
|
18776
18830
|
const updateScrollXStatus = (fullColumn) => {
|
|
@@ -18781,9 +18835,14 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
18781
18835
|
reactData.scrollXLoad = scrollXLoad;
|
|
18782
18836
|
return scrollXLoad;
|
|
18783
18837
|
};
|
|
18838
|
+
const syncGanttScrollYStatus = () => {
|
|
18839
|
+
const $xeGanttView = internalData.xeGanttView;
|
|
18840
|
+
if ($xeGanttView && $xeGanttView.handleUpdateSYStatus) {
|
|
18841
|
+
$xeGanttView.handleUpdateSYStatus(reactData.scrollYLoad);
|
|
18842
|
+
}
|
|
18843
|
+
};
|
|
18784
18844
|
const updateScrollYStatus = (fullData) => {
|
|
18785
18845
|
const { treeConfig } = props;
|
|
18786
|
-
const $xeGanttView = internalData.xeGanttView;
|
|
18787
18846
|
const virtualYOpts = computeVirtualYOpts.value;
|
|
18788
18847
|
const treeOpts = computeTreeOpts.value;
|
|
18789
18848
|
const { transform } = treeOpts;
|
|
@@ -18791,9 +18850,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
18791
18850
|
// 如果gt为0,则总是启用
|
|
18792
18851
|
const scrollYLoad = (transform || !treeConfig) && !!virtualYOpts.enabled && virtualYOpts.gt > -1 && (virtualYOpts.gt === 0 || virtualYOpts.gt < allList.length);
|
|
18793
18852
|
reactData.scrollYLoad = scrollYLoad;
|
|
18794
|
-
|
|
18795
|
-
$xeGanttView.handleUpdateSYStatus(scrollYLoad);
|
|
18796
|
-
}
|
|
18853
|
+
syncGanttScrollYStatus();
|
|
18797
18854
|
return scrollYLoad;
|
|
18798
18855
|
};
|
|
18799
18856
|
/**
|
|
@@ -20704,7 +20761,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
20704
20761
|
const rowid = XEUtils.isString(row) || XEUtils.isNumber(row) ? row : handleGetRowId(row);
|
|
20705
20762
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
20706
20763
|
if (rowRest) {
|
|
20707
|
-
rowRest.resizeHeight = calcCellAutoHeight(rowRest, el);
|
|
20764
|
+
rowRest.resizeHeight = calcCellAutoHeight(rowid, rowRest, el);
|
|
20708
20765
|
}
|
|
20709
20766
|
el.removeAttribute('data-calc-row');
|
|
20710
20767
|
});
|
|
@@ -22458,6 +22515,65 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
22458
22515
|
clearHistory() {
|
|
22459
22516
|
return $xeTable.handleClearStack();
|
|
22460
22517
|
},
|
|
22518
|
+
/**
|
|
22519
|
+
* 用于 custom-config,用于手动恢复自定义列设置信息,恢复表格重置为初始状态
|
|
22520
|
+
* @param storeData
|
|
22521
|
+
* @returns
|
|
22522
|
+
*/
|
|
22523
|
+
setCustomStoreData(storeData) {
|
|
22524
|
+
if (!storeData) {
|
|
22525
|
+
return nextTick();
|
|
22526
|
+
}
|
|
22527
|
+
const customOpts = computeCustomOpts.value;
|
|
22528
|
+
const { checkMethod } = customOpts;
|
|
22529
|
+
// 重置状态
|
|
22530
|
+
clearTableAllStatus($xeTable);
|
|
22531
|
+
// 恢复列
|
|
22532
|
+
const allCols = [];
|
|
22533
|
+
XEUtils.eachTree(internalData.collectColumn, (column) => {
|
|
22534
|
+
column.resizeWidth = 0;
|
|
22535
|
+
column.fixed = column.defaultFixed;
|
|
22536
|
+
column.renderSortNumber = column.sortNumber;
|
|
22537
|
+
column.parentId = column.defaultParentId;
|
|
22538
|
+
if (!checkMethod || checkMethod({ $table: $xeTable, column })) {
|
|
22539
|
+
column.visible = column.defaultVisible;
|
|
22540
|
+
}
|
|
22541
|
+
column.aggFunc = column.defaultAggFunc;
|
|
22542
|
+
column.renderAggFn = column.defaultAggFunc;
|
|
22543
|
+
column.renderResizeWidth = column.renderWidth;
|
|
22544
|
+
allCols.push(column);
|
|
22545
|
+
});
|
|
22546
|
+
const newCollectCols = XEUtils.toArrayTree(XEUtils.orderBy(allCols, 'renderSortNumber'), { key: 'id', parentKey: 'parentId', children: 'children' });
|
|
22547
|
+
internalData.collectColumn = newCollectCols;
|
|
22548
|
+
internalData.tableFullColumn = getColumnList(newCollectCols);
|
|
22549
|
+
reactData.updateColFlag++;
|
|
22550
|
+
reactData.isColLoading = true;
|
|
22551
|
+
initColumnHierarchy();
|
|
22552
|
+
return Promise.resolve(handleCustomRestore(storeData)).then(() => {
|
|
22553
|
+
return buildColumnInfo();
|
|
22554
|
+
}).then(() => {
|
|
22555
|
+
// 恢复数据聚合分组
|
|
22556
|
+
const { isRowGroupStatus, rowGroupList } = reactData;
|
|
22557
|
+
if (isRowGroupStatus && !!$xeTable.handlePivotTableAggData) {
|
|
22558
|
+
const rowGroupFields = computeRowGroupFields.value;
|
|
22559
|
+
if (rowGroupFields ? rowGroupFields.length : rowGroupList.length) {
|
|
22560
|
+
if (rowGroupFields && rowGroupFields.length) {
|
|
22561
|
+
$xeTable.setRowGroups(rowGroupFields);
|
|
22562
|
+
}
|
|
22563
|
+
else {
|
|
22564
|
+
$xeTable.clearRowGroups();
|
|
22565
|
+
}
|
|
22566
|
+
}
|
|
22567
|
+
else {
|
|
22568
|
+
$xeTable.handleUpdateAggData();
|
|
22569
|
+
}
|
|
22570
|
+
}
|
|
22571
|
+
});
|
|
22572
|
+
},
|
|
22573
|
+
/**
|
|
22574
|
+
* 用于 custom-config,用于获取自定义列设置信息,用于自定义保持
|
|
22575
|
+
* @returns
|
|
22576
|
+
*/
|
|
22461
22577
|
getCustomStoreData() {
|
|
22462
22578
|
const { id } = props;
|
|
22463
22579
|
const customOpts = computeCustomOpts.value;
|
|
@@ -24227,6 +24343,9 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
24227
24343
|
}
|
|
24228
24344
|
}
|
|
24229
24345
|
},
|
|
24346
|
+
/**
|
|
24347
|
+
* @private
|
|
24348
|
+
*/
|
|
24230
24349
|
handleRowResizeMousedownEvent(evnt, params) {
|
|
24231
24350
|
evnt.stopPropagation();
|
|
24232
24351
|
evnt.preventDefault();
|
|
@@ -24343,6 +24462,9 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
24343
24462
|
};
|
|
24344
24463
|
updateEvent(evnt);
|
|
24345
24464
|
},
|
|
24465
|
+
/**
|
|
24466
|
+
* @private
|
|
24467
|
+
*/
|
|
24346
24468
|
handleRowResizeDblclickEvent(evnt, params) {
|
|
24347
24469
|
const resizableOpts = computeResizableOpts.value;
|
|
24348
24470
|
const { isDblclickAutoHeight } = resizableOpts;
|
|
@@ -24361,7 +24483,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
24361
24483
|
}
|
|
24362
24484
|
const handleRsHeight = () => {
|
|
24363
24485
|
el.setAttribute('data-calc-row', 'Y');
|
|
24364
|
-
const resizeHeight = calcCellAutoHeight(rowRest, el);
|
|
24486
|
+
const resizeHeight = calcCellAutoHeight(rowid, rowRest, el);
|
|
24365
24487
|
el.removeAttribute('data-calc-row');
|
|
24366
24488
|
const resizeParams = Object.assign(Object.assign({}, params), { resizeHeight, resizeRow: row });
|
|
24367
24489
|
reactData.isDragResize = false;
|
|
@@ -24382,6 +24504,9 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
24382
24504
|
}
|
|
24383
24505
|
}
|
|
24384
24506
|
},
|
|
24507
|
+
/**
|
|
24508
|
+
* @private
|
|
24509
|
+
*/
|
|
24385
24510
|
saveCustomStore(type) {
|
|
24386
24511
|
const { customConfig } = props;
|
|
24387
24512
|
const tableId = computeTableId.value;
|
|
@@ -24428,6 +24553,9 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
24428
24553
|
}
|
|
24429
24554
|
return nextTick();
|
|
24430
24555
|
},
|
|
24556
|
+
/**
|
|
24557
|
+
* @private
|
|
24558
|
+
*/
|
|
24431
24559
|
handleCustom() {
|
|
24432
24560
|
const { mouseConfig } = props;
|
|
24433
24561
|
if (mouseConfig) {
|
|
@@ -29518,7 +29646,7 @@ var VxeToolbarComponent = defineVxeComponent({
|
|
|
29518
29646
|
|
|
29519
29647
|
const { getConfig, getI18n, commands, hooks, useFns, createEvent, globalEvents, GLOBAL_EVENT_KEYS, renderEmptyElement } = VxeUI;
|
|
29520
29648
|
const tableComponentPropKeys = Object.keys(tableProps);
|
|
29521
|
-
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeRowLevel', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'recalcRowHeight', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'setFilterByEvent', 'sort', 'setSort', 'setSortByEvent', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'getScrollData', 'scrollTo', 'scrollToStartRow', 'scrollToEndRow', 'scrollToRow', 'scrollToStartColumn', 'scrollToEndColumn', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'setMergeHeaderCells', 'removeMergeHeaderCells', 'getMergeHeaderCells', 'clearMergeHeaderCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'setRowGroupExpand', 'setRowGroupExpandByField', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'updateCellLabel', 'clearFormatterCache', 'getFooterCellLabel', 'updateFooterCellLabel', 'clearFooterFormatterCache', 'undo', 'redo', 'getCellElement', 'focus', 'blur', 'connect', 'connectToolbar'];
|
|
29649
|
+
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeRowLevel', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'recalcRowHeight', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'setFilterByEvent', 'sort', 'setSort', 'setSortByEvent', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'getScrollData', 'scrollTo', 'scrollToStartRow', 'scrollToEndRow', 'scrollToRow', 'scrollToStartColumn', 'scrollToEndColumn', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'setMergeHeaderCells', 'removeMergeHeaderCells', 'getMergeHeaderCells', 'clearMergeHeaderCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'setCustomStoreData', 'getCustomStoreData', 'setRowGroupExpand', 'setRowGroupExpandByField', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'updateCellLabel', 'clearFormatterCache', 'getFooterCellLabel', 'updateFooterCellLabel', 'clearFooterFormatterCache', 'undo', 'redo', 'getCellElement', 'focus', 'blur', 'connect', 'connectToolbar'];
|
|
29522
29650
|
function createReactData() {
|
|
29523
29651
|
var _a;
|
|
29524
29652
|
return {
|