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/index.umd.js
CHANGED
|
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
|
|
|
2220
2220
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2221
2221
|
|
|
2222
2222
|
|
|
2223
|
-
const version = "3.11.
|
|
2223
|
+
const version = "3.11.6-beta.1";
|
|
2224
2224
|
core_.VxeUI.version = version;
|
|
2225
2225
|
core_.VxeUI.tableVersion = version;
|
|
2226
2226
|
core_.VxeUI.setConfig({
|
|
@@ -2251,7 +2251,7 @@ core_.VxeUI.setConfig({
|
|
|
2251
2251
|
// keyField: '_X_ROW_KEY' // 行数据的唯一主键字段名
|
|
2252
2252
|
// },
|
|
2253
2253
|
resizeConfig: {
|
|
2254
|
-
refreshDelay: 250
|
|
2254
|
+
// refreshDelay: 250
|
|
2255
2255
|
},
|
|
2256
2256
|
radioConfig: {
|
|
2257
2257
|
// trigger: 'default'
|
|
@@ -2774,7 +2774,7 @@ function isNodeElement(elem) {
|
|
|
2774
2774
|
const {
|
|
2775
2775
|
log: log_log
|
|
2776
2776
|
} = core_.VxeUI;
|
|
2777
|
-
const log_version = `table v${"3.11.
|
|
2777
|
+
const log_version = `table v${"3.11.6-beta.1"}`;
|
|
2778
2778
|
const warnLog = log_log.create('warn', log_version);
|
|
2779
2779
|
const errLog = log_log.create('error', log_version);
|
|
2780
2780
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -4844,8 +4844,8 @@ const {
|
|
|
4844
4844
|
interceptor: methods_interceptor,
|
|
4845
4845
|
createEvent
|
|
4846
4846
|
} = core_.VxeUI;
|
|
4847
|
-
const isWebkit = browse['-webkit'] && !browse.edge
|
|
4848
|
-
const debounceScrollYDuration = browse.msie ? 80 : 20
|
|
4847
|
+
// const isWebkit = browse['-webkit'] && !browse.edge
|
|
4848
|
+
// const debounceScrollYDuration = browse.msie ? 80 : 20
|
|
4849
4849
|
const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
4850
4850
|
// 获取所有的列,排除分组
|
|
4851
4851
|
const getColumnList = columns => {
|
|
@@ -4952,28 +4952,30 @@ function handleVirtualXVisible(_vm) {
|
|
|
4952
4952
|
};
|
|
4953
4953
|
}
|
|
4954
4954
|
const computeRowHeight = $xeTable => {
|
|
4955
|
+
const props = $xeTable;
|
|
4955
4956
|
const {
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
const
|
|
4960
|
-
const tableBody = $refs.tableBody;
|
|
4957
|
+
showOverflow
|
|
4958
|
+
} = props;
|
|
4959
|
+
const tableHeader = $xeTable.$refs.tableHeader;
|
|
4960
|
+
const tableBody = $xeTable.$refs.tableBody;
|
|
4961
4961
|
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
4962
|
-
const vSize = computeSize;
|
|
4962
|
+
const vSize = $xeTable.computeSize;
|
|
4963
4963
|
const rowHeightMaps = $xeTable.rowHeightMaps;
|
|
4964
4964
|
let rowHeight = 0;
|
|
4965
|
-
if (
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
firstTrElem
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
rowHeight
|
|
4965
|
+
if (showOverflow) {
|
|
4966
|
+
if (tableBodyElem) {
|
|
4967
|
+
const tableHeaderElem = tableHeader ? tableHeader.$el : null;
|
|
4968
|
+
let firstTrElem;
|
|
4969
|
+
firstTrElem = tableBodyElem.querySelector('tr');
|
|
4970
|
+
if (!firstTrElem && tableHeaderElem) {
|
|
4971
|
+
firstTrElem = tableHeaderElem.querySelector('tr');
|
|
4972
|
+
}
|
|
4973
|
+
if (firstTrElem) {
|
|
4974
|
+
rowHeight = firstTrElem.clientHeight;
|
|
4975
|
+
}
|
|
4976
|
+
if (!rowHeight) {
|
|
4977
|
+
rowHeight = rowHeightMaps[vSize || 'default'];
|
|
4978
|
+
}
|
|
4977
4979
|
}
|
|
4978
4980
|
}
|
|
4979
4981
|
return rowHeight;
|
|
@@ -5163,24 +5165,50 @@ function calcTableHeight(_vm, key) {
|
|
|
5163
5165
|
return num;
|
|
5164
5166
|
}
|
|
5165
5167
|
const calcCellHeight = $xeTable => {
|
|
5168
|
+
const props = $xeTable;
|
|
5169
|
+
const reactData = $xeTable;
|
|
5170
|
+
const internalData = $xeTable;
|
|
5171
|
+
const {
|
|
5172
|
+
showOverflow
|
|
5173
|
+
} = props;
|
|
5166
5174
|
const {
|
|
5167
5175
|
tableData,
|
|
5168
|
-
|
|
5176
|
+
scrollXLoad,
|
|
5177
|
+
scrollYLoad
|
|
5178
|
+
} = reactData;
|
|
5179
|
+
const {
|
|
5169
5180
|
fullAllDataRowIdData
|
|
5170
|
-
} =
|
|
5181
|
+
} = internalData;
|
|
5171
5182
|
const el = $xeTable.$el;
|
|
5172
|
-
if (scrollYLoad && el) {
|
|
5183
|
+
if (!showOverflow && (scrollXLoad || scrollYLoad) && el) {
|
|
5184
|
+
let paddingTop = 0;
|
|
5185
|
+
let paddingBottom = 0;
|
|
5186
|
+
let calcPadding = false;
|
|
5173
5187
|
tableData.forEach(row => {
|
|
5174
5188
|
const rowid = getRowid($xeTable, row);
|
|
5175
|
-
const
|
|
5189
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
5176
5190
|
const trList = el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]`);
|
|
5177
|
-
if (
|
|
5191
|
+
if (rowRest && trList.length) {
|
|
5178
5192
|
let height = 0;
|
|
5179
5193
|
for (let i = 0; i < trList.length; i++) {
|
|
5180
5194
|
const trEl = trList[i];
|
|
5181
|
-
|
|
5195
|
+
const tdList = trEl.children;
|
|
5196
|
+
for (let j = 0; j < tdList.length; j++) {
|
|
5197
|
+
const tdEl = tdList[j];
|
|
5198
|
+
const cellElem = tdEl.querySelector('.vxe-cell');
|
|
5199
|
+
if (!calcPadding) {
|
|
5200
|
+
paddingTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingTop);
|
|
5201
|
+
paddingBottom = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingBottom);
|
|
5202
|
+
calcPadding = true;
|
|
5203
|
+
}
|
|
5204
|
+
let cellHeight = paddingTop + paddingBottom;
|
|
5205
|
+
if (cellElem) {
|
|
5206
|
+
cellHeight += cellElem.offsetHeight;
|
|
5207
|
+
}
|
|
5208
|
+
height = Math.max(height, cellHeight);
|
|
5209
|
+
}
|
|
5182
5210
|
}
|
|
5183
|
-
|
|
5211
|
+
rowRest.height = height;
|
|
5184
5212
|
}
|
|
5185
5213
|
});
|
|
5186
5214
|
}
|
|
@@ -5360,6 +5388,52 @@ const handleScrollToRowColumn = ($xeTable, fieldOrColumn, row) => {
|
|
|
5360
5388
|
}
|
|
5361
5389
|
return $xeTable.$nextTick();
|
|
5362
5390
|
};
|
|
5391
|
+
function handleRecalculateLayout($xeTable, reFull) {
|
|
5392
|
+
const el = $xeTable.$refs.refElem;
|
|
5393
|
+
if (!el || !el.clientWidth) {
|
|
5394
|
+
return $xeTable.$nextTick();
|
|
5395
|
+
}
|
|
5396
|
+
$xeTable.calcCellWidth();
|
|
5397
|
+
$xeTable.autoCellWidth();
|
|
5398
|
+
if (reFull === true) {
|
|
5399
|
+
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
5400
|
+
return $xeTable.computeScrollLoad().then(() => {
|
|
5401
|
+
calcCellHeight($xeTable);
|
|
5402
|
+
$xeTable.calcCellWidth();
|
|
5403
|
+
$xeTable.autoCellWidth();
|
|
5404
|
+
return $xeTable.computeScrollLoad();
|
|
5405
|
+
});
|
|
5406
|
+
}
|
|
5407
|
+
return $xeTable.computeScrollLoad();
|
|
5408
|
+
}
|
|
5409
|
+
function checkLastSyncScroll($xeTable, isRollX, isRollY) {
|
|
5410
|
+
const reactData = $xeTable;
|
|
5411
|
+
const internalData = $xeTable;
|
|
5412
|
+
const {
|
|
5413
|
+
scrollXLoad,
|
|
5414
|
+
scrollYLoad
|
|
5415
|
+
} = reactData;
|
|
5416
|
+
const {
|
|
5417
|
+
lcsTimeout
|
|
5418
|
+
} = internalData;
|
|
5419
|
+
if (lcsTimeout) {
|
|
5420
|
+
clearTimeout(lcsTimeout);
|
|
5421
|
+
}
|
|
5422
|
+
internalData.lcsTimeout = setTimeout(() => {
|
|
5423
|
+
internalData.lcsTimeout = undefined;
|
|
5424
|
+
internalData.inVirtualScroll = false;
|
|
5425
|
+
internalData.inBodyScroll = false;
|
|
5426
|
+
internalData.bodyScrollType = '';
|
|
5427
|
+
internalData.inFooterScroll = false;
|
|
5428
|
+
if (isRollX && scrollXLoad) {
|
|
5429
|
+
$xeTable.updateScrollXData();
|
|
5430
|
+
}
|
|
5431
|
+
if (isRollY && scrollYLoad) {
|
|
5432
|
+
$xeTable.updateScrollYData();
|
|
5433
|
+
}
|
|
5434
|
+
$xeTable.updateCellAreas();
|
|
5435
|
+
}, 200);
|
|
5436
|
+
}
|
|
5363
5437
|
const Methods = {
|
|
5364
5438
|
callSlot(slotFunc, params, h, vNodes) {
|
|
5365
5439
|
if (slotFunc) {
|
|
@@ -7709,22 +7783,22 @@ const Methods = {
|
|
|
7709
7783
|
* 支持 width=? width=?px width=?% min-width=? min-width=?px min-width=?%
|
|
7710
7784
|
*/
|
|
7711
7785
|
recalculate(reFull) {
|
|
7712
|
-
const
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
return this.computeScrollLoad().then(() => {
|
|
7722
|
-
calcCellHeight(this);
|
|
7723
|
-
this.autoCellWidth();
|
|
7724
|
-
return this.computeScrollLoad();
|
|
7725
|
-
});
|
|
7786
|
+
const $xeTable = this;
|
|
7787
|
+
const internalData = $xeTable;
|
|
7788
|
+
const {
|
|
7789
|
+
rceTimeout
|
|
7790
|
+
} = internalData;
|
|
7791
|
+
if (rceTimeout) {
|
|
7792
|
+
clearTimeout(rceTimeout);
|
|
7793
|
+
} else {
|
|
7794
|
+
handleRecalculateLayout($xeTable, !!reFull);
|
|
7726
7795
|
}
|
|
7727
|
-
return
|
|
7796
|
+
return new Promise(resolve => {
|
|
7797
|
+
internalData.rceTimeout = setTimeout(() => {
|
|
7798
|
+
internalData.rceTimeout = undefined;
|
|
7799
|
+
resolve(handleRecalculateLayout($xeTable, !!reFull));
|
|
7800
|
+
}, 20);
|
|
7801
|
+
});
|
|
7728
7802
|
},
|
|
7729
7803
|
calcCellWidth() {
|
|
7730
7804
|
const $xeTable = this;
|
|
@@ -7937,17 +8011,25 @@ const Methods = {
|
|
|
7937
8011
|
},
|
|
7938
8012
|
calcCellHeight() {
|
|
7939
8013
|
const $xeTable = this;
|
|
8014
|
+
const props = $xeTable;
|
|
7940
8015
|
const reactData = $xeTable;
|
|
7941
8016
|
const internalData = $xeTable;
|
|
8017
|
+
const {
|
|
8018
|
+
showOverflow
|
|
8019
|
+
} = props;
|
|
7942
8020
|
const {
|
|
7943
8021
|
tableData,
|
|
8022
|
+
scrollXLoad,
|
|
7944
8023
|
scrollYLoad
|
|
7945
8024
|
} = reactData;
|
|
7946
8025
|
const {
|
|
7947
8026
|
fullAllDataRowIdData
|
|
7948
8027
|
} = internalData;
|
|
7949
8028
|
const el = $xeTable.$el;
|
|
7950
|
-
if (scrollYLoad && el) {
|
|
8029
|
+
if (!showOverflow && (scrollXLoad || scrollYLoad) && el) {
|
|
8030
|
+
let paddingTop = 0;
|
|
8031
|
+
let paddingBottom = 0;
|
|
8032
|
+
let calcPadding = false;
|
|
7951
8033
|
tableData.forEach(row => {
|
|
7952
8034
|
const rowid = getRowid($xeTable, row);
|
|
7953
8035
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
@@ -7956,9 +8038,23 @@ const Methods = {
|
|
|
7956
8038
|
let height = 0;
|
|
7957
8039
|
for (let i = 0; i < trList.length; i++) {
|
|
7958
8040
|
const trEl = trList[i];
|
|
7959
|
-
|
|
8041
|
+
const tdList = trEl.children;
|
|
8042
|
+
for (let j = 0; j < tdList.length; j++) {
|
|
8043
|
+
const tdEl = tdList[j];
|
|
8044
|
+
const cellElem = tdEl.querySelector('.vxe-cell');
|
|
8045
|
+
if (!calcPadding) {
|
|
8046
|
+
paddingTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingTop);
|
|
8047
|
+
paddingBottom = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingBottom);
|
|
8048
|
+
calcPadding = true;
|
|
8049
|
+
}
|
|
8050
|
+
let cellHeight = paddingTop + paddingBottom;
|
|
8051
|
+
if (cellElem) {
|
|
8052
|
+
cellHeight += cellElem.offsetHeight;
|
|
8053
|
+
}
|
|
8054
|
+
height = Math.max(height, cellHeight);
|
|
8055
|
+
}
|
|
7960
8056
|
}
|
|
7961
|
-
rowRest.height = height;
|
|
8057
|
+
rowRest.height = scrollXLoad ? Math.max(rowRest.height, height) : height;
|
|
7962
8058
|
}
|
|
7963
8059
|
});
|
|
7964
8060
|
}
|
|
@@ -11860,18 +11956,17 @@ const Methods = {
|
|
|
11860
11956
|
scrollLeft: bodyElem.scrollLeft
|
|
11861
11957
|
};
|
|
11862
11958
|
},
|
|
11863
|
-
/**
|
|
11864
|
-
* 横向 X 可视渲染事件处理
|
|
11865
|
-
*/
|
|
11866
|
-
triggerScrollXEvent() {
|
|
11867
|
-
this.loadScrollXData();
|
|
11868
|
-
},
|
|
11869
11959
|
loadScrollXData() {
|
|
11960
|
+
const $xeTable = this;
|
|
11961
|
+
const reactData = $xeTable;
|
|
11962
|
+
const internalData = $xeTable;
|
|
11870
11963
|
const {
|
|
11871
11964
|
mergeList,
|
|
11872
|
-
mergeFooterList
|
|
11965
|
+
mergeFooterList
|
|
11966
|
+
} = reactData;
|
|
11967
|
+
const {
|
|
11873
11968
|
scrollXStore
|
|
11874
|
-
} =
|
|
11969
|
+
} = internalData;
|
|
11875
11970
|
const {
|
|
11876
11971
|
startIndex,
|
|
11877
11972
|
endIndex,
|
|
@@ -11880,7 +11975,7 @@ const Methods = {
|
|
|
11880
11975
|
const {
|
|
11881
11976
|
toVisibleIndex,
|
|
11882
11977
|
visibleSize
|
|
11883
|
-
} = handleVirtualXVisible(
|
|
11978
|
+
} = handleVirtualXVisible($xeTable);
|
|
11884
11979
|
const offsetItem = {
|
|
11885
11980
|
startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize),
|
|
11886
11981
|
endIndex: toVisibleIndex + visibleSize + offsetSize
|
|
@@ -11894,10 +11989,10 @@ const Methods = {
|
|
|
11894
11989
|
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
11895
11990
|
scrollXStore.startIndex = offsetStartIndex;
|
|
11896
11991
|
scrollXStore.endIndex = offsetEndIndex;
|
|
11897
|
-
|
|
11992
|
+
$xeTable.updateScrollXData();
|
|
11898
11993
|
}
|
|
11899
11994
|
}
|
|
11900
|
-
|
|
11995
|
+
$xeTable.closeTooltip();
|
|
11901
11996
|
},
|
|
11902
11997
|
handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, params) {
|
|
11903
11998
|
const $xeTable = this;
|
|
@@ -11948,7 +12043,6 @@ const Methods = {
|
|
|
11948
12043
|
}
|
|
11949
12044
|
$xeTable.checkScrolling();
|
|
11950
12045
|
internalData.lastScrollLeft = scrollLeft;
|
|
11951
|
-
reactData.lastScrollTime = Date.now();
|
|
11952
12046
|
} else {
|
|
11953
12047
|
const yThreshold = $xeTable.computeScrollYThreshold;
|
|
11954
12048
|
isTop = scrollTop <= 0;
|
|
@@ -11967,8 +12061,8 @@ const Methods = {
|
|
|
11967
12061
|
}
|
|
11968
12062
|
}
|
|
11969
12063
|
internalData.lastScrollTop = scrollTop;
|
|
11970
|
-
reactData.lastScrollTime = Date.now();
|
|
11971
12064
|
}
|
|
12065
|
+
reactData.lastScrollTime = Date.now();
|
|
11972
12066
|
const evntParams = {
|
|
11973
12067
|
scrollTop,
|
|
11974
12068
|
scrollLeft,
|
|
@@ -11985,6 +12079,7 @@ const Methods = {
|
|
|
11985
12079
|
direction,
|
|
11986
12080
|
...params
|
|
11987
12081
|
};
|
|
12082
|
+
checkLastSyncScroll($xeTable, isRollX, isRollY);
|
|
11988
12083
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
11989
12084
|
$xeTable.clearHoverRow();
|
|
11990
12085
|
}
|
|
@@ -11999,46 +12094,99 @@ const Methods = {
|
|
|
11999
12094
|
}
|
|
12000
12095
|
$xeTable.dispatchEvent('scroll', evntParams, evnt);
|
|
12001
12096
|
},
|
|
12002
|
-
|
|
12003
|
-
|
|
12004
|
-
|
|
12005
|
-
|
|
12097
|
+
lazyScrollXData() {
|
|
12098
|
+
const $xeTable = this;
|
|
12099
|
+
const internalData = $xeTable;
|
|
12100
|
+
const {
|
|
12101
|
+
lxTimeout,
|
|
12102
|
+
lxRunTime,
|
|
12103
|
+
scrollXStore
|
|
12104
|
+
} = internalData;
|
|
12105
|
+
const {
|
|
12106
|
+
visibleSize
|
|
12107
|
+
} = scrollXStore;
|
|
12108
|
+
const fpsTime = Math.min(80, Math.floor(visibleSize * 3));
|
|
12109
|
+
if (lxTimeout) {
|
|
12110
|
+
clearTimeout(lxTimeout);
|
|
12111
|
+
}
|
|
12112
|
+
if (!lxRunTime || lxRunTime + fpsTime < Date.now()) {
|
|
12113
|
+
internalData.lxRunTime = Date.now();
|
|
12114
|
+
$xeTable.loadScrollXData();
|
|
12115
|
+
}
|
|
12116
|
+
internalData.lxTimeout = setTimeout(() => {
|
|
12117
|
+
internalData.lxRunTime = undefined;
|
|
12118
|
+
internalData.lxRunTime = undefined;
|
|
12119
|
+
$xeTable.loadScrollXData();
|
|
12120
|
+
}, fpsTime);
|
|
12121
|
+
},
|
|
12122
|
+
lazyScrollYData() {
|
|
12123
|
+
const $xeTable = this;
|
|
12124
|
+
const internalData = $xeTable;
|
|
12006
12125
|
const {
|
|
12126
|
+
lyTimeout,
|
|
12127
|
+
lyRunTime,
|
|
12007
12128
|
scrollYStore
|
|
12008
|
-
} =
|
|
12129
|
+
} = internalData;
|
|
12009
12130
|
const {
|
|
12010
|
-
adaptive,
|
|
12011
|
-
offsetSize,
|
|
12012
12131
|
visibleSize
|
|
12013
12132
|
} = scrollYStore;
|
|
12014
|
-
|
|
12015
|
-
if (
|
|
12016
|
-
|
|
12133
|
+
const fpsTime = Math.min(80, Math.floor(visibleSize * 2));
|
|
12134
|
+
if (lyTimeout) {
|
|
12135
|
+
clearTimeout(lyTimeout);
|
|
12136
|
+
}
|
|
12137
|
+
if (!lyRunTime || lyRunTime + fpsTime < Date.now()) {
|
|
12138
|
+
internalData.lyRunTime = Date.now();
|
|
12139
|
+
$xeTable.loadScrollYData();
|
|
12140
|
+
}
|
|
12141
|
+
internalData.lyTimeout = setTimeout(() => {
|
|
12142
|
+
internalData.lyTimeout = undefined;
|
|
12143
|
+
internalData.lyRunTime = undefined;
|
|
12144
|
+
$xeTable.loadScrollYData();
|
|
12145
|
+
}, fpsTime);
|
|
12146
|
+
},
|
|
12147
|
+
/**
|
|
12148
|
+
* 横向 X 可视渲染事件处理
|
|
12149
|
+
*/
|
|
12150
|
+
triggerScrollXEvent() {
|
|
12151
|
+
const $xeTable = this;
|
|
12152
|
+
const sXOpts = $xeTable.computeSXOpts;
|
|
12153
|
+
if (sXOpts.immediate) {
|
|
12154
|
+
$xeTable.loadScrollXData();
|
|
12155
|
+
} else {
|
|
12156
|
+
$xeTable.lazyScrollXData();
|
|
12157
|
+
}
|
|
12158
|
+
},
|
|
12159
|
+
/**
|
|
12160
|
+
* 纵向 Y 可视渲染事件处理
|
|
12161
|
+
*/
|
|
12162
|
+
triggerScrollYEvent() {
|
|
12163
|
+
const $xeTable = this;
|
|
12164
|
+
const sYOpts = $xeTable.computeSYOpts;
|
|
12165
|
+
if (sYOpts.immediate) {
|
|
12166
|
+
$xeTable.loadScrollYData();
|
|
12017
12167
|
} else {
|
|
12018
|
-
|
|
12168
|
+
$xeTable.lazyScrollYData();
|
|
12019
12169
|
}
|
|
12020
|
-
this.debounceScrollYCalculate();
|
|
12021
12170
|
},
|
|
12022
|
-
|
|
12023
|
-
this.loadScrollYData();
|
|
12024
|
-
}, debounceScrollYDuration, {
|
|
12025
|
-
leading: false,
|
|
12026
|
-
trailing: true
|
|
12027
|
-
}),
|
|
12028
|
-
handleSyncScrollX(scrollLeft) {
|
|
12171
|
+
scrollXEvent(evnt) {
|
|
12029
12172
|
const $xeTable = this;
|
|
12173
|
+
const internalData = $xeTable;
|
|
12174
|
+
const {
|
|
12175
|
+
inFooterScroll,
|
|
12176
|
+
inBodyScroll
|
|
12177
|
+
} = internalData;
|
|
12178
|
+
if (inFooterScroll) {
|
|
12179
|
+
return;
|
|
12180
|
+
}
|
|
12181
|
+
if (inBodyScroll) {
|
|
12182
|
+
return;
|
|
12183
|
+
}
|
|
12030
12184
|
const tableHeader = $xeTable.$refs.tableHeader;
|
|
12031
12185
|
const tableBody = $xeTable.$refs.tableBody;
|
|
12032
12186
|
const tableFooter = $xeTable.$refs.tableFooter;
|
|
12033
12187
|
const bodyElem = tableBody.$el;
|
|
12034
12188
|
const headerElem = tableHeader ? tableHeader.$el : null;
|
|
12035
12189
|
const footerElem = tableFooter ? tableFooter.$el : null;
|
|
12036
|
-
setScrollLeft(bodyElem, scrollLeft);
|
|
12037
|
-
setScrollLeft(headerElem, scrollLeft);
|
|
12038
|
-
setScrollLeft(footerElem, scrollLeft);
|
|
12039
|
-
},
|
|
12040
|
-
scrollXEvent(evnt) {
|
|
12041
|
-
const $xeTable = this;
|
|
12042
12190
|
const wrapperEl = evnt.currentTarget;
|
|
12043
12191
|
const {
|
|
12044
12192
|
scrollTop,
|
|
@@ -12046,33 +12194,35 @@ const Methods = {
|
|
|
12046
12194
|
} = wrapperEl;
|
|
12047
12195
|
const isRollX = true;
|
|
12048
12196
|
const isRollY = false;
|
|
12049
|
-
|
|
12197
|
+
internalData.inVirtualScroll = true;
|
|
12198
|
+
setScrollLeft(bodyElem, scrollLeft);
|
|
12199
|
+
setScrollLeft(headerElem, scrollLeft);
|
|
12200
|
+
setScrollLeft(footerElem, scrollLeft);
|
|
12050
12201
|
$xeTable.triggerScrollXEvent(evnt);
|
|
12051
12202
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
12052
12203
|
type: 'table',
|
|
12053
12204
|
fixed: ''
|
|
12054
12205
|
});
|
|
12055
12206
|
},
|
|
12056
|
-
|
|
12057
|
-
this.updateScrollYSpace();
|
|
12058
|
-
}, 1000, {
|
|
12059
|
-
leading: false,
|
|
12060
|
-
trailing: true
|
|
12061
|
-
}),
|
|
12062
|
-
handleSyncScrollY(scrollTop) {
|
|
12207
|
+
scrollYEvent(evnt) {
|
|
12063
12208
|
const $xeTable = this;
|
|
12209
|
+
const internalData = $xeTable;
|
|
12210
|
+
const {
|
|
12211
|
+
inFooterScroll,
|
|
12212
|
+
inBodyScroll
|
|
12213
|
+
} = internalData;
|
|
12214
|
+
if (inFooterScroll) {
|
|
12215
|
+
return;
|
|
12216
|
+
}
|
|
12217
|
+
if (inBodyScroll) {
|
|
12218
|
+
return;
|
|
12219
|
+
}
|
|
12064
12220
|
const tableBody = $xeTable.$refs.tableBody;
|
|
12065
12221
|
const leftBody = $xeTable.$refs.leftBody;
|
|
12066
12222
|
const rightBody = $xeTable.$refs.rightBody;
|
|
12067
12223
|
const bodyElem = tableBody.$el;
|
|
12068
12224
|
const leftElem = leftBody ? leftBody.$el : null;
|
|
12069
12225
|
const rightElem = rightBody ? rightBody.$el : null;
|
|
12070
|
-
setScrollTop(bodyElem, scrollTop);
|
|
12071
|
-
setScrollTop(leftElem, scrollTop);
|
|
12072
|
-
setScrollTop(rightElem, scrollTop);
|
|
12073
|
-
},
|
|
12074
|
-
scrollYEvent(evnt) {
|
|
12075
|
-
const $xeTable = this;
|
|
12076
12226
|
const wrapperEl = evnt.currentTarget;
|
|
12077
12227
|
const {
|
|
12078
12228
|
scrollTop,
|
|
@@ -12080,7 +12230,10 @@ const Methods = {
|
|
|
12080
12230
|
} = wrapperEl;
|
|
12081
12231
|
const isRollX = false;
|
|
12082
12232
|
const isRollY = true;
|
|
12083
|
-
|
|
12233
|
+
internalData.inVirtualScroll = true;
|
|
12234
|
+
setScrollTop(bodyElem, scrollTop);
|
|
12235
|
+
setScrollTop(leftElem, scrollTop);
|
|
12236
|
+
setScrollTop(rightElem, scrollTop);
|
|
12084
12237
|
$xeTable.triggerScrollYEvent(evnt);
|
|
12085
12238
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
12086
12239
|
type: 'table',
|
|
@@ -12091,22 +12244,33 @@ const Methods = {
|
|
|
12091
12244
|
* 纵向 Y 可视渲染处理
|
|
12092
12245
|
*/
|
|
12093
12246
|
loadScrollYData() {
|
|
12247
|
+
const $xeTable = this;
|
|
12248
|
+
const props = $xeTable;
|
|
12249
|
+
const reactData = $xeTable;
|
|
12250
|
+
const internalData = $xeTable;
|
|
12094
12251
|
const {
|
|
12095
|
-
|
|
12252
|
+
showOverflow
|
|
12253
|
+
} = props;
|
|
12254
|
+
const {
|
|
12255
|
+
mergeList
|
|
12256
|
+
} = reactData;
|
|
12257
|
+
const {
|
|
12258
|
+
tableHeight,
|
|
12096
12259
|
scrollYStore
|
|
12097
|
-
} =
|
|
12260
|
+
} = internalData;
|
|
12098
12261
|
const {
|
|
12099
12262
|
startIndex,
|
|
12100
12263
|
endIndex,
|
|
12101
12264
|
offsetSize
|
|
12102
12265
|
} = scrollYStore;
|
|
12266
|
+
const offsetYSize = showOverflow ? offsetSize : offsetSize + Math.min(8, Math.ceil(tableHeight / 200));
|
|
12103
12267
|
const {
|
|
12104
12268
|
toVisibleIndex,
|
|
12105
12269
|
visibleSize
|
|
12106
|
-
} = handleVirtualYVisible(
|
|
12270
|
+
} = handleVirtualYVisible($xeTable);
|
|
12107
12271
|
const offsetItem = {
|
|
12108
|
-
startIndex: Math.max(0, toVisibleIndex - 1 -
|
|
12109
|
-
endIndex: toVisibleIndex + visibleSize +
|
|
12272
|
+
startIndex: Math.max(0, toVisibleIndex - 1 - offsetYSize),
|
|
12273
|
+
endIndex: toVisibleIndex + visibleSize + offsetYSize
|
|
12110
12274
|
};
|
|
12111
12275
|
calculateMergerOffsetIndex(mergeList, offsetItem, 'row');
|
|
12112
12276
|
const {
|
|
@@ -12117,18 +12281,14 @@ const Methods = {
|
|
|
12117
12281
|
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
12118
12282
|
scrollYStore.startIndex = offsetStartIndex;
|
|
12119
12283
|
scrollYStore.endIndex = offsetEndIndex;
|
|
12120
|
-
|
|
12284
|
+
$xeTable.updateScrollYData();
|
|
12121
12285
|
}
|
|
12122
12286
|
}
|
|
12123
12287
|
},
|
|
12124
12288
|
// 计算可视渲染相关数据
|
|
12125
12289
|
computeScrollLoad() {
|
|
12126
12290
|
const $xeTable = this;
|
|
12127
|
-
const props = $xeTable;
|
|
12128
12291
|
return this.$nextTick().then(() => {
|
|
12129
|
-
const {
|
|
12130
|
-
showOverflow
|
|
12131
|
-
} = props;
|
|
12132
12292
|
const {
|
|
12133
12293
|
sYOpts,
|
|
12134
12294
|
sXOpts,
|
|
@@ -12141,16 +12301,14 @@ const Methods = {
|
|
|
12141
12301
|
if (scrollXLoad) {
|
|
12142
12302
|
const {
|
|
12143
12303
|
visibleSize: visibleXSize
|
|
12144
|
-
} = handleVirtualXVisible(
|
|
12145
|
-
|
|
12146
|
-
const bufferSize = showOverflow ? 0 : 2;
|
|
12147
|
-
const offsetXSize = Math.max(bufferSize, sXOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(sXOpts.oSize) : browse.msie ? 10 : browse.edge ? 5 : 0);
|
|
12304
|
+
} = handleVirtualXVisible($xeTable);
|
|
12305
|
+
const offsetXSize = Math.max(0, sXOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(sXOpts.oSize) : browse.edge ? 5 : 0);
|
|
12148
12306
|
scrollXStore.offsetSize = offsetXSize;
|
|
12149
12307
|
scrollXStore.visibleSize = visibleXSize;
|
|
12150
12308
|
scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
|
|
12151
|
-
|
|
12309
|
+
$xeTable.updateScrollXData();
|
|
12152
12310
|
} else {
|
|
12153
|
-
|
|
12311
|
+
$xeTable.updateScrollXSpace();
|
|
12154
12312
|
}
|
|
12155
12313
|
calcCellHeight(this);
|
|
12156
12314
|
// 计算 Y 逻辑
|
|
@@ -12159,19 +12317,17 @@ const Methods = {
|
|
|
12159
12317
|
this.rowHeight = rowHeight;
|
|
12160
12318
|
const {
|
|
12161
12319
|
visibleSize: visibleYSize
|
|
12162
|
-
} = handleVirtualYVisible(
|
|
12320
|
+
} = handleVirtualYVisible($xeTable);
|
|
12163
12321
|
if (scrollYLoad) {
|
|
12164
|
-
|
|
12165
|
-
const bufferSize = showOverflow ? 0 : 2;
|
|
12166
|
-
const offsetYSize = Math.max(bufferSize, sYOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(sYOpts.oSize) : browse.edge ? 10 : 0);
|
|
12322
|
+
const offsetYSize = Math.max(0, sYOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(sYOpts.oSize) : browse.edge ? 10 : 0);
|
|
12167
12323
|
scrollYStore.offsetSize = offsetYSize;
|
|
12168
12324
|
scrollYStore.visibleSize = visibleYSize;
|
|
12169
12325
|
scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
|
|
12170
|
-
|
|
12326
|
+
$xeTable.updateScrollYData();
|
|
12171
12327
|
} else {
|
|
12172
|
-
|
|
12328
|
+
$xeTable.updateScrollYSpace();
|
|
12173
12329
|
}
|
|
12174
|
-
|
|
12330
|
+
$xeTable.$nextTick(this.updateStyle);
|
|
12175
12331
|
});
|
|
12176
12332
|
},
|
|
12177
12333
|
handleTableColumn() {
|
|
@@ -12192,10 +12348,19 @@ const Methods = {
|
|
|
12192
12348
|
this.tableColumn = tableColumn;
|
|
12193
12349
|
},
|
|
12194
12350
|
updateScrollXData() {
|
|
12351
|
+
const $xeTable = this;
|
|
12352
|
+
const props = $xeTable;
|
|
12353
|
+
const {
|
|
12354
|
+
showOverflow
|
|
12355
|
+
} = props;
|
|
12195
12356
|
// this.tableColumn = []
|
|
12196
|
-
return
|
|
12197
|
-
|
|
12198
|
-
|
|
12357
|
+
return $xeTable.$nextTick().then(() => {
|
|
12358
|
+
$xeTable.handleTableColumn();
|
|
12359
|
+
calcCellHeight($xeTable);
|
|
12360
|
+
$xeTable.updateScrollXSpace();
|
|
12361
|
+
if (!showOverflow) {
|
|
12362
|
+
$xeTable.updateScrollYSpace();
|
|
12363
|
+
}
|
|
12199
12364
|
});
|
|
12200
12365
|
},
|
|
12201
12366
|
// 更新横向 X 可视渲染上下剩余空间大小
|
|
@@ -12255,10 +12420,10 @@ const Methods = {
|
|
|
12255
12420
|
updateScrollYData() {
|
|
12256
12421
|
const $xeTable = this;
|
|
12257
12422
|
// this.tableData = []
|
|
12258
|
-
return
|
|
12259
|
-
|
|
12423
|
+
return $xeTable.$nextTick().then(() => {
|
|
12424
|
+
$xeTable.handleTableData();
|
|
12260
12425
|
calcCellHeight($xeTable);
|
|
12261
|
-
|
|
12426
|
+
$xeTable.updateScrollYSpace();
|
|
12262
12427
|
});
|
|
12263
12428
|
},
|
|
12264
12429
|
// 更新纵向 Y 可视渲染上下剩余空间大小
|
|
@@ -12716,7 +12881,7 @@ const Methods = {
|
|
|
12716
12881
|
}
|
|
12717
12882
|
};
|
|
12718
12883
|
// Module methods
|
|
12719
|
-
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(',');
|
|
12884
|
+
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(',');
|
|
12720
12885
|
funcs.forEach(name => {
|
|
12721
12886
|
Methods[name] = function (...args) {
|
|
12722
12887
|
if (true) {
|
|
@@ -12748,7 +12913,8 @@ funcs.forEach(name => {
|
|
|
12748
12913
|
|
|
12749
12914
|
const {
|
|
12750
12915
|
getI18n: body_getI18n,
|
|
12751
|
-
renderer: body_renderer
|
|
12916
|
+
renderer: body_renderer,
|
|
12917
|
+
renderEmptyElement: body_renderEmptyElement
|
|
12752
12918
|
} = core_.VxeUI;
|
|
12753
12919
|
const renderType = 'body';
|
|
12754
12920
|
// 滚动、拖动过程中不需要触发
|
|
@@ -12810,6 +12976,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
12810
12976
|
columnKey,
|
|
12811
12977
|
overflowX,
|
|
12812
12978
|
sYOpts,
|
|
12979
|
+
scrollXLoad,
|
|
12813
12980
|
scrollYLoad,
|
|
12814
12981
|
highlightCurrentRow,
|
|
12815
12982
|
showOverflow: allColumnOverflow,
|
|
@@ -12834,8 +13001,13 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
12834
13001
|
tooltipConfig,
|
|
12835
13002
|
rowOpts,
|
|
12836
13003
|
columnOpts,
|
|
13004
|
+
mouseOpts,
|
|
13005
|
+
areaOpts,
|
|
12837
13006
|
validErrorMaps
|
|
12838
13007
|
} = $xetable;
|
|
13008
|
+
const {
|
|
13009
|
+
selectCellToRow
|
|
13010
|
+
} = areaOpts;
|
|
12839
13011
|
const cellOpts = $xetable.computeCellOpts;
|
|
12840
13012
|
const {
|
|
12841
13013
|
type,
|
|
@@ -13036,7 +13208,8 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
13036
13208
|
const validSlot = slots ? slots.valid : null;
|
|
13037
13209
|
const validParams = {
|
|
13038
13210
|
...params,
|
|
13039
|
-
...errorValidItem
|
|
13211
|
+
...errorValidItem,
|
|
13212
|
+
rule: errorValidItem
|
|
13040
13213
|
};
|
|
13041
13214
|
tdVNs.push(h('div', {
|
|
13042
13215
|
class: ['vxe-cell--valid-error-tip', getClass(validOpts.className, errorValidItem)],
|
|
@@ -13053,11 +13226,18 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
13053
13226
|
let cellHeight = '';
|
|
13054
13227
|
if (hasEllipsis && (scrollYRHeight || rowHeight)) {
|
|
13055
13228
|
cellHeight = `${scrollYRHeight || rowHeight}px`;
|
|
13056
|
-
} else if (scrollYLoad) {
|
|
13229
|
+
} else if (scrollXLoad || scrollYLoad) {
|
|
13057
13230
|
if (!hasEllipsis) {
|
|
13058
13231
|
cellHeight = `${rest.height || 24}px`;
|
|
13059
13232
|
}
|
|
13060
13233
|
}
|
|
13234
|
+
if (mouseConfig && mouseOpts.area && selectCellToRow) {
|
|
13235
|
+
if (!$columnIndex && selectCellToRow === true || selectCellToRow === column.field) {
|
|
13236
|
+
tdVNs.push(h('div', {
|
|
13237
|
+
class: 'vxe-cell--area-status'
|
|
13238
|
+
}));
|
|
13239
|
+
}
|
|
13240
|
+
}
|
|
13061
13241
|
return h('td', {
|
|
13062
13242
|
class: ['vxe-body--column', column.id, {
|
|
13063
13243
|
[`col--${cellAlign}`]: cellAlign,
|
|
@@ -13325,6 +13505,7 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
|
|
|
13325
13505
|
elemStore[`${prefix}emptyBlock`] = null;
|
|
13326
13506
|
},
|
|
13327
13507
|
render(h) {
|
|
13508
|
+
const $xeTable = this.$parent;
|
|
13328
13509
|
const {
|
|
13329
13510
|
_e,
|
|
13330
13511
|
$parent: $xetable,
|
|
@@ -13390,16 +13571,19 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
|
|
|
13390
13571
|
emptyContent = $xetable.emptyText || body_getI18n('vxe.table.emptyText');
|
|
13391
13572
|
}
|
|
13392
13573
|
}
|
|
13574
|
+
const ons = {
|
|
13575
|
+
scroll: this.scrollEvent
|
|
13576
|
+
};
|
|
13577
|
+
if (sYOpts.mode === 'wheel') {
|
|
13578
|
+
ons.wheel = this.wheelEvent;
|
|
13579
|
+
}
|
|
13393
13580
|
return h('div', {
|
|
13581
|
+
ref: 'refElem',
|
|
13394
13582
|
class: ['vxe-table--body-wrapper', fixedType ? `fixed-${fixedType}--wrapper` : 'body--wrapper'],
|
|
13395
13583
|
attrs: {
|
|
13396
13584
|
xid: tId
|
|
13397
13585
|
},
|
|
13398
|
-
on:
|
|
13399
|
-
scroll: this.scrollEvent
|
|
13400
|
-
}, scrollYLoad && sYOpts.mode === 'wheel' ? {
|
|
13401
|
-
wheel: this.wheelEvent
|
|
13402
|
-
} : null)
|
|
13586
|
+
on: ons
|
|
13403
13587
|
}, [fixedType ? _e() : h('div', {
|
|
13404
13588
|
class: 'vxe-body--x-space',
|
|
13405
13589
|
ref: 'xSpace'
|
|
@@ -13464,12 +13648,12 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
|
|
|
13464
13648
|
class: 'vxe-table--cell-multi-area'
|
|
13465
13649
|
}), h('span', {
|
|
13466
13650
|
class: 'vxe-table--cell-active-area'
|
|
13467
|
-
})]) :
|
|
13651
|
+
})]) : body_renderEmptyElement($xeTable), !fixedType ? h('div', {
|
|
13468
13652
|
class: 'vxe-table--empty-block',
|
|
13469
13653
|
ref: 'emptyBlock'
|
|
13470
13654
|
}, [h('div', {
|
|
13471
13655
|
class: 'vxe-table--empty-content'
|
|
13472
|
-
}, emptyContent)]) :
|
|
13656
|
+
}, emptyContent)]) : body_renderEmptyElement($xeTable)]);
|
|
13473
13657
|
},
|
|
13474
13658
|
methods: {
|
|
13475
13659
|
/**
|
|
@@ -13478,37 +13662,52 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
|
|
|
13478
13662
|
* 如果存在列固定右侧,同步更新滚动状态
|
|
13479
13663
|
*/
|
|
13480
13664
|
scrollEvent(evnt) {
|
|
13665
|
+
const $xeTable = this.$parent;
|
|
13666
|
+
const tableInternalData = $xeTable;
|
|
13481
13667
|
const {
|
|
13482
|
-
$el: scrollBodyElem,
|
|
13483
|
-
$parent: $xeTable,
|
|
13484
13668
|
fixedType
|
|
13485
13669
|
} = this;
|
|
13486
13670
|
const {
|
|
13487
|
-
$refs,
|
|
13488
13671
|
lastScrollTop,
|
|
13489
|
-
lastScrollLeft
|
|
13490
|
-
|
|
13672
|
+
lastScrollLeft,
|
|
13673
|
+
inVirtualScroll,
|
|
13674
|
+
inBodyScroll,
|
|
13675
|
+
bodyScrollType,
|
|
13676
|
+
inFooterScroll
|
|
13677
|
+
} = tableInternalData;
|
|
13678
|
+
if (inVirtualScroll) {
|
|
13679
|
+
return;
|
|
13680
|
+
}
|
|
13681
|
+
if (inFooterScroll) {
|
|
13682
|
+
return;
|
|
13683
|
+
}
|
|
13684
|
+
if (inBodyScroll) {
|
|
13685
|
+
if (bodyScrollType !== fixedType) {
|
|
13686
|
+
return;
|
|
13687
|
+
}
|
|
13688
|
+
}
|
|
13491
13689
|
const {
|
|
13492
13690
|
tableHeader,
|
|
13493
13691
|
tableBody,
|
|
13494
13692
|
leftBody,
|
|
13495
13693
|
rightBody,
|
|
13496
13694
|
tableFooter
|
|
13497
|
-
} = $refs;
|
|
13695
|
+
} = $xeTable.$refs;
|
|
13696
|
+
const scrollBodyElem = this.$el;
|
|
13498
13697
|
const headerElem = tableHeader ? tableHeader.$el : null;
|
|
13499
13698
|
const footerElem = tableFooter ? tableFooter.$el : null;
|
|
13500
13699
|
const bodyElem = tableBody.$el;
|
|
13501
13700
|
const leftElem = leftBody ? leftBody.$el : null;
|
|
13502
13701
|
const rightElem = rightBody ? rightBody.$el : null;
|
|
13702
|
+
const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
|
|
13703
|
+
const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
|
|
13503
13704
|
const scrollTop = scrollBodyElem.scrollTop;
|
|
13504
13705
|
const scrollLeft = bodyElem.scrollLeft;
|
|
13505
13706
|
const isRollX = scrollLeft !== lastScrollLeft;
|
|
13506
13707
|
const isRollY = scrollTop !== lastScrollTop;
|
|
13507
|
-
|
|
13508
|
-
|
|
13509
|
-
if (
|
|
13510
|
-
yHandleEl.scrollTop = scrollTop;
|
|
13511
|
-
} else if (isRollY) {
|
|
13708
|
+
tableInternalData.inBodyScroll = true;
|
|
13709
|
+
tableInternalData.bodyScrollType = fixedType;
|
|
13710
|
+
if (isRollY) {
|
|
13512
13711
|
if (leftElem && fixedType === 'left') {
|
|
13513
13712
|
setScrollTop(bodyElem, scrollTop);
|
|
13514
13713
|
setScrollTop(rightElem, scrollTop);
|
|
@@ -13519,21 +13718,19 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
|
|
|
13519
13718
|
setScrollTop(leftElem, scrollTop);
|
|
13520
13719
|
setScrollTop(rightElem, scrollTop);
|
|
13521
13720
|
}
|
|
13522
|
-
|
|
13523
|
-
|
|
13524
|
-
fixed: fixedType
|
|
13525
|
-
});
|
|
13721
|
+
setScrollTop(yHandleEl, scrollTop);
|
|
13722
|
+
$xeTable.triggerScrollYEvent(evnt);
|
|
13526
13723
|
}
|
|
13527
|
-
if (
|
|
13528
|
-
xHandleEl
|
|
13529
|
-
} else if (isRollX) {
|
|
13724
|
+
if (isRollX) {
|
|
13725
|
+
setScrollLeft(xHandleEl, scrollLeft);
|
|
13530
13726
|
setScrollLeft(headerElem, scrollLeft);
|
|
13531
13727
|
setScrollLeft(footerElem, scrollLeft);
|
|
13532
|
-
$xeTable.
|
|
13533
|
-
type: renderType,
|
|
13534
|
-
fixed: fixedType
|
|
13535
|
-
});
|
|
13728
|
+
$xeTable.triggerScrollXEvent(evnt);
|
|
13536
13729
|
}
|
|
13730
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
13731
|
+
type: renderType,
|
|
13732
|
+
fixed: fixedType
|
|
13733
|
+
});
|
|
13537
13734
|
},
|
|
13538
13735
|
handleWheel(evnt, isTopWheel, deltaTop, isRollX, isRollY) {
|
|
13539
13736
|
const {
|
|
@@ -14384,14 +14581,16 @@ function footer_renderHeads(h, _vm, footerTableData) {
|
|
|
14384
14581
|
tableColumn = visibleColumn;
|
|
14385
14582
|
}
|
|
14386
14583
|
}
|
|
14584
|
+
const ons = {};
|
|
14585
|
+
if (!fixedType) {
|
|
14586
|
+
ons.scroll = this.scrollEvent;
|
|
14587
|
+
}
|
|
14387
14588
|
return h('div', {
|
|
14388
14589
|
class: ['vxe-table--footer-wrapper', fixedType ? `fixed-${fixedType}--wrapper` : 'body--wrapper'],
|
|
14389
14590
|
attrs: {
|
|
14390
14591
|
xid: tId
|
|
14391
14592
|
},
|
|
14392
|
-
on:
|
|
14393
|
-
scroll: this.scrollEvent
|
|
14394
|
-
}
|
|
14593
|
+
on: ons
|
|
14395
14594
|
}, [fixedType ? _e() : h('div', {
|
|
14396
14595
|
class: 'vxe-body--x-space',
|
|
14397
14596
|
ref: 'xSpace'
|
|
@@ -14436,36 +14635,43 @@ function footer_renderHeads(h, _vm, footerTableData) {
|
|
|
14436
14635
|
* 如果存在列固定右侧,同步更新滚动状态
|
|
14437
14636
|
*/
|
|
14438
14637
|
scrollEvent(evnt) {
|
|
14638
|
+
const $xeTable = this.$parent;
|
|
14639
|
+
const tableInternalData = $xeTable;
|
|
14640
|
+
const {
|
|
14641
|
+
inVirtualScroll,
|
|
14642
|
+
inBodyScroll
|
|
14643
|
+
} = tableInternalData;
|
|
14644
|
+
if (inVirtualScroll) {
|
|
14645
|
+
return;
|
|
14646
|
+
}
|
|
14647
|
+
if (inBodyScroll) {
|
|
14648
|
+
return;
|
|
14649
|
+
}
|
|
14439
14650
|
const {
|
|
14440
|
-
$parent: $xeTable,
|
|
14441
14651
|
fixedType
|
|
14442
14652
|
} = this;
|
|
14443
|
-
const {
|
|
14444
|
-
$refs
|
|
14445
|
-
} = $xeTable;
|
|
14446
14653
|
const {
|
|
14447
14654
|
tableHeader,
|
|
14448
14655
|
tableBody,
|
|
14449
14656
|
tableFooter
|
|
14450
|
-
} = $refs;
|
|
14657
|
+
} = $xeTable.$refs;
|
|
14451
14658
|
const headerElem = tableHeader ? tableHeader.$el : null;
|
|
14452
14659
|
const footerElem = tableFooter ? tableFooter.$el : null;
|
|
14453
14660
|
const bodyElem = tableBody.$el;
|
|
14454
|
-
const
|
|
14455
|
-
const
|
|
14456
|
-
|
|
14457
|
-
|
|
14458
|
-
|
|
14459
|
-
|
|
14460
|
-
|
|
14461
|
-
|
|
14462
|
-
|
|
14463
|
-
|
|
14464
|
-
|
|
14465
|
-
|
|
14466
|
-
|
|
14467
|
-
|
|
14468
|
-
}
|
|
14661
|
+
const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
|
|
14662
|
+
const scrollLeft = footerElem.scrollLeft;
|
|
14663
|
+
const isRollX = true;
|
|
14664
|
+
const isRollY = false;
|
|
14665
|
+
const scrollTop = bodyElem.scrollTop;
|
|
14666
|
+
tableInternalData.inFooterScroll = true;
|
|
14667
|
+
setScrollLeft(xHandleEl, scrollLeft);
|
|
14668
|
+
setScrollLeft(headerElem, scrollLeft);
|
|
14669
|
+
setScrollLeft(bodyElem, scrollLeft);
|
|
14670
|
+
$xeTable.triggerScrollXEvent(evnt);
|
|
14671
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
14672
|
+
type: footer_renderType,
|
|
14673
|
+
fixed: fixedType
|
|
14674
|
+
});
|
|
14469
14675
|
}
|
|
14470
14676
|
}
|
|
14471
14677
|
});
|
|
@@ -15878,20 +16084,16 @@ const {
|
|
|
15878
16084
|
// 确认筛选
|
|
15879
16085
|
confirmFilter(evnt) {
|
|
15880
16086
|
const {
|
|
15881
|
-
$parent: $xetable
|
|
15882
|
-
filterStore
|
|
16087
|
+
$parent: $xetable
|
|
15883
16088
|
} = this;
|
|
15884
|
-
|
|
15885
|
-
option.checked = option._checked;
|
|
15886
|
-
});
|
|
15887
|
-
$xetable.confirmFilterEvent(evnt);
|
|
16089
|
+
$xetable.handleFilterConfirmFilter(evnt);
|
|
15888
16090
|
},
|
|
15889
16091
|
// 重置筛选
|
|
15890
16092
|
resetFilter(evnt) {
|
|
15891
16093
|
const {
|
|
15892
16094
|
$parent: $xetable
|
|
15893
16095
|
} = this;
|
|
15894
|
-
$xetable.
|
|
16096
|
+
$xetable.handleFilterResetFilter(evnt);
|
|
15895
16097
|
}
|
|
15896
16098
|
/*************************
|
|
15897
16099
|
* Publish methods
|
|
@@ -16918,6 +17120,27 @@ const {
|
|
|
16918
17120
|
visible: filterStore.visible
|
|
16919
17121
|
}, evnt);
|
|
16920
17122
|
},
|
|
17123
|
+
handleFilterConfirmFilter(evnt) {
|
|
17124
|
+
const $xeTable = this;
|
|
17125
|
+
const reactData = $xeTable;
|
|
17126
|
+
const {
|
|
17127
|
+
filterStore
|
|
17128
|
+
} = reactData;
|
|
17129
|
+
filterStore.options.forEach(option => {
|
|
17130
|
+
option.checked = option._checked;
|
|
17131
|
+
});
|
|
17132
|
+
$xeTable.confirmFilterEvent(evnt);
|
|
17133
|
+
},
|
|
17134
|
+
_saveFilterPanel() {
|
|
17135
|
+
const $xeTable = this;
|
|
17136
|
+
$xeTable.handleFilterConfirmFilter(null);
|
|
17137
|
+
return $xeTable.$nextTick();
|
|
17138
|
+
},
|
|
17139
|
+
_resetFilterPanel() {
|
|
17140
|
+
const $xeTable = this;
|
|
17141
|
+
$xeTable.handleFilterResetFilter(null);
|
|
17142
|
+
return $xeTable.$nextTick();
|
|
17143
|
+
},
|
|
16921
17144
|
_getCheckedFilters() {
|
|
16922
17145
|
const {
|
|
16923
17146
|
tableFullColumn
|
|
@@ -16996,7 +17219,9 @@ const {
|
|
|
16996
17219
|
if (this.mouseConfig && this.mouseOpts.area && this.handleFilterEvent) {
|
|
16997
17220
|
this.handleFilterEvent(evnt, params);
|
|
16998
17221
|
}
|
|
16999
|
-
|
|
17222
|
+
if (evnt) {
|
|
17223
|
+
this.emitEvent('filter-change', params, evnt);
|
|
17224
|
+
}
|
|
17000
17225
|
this.closeFilter();
|
|
17001
17226
|
this.updateFooter().then(() => {
|
|
17002
17227
|
const {
|
|
@@ -17051,7 +17276,7 @@ const {
|
|
|
17051
17276
|
* 当筛选面板中的重置按钮被按下时触发
|
|
17052
17277
|
* @param {Event} evnt 事件
|
|
17053
17278
|
*/
|
|
17054
|
-
|
|
17279
|
+
handleFilterResetFilter(evnt) {
|
|
17055
17280
|
this.handleClearFilter(this.filterStore.column);
|
|
17056
17281
|
this.confirmFilterEvent(evnt);
|
|
17057
17282
|
},
|
|
@@ -22766,6 +22991,7 @@ function handleUupdateResize(_vm) {
|
|
|
22766
22991
|
const VxeUILoadingComponent = core_.VxeUI.getComponent('VxeLoading');
|
|
22767
22992
|
const VxeUITooltipComponent = core_.VxeUI.getComponent('VxeTooltip');
|
|
22768
22993
|
const $xeTable = this;
|
|
22994
|
+
const $xeGrid = $xeTable.$xeGrid;
|
|
22769
22995
|
const {
|
|
22770
22996
|
_e,
|
|
22771
22997
|
$scopedSlots,
|
|
@@ -22815,6 +23041,7 @@ function handleUupdateResize(_vm) {
|
|
|
22815
23041
|
leftList,
|
|
22816
23042
|
rightList
|
|
22817
23043
|
} = columnStore;
|
|
23044
|
+
const loadingSlot = $scopedSlots.loading;
|
|
22818
23045
|
const currLoading = this._isLoading || loading;
|
|
22819
23046
|
const vSize = computeSize;
|
|
22820
23047
|
const virtualScrollBars = $xeTable.computeVirtualScrollBars;
|
|
@@ -22971,7 +23198,19 @@ function handleUupdateResize(_vm) {
|
|
|
22971
23198
|
icon: loadingOpts.icon,
|
|
22972
23199
|
text: loadingOpts.text
|
|
22973
23200
|
}
|
|
22974
|
-
},
|
|
23201
|
+
}, $xeTable.callSlot(loadingSlot, {
|
|
23202
|
+
$table: $xeTable,
|
|
23203
|
+
$grid: $xeGrid,
|
|
23204
|
+
loading: currLoading
|
|
23205
|
+
}, h)) : loadingSlot ? h('div', {
|
|
23206
|
+
class: ['vxe-loading--custom-wrapper', {
|
|
23207
|
+
'is--visible': currLoading
|
|
23208
|
+
}]
|
|
23209
|
+
}, $xeTable.callSlot(loadingSlot, {
|
|
23210
|
+
$table: $xeTable,
|
|
23211
|
+
$grid: $xeGrid,
|
|
23212
|
+
loading: currLoading
|
|
23213
|
+
}, h)) : table_renderEmptyElement($xeTable),
|
|
22975
23214
|
/**
|
|
22976
23215
|
* 自定义列
|
|
22977
23216
|
*/
|
|
@@ -22981,7 +23220,7 @@ function handleUupdateResize(_vm) {
|
|
|
22981
23220
|
props: {
|
|
22982
23221
|
customStore
|
|
22983
23222
|
}
|
|
22984
|
-
}) :
|
|
23223
|
+
}) : table_renderEmptyElement($xeTable),
|
|
22985
23224
|
/**
|
|
22986
23225
|
* 筛选
|
|
22987
23226
|
*/
|