vxe-table 3.11.4 → 3.11.6-beta.0
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 -109
- 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 -196
- 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 -127
- 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 -112
- package/packages/table/src/table.ts +11 -3
- package/packages/ui/index.ts +1 -1
- package/packages/ui/src/dom.ts +2 -2
- package/styles/components/table.scss +38 -3
- /package/es/{iconfont.1732091003142.ttf → iconfont.1732505453169.ttf} +0 -0
- /package/es/{iconfont.1732091003142.woff → iconfont.1732505453169.woff} +0 -0
- /package/es/{iconfont.1732091003142.woff2 → iconfont.1732505453169.woff2} +0 -0
- /package/lib/{iconfont.1732091003142.ttf → iconfont.1732505453169.ttf} +0 -0
- /package/lib/{iconfont.1732091003142.woff → iconfont.1732505453169.woff} +0 -0
- /package/lib/{iconfont.1732091003142.woff2 → iconfont.1732505453169.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,53 @@ 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
|
+
calcCellHeight($xeTable);
|
|
574
|
+
$xeTable.calcCellWidth();
|
|
575
|
+
$xeTable.autoCellWidth();
|
|
576
|
+
if (reFull === true) {
|
|
577
|
+
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
578
|
+
return $xeTable.computeScrollLoad().then(() => {
|
|
579
|
+
calcCellHeight($xeTable);
|
|
580
|
+
$xeTable.calcCellWidth();
|
|
581
|
+
$xeTable.autoCellWidth();
|
|
582
|
+
return $xeTable.computeScrollLoad();
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
return $xeTable.computeScrollLoad();
|
|
586
|
+
}
|
|
587
|
+
function checkLastSyncScroll($xeTable, isRollX, isRollY) {
|
|
588
|
+
const reactData = $xeTable;
|
|
589
|
+
const internalData = $xeTable;
|
|
590
|
+
const {
|
|
591
|
+
scrollXLoad,
|
|
592
|
+
scrollYLoad
|
|
593
|
+
} = reactData;
|
|
594
|
+
const {
|
|
595
|
+
lcsTimeout
|
|
596
|
+
} = internalData;
|
|
597
|
+
if (lcsTimeout) {
|
|
598
|
+
clearTimeout(lcsTimeout);
|
|
599
|
+
}
|
|
600
|
+
internalData.lcsTimeout = setTimeout(() => {
|
|
601
|
+
internalData.lcsTimeout = undefined;
|
|
602
|
+
internalData.inVirtualScroll = false;
|
|
603
|
+
internalData.inBodyScroll = false;
|
|
604
|
+
internalData.bodyScrollType = '';
|
|
605
|
+
internalData.inFooterScroll = false;
|
|
606
|
+
if (isRollX && scrollXLoad) {
|
|
607
|
+
$xeTable.updateScrollXData();
|
|
608
|
+
}
|
|
609
|
+
if (isRollY && scrollYLoad) {
|
|
610
|
+
$xeTable.updateScrollYData();
|
|
611
|
+
}
|
|
612
|
+
$xeTable.updateCellAreas();
|
|
613
|
+
}, 200);
|
|
614
|
+
}
|
|
540
615
|
const Methods = {
|
|
541
616
|
callSlot(slotFunc, params, h, vNodes) {
|
|
542
617
|
if (slotFunc) {
|
|
@@ -2884,22 +2959,22 @@ const Methods = {
|
|
|
2884
2959
|
* 支持 width=? width=?px width=?% min-width=? min-width=?px min-width=?%
|
|
2885
2960
|
*/
|
|
2886
2961
|
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
|
-
});
|
|
2962
|
+
const $xeTable = this;
|
|
2963
|
+
const internalData = $xeTable;
|
|
2964
|
+
const {
|
|
2965
|
+
rceTimeout
|
|
2966
|
+
} = internalData;
|
|
2967
|
+
if (rceTimeout) {
|
|
2968
|
+
clearTimeout(rceTimeout);
|
|
2969
|
+
} else {
|
|
2970
|
+
handleRecalculateLayout($xeTable, !!reFull);
|
|
2901
2971
|
}
|
|
2902
|
-
return
|
|
2972
|
+
return new Promise(resolve => {
|
|
2973
|
+
internalData.rceTimeout = setTimeout(() => {
|
|
2974
|
+
internalData.rceTimeout = undefined;
|
|
2975
|
+
resolve(handleRecalculateLayout($xeTable, !!reFull));
|
|
2976
|
+
}, 20);
|
|
2977
|
+
});
|
|
2903
2978
|
},
|
|
2904
2979
|
calcCellWidth() {
|
|
2905
2980
|
const $xeTable = this;
|
|
@@ -3112,17 +3187,25 @@ const Methods = {
|
|
|
3112
3187
|
},
|
|
3113
3188
|
calcCellHeight() {
|
|
3114
3189
|
const $xeTable = this;
|
|
3190
|
+
const props = $xeTable;
|
|
3115
3191
|
const reactData = $xeTable;
|
|
3116
3192
|
const internalData = $xeTable;
|
|
3193
|
+
const {
|
|
3194
|
+
showOverflow
|
|
3195
|
+
} = props;
|
|
3117
3196
|
const {
|
|
3118
3197
|
tableData,
|
|
3198
|
+
scrollXLoad,
|
|
3119
3199
|
scrollYLoad
|
|
3120
3200
|
} = reactData;
|
|
3121
3201
|
const {
|
|
3122
3202
|
fullAllDataRowIdData
|
|
3123
3203
|
} = internalData;
|
|
3124
3204
|
const el = $xeTable.$el;
|
|
3125
|
-
if (scrollYLoad && el) {
|
|
3205
|
+
if (!showOverflow && (scrollXLoad || scrollYLoad) && el) {
|
|
3206
|
+
let paddingTop = 0;
|
|
3207
|
+
let paddingBottom = 0;
|
|
3208
|
+
let calcPadding = false;
|
|
3126
3209
|
tableData.forEach(row => {
|
|
3127
3210
|
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
3128
3211
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
@@ -3131,7 +3214,21 @@ const Methods = {
|
|
|
3131
3214
|
let height = 0;
|
|
3132
3215
|
for (let i = 0; i < trList.length; i++) {
|
|
3133
3216
|
const trEl = trList[i];
|
|
3134
|
-
|
|
3217
|
+
const tdList = trEl.children;
|
|
3218
|
+
for (let j = 0; j < tdList.length; j++) {
|
|
3219
|
+
const tdEl = tdList[j];
|
|
3220
|
+
const cellElem = tdEl.querySelector('.vxe-cell');
|
|
3221
|
+
if (!calcPadding) {
|
|
3222
|
+
paddingTop = _xeUtils.default.toNumber(getComputedStyle(tdEl).paddingTop);
|
|
3223
|
+
paddingBottom = _xeUtils.default.toNumber(getComputedStyle(tdEl).paddingBottom);
|
|
3224
|
+
calcPadding = true;
|
|
3225
|
+
}
|
|
3226
|
+
let cellHeight = paddingTop + paddingBottom;
|
|
3227
|
+
if (cellElem) {
|
|
3228
|
+
cellHeight += cellElem.offsetHeight;
|
|
3229
|
+
}
|
|
3230
|
+
height = Math.max(height, cellHeight);
|
|
3231
|
+
}
|
|
3135
3232
|
}
|
|
3136
3233
|
rowRest.height = height;
|
|
3137
3234
|
}
|
|
@@ -7023,18 +7120,17 @@ const Methods = {
|
|
|
7023
7120
|
scrollLeft: bodyElem.scrollLeft
|
|
7024
7121
|
};
|
|
7025
7122
|
},
|
|
7026
|
-
/**
|
|
7027
|
-
* 横向 X 可视渲染事件处理
|
|
7028
|
-
*/
|
|
7029
|
-
triggerScrollXEvent() {
|
|
7030
|
-
this.loadScrollXData();
|
|
7031
|
-
},
|
|
7032
7123
|
loadScrollXData() {
|
|
7124
|
+
const $xeTable = this;
|
|
7125
|
+
const reactData = $xeTable;
|
|
7126
|
+
const internalData = $xeTable;
|
|
7033
7127
|
const {
|
|
7034
7128
|
mergeList,
|
|
7035
|
-
mergeFooterList
|
|
7129
|
+
mergeFooterList
|
|
7130
|
+
} = reactData;
|
|
7131
|
+
const {
|
|
7036
7132
|
scrollXStore
|
|
7037
|
-
} =
|
|
7133
|
+
} = internalData;
|
|
7038
7134
|
const {
|
|
7039
7135
|
startIndex,
|
|
7040
7136
|
endIndex,
|
|
@@ -7043,7 +7139,7 @@ const Methods = {
|
|
|
7043
7139
|
const {
|
|
7044
7140
|
toVisibleIndex,
|
|
7045
7141
|
visibleSize
|
|
7046
|
-
} = handleVirtualXVisible(
|
|
7142
|
+
} = handleVirtualXVisible($xeTable);
|
|
7047
7143
|
const offsetItem = {
|
|
7048
7144
|
startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize),
|
|
7049
7145
|
endIndex: toVisibleIndex + visibleSize + offsetSize
|
|
@@ -7057,10 +7153,10 @@ const Methods = {
|
|
|
7057
7153
|
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
7058
7154
|
scrollXStore.startIndex = offsetStartIndex;
|
|
7059
7155
|
scrollXStore.endIndex = offsetEndIndex;
|
|
7060
|
-
|
|
7156
|
+
$xeTable.updateScrollXData();
|
|
7061
7157
|
}
|
|
7062
7158
|
}
|
|
7063
|
-
|
|
7159
|
+
$xeTable.closeTooltip();
|
|
7064
7160
|
},
|
|
7065
7161
|
handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, params) {
|
|
7066
7162
|
const $xeTable = this;
|
|
@@ -7111,7 +7207,6 @@ const Methods = {
|
|
|
7111
7207
|
}
|
|
7112
7208
|
$xeTable.checkScrolling();
|
|
7113
7209
|
internalData.lastScrollLeft = scrollLeft;
|
|
7114
|
-
reactData.lastScrollTime = Date.now();
|
|
7115
7210
|
} else {
|
|
7116
7211
|
const yThreshold = $xeTable.computeScrollYThreshold;
|
|
7117
7212
|
isTop = scrollTop <= 0;
|
|
@@ -7130,8 +7225,8 @@ const Methods = {
|
|
|
7130
7225
|
}
|
|
7131
7226
|
}
|
|
7132
7227
|
internalData.lastScrollTop = scrollTop;
|
|
7133
|
-
reactData.lastScrollTime = Date.now();
|
|
7134
7228
|
}
|
|
7229
|
+
reactData.lastScrollTime = Date.now();
|
|
7135
7230
|
const evntParams = Object.assign({
|
|
7136
7231
|
scrollTop,
|
|
7137
7232
|
scrollLeft,
|
|
@@ -7147,6 +7242,7 @@ const Methods = {
|
|
|
7147
7242
|
isRight,
|
|
7148
7243
|
direction
|
|
7149
7244
|
}, params);
|
|
7245
|
+
checkLastSyncScroll($xeTable, isRollX, isRollY);
|
|
7150
7246
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
7151
7247
|
$xeTable.clearHoverRow();
|
|
7152
7248
|
}
|
|
@@ -7161,46 +7257,99 @@ const Methods = {
|
|
|
7161
7257
|
}
|
|
7162
7258
|
$xeTable.dispatchEvent('scroll', evntParams, evnt);
|
|
7163
7259
|
},
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7260
|
+
lazyScrollXData() {
|
|
7261
|
+
const $xeTable = this;
|
|
7262
|
+
const internalData = $xeTable;
|
|
7263
|
+
const {
|
|
7264
|
+
lxTimeout,
|
|
7265
|
+
lxRunTime,
|
|
7266
|
+
scrollXStore
|
|
7267
|
+
} = internalData;
|
|
7268
|
+
const {
|
|
7269
|
+
visibleSize
|
|
7270
|
+
} = scrollXStore;
|
|
7271
|
+
const fpsTime = Math.min(80, Math.floor(visibleSize * 3));
|
|
7272
|
+
if (lxTimeout) {
|
|
7273
|
+
clearTimeout(lxTimeout);
|
|
7274
|
+
}
|
|
7275
|
+
if (!lxRunTime || lxRunTime + fpsTime < Date.now()) {
|
|
7276
|
+
internalData.lxRunTime = Date.now();
|
|
7277
|
+
$xeTable.loadScrollXData();
|
|
7278
|
+
}
|
|
7279
|
+
internalData.lxTimeout = setTimeout(() => {
|
|
7280
|
+
internalData.lxRunTime = undefined;
|
|
7281
|
+
internalData.lxRunTime = undefined;
|
|
7282
|
+
$xeTable.loadScrollXData();
|
|
7283
|
+
}, fpsTime);
|
|
7284
|
+
},
|
|
7285
|
+
lazyScrollYData() {
|
|
7286
|
+
const $xeTable = this;
|
|
7287
|
+
const internalData = $xeTable;
|
|
7168
7288
|
const {
|
|
7289
|
+
lyTimeout,
|
|
7290
|
+
lyRunTime,
|
|
7169
7291
|
scrollYStore
|
|
7170
|
-
} =
|
|
7292
|
+
} = internalData;
|
|
7171
7293
|
const {
|
|
7172
|
-
adaptive,
|
|
7173
|
-
offsetSize,
|
|
7174
7294
|
visibleSize
|
|
7175
7295
|
} = scrollYStore;
|
|
7176
|
-
|
|
7177
|
-
if (
|
|
7178
|
-
|
|
7296
|
+
const fpsTime = Math.min(80, Math.floor(visibleSize * 2));
|
|
7297
|
+
if (lyTimeout) {
|
|
7298
|
+
clearTimeout(lyTimeout);
|
|
7299
|
+
}
|
|
7300
|
+
if (!lyRunTime || lyRunTime + fpsTime < Date.now()) {
|
|
7301
|
+
internalData.lyRunTime = Date.now();
|
|
7302
|
+
$xeTable.loadScrollYData();
|
|
7303
|
+
}
|
|
7304
|
+
internalData.lyTimeout = setTimeout(() => {
|
|
7305
|
+
internalData.lyTimeout = undefined;
|
|
7306
|
+
internalData.lyRunTime = undefined;
|
|
7307
|
+
$xeTable.loadScrollYData();
|
|
7308
|
+
}, fpsTime);
|
|
7309
|
+
},
|
|
7310
|
+
/**
|
|
7311
|
+
* 横向 X 可视渲染事件处理
|
|
7312
|
+
*/
|
|
7313
|
+
triggerScrollXEvent() {
|
|
7314
|
+
const $xeTable = this;
|
|
7315
|
+
const sXOpts = $xeTable.computeSXOpts;
|
|
7316
|
+
if (sXOpts.immediate) {
|
|
7317
|
+
$xeTable.loadScrollXData();
|
|
7179
7318
|
} else {
|
|
7180
|
-
|
|
7319
|
+
$xeTable.lazyScrollXData();
|
|
7181
7320
|
}
|
|
7182
|
-
this.debounceScrollYCalculate();
|
|
7183
7321
|
},
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
trailing: true
|
|
7189
|
-
}),
|
|
7190
|
-
handleSyncScrollX(scrollLeft) {
|
|
7322
|
+
/**
|
|
7323
|
+
* 纵向 Y 可视渲染事件处理
|
|
7324
|
+
*/
|
|
7325
|
+
triggerScrollYEvent() {
|
|
7191
7326
|
const $xeTable = this;
|
|
7327
|
+
const sYOpts = $xeTable.computeSYOpts;
|
|
7328
|
+
if (sYOpts.immediate) {
|
|
7329
|
+
$xeTable.loadScrollYData();
|
|
7330
|
+
} else {
|
|
7331
|
+
$xeTable.lazyScrollYData();
|
|
7332
|
+
}
|
|
7333
|
+
},
|
|
7334
|
+
scrollXEvent(evnt) {
|
|
7335
|
+
const $xeTable = this;
|
|
7336
|
+
const internalData = $xeTable;
|
|
7337
|
+
const {
|
|
7338
|
+
inFooterScroll,
|
|
7339
|
+
inBodyScroll
|
|
7340
|
+
} = internalData;
|
|
7341
|
+
if (inFooterScroll) {
|
|
7342
|
+
return;
|
|
7343
|
+
}
|
|
7344
|
+
if (inBodyScroll) {
|
|
7345
|
+
return;
|
|
7346
|
+
}
|
|
7192
7347
|
const tableHeader = $xeTable.$refs.tableHeader;
|
|
7193
7348
|
const tableBody = $xeTable.$refs.tableBody;
|
|
7194
7349
|
const tableFooter = $xeTable.$refs.tableFooter;
|
|
7195
7350
|
const bodyElem = tableBody.$el;
|
|
7196
7351
|
const headerElem = tableHeader ? tableHeader.$el : null;
|
|
7197
7352
|
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
7353
|
const wrapperEl = evnt.currentTarget;
|
|
7205
7354
|
const {
|
|
7206
7355
|
scrollTop,
|
|
@@ -7208,33 +7357,35 @@ const Methods = {
|
|
|
7208
7357
|
} = wrapperEl;
|
|
7209
7358
|
const isRollX = true;
|
|
7210
7359
|
const isRollY = false;
|
|
7211
|
-
|
|
7360
|
+
internalData.inVirtualScroll = true;
|
|
7361
|
+
(0, _dom.setScrollLeft)(bodyElem, scrollLeft);
|
|
7362
|
+
(0, _dom.setScrollLeft)(headerElem, scrollLeft);
|
|
7363
|
+
(0, _dom.setScrollLeft)(footerElem, scrollLeft);
|
|
7212
7364
|
$xeTable.triggerScrollXEvent(evnt);
|
|
7213
7365
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
7214
7366
|
type: 'table',
|
|
7215
7367
|
fixed: ''
|
|
7216
7368
|
});
|
|
7217
7369
|
},
|
|
7218
|
-
|
|
7219
|
-
this.updateScrollYSpace();
|
|
7220
|
-
}, 1000, {
|
|
7221
|
-
leading: false,
|
|
7222
|
-
trailing: true
|
|
7223
|
-
}),
|
|
7224
|
-
handleSyncScrollY(scrollTop) {
|
|
7370
|
+
scrollYEvent(evnt) {
|
|
7225
7371
|
const $xeTable = this;
|
|
7372
|
+
const internalData = $xeTable;
|
|
7373
|
+
const {
|
|
7374
|
+
inFooterScroll,
|
|
7375
|
+
inBodyScroll
|
|
7376
|
+
} = internalData;
|
|
7377
|
+
if (inFooterScroll) {
|
|
7378
|
+
return;
|
|
7379
|
+
}
|
|
7380
|
+
if (inBodyScroll) {
|
|
7381
|
+
return;
|
|
7382
|
+
}
|
|
7226
7383
|
const tableBody = $xeTable.$refs.tableBody;
|
|
7227
7384
|
const leftBody = $xeTable.$refs.leftBody;
|
|
7228
7385
|
const rightBody = $xeTable.$refs.rightBody;
|
|
7229
7386
|
const bodyElem = tableBody.$el;
|
|
7230
7387
|
const leftElem = leftBody ? leftBody.$el : null;
|
|
7231
7388
|
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
7389
|
const wrapperEl = evnt.currentTarget;
|
|
7239
7390
|
const {
|
|
7240
7391
|
scrollTop,
|
|
@@ -7242,7 +7393,10 @@ const Methods = {
|
|
|
7242
7393
|
} = wrapperEl;
|
|
7243
7394
|
const isRollX = false;
|
|
7244
7395
|
const isRollY = true;
|
|
7245
|
-
|
|
7396
|
+
internalData.inVirtualScroll = true;
|
|
7397
|
+
(0, _dom.setScrollTop)(bodyElem, scrollTop);
|
|
7398
|
+
(0, _dom.setScrollTop)(leftElem, scrollTop);
|
|
7399
|
+
(0, _dom.setScrollTop)(rightElem, scrollTop);
|
|
7246
7400
|
$xeTable.triggerScrollYEvent(evnt);
|
|
7247
7401
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
7248
7402
|
type: 'table',
|
|
@@ -7253,22 +7407,33 @@ const Methods = {
|
|
|
7253
7407
|
* 纵向 Y 可视渲染处理
|
|
7254
7408
|
*/
|
|
7255
7409
|
loadScrollYData() {
|
|
7410
|
+
const $xeTable = this;
|
|
7411
|
+
const props = $xeTable;
|
|
7412
|
+
const reactData = $xeTable;
|
|
7413
|
+
const internalData = $xeTable;
|
|
7256
7414
|
const {
|
|
7257
|
-
|
|
7415
|
+
showOverflow
|
|
7416
|
+
} = props;
|
|
7417
|
+
const {
|
|
7418
|
+
mergeList
|
|
7419
|
+
} = reactData;
|
|
7420
|
+
const {
|
|
7421
|
+
tableHeight,
|
|
7258
7422
|
scrollYStore
|
|
7259
|
-
} =
|
|
7423
|
+
} = internalData;
|
|
7260
7424
|
const {
|
|
7261
7425
|
startIndex,
|
|
7262
7426
|
endIndex,
|
|
7263
7427
|
offsetSize
|
|
7264
7428
|
} = scrollYStore;
|
|
7429
|
+
const offsetYSize = showOverflow ? offsetSize : offsetSize + Math.min(8, Math.ceil(tableHeight / 200));
|
|
7265
7430
|
const {
|
|
7266
7431
|
toVisibleIndex,
|
|
7267
7432
|
visibleSize
|
|
7268
|
-
} = handleVirtualYVisible(
|
|
7433
|
+
} = handleVirtualYVisible($xeTable);
|
|
7269
7434
|
const offsetItem = {
|
|
7270
|
-
startIndex: Math.max(0, toVisibleIndex - 1 -
|
|
7271
|
-
endIndex: toVisibleIndex + visibleSize +
|
|
7435
|
+
startIndex: Math.max(0, toVisibleIndex - 1 - offsetYSize),
|
|
7436
|
+
endIndex: toVisibleIndex + visibleSize + offsetYSize
|
|
7272
7437
|
};
|
|
7273
7438
|
calculateMergerOffsetIndex(mergeList, offsetItem, 'row');
|
|
7274
7439
|
const {
|
|
@@ -7279,18 +7444,14 @@ const Methods = {
|
|
|
7279
7444
|
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
7280
7445
|
scrollYStore.startIndex = offsetStartIndex;
|
|
7281
7446
|
scrollYStore.endIndex = offsetEndIndex;
|
|
7282
|
-
|
|
7447
|
+
$xeTable.updateScrollYData();
|
|
7283
7448
|
}
|
|
7284
7449
|
}
|
|
7285
7450
|
},
|
|
7286
7451
|
// 计算可视渲染相关数据
|
|
7287
7452
|
computeScrollLoad() {
|
|
7288
7453
|
const $xeTable = this;
|
|
7289
|
-
const props = $xeTable;
|
|
7290
7454
|
return this.$nextTick().then(() => {
|
|
7291
|
-
const {
|
|
7292
|
-
showOverflow
|
|
7293
|
-
} = props;
|
|
7294
7455
|
const {
|
|
7295
7456
|
sYOpts,
|
|
7296
7457
|
sXOpts,
|
|
@@ -7303,16 +7464,14 @@ const Methods = {
|
|
|
7303
7464
|
if (scrollXLoad) {
|
|
7304
7465
|
const {
|
|
7305
7466
|
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);
|
|
7467
|
+
} = handleVirtualXVisible($xeTable);
|
|
7468
|
+
const offsetXSize = Math.max(0, sXOpts.oSize ? _xeUtils.default.toNumber(sXOpts.oSize) : _dom.browse.edge ? 5 : 0);
|
|
7310
7469
|
scrollXStore.offsetSize = offsetXSize;
|
|
7311
7470
|
scrollXStore.visibleSize = visibleXSize;
|
|
7312
7471
|
scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
|
|
7313
|
-
|
|
7472
|
+
$xeTable.updateScrollXData();
|
|
7314
7473
|
} else {
|
|
7315
|
-
|
|
7474
|
+
$xeTable.updateScrollXSpace();
|
|
7316
7475
|
}
|
|
7317
7476
|
calcCellHeight(this);
|
|
7318
7477
|
// 计算 Y 逻辑
|
|
@@ -7321,19 +7480,17 @@ const Methods = {
|
|
|
7321
7480
|
this.rowHeight = rowHeight;
|
|
7322
7481
|
const {
|
|
7323
7482
|
visibleSize: visibleYSize
|
|
7324
|
-
} = handleVirtualYVisible(
|
|
7483
|
+
} = handleVirtualYVisible($xeTable);
|
|
7325
7484
|
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);
|
|
7485
|
+
const offsetYSize = Math.max(0, sYOpts.oSize ? _xeUtils.default.toNumber(sYOpts.oSize) : _dom.browse.edge ? 10 : 0);
|
|
7329
7486
|
scrollYStore.offsetSize = offsetYSize;
|
|
7330
7487
|
scrollYStore.visibleSize = visibleYSize;
|
|
7331
7488
|
scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
|
|
7332
|
-
|
|
7489
|
+
$xeTable.updateScrollYData();
|
|
7333
7490
|
} else {
|
|
7334
|
-
|
|
7491
|
+
$xeTable.updateScrollYSpace();
|
|
7335
7492
|
}
|
|
7336
|
-
|
|
7493
|
+
$xeTable.$nextTick(this.updateStyle);
|
|
7337
7494
|
});
|
|
7338
7495
|
},
|
|
7339
7496
|
handleTableColumn() {
|
|
@@ -7354,10 +7511,19 @@ const Methods = {
|
|
|
7354
7511
|
this.tableColumn = tableColumn;
|
|
7355
7512
|
},
|
|
7356
7513
|
updateScrollXData() {
|
|
7514
|
+
const $xeTable = this;
|
|
7515
|
+
const props = $xeTable;
|
|
7516
|
+
const {
|
|
7517
|
+
showOverflow
|
|
7518
|
+
} = props;
|
|
7357
7519
|
// this.tableColumn = []
|
|
7358
|
-
return
|
|
7359
|
-
|
|
7360
|
-
|
|
7520
|
+
return $xeTable.$nextTick().then(() => {
|
|
7521
|
+
$xeTable.handleTableColumn();
|
|
7522
|
+
calcCellHeight($xeTable);
|
|
7523
|
+
$xeTable.updateScrollXSpace();
|
|
7524
|
+
if (!showOverflow) {
|
|
7525
|
+
$xeTable.updateScrollYSpace();
|
|
7526
|
+
}
|
|
7361
7527
|
});
|
|
7362
7528
|
},
|
|
7363
7529
|
// 更新横向 X 可视渲染上下剩余空间大小
|
|
@@ -7417,10 +7583,10 @@ const Methods = {
|
|
|
7417
7583
|
updateScrollYData() {
|
|
7418
7584
|
const $xeTable = this;
|
|
7419
7585
|
// this.tableData = []
|
|
7420
|
-
return
|
|
7421
|
-
|
|
7586
|
+
return $xeTable.$nextTick().then(() => {
|
|
7587
|
+
$xeTable.handleTableData();
|
|
7422
7588
|
calcCellHeight($xeTable);
|
|
7423
|
-
|
|
7589
|
+
$xeTable.updateScrollYSpace();
|
|
7424
7590
|
});
|
|
7425
7591
|
},
|
|
7426
7592
|
// 更新纵向 Y 可视渲染上下剩余空间大小
|
|
@@ -7878,7 +8044,7 @@ const Methods = {
|
|
|
7878
8044
|
}
|
|
7879
8045
|
};
|
|
7880
8046
|
// 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(',');
|
|
8047
|
+
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
8048
|
funcs.forEach(name => {
|
|
7883
8049
|
Methods[name] = function (...args) {
|
|
7884
8050
|
if (process.env.NODE_ENV === 'development') {
|