vxe-table 3.11.5 → 3.11.6-beta.1
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/index.css +1 -0
- package/es/index.min.css +1 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/filter/mixin.js +23 -2
- package/es/table/module/filter/panel.js +3 -6
- package/es/table/src/body.js +55 -30
- package/es/table/src/footer.js +30 -22
- package/es/table/src/methods.js +253 -110
- package/es/table/src/table.js +11 -3
- package/es/table/style.css +48 -3
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +48 -3
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -0
- package/lib/index.min.css +1 -0
- package/lib/index.umd.js +436 -197
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/filter/mixin.js +25 -2
- package/lib/table/module/filter/mixin.min.js +1 -1
- package/lib/table/module/filter/panel.js +3 -7
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/src/body.js +65 -32
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +32 -23
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/methods.js +293 -128
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +16 -2
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +48 -3
- package/lib/table/style/style.min.css +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/lib/vxe-table/style/style.css +48 -3
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/filter/mixin.ts +26 -2
- package/packages/table/module/filter/panel.ts +3 -6
- package/packages/table/src/body.ts +66 -27
- package/packages/table/src/footer.ts +33 -21
- package/packages/table/src/methods.ts +266 -113
- package/packages/ui/index.ts +1 -1
- package/packages/ui/src/dom.ts +2 -2
- package/styles/components/table.scss +24 -3
- /package/es/{iconfont.1732091003142.ttf → iconfont.1732506597105.ttf} +0 -0
- /package/es/{iconfont.1732091003142.woff → iconfont.1732506597105.woff} +0 -0
- /package/es/{iconfont.1732091003142.woff2 → iconfont.1732506597105.woff2} +0 -0
- /package/lib/{iconfont.1732091003142.ttf → iconfont.1732506597105.ttf} +0 -0
- /package/lib/{iconfont.1732091003142.woff → iconfont.1732506597105.woff} +0 -0
- /package/lib/{iconfont.1732091003142.woff2 → iconfont.1732506597105.woff2} +0 -0
package/lib/table/src/methods.js
CHANGED
|
@@ -21,8 +21,8 @@ const {
|
|
|
21
21
|
interceptor,
|
|
22
22
|
createEvent
|
|
23
23
|
} = _ui.VxeUI;
|
|
24
|
-
const isWebkit =
|
|
25
|
-
const debounceScrollYDuration =
|
|
24
|
+
// const isWebkit = browse['-webkit'] && !browse.edge
|
|
25
|
+
// const debounceScrollYDuration = browse.msie ? 80 : 20
|
|
26
26
|
const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
27
27
|
// 获取所有的列,排除分组
|
|
28
28
|
const getColumnList = columns => {
|
|
@@ -129,28 +129,30 @@ function handleVirtualXVisible(_vm) {
|
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
131
|
const computeRowHeight = $xeTable => {
|
|
132
|
+
const props = $xeTable;
|
|
132
133
|
const {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const
|
|
137
|
-
const tableBody = $refs.tableBody;
|
|
134
|
+
showOverflow
|
|
135
|
+
} = props;
|
|
136
|
+
const tableHeader = $xeTable.$refs.tableHeader;
|
|
137
|
+
const tableBody = $xeTable.$refs.tableBody;
|
|
138
138
|
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
139
|
-
const vSize = computeSize;
|
|
139
|
+
const vSize = $xeTable.computeSize;
|
|
140
140
|
const rowHeightMaps = $xeTable.rowHeightMaps;
|
|
141
141
|
let rowHeight = 0;
|
|
142
|
-
if (
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
firstTrElem
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
rowHeight
|
|
142
|
+
if (showOverflow) {
|
|
143
|
+
if (tableBodyElem) {
|
|
144
|
+
const tableHeaderElem = tableHeader ? tableHeader.$el : null;
|
|
145
|
+
let firstTrElem;
|
|
146
|
+
firstTrElem = tableBodyElem.querySelector('tr');
|
|
147
|
+
if (!firstTrElem && tableHeaderElem) {
|
|
148
|
+
firstTrElem = tableHeaderElem.querySelector('tr');
|
|
149
|
+
}
|
|
150
|
+
if (firstTrElem) {
|
|
151
|
+
rowHeight = firstTrElem.clientHeight;
|
|
152
|
+
}
|
|
153
|
+
if (!rowHeight) {
|
|
154
|
+
rowHeight = rowHeightMaps[vSize || 'default'];
|
|
155
|
+
}
|
|
154
156
|
}
|
|
155
157
|
}
|
|
156
158
|
return rowHeight;
|
|
@@ -340,24 +342,50 @@ function calcTableHeight(_vm, key) {
|
|
|
340
342
|
return num;
|
|
341
343
|
}
|
|
342
344
|
const calcCellHeight = $xeTable => {
|
|
345
|
+
const props = $xeTable;
|
|
346
|
+
const reactData = $xeTable;
|
|
347
|
+
const internalData = $xeTable;
|
|
348
|
+
const {
|
|
349
|
+
showOverflow
|
|
350
|
+
} = props;
|
|
343
351
|
const {
|
|
344
352
|
tableData,
|
|
345
|
-
|
|
353
|
+
scrollXLoad,
|
|
354
|
+
scrollYLoad
|
|
355
|
+
} = reactData;
|
|
356
|
+
const {
|
|
346
357
|
fullAllDataRowIdData
|
|
347
|
-
} =
|
|
358
|
+
} = internalData;
|
|
348
359
|
const el = $xeTable.$el;
|
|
349
|
-
if (scrollYLoad && el) {
|
|
360
|
+
if (!showOverflow && (scrollXLoad || scrollYLoad) && el) {
|
|
361
|
+
let paddingTop = 0;
|
|
362
|
+
let paddingBottom = 0;
|
|
363
|
+
let calcPadding = false;
|
|
350
364
|
tableData.forEach(row => {
|
|
351
365
|
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
352
|
-
const
|
|
366
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
353
367
|
const trList = el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]`);
|
|
354
|
-
if (
|
|
368
|
+
if (rowRest && trList.length) {
|
|
355
369
|
let height = 0;
|
|
356
370
|
for (let i = 0; i < trList.length; i++) {
|
|
357
371
|
const trEl = trList[i];
|
|
358
|
-
|
|
372
|
+
const tdList = trEl.children;
|
|
373
|
+
for (let j = 0; j < tdList.length; j++) {
|
|
374
|
+
const tdEl = tdList[j];
|
|
375
|
+
const cellElem = tdEl.querySelector('.vxe-cell');
|
|
376
|
+
if (!calcPadding) {
|
|
377
|
+
paddingTop = _xeUtils.default.toNumber(getComputedStyle(tdEl).paddingTop);
|
|
378
|
+
paddingBottom = _xeUtils.default.toNumber(getComputedStyle(tdEl).paddingBottom);
|
|
379
|
+
calcPadding = true;
|
|
380
|
+
}
|
|
381
|
+
let cellHeight = paddingTop + paddingBottom;
|
|
382
|
+
if (cellElem) {
|
|
383
|
+
cellHeight += cellElem.offsetHeight;
|
|
384
|
+
}
|
|
385
|
+
height = Math.max(height, cellHeight);
|
|
386
|
+
}
|
|
359
387
|
}
|
|
360
|
-
|
|
388
|
+
rowRest.height = height;
|
|
361
389
|
}
|
|
362
390
|
});
|
|
363
391
|
}
|
|
@@ -537,6 +565,52 @@ const handleScrollToRowColumn = ($xeTable, fieldOrColumn, row) => {
|
|
|
537
565
|
}
|
|
538
566
|
return $xeTable.$nextTick();
|
|
539
567
|
};
|
|
568
|
+
function handleRecalculateLayout($xeTable, reFull) {
|
|
569
|
+
const el = $xeTable.$refs.refElem;
|
|
570
|
+
if (!el || !el.clientWidth) {
|
|
571
|
+
return $xeTable.$nextTick();
|
|
572
|
+
}
|
|
573
|
+
$xeTable.calcCellWidth();
|
|
574
|
+
$xeTable.autoCellWidth();
|
|
575
|
+
if (reFull === true) {
|
|
576
|
+
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
577
|
+
return $xeTable.computeScrollLoad().then(() => {
|
|
578
|
+
calcCellHeight($xeTable);
|
|
579
|
+
$xeTable.calcCellWidth();
|
|
580
|
+
$xeTable.autoCellWidth();
|
|
581
|
+
return $xeTable.computeScrollLoad();
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
return $xeTable.computeScrollLoad();
|
|
585
|
+
}
|
|
586
|
+
function checkLastSyncScroll($xeTable, isRollX, isRollY) {
|
|
587
|
+
const reactData = $xeTable;
|
|
588
|
+
const internalData = $xeTable;
|
|
589
|
+
const {
|
|
590
|
+
scrollXLoad,
|
|
591
|
+
scrollYLoad
|
|
592
|
+
} = reactData;
|
|
593
|
+
const {
|
|
594
|
+
lcsTimeout
|
|
595
|
+
} = internalData;
|
|
596
|
+
if (lcsTimeout) {
|
|
597
|
+
clearTimeout(lcsTimeout);
|
|
598
|
+
}
|
|
599
|
+
internalData.lcsTimeout = setTimeout(() => {
|
|
600
|
+
internalData.lcsTimeout = undefined;
|
|
601
|
+
internalData.inVirtualScroll = false;
|
|
602
|
+
internalData.inBodyScroll = false;
|
|
603
|
+
internalData.bodyScrollType = '';
|
|
604
|
+
internalData.inFooterScroll = false;
|
|
605
|
+
if (isRollX && scrollXLoad) {
|
|
606
|
+
$xeTable.updateScrollXData();
|
|
607
|
+
}
|
|
608
|
+
if (isRollY && scrollYLoad) {
|
|
609
|
+
$xeTable.updateScrollYData();
|
|
610
|
+
}
|
|
611
|
+
$xeTable.updateCellAreas();
|
|
612
|
+
}, 200);
|
|
613
|
+
}
|
|
540
614
|
const Methods = {
|
|
541
615
|
callSlot(slotFunc, params, h, vNodes) {
|
|
542
616
|
if (slotFunc) {
|
|
@@ -2884,22 +2958,22 @@ const Methods = {
|
|
|
2884
2958
|
* 支持 width=? width=?px width=?% min-width=? min-width=?px min-width=?%
|
|
2885
2959
|
*/
|
|
2886
2960
|
recalculate(reFull) {
|
|
2887
|
-
const
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
return this.computeScrollLoad().then(() => {
|
|
2897
|
-
calcCellHeight(this);
|
|
2898
|
-
this.autoCellWidth();
|
|
2899
|
-
return this.computeScrollLoad();
|
|
2900
|
-
});
|
|
2961
|
+
const $xeTable = this;
|
|
2962
|
+
const internalData = $xeTable;
|
|
2963
|
+
const {
|
|
2964
|
+
rceTimeout
|
|
2965
|
+
} = internalData;
|
|
2966
|
+
if (rceTimeout) {
|
|
2967
|
+
clearTimeout(rceTimeout);
|
|
2968
|
+
} else {
|
|
2969
|
+
handleRecalculateLayout($xeTable, !!reFull);
|
|
2901
2970
|
}
|
|
2902
|
-
return
|
|
2971
|
+
return new Promise(resolve => {
|
|
2972
|
+
internalData.rceTimeout = setTimeout(() => {
|
|
2973
|
+
internalData.rceTimeout = undefined;
|
|
2974
|
+
resolve(handleRecalculateLayout($xeTable, !!reFull));
|
|
2975
|
+
}, 20);
|
|
2976
|
+
});
|
|
2903
2977
|
},
|
|
2904
2978
|
calcCellWidth() {
|
|
2905
2979
|
const $xeTable = this;
|
|
@@ -3112,17 +3186,25 @@ const Methods = {
|
|
|
3112
3186
|
},
|
|
3113
3187
|
calcCellHeight() {
|
|
3114
3188
|
const $xeTable = this;
|
|
3189
|
+
const props = $xeTable;
|
|
3115
3190
|
const reactData = $xeTable;
|
|
3116
3191
|
const internalData = $xeTable;
|
|
3192
|
+
const {
|
|
3193
|
+
showOverflow
|
|
3194
|
+
} = props;
|
|
3117
3195
|
const {
|
|
3118
3196
|
tableData,
|
|
3197
|
+
scrollXLoad,
|
|
3119
3198
|
scrollYLoad
|
|
3120
3199
|
} = reactData;
|
|
3121
3200
|
const {
|
|
3122
3201
|
fullAllDataRowIdData
|
|
3123
3202
|
} = internalData;
|
|
3124
3203
|
const el = $xeTable.$el;
|
|
3125
|
-
if (scrollYLoad && el) {
|
|
3204
|
+
if (!showOverflow && (scrollXLoad || scrollYLoad) && el) {
|
|
3205
|
+
let paddingTop = 0;
|
|
3206
|
+
let paddingBottom = 0;
|
|
3207
|
+
let calcPadding = false;
|
|
3126
3208
|
tableData.forEach(row => {
|
|
3127
3209
|
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
3128
3210
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
@@ -3131,9 +3213,23 @@ const Methods = {
|
|
|
3131
3213
|
let height = 0;
|
|
3132
3214
|
for (let i = 0; i < trList.length; i++) {
|
|
3133
3215
|
const trEl = trList[i];
|
|
3134
|
-
|
|
3216
|
+
const tdList = trEl.children;
|
|
3217
|
+
for (let j = 0; j < tdList.length; j++) {
|
|
3218
|
+
const tdEl = tdList[j];
|
|
3219
|
+
const cellElem = tdEl.querySelector('.vxe-cell');
|
|
3220
|
+
if (!calcPadding) {
|
|
3221
|
+
paddingTop = _xeUtils.default.toNumber(getComputedStyle(tdEl).paddingTop);
|
|
3222
|
+
paddingBottom = _xeUtils.default.toNumber(getComputedStyle(tdEl).paddingBottom);
|
|
3223
|
+
calcPadding = true;
|
|
3224
|
+
}
|
|
3225
|
+
let cellHeight = paddingTop + paddingBottom;
|
|
3226
|
+
if (cellElem) {
|
|
3227
|
+
cellHeight += cellElem.offsetHeight;
|
|
3228
|
+
}
|
|
3229
|
+
height = Math.max(height, cellHeight);
|
|
3230
|
+
}
|
|
3135
3231
|
}
|
|
3136
|
-
rowRest.height = height;
|
|
3232
|
+
rowRest.height = scrollXLoad ? Math.max(rowRest.height, height) : height;
|
|
3137
3233
|
}
|
|
3138
3234
|
});
|
|
3139
3235
|
}
|
|
@@ -7023,18 +7119,17 @@ const Methods = {
|
|
|
7023
7119
|
scrollLeft: bodyElem.scrollLeft
|
|
7024
7120
|
};
|
|
7025
7121
|
},
|
|
7026
|
-
/**
|
|
7027
|
-
* 横向 X 可视渲染事件处理
|
|
7028
|
-
*/
|
|
7029
|
-
triggerScrollXEvent() {
|
|
7030
|
-
this.loadScrollXData();
|
|
7031
|
-
},
|
|
7032
7122
|
loadScrollXData() {
|
|
7123
|
+
const $xeTable = this;
|
|
7124
|
+
const reactData = $xeTable;
|
|
7125
|
+
const internalData = $xeTable;
|
|
7033
7126
|
const {
|
|
7034
7127
|
mergeList,
|
|
7035
|
-
mergeFooterList
|
|
7128
|
+
mergeFooterList
|
|
7129
|
+
} = reactData;
|
|
7130
|
+
const {
|
|
7036
7131
|
scrollXStore
|
|
7037
|
-
} =
|
|
7132
|
+
} = internalData;
|
|
7038
7133
|
const {
|
|
7039
7134
|
startIndex,
|
|
7040
7135
|
endIndex,
|
|
@@ -7043,7 +7138,7 @@ const Methods = {
|
|
|
7043
7138
|
const {
|
|
7044
7139
|
toVisibleIndex,
|
|
7045
7140
|
visibleSize
|
|
7046
|
-
} = handleVirtualXVisible(
|
|
7141
|
+
} = handleVirtualXVisible($xeTable);
|
|
7047
7142
|
const offsetItem = {
|
|
7048
7143
|
startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize),
|
|
7049
7144
|
endIndex: toVisibleIndex + visibleSize + offsetSize
|
|
@@ -7057,10 +7152,10 @@ const Methods = {
|
|
|
7057
7152
|
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
7058
7153
|
scrollXStore.startIndex = offsetStartIndex;
|
|
7059
7154
|
scrollXStore.endIndex = offsetEndIndex;
|
|
7060
|
-
|
|
7155
|
+
$xeTable.updateScrollXData();
|
|
7061
7156
|
}
|
|
7062
7157
|
}
|
|
7063
|
-
|
|
7158
|
+
$xeTable.closeTooltip();
|
|
7064
7159
|
},
|
|
7065
7160
|
handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, params) {
|
|
7066
7161
|
const $xeTable = this;
|
|
@@ -7111,7 +7206,6 @@ const Methods = {
|
|
|
7111
7206
|
}
|
|
7112
7207
|
$xeTable.checkScrolling();
|
|
7113
7208
|
internalData.lastScrollLeft = scrollLeft;
|
|
7114
|
-
reactData.lastScrollTime = Date.now();
|
|
7115
7209
|
} else {
|
|
7116
7210
|
const yThreshold = $xeTable.computeScrollYThreshold;
|
|
7117
7211
|
isTop = scrollTop <= 0;
|
|
@@ -7130,8 +7224,8 @@ const Methods = {
|
|
|
7130
7224
|
}
|
|
7131
7225
|
}
|
|
7132
7226
|
internalData.lastScrollTop = scrollTop;
|
|
7133
|
-
reactData.lastScrollTime = Date.now();
|
|
7134
7227
|
}
|
|
7228
|
+
reactData.lastScrollTime = Date.now();
|
|
7135
7229
|
const evntParams = Object.assign({
|
|
7136
7230
|
scrollTop,
|
|
7137
7231
|
scrollLeft,
|
|
@@ -7147,6 +7241,7 @@ const Methods = {
|
|
|
7147
7241
|
isRight,
|
|
7148
7242
|
direction
|
|
7149
7243
|
}, params);
|
|
7244
|
+
checkLastSyncScroll($xeTable, isRollX, isRollY);
|
|
7150
7245
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
7151
7246
|
$xeTable.clearHoverRow();
|
|
7152
7247
|
}
|
|
@@ -7161,46 +7256,99 @@ const Methods = {
|
|
|
7161
7256
|
}
|
|
7162
7257
|
$xeTable.dispatchEvent('scroll', evntParams, evnt);
|
|
7163
7258
|
},
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7259
|
+
lazyScrollXData() {
|
|
7260
|
+
const $xeTable = this;
|
|
7261
|
+
const internalData = $xeTable;
|
|
7262
|
+
const {
|
|
7263
|
+
lxTimeout,
|
|
7264
|
+
lxRunTime,
|
|
7265
|
+
scrollXStore
|
|
7266
|
+
} = internalData;
|
|
7267
|
+
const {
|
|
7268
|
+
visibleSize
|
|
7269
|
+
} = scrollXStore;
|
|
7270
|
+
const fpsTime = Math.min(80, Math.floor(visibleSize * 3));
|
|
7271
|
+
if (lxTimeout) {
|
|
7272
|
+
clearTimeout(lxTimeout);
|
|
7273
|
+
}
|
|
7274
|
+
if (!lxRunTime || lxRunTime + fpsTime < Date.now()) {
|
|
7275
|
+
internalData.lxRunTime = Date.now();
|
|
7276
|
+
$xeTable.loadScrollXData();
|
|
7277
|
+
}
|
|
7278
|
+
internalData.lxTimeout = setTimeout(() => {
|
|
7279
|
+
internalData.lxRunTime = undefined;
|
|
7280
|
+
internalData.lxRunTime = undefined;
|
|
7281
|
+
$xeTable.loadScrollXData();
|
|
7282
|
+
}, fpsTime);
|
|
7283
|
+
},
|
|
7284
|
+
lazyScrollYData() {
|
|
7285
|
+
const $xeTable = this;
|
|
7286
|
+
const internalData = $xeTable;
|
|
7168
7287
|
const {
|
|
7288
|
+
lyTimeout,
|
|
7289
|
+
lyRunTime,
|
|
7169
7290
|
scrollYStore
|
|
7170
|
-
} =
|
|
7291
|
+
} = internalData;
|
|
7171
7292
|
const {
|
|
7172
|
-
adaptive,
|
|
7173
|
-
offsetSize,
|
|
7174
7293
|
visibleSize
|
|
7175
7294
|
} = scrollYStore;
|
|
7176
|
-
|
|
7177
|
-
if (
|
|
7178
|
-
|
|
7295
|
+
const fpsTime = Math.min(80, Math.floor(visibleSize * 2));
|
|
7296
|
+
if (lyTimeout) {
|
|
7297
|
+
clearTimeout(lyTimeout);
|
|
7298
|
+
}
|
|
7299
|
+
if (!lyRunTime || lyRunTime + fpsTime < Date.now()) {
|
|
7300
|
+
internalData.lyRunTime = Date.now();
|
|
7301
|
+
$xeTable.loadScrollYData();
|
|
7302
|
+
}
|
|
7303
|
+
internalData.lyTimeout = setTimeout(() => {
|
|
7304
|
+
internalData.lyTimeout = undefined;
|
|
7305
|
+
internalData.lyRunTime = undefined;
|
|
7306
|
+
$xeTable.loadScrollYData();
|
|
7307
|
+
}, fpsTime);
|
|
7308
|
+
},
|
|
7309
|
+
/**
|
|
7310
|
+
* 横向 X 可视渲染事件处理
|
|
7311
|
+
*/
|
|
7312
|
+
triggerScrollXEvent() {
|
|
7313
|
+
const $xeTable = this;
|
|
7314
|
+
const sXOpts = $xeTable.computeSXOpts;
|
|
7315
|
+
if (sXOpts.immediate) {
|
|
7316
|
+
$xeTable.loadScrollXData();
|
|
7179
7317
|
} else {
|
|
7180
|
-
|
|
7318
|
+
$xeTable.lazyScrollXData();
|
|
7181
7319
|
}
|
|
7182
|
-
this.debounceScrollYCalculate();
|
|
7183
7320
|
},
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
trailing: true
|
|
7189
|
-
}),
|
|
7190
|
-
handleSyncScrollX(scrollLeft) {
|
|
7321
|
+
/**
|
|
7322
|
+
* 纵向 Y 可视渲染事件处理
|
|
7323
|
+
*/
|
|
7324
|
+
triggerScrollYEvent() {
|
|
7191
7325
|
const $xeTable = this;
|
|
7326
|
+
const sYOpts = $xeTable.computeSYOpts;
|
|
7327
|
+
if (sYOpts.immediate) {
|
|
7328
|
+
$xeTable.loadScrollYData();
|
|
7329
|
+
} else {
|
|
7330
|
+
$xeTable.lazyScrollYData();
|
|
7331
|
+
}
|
|
7332
|
+
},
|
|
7333
|
+
scrollXEvent(evnt) {
|
|
7334
|
+
const $xeTable = this;
|
|
7335
|
+
const internalData = $xeTable;
|
|
7336
|
+
const {
|
|
7337
|
+
inFooterScroll,
|
|
7338
|
+
inBodyScroll
|
|
7339
|
+
} = internalData;
|
|
7340
|
+
if (inFooterScroll) {
|
|
7341
|
+
return;
|
|
7342
|
+
}
|
|
7343
|
+
if (inBodyScroll) {
|
|
7344
|
+
return;
|
|
7345
|
+
}
|
|
7192
7346
|
const tableHeader = $xeTable.$refs.tableHeader;
|
|
7193
7347
|
const tableBody = $xeTable.$refs.tableBody;
|
|
7194
7348
|
const tableFooter = $xeTable.$refs.tableFooter;
|
|
7195
7349
|
const bodyElem = tableBody.$el;
|
|
7196
7350
|
const headerElem = tableHeader ? tableHeader.$el : null;
|
|
7197
7351
|
const footerElem = tableFooter ? tableFooter.$el : null;
|
|
7198
|
-
(0, _dom.setScrollLeft)(bodyElem, scrollLeft);
|
|
7199
|
-
(0, _dom.setScrollLeft)(headerElem, scrollLeft);
|
|
7200
|
-
(0, _dom.setScrollLeft)(footerElem, scrollLeft);
|
|
7201
|
-
},
|
|
7202
|
-
scrollXEvent(evnt) {
|
|
7203
|
-
const $xeTable = this;
|
|
7204
7352
|
const wrapperEl = evnt.currentTarget;
|
|
7205
7353
|
const {
|
|
7206
7354
|
scrollTop,
|
|
@@ -7208,33 +7356,35 @@ const Methods = {
|
|
|
7208
7356
|
} = wrapperEl;
|
|
7209
7357
|
const isRollX = true;
|
|
7210
7358
|
const isRollY = false;
|
|
7211
|
-
|
|
7359
|
+
internalData.inVirtualScroll = true;
|
|
7360
|
+
(0, _dom.setScrollLeft)(bodyElem, scrollLeft);
|
|
7361
|
+
(0, _dom.setScrollLeft)(headerElem, scrollLeft);
|
|
7362
|
+
(0, _dom.setScrollLeft)(footerElem, scrollLeft);
|
|
7212
7363
|
$xeTable.triggerScrollXEvent(evnt);
|
|
7213
7364
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
7214
7365
|
type: 'table',
|
|
7215
7366
|
fixed: ''
|
|
7216
7367
|
});
|
|
7217
7368
|
},
|
|
7218
|
-
|
|
7219
|
-
this.updateScrollYSpace();
|
|
7220
|
-
}, 1000, {
|
|
7221
|
-
leading: false,
|
|
7222
|
-
trailing: true
|
|
7223
|
-
}),
|
|
7224
|
-
handleSyncScrollY(scrollTop) {
|
|
7369
|
+
scrollYEvent(evnt) {
|
|
7225
7370
|
const $xeTable = this;
|
|
7371
|
+
const internalData = $xeTable;
|
|
7372
|
+
const {
|
|
7373
|
+
inFooterScroll,
|
|
7374
|
+
inBodyScroll
|
|
7375
|
+
} = internalData;
|
|
7376
|
+
if (inFooterScroll) {
|
|
7377
|
+
return;
|
|
7378
|
+
}
|
|
7379
|
+
if (inBodyScroll) {
|
|
7380
|
+
return;
|
|
7381
|
+
}
|
|
7226
7382
|
const tableBody = $xeTable.$refs.tableBody;
|
|
7227
7383
|
const leftBody = $xeTable.$refs.leftBody;
|
|
7228
7384
|
const rightBody = $xeTable.$refs.rightBody;
|
|
7229
7385
|
const bodyElem = tableBody.$el;
|
|
7230
7386
|
const leftElem = leftBody ? leftBody.$el : null;
|
|
7231
7387
|
const rightElem = rightBody ? rightBody.$el : null;
|
|
7232
|
-
(0, _dom.setScrollTop)(bodyElem, scrollTop);
|
|
7233
|
-
(0, _dom.setScrollTop)(leftElem, scrollTop);
|
|
7234
|
-
(0, _dom.setScrollTop)(rightElem, scrollTop);
|
|
7235
|
-
},
|
|
7236
|
-
scrollYEvent(evnt) {
|
|
7237
|
-
const $xeTable = this;
|
|
7238
7388
|
const wrapperEl = evnt.currentTarget;
|
|
7239
7389
|
const {
|
|
7240
7390
|
scrollTop,
|
|
@@ -7242,7 +7392,10 @@ const Methods = {
|
|
|
7242
7392
|
} = wrapperEl;
|
|
7243
7393
|
const isRollX = false;
|
|
7244
7394
|
const isRollY = true;
|
|
7245
|
-
|
|
7395
|
+
internalData.inVirtualScroll = true;
|
|
7396
|
+
(0, _dom.setScrollTop)(bodyElem, scrollTop);
|
|
7397
|
+
(0, _dom.setScrollTop)(leftElem, scrollTop);
|
|
7398
|
+
(0, _dom.setScrollTop)(rightElem, scrollTop);
|
|
7246
7399
|
$xeTable.triggerScrollYEvent(evnt);
|
|
7247
7400
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
7248
7401
|
type: 'table',
|
|
@@ -7253,22 +7406,33 @@ const Methods = {
|
|
|
7253
7406
|
* 纵向 Y 可视渲染处理
|
|
7254
7407
|
*/
|
|
7255
7408
|
loadScrollYData() {
|
|
7409
|
+
const $xeTable = this;
|
|
7410
|
+
const props = $xeTable;
|
|
7411
|
+
const reactData = $xeTable;
|
|
7412
|
+
const internalData = $xeTable;
|
|
7256
7413
|
const {
|
|
7257
|
-
|
|
7414
|
+
showOverflow
|
|
7415
|
+
} = props;
|
|
7416
|
+
const {
|
|
7417
|
+
mergeList
|
|
7418
|
+
} = reactData;
|
|
7419
|
+
const {
|
|
7420
|
+
tableHeight,
|
|
7258
7421
|
scrollYStore
|
|
7259
|
-
} =
|
|
7422
|
+
} = internalData;
|
|
7260
7423
|
const {
|
|
7261
7424
|
startIndex,
|
|
7262
7425
|
endIndex,
|
|
7263
7426
|
offsetSize
|
|
7264
7427
|
} = scrollYStore;
|
|
7428
|
+
const offsetYSize = showOverflow ? offsetSize : offsetSize + Math.min(8, Math.ceil(tableHeight / 200));
|
|
7265
7429
|
const {
|
|
7266
7430
|
toVisibleIndex,
|
|
7267
7431
|
visibleSize
|
|
7268
|
-
} = handleVirtualYVisible(
|
|
7432
|
+
} = handleVirtualYVisible($xeTable);
|
|
7269
7433
|
const offsetItem = {
|
|
7270
|
-
startIndex: Math.max(0, toVisibleIndex - 1 -
|
|
7271
|
-
endIndex: toVisibleIndex + visibleSize +
|
|
7434
|
+
startIndex: Math.max(0, toVisibleIndex - 1 - offsetYSize),
|
|
7435
|
+
endIndex: toVisibleIndex + visibleSize + offsetYSize
|
|
7272
7436
|
};
|
|
7273
7437
|
calculateMergerOffsetIndex(mergeList, offsetItem, 'row');
|
|
7274
7438
|
const {
|
|
@@ -7279,18 +7443,14 @@ const Methods = {
|
|
|
7279
7443
|
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
7280
7444
|
scrollYStore.startIndex = offsetStartIndex;
|
|
7281
7445
|
scrollYStore.endIndex = offsetEndIndex;
|
|
7282
|
-
|
|
7446
|
+
$xeTable.updateScrollYData();
|
|
7283
7447
|
}
|
|
7284
7448
|
}
|
|
7285
7449
|
},
|
|
7286
7450
|
// 计算可视渲染相关数据
|
|
7287
7451
|
computeScrollLoad() {
|
|
7288
7452
|
const $xeTable = this;
|
|
7289
|
-
const props = $xeTable;
|
|
7290
7453
|
return this.$nextTick().then(() => {
|
|
7291
|
-
const {
|
|
7292
|
-
showOverflow
|
|
7293
|
-
} = props;
|
|
7294
7454
|
const {
|
|
7295
7455
|
sYOpts,
|
|
7296
7456
|
sXOpts,
|
|
@@ -7303,16 +7463,14 @@ const Methods = {
|
|
|
7303
7463
|
if (scrollXLoad) {
|
|
7304
7464
|
const {
|
|
7305
7465
|
visibleSize: visibleXSize
|
|
7306
|
-
} = handleVirtualXVisible(
|
|
7307
|
-
|
|
7308
|
-
const bufferSize = showOverflow ? 0 : 2;
|
|
7309
|
-
const offsetXSize = Math.max(bufferSize, sXOpts.oSize ? _xeUtils.default.toNumber(sXOpts.oSize) : _dom.browse.msie ? 10 : _dom.browse.edge ? 5 : 0);
|
|
7466
|
+
} = handleVirtualXVisible($xeTable);
|
|
7467
|
+
const offsetXSize = Math.max(0, sXOpts.oSize ? _xeUtils.default.toNumber(sXOpts.oSize) : _dom.browse.edge ? 5 : 0);
|
|
7310
7468
|
scrollXStore.offsetSize = offsetXSize;
|
|
7311
7469
|
scrollXStore.visibleSize = visibleXSize;
|
|
7312
7470
|
scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
|
|
7313
|
-
|
|
7471
|
+
$xeTable.updateScrollXData();
|
|
7314
7472
|
} else {
|
|
7315
|
-
|
|
7473
|
+
$xeTable.updateScrollXSpace();
|
|
7316
7474
|
}
|
|
7317
7475
|
calcCellHeight(this);
|
|
7318
7476
|
// 计算 Y 逻辑
|
|
@@ -7321,19 +7479,17 @@ const Methods = {
|
|
|
7321
7479
|
this.rowHeight = rowHeight;
|
|
7322
7480
|
const {
|
|
7323
7481
|
visibleSize: visibleYSize
|
|
7324
|
-
} = handleVirtualYVisible(
|
|
7482
|
+
} = handleVirtualYVisible($xeTable);
|
|
7325
7483
|
if (scrollYLoad) {
|
|
7326
|
-
|
|
7327
|
-
const bufferSize = showOverflow ? 0 : 2;
|
|
7328
|
-
const offsetYSize = Math.max(bufferSize, sYOpts.oSize ? _xeUtils.default.toNumber(sYOpts.oSize) : _dom.browse.edge ? 10 : 0);
|
|
7484
|
+
const offsetYSize = Math.max(0, sYOpts.oSize ? _xeUtils.default.toNumber(sYOpts.oSize) : _dom.browse.edge ? 10 : 0);
|
|
7329
7485
|
scrollYStore.offsetSize = offsetYSize;
|
|
7330
7486
|
scrollYStore.visibleSize = visibleYSize;
|
|
7331
7487
|
scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
|
|
7332
|
-
|
|
7488
|
+
$xeTable.updateScrollYData();
|
|
7333
7489
|
} else {
|
|
7334
|
-
|
|
7490
|
+
$xeTable.updateScrollYSpace();
|
|
7335
7491
|
}
|
|
7336
|
-
|
|
7492
|
+
$xeTable.$nextTick(this.updateStyle);
|
|
7337
7493
|
});
|
|
7338
7494
|
},
|
|
7339
7495
|
handleTableColumn() {
|
|
@@ -7354,10 +7510,19 @@ const Methods = {
|
|
|
7354
7510
|
this.tableColumn = tableColumn;
|
|
7355
7511
|
},
|
|
7356
7512
|
updateScrollXData() {
|
|
7513
|
+
const $xeTable = this;
|
|
7514
|
+
const props = $xeTable;
|
|
7515
|
+
const {
|
|
7516
|
+
showOverflow
|
|
7517
|
+
} = props;
|
|
7357
7518
|
// this.tableColumn = []
|
|
7358
|
-
return
|
|
7359
|
-
|
|
7360
|
-
|
|
7519
|
+
return $xeTable.$nextTick().then(() => {
|
|
7520
|
+
$xeTable.handleTableColumn();
|
|
7521
|
+
calcCellHeight($xeTable);
|
|
7522
|
+
$xeTable.updateScrollXSpace();
|
|
7523
|
+
if (!showOverflow) {
|
|
7524
|
+
$xeTable.updateScrollYSpace();
|
|
7525
|
+
}
|
|
7361
7526
|
});
|
|
7362
7527
|
},
|
|
7363
7528
|
// 更新横向 X 可视渲染上下剩余空间大小
|
|
@@ -7417,10 +7582,10 @@ const Methods = {
|
|
|
7417
7582
|
updateScrollYData() {
|
|
7418
7583
|
const $xeTable = this;
|
|
7419
7584
|
// this.tableData = []
|
|
7420
|
-
return
|
|
7421
|
-
|
|
7585
|
+
return $xeTable.$nextTick().then(() => {
|
|
7586
|
+
$xeTable.handleTableData();
|
|
7422
7587
|
calcCellHeight($xeTable);
|
|
7423
|
-
|
|
7588
|
+
$xeTable.updateScrollYSpace();
|
|
7424
7589
|
});
|
|
7425
7590
|
},
|
|
7426
7591
|
// 更新纵向 Y 可视渲染上下剩余空间大小
|
|
@@ -7878,7 +8043,7 @@ const Methods = {
|
|
|
7878
8043
|
}
|
|
7879
8044
|
};
|
|
7880
8045
|
// Module methods
|
|
7881
|
-
const funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,fullValidateField,validateField,openExport,closeExport,openPrint,closePrint,getPrintHtml,exportData,openImport,closeImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom,saveCustom,cancelCustom,resetCustom,toggleCustomAllCheckbox,setCustomAllCheckbox'.split(',');
|
|
8046
|
+
const funcs = 'setFilter,openFilter,clearFilter,saveFilterPanel,resetFilterPanel,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,fullValidateField,validateField,openExport,closeExport,openPrint,closePrint,getPrintHtml,exportData,openImport,closeImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom,saveCustom,cancelCustom,resetCustom,toggleCustomAllCheckbox,setCustomAllCheckbox'.split(',');
|
|
7882
8047
|
funcs.forEach(name => {
|
|
7883
8048
|
Methods[name] = function (...args) {
|
|
7884
8049
|
if (process.env.NODE_ENV === 'development') {
|