vxe-table 4.15.3 → 4.15.5
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/README.en.md +2 -6
- package/README.ja-JP.md +2 -6
- package/README.md +2 -6
- package/README.zh-TW.md +2 -6
- package/es/grid/src/grid.js +9 -1
- package/es/style.css +1 -1
- package/es/table/src/header.js +2 -2
- package/es/table/src/table.js +49 -141
- package/es/table/src/util.js +117 -10
- package/es/toolbar/src/toolbar.js +10 -4
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +9 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +147 -65
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/header.js +2 -2
- package/lib/table/src/table.js +8 -47
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +118 -10
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +9 -3
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/grid/src/grid.ts +12 -2
- package/packages/table/src/header.ts +5 -5
- package/packages/table/src/table.ts +52 -146
- package/packages/table/src/util.ts +122 -11
- package/packages/toolbar/src/toolbar.ts +12 -4
- package/styles/cssvar.scss +0 -2
- /package/es/{iconfont.1754441841476.ttf → iconfont.1754615009926.ttf} +0 -0
- /package/es/{iconfont.1754441841476.woff → iconfont.1754615009926.woff} +0 -0
- /package/es/{iconfont.1754441841476.woff2 → iconfont.1754615009926.woff2} +0 -0
- /package/lib/{iconfont.1754441841476.ttf → iconfont.1754615009926.ttf} +0 -0
- /package/lib/{iconfont.1754441841476.woff → iconfont.1754615009926.woff} +0 -0
- /package/lib/{iconfont.1754441841476.woff2 → iconfont.1754615009926.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -4,7 +4,7 @@ import XEUtils from 'xe-utils';
|
|
|
4
4
|
import { initTpImg, getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey } from '../../ui/src/dom';
|
|
5
5
|
import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils';
|
|
6
6
|
import { VxeUI } from '../../ui';
|
|
7
|
-
import { getRowUniqueId, clearTableAllStatus, getColumnList, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getCalcHeight, getCellRestHeight } from './util';
|
|
7
|
+
import { createInternalData, getRowUniqueId, clearTableAllStatus, getColumnList, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getCalcHeight, getCellRestHeight } from './util';
|
|
8
8
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
9
9
|
import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from './anime';
|
|
10
10
|
import { warnLog, errLog } from '../../ui/src/log';
|
|
@@ -275,120 +275,7 @@ export default defineVxeComponent({
|
|
|
275
275
|
isRowLoading: false,
|
|
276
276
|
isColLoading: false
|
|
277
277
|
});
|
|
278
|
-
const internalData =
|
|
279
|
-
tZindex: 0,
|
|
280
|
-
currKeyField: '',
|
|
281
|
-
isCurrDeepKey: false,
|
|
282
|
-
elemStore: {},
|
|
283
|
-
// 存放横向 X 虚拟滚动相关的信息
|
|
284
|
-
scrollXStore: {
|
|
285
|
-
preloadSize: 0,
|
|
286
|
-
offsetSize: 0,
|
|
287
|
-
visibleSize: 0,
|
|
288
|
-
visibleStartIndex: 0,
|
|
289
|
-
visibleEndIndex: 0,
|
|
290
|
-
startIndex: 0,
|
|
291
|
-
endIndex: 0
|
|
292
|
-
},
|
|
293
|
-
// 存放纵向 Y 虚拟滚动相关信息
|
|
294
|
-
scrollYStore: {
|
|
295
|
-
preloadSize: 0,
|
|
296
|
-
offsetSize: 0,
|
|
297
|
-
visibleSize: 0,
|
|
298
|
-
visibleStartIndex: 0,
|
|
299
|
-
visibleEndIndex: 0,
|
|
300
|
-
startIndex: 0,
|
|
301
|
-
endIndex: 0
|
|
302
|
-
},
|
|
303
|
-
// 表格宽度
|
|
304
|
-
tableWidth: 0,
|
|
305
|
-
// 表格高度
|
|
306
|
-
tableHeight: 0,
|
|
307
|
-
// 表头高度
|
|
308
|
-
headerHeight: 0,
|
|
309
|
-
// 表尾高度
|
|
310
|
-
footerHeight: 0,
|
|
311
|
-
customHeight: 0,
|
|
312
|
-
customMinHeight: 0,
|
|
313
|
-
customMaxHeight: 0,
|
|
314
|
-
// 当前 hover 行
|
|
315
|
-
hoverRow: null,
|
|
316
|
-
// 最后滚动位置
|
|
317
|
-
lastScrollLeft: 0,
|
|
318
|
-
lastScrollTop: 0,
|
|
319
|
-
// 单选框属性,已选中保留的行
|
|
320
|
-
radioReserveRow: null,
|
|
321
|
-
// 复选框属性,已选中保留的行集合
|
|
322
|
-
checkboxReserveRowMap: {},
|
|
323
|
-
// 行数据,已展开保留的行集合
|
|
324
|
-
rowExpandedReserveRowMap: {},
|
|
325
|
-
// 树结构数据,已展开保留的行集合
|
|
326
|
-
treeExpandedReserveRowMap: {},
|
|
327
|
-
// 树结构数据,不确定状态的集合
|
|
328
|
-
treeIndeterminateRowMaps: {},
|
|
329
|
-
// 列表完整数据、条件处理后
|
|
330
|
-
tableFullData: [],
|
|
331
|
-
afterFullData: [],
|
|
332
|
-
afterTreeFullData: [],
|
|
333
|
-
afterGroupFullData: [],
|
|
334
|
-
// 列表条件处理后数据集合
|
|
335
|
-
afterFullRowMaps: {},
|
|
336
|
-
// 树结构完整数据、条件处理后
|
|
337
|
-
tableFullTreeData: [],
|
|
338
|
-
// 行分组全量数据、条件处理后
|
|
339
|
-
tableFullGroupData: [],
|
|
340
|
-
tableSynchData: [],
|
|
341
|
-
tableSourceData: [],
|
|
342
|
-
// 收集的列配置(带分组)
|
|
343
|
-
collectColumn: [],
|
|
344
|
-
// 完整所有列(不带分组)
|
|
345
|
-
tableFullColumn: [],
|
|
346
|
-
// 渲染所有列
|
|
347
|
-
visibleColumn: [],
|
|
348
|
-
// 全量数据集(包括当前和已删除)
|
|
349
|
-
fullAllDataRowIdData: {},
|
|
350
|
-
// 数据集(仅当前)
|
|
351
|
-
fullDataRowIdData: {},
|
|
352
|
-
// 数据集(仅可视)
|
|
353
|
-
visibleDataRowIdData: {},
|
|
354
|
-
// 渲染中缓存数据
|
|
355
|
-
sourceDataRowIdData: {},
|
|
356
|
-
fullColumnIdData: {},
|
|
357
|
-
fullColumnFieldData: {},
|
|
358
|
-
// 合并单元格的数据
|
|
359
|
-
mergeBodyList: [],
|
|
360
|
-
mergeBodyMaps: {},
|
|
361
|
-
// 合并表尾的数据
|
|
362
|
-
mergeFooterList: [],
|
|
363
|
-
mergeFooterMaps: {},
|
|
364
|
-
// 已合并单元格数据集合
|
|
365
|
-
mergeBodyCellMaps: {},
|
|
366
|
-
// 已合并表尾数据集合
|
|
367
|
-
mergeFooterCellMaps: {},
|
|
368
|
-
// 已展开的行集合
|
|
369
|
-
rowExpandedMaps: {},
|
|
370
|
-
// 懒加载中的展开行的集合
|
|
371
|
-
rowExpandLazyLoadedMaps: {},
|
|
372
|
-
// 已展开的分组行
|
|
373
|
-
rowGroupExpandedMaps: {},
|
|
374
|
-
// 已展开树节点集合
|
|
375
|
-
treeExpandedMaps: {},
|
|
376
|
-
// 懒加载中的树节点的集合
|
|
377
|
-
treeExpandLazyLoadedMaps: {},
|
|
378
|
-
// 复选框属性,已选中的行集合
|
|
379
|
-
selectCheckboxMaps: {},
|
|
380
|
-
// 已标记的对象集
|
|
381
|
-
pendingRowMaps: {},
|
|
382
|
-
// 已新增的临时行
|
|
383
|
-
insertRowMaps: {},
|
|
384
|
-
// 已删除行
|
|
385
|
-
removeRowMaps: {},
|
|
386
|
-
cvCacheMaps: {},
|
|
387
|
-
inited: false,
|
|
388
|
-
tooltipTimeout: null,
|
|
389
|
-
initStatus: false,
|
|
390
|
-
isActivated: false
|
|
391
|
-
};
|
|
278
|
+
const internalData = createInternalData();
|
|
392
279
|
let tableMethods = {};
|
|
393
280
|
let tablePrivateMethods = {};
|
|
394
281
|
const refElem = ref();
|
|
@@ -1863,12 +1750,17 @@ export default defineVxeComponent({
|
|
|
1863
1750
|
const calcCellAutoHeight = (rowRest, wrapperEl) => {
|
|
1864
1751
|
const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
|
|
1865
1752
|
let colHeight = rowRest.height;
|
|
1753
|
+
let firstCellStyle = null;
|
|
1754
|
+
let topBottomPadding = 0;
|
|
1866
1755
|
for (let i = 0; i < cellElemList.length; i++) {
|
|
1867
|
-
const
|
|
1868
|
-
const
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1756
|
+
const wrapperElem = cellElemList[i];
|
|
1757
|
+
const cellElem = wrapperElem.parentElement;
|
|
1758
|
+
if (!firstCellStyle) {
|
|
1759
|
+
firstCellStyle = getComputedStyle(cellElem);
|
|
1760
|
+
topBottomPadding = firstCellStyle ? Math.ceil(XEUtils.toNumber(firstCellStyle.paddingTop) + XEUtils.toNumber(firstCellStyle.paddingBottom)) : 0;
|
|
1761
|
+
}
|
|
1762
|
+
const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0;
|
|
1763
|
+
colHeight = Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding));
|
|
1872
1764
|
}
|
|
1873
1765
|
return colHeight;
|
|
1874
1766
|
};
|
|
@@ -3377,9 +3269,7 @@ export default defineVxeComponent({
|
|
|
3377
3269
|
internalData.cvCacheMaps = {};
|
|
3378
3270
|
reactData.isRowLoading = true;
|
|
3379
3271
|
reactData.scrollVMLoading = false;
|
|
3380
|
-
// internalData.treeExpandedMaps = {}
|
|
3381
3272
|
reactData.treeExpandedFlag++;
|
|
3382
|
-
// internalData.rowExpandedMaps = {}
|
|
3383
3273
|
reactData.rowExpandedFlag++;
|
|
3384
3274
|
internalData.insertRowMaps = {};
|
|
3385
3275
|
reactData.insertRowFlag++;
|
|
@@ -5305,6 +5195,25 @@ export default defineVxeComponent({
|
|
|
5305
5195
|
});
|
|
5306
5196
|
return rest;
|
|
5307
5197
|
},
|
|
5198
|
+
recalcRowHeight(rowOrId) {
|
|
5199
|
+
const { fullAllDataRowIdData } = internalData;
|
|
5200
|
+
const rows = XEUtils.isArray(rowOrId) ? rowOrId : [rowOrId];
|
|
5201
|
+
const el = refElem.value;
|
|
5202
|
+
if (el) {
|
|
5203
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
5204
|
+
el.setAttribute('data-calc-row', 'Y');
|
|
5205
|
+
rows.forEach(row => {
|
|
5206
|
+
const rowid = XEUtils.isString(row) || XEUtils.isNumber(row) ? row : handleGetRowId(row);
|
|
5207
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
5208
|
+
if (rowRest) {
|
|
5209
|
+
rowRest.resizeHeight = calcCellAutoHeight(rowRest, el);
|
|
5210
|
+
}
|
|
5211
|
+
el.removeAttribute('data-calc-row');
|
|
5212
|
+
});
|
|
5213
|
+
reactData.calcCellHeightFlag++;
|
|
5214
|
+
}
|
|
5215
|
+
return nextTick();
|
|
5216
|
+
},
|
|
5308
5217
|
setRowHeight(rowOrId, height) {
|
|
5309
5218
|
const { fullAllDataRowIdData } = internalData;
|
|
5310
5219
|
let status = false;
|
|
@@ -8288,6 +8197,7 @@ export default defineVxeComponent({
|
|
|
8288
8197
|
evnt.stopPropagation();
|
|
8289
8198
|
evnt.preventDefault();
|
|
8290
8199
|
const { row } = params;
|
|
8200
|
+
const { showOverflow } = props;
|
|
8291
8201
|
const { overflowX, scrollbarWidth, overflowY, scrollbarHeight } = reactData;
|
|
8292
8202
|
const { elemStore, fullAllDataRowIdData } = internalData;
|
|
8293
8203
|
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
@@ -8316,7 +8226,10 @@ export default defineVxeComponent({
|
|
|
8316
8226
|
return;
|
|
8317
8227
|
}
|
|
8318
8228
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
8319
|
-
|
|
8229
|
+
let currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
8230
|
+
if (!showOverflow) {
|
|
8231
|
+
currCellHeight = tdEl.clientHeight;
|
|
8232
|
+
}
|
|
8320
8233
|
const tableRect = tableEl.getBoundingClientRect();
|
|
8321
8234
|
const trRect = trEl.getBoundingClientRect();
|
|
8322
8235
|
const targetOffsetY = dragClientY - trRect.y - trEl.clientHeight;
|
|
@@ -11703,7 +11616,7 @@ export default defineVxeComponent({
|
|
|
11703
11616
|
if (value && value.length >= 50000) {
|
|
11704
11617
|
warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)']);
|
|
11705
11618
|
}
|
|
11706
|
-
loadTableData(value,
|
|
11619
|
+
loadTableData(value, true).then(() => {
|
|
11707
11620
|
const { scrollXLoad, scrollYLoad, expandColumn } = reactData;
|
|
11708
11621
|
const expandOpts = computeExpandOpts.value;
|
|
11709
11622
|
internalData.inited = true;
|
|
@@ -11752,28 +11665,22 @@ export default defineVxeComponent({
|
|
|
11752
11665
|
tableMethods.refreshColumn();
|
|
11753
11666
|
});
|
|
11754
11667
|
});
|
|
11755
|
-
const
|
|
11668
|
+
const reLayoutFlag = ref(0);
|
|
11756
11669
|
watch(computeSize, () => {
|
|
11757
|
-
|
|
11670
|
+
reLayoutFlag.value++;
|
|
11758
11671
|
});
|
|
11759
11672
|
watch(() => props.showHeader, () => {
|
|
11760
|
-
|
|
11673
|
+
reLayoutFlag.value++;
|
|
11761
11674
|
});
|
|
11762
11675
|
watch(() => props.showFooter, () => {
|
|
11763
|
-
|
|
11676
|
+
reLayoutFlag.value++;
|
|
11764
11677
|
});
|
|
11765
11678
|
watch(() => reactData.overflowX, () => {
|
|
11766
|
-
|
|
11679
|
+
reLayoutFlag.value++;
|
|
11767
11680
|
});
|
|
11768
11681
|
watch(() => reactData.overflowY, () => {
|
|
11769
|
-
|
|
11770
|
-
});
|
|
11771
|
-
watch(reScrollFlag, () => {
|
|
11772
|
-
nextTick(() => {
|
|
11773
|
-
tableMethods.recalculate(true).then(() => tableMethods.refreshScroll());
|
|
11774
|
-
});
|
|
11682
|
+
reLayoutFlag.value++;
|
|
11775
11683
|
});
|
|
11776
|
-
const reLayoutFlag = ref(0);
|
|
11777
11684
|
watch(() => props.height, () => {
|
|
11778
11685
|
reLayoutFlag.value++;
|
|
11779
11686
|
});
|
|
@@ -11790,7 +11697,7 @@ export default defineVxeComponent({
|
|
|
11790
11697
|
reLayoutFlag.value++;
|
|
11791
11698
|
});
|
|
11792
11699
|
watch(reLayoutFlag, () => {
|
|
11793
|
-
|
|
11700
|
+
$xeTable.recalculate(true);
|
|
11794
11701
|
});
|
|
11795
11702
|
const footFlag = ref(0);
|
|
11796
11703
|
watch(() => props.footerData ? props.footerData.length : -1, () => {
|
|
@@ -11800,7 +11707,7 @@ export default defineVxeComponent({
|
|
|
11800
11707
|
footFlag.value++;
|
|
11801
11708
|
});
|
|
11802
11709
|
watch(footFlag, () => {
|
|
11803
|
-
|
|
11710
|
+
$xeTable.updateFooter();
|
|
11804
11711
|
});
|
|
11805
11712
|
watch(() => props.syncResize, (value) => {
|
|
11806
11713
|
if (value) {
|
|
@@ -12134,9 +12041,6 @@ export default defineVxeComponent({
|
|
|
12134
12041
|
if ($xeTable.closeMenu) {
|
|
12135
12042
|
$xeTable.closeMenu();
|
|
12136
12043
|
}
|
|
12137
|
-
tablePrivateMethods.preventEvent(null, 'beforeUnmount', { $table: $xeTable });
|
|
12138
|
-
});
|
|
12139
|
-
onUnmounted(() => {
|
|
12140
12044
|
globalEvents.off($xeTable, 'paste');
|
|
12141
12045
|
globalEvents.off($xeTable, 'copy');
|
|
12142
12046
|
globalEvents.off($xeTable, 'cut');
|
|
@@ -12146,7 +12050,11 @@ export default defineVxeComponent({
|
|
|
12146
12050
|
globalEvents.off($xeTable, 'keydown');
|
|
12147
12051
|
globalEvents.off($xeTable, 'resize');
|
|
12148
12052
|
globalEvents.off($xeTable, 'contextmenu');
|
|
12053
|
+
tablePrivateMethods.preventEvent(null, 'beforeUnmount', { $table: $xeTable });
|
|
12054
|
+
});
|
|
12055
|
+
onUnmounted(() => {
|
|
12149
12056
|
tablePrivateMethods.preventEvent(null, 'unmounted', { $table: $xeTable });
|
|
12057
|
+
XEUtils.assign(internalData, createInternalData());
|
|
12150
12058
|
});
|
|
12151
12059
|
nextTick(() => {
|
|
12152
12060
|
if (props.loading) {
|
package/es/table/src/util.js
CHANGED
|
@@ -3,6 +3,122 @@ import XEUtils from 'xe-utils';
|
|
|
3
3
|
import { ColumnInfo } from './columnInfo';
|
|
4
4
|
import { isPx, isScale, queryElement } from '../../ui/src/dom';
|
|
5
5
|
import { eqEmptyValue } from '../../ui/src/utils';
|
|
6
|
+
export function createInternalData() {
|
|
7
|
+
return {
|
|
8
|
+
tZindex: 0,
|
|
9
|
+
currKeyField: '',
|
|
10
|
+
isCurrDeepKey: false,
|
|
11
|
+
elemStore: {},
|
|
12
|
+
// 存放横向 X 虚拟滚动相关的信息
|
|
13
|
+
scrollXStore: {
|
|
14
|
+
preloadSize: 0,
|
|
15
|
+
offsetSize: 0,
|
|
16
|
+
visibleSize: 0,
|
|
17
|
+
visibleStartIndex: 0,
|
|
18
|
+
visibleEndIndex: 0,
|
|
19
|
+
startIndex: 0,
|
|
20
|
+
endIndex: 0
|
|
21
|
+
},
|
|
22
|
+
// 存放纵向 Y 虚拟滚动相关信息
|
|
23
|
+
scrollYStore: {
|
|
24
|
+
preloadSize: 0,
|
|
25
|
+
offsetSize: 0,
|
|
26
|
+
visibleSize: 0,
|
|
27
|
+
visibleStartIndex: 0,
|
|
28
|
+
visibleEndIndex: 0,
|
|
29
|
+
startIndex: 0,
|
|
30
|
+
endIndex: 0
|
|
31
|
+
},
|
|
32
|
+
// 表格宽度
|
|
33
|
+
tableWidth: 0,
|
|
34
|
+
// 表格高度
|
|
35
|
+
tableHeight: 0,
|
|
36
|
+
// 表头高度
|
|
37
|
+
headerHeight: 0,
|
|
38
|
+
// 表尾高度
|
|
39
|
+
footerHeight: 0,
|
|
40
|
+
customHeight: 0,
|
|
41
|
+
customMinHeight: 0,
|
|
42
|
+
customMaxHeight: 0,
|
|
43
|
+
// 当前 hover 行
|
|
44
|
+
hoverRow: null,
|
|
45
|
+
// 最后滚动位置
|
|
46
|
+
lastScrollLeft: 0,
|
|
47
|
+
lastScrollTop: 0,
|
|
48
|
+
// 单选框属性,已选中保留的行
|
|
49
|
+
radioReserveRow: null,
|
|
50
|
+
// 复选框属性,已选中保留的行集合
|
|
51
|
+
checkboxReserveRowMap: {},
|
|
52
|
+
// 行数据,已展开保留的行集合
|
|
53
|
+
rowExpandedReserveRowMap: {},
|
|
54
|
+
// 树结构数据,已展开保留的行集合
|
|
55
|
+
treeExpandedReserveRowMap: {},
|
|
56
|
+
// 树结构数据,不确定状态的集合
|
|
57
|
+
treeIndeterminateRowMaps: {},
|
|
58
|
+
// 列表完整数据、条件处理后
|
|
59
|
+
tableFullData: [],
|
|
60
|
+
afterFullData: [],
|
|
61
|
+
afterTreeFullData: [],
|
|
62
|
+
afterGroupFullData: [],
|
|
63
|
+
// 列表条件处理后数据集合
|
|
64
|
+
afterFullRowMaps: {},
|
|
65
|
+
// 树结构完整数据、条件处理后
|
|
66
|
+
tableFullTreeData: [],
|
|
67
|
+
// 行分组全量数据、条件处理后
|
|
68
|
+
tableFullGroupData: [],
|
|
69
|
+
tableSynchData: [],
|
|
70
|
+
tableSourceData: [],
|
|
71
|
+
// 收集的列配置(带分组)
|
|
72
|
+
collectColumn: [],
|
|
73
|
+
// 完整所有列(不带分组)
|
|
74
|
+
tableFullColumn: [],
|
|
75
|
+
// 渲染所有列
|
|
76
|
+
visibleColumn: [],
|
|
77
|
+
// 全量数据集(包括当前和已删除)
|
|
78
|
+
fullAllDataRowIdData: {},
|
|
79
|
+
// 数据集(仅当前)
|
|
80
|
+
fullDataRowIdData: {},
|
|
81
|
+
// 数据集(仅可视)
|
|
82
|
+
visibleDataRowIdData: {},
|
|
83
|
+
// 渲染中缓存数据
|
|
84
|
+
sourceDataRowIdData: {},
|
|
85
|
+
fullColumnIdData: {},
|
|
86
|
+
fullColumnFieldData: {},
|
|
87
|
+
// 合并单元格的数据
|
|
88
|
+
mergeBodyList: [],
|
|
89
|
+
mergeBodyMaps: {},
|
|
90
|
+
// 合并表尾的数据
|
|
91
|
+
mergeFooterList: [],
|
|
92
|
+
mergeFooterMaps: {},
|
|
93
|
+
// 已合并单元格数据集合
|
|
94
|
+
mergeBodyCellMaps: {},
|
|
95
|
+
// 已合并表尾数据集合
|
|
96
|
+
mergeFooterCellMaps: {},
|
|
97
|
+
// 已展开的行集合
|
|
98
|
+
rowExpandedMaps: {},
|
|
99
|
+
// 懒加载中的展开行的集合
|
|
100
|
+
rowExpandLazyLoadedMaps: {},
|
|
101
|
+
// 已展开的分组行
|
|
102
|
+
rowGroupExpandedMaps: {},
|
|
103
|
+
// 已展开树节点集合
|
|
104
|
+
treeExpandedMaps: {},
|
|
105
|
+
// 懒加载中的树节点的集合
|
|
106
|
+
treeExpandLazyLoadedMaps: {},
|
|
107
|
+
// 复选框属性,已选中的行集合
|
|
108
|
+
selectCheckboxMaps: {},
|
|
109
|
+
// 已标记的对象集
|
|
110
|
+
pendingRowMaps: {},
|
|
111
|
+
// 已新增的临时行
|
|
112
|
+
insertRowMaps: {},
|
|
113
|
+
// 已删除行
|
|
114
|
+
removeRowMaps: {},
|
|
115
|
+
cvCacheMaps: {},
|
|
116
|
+
inited: false,
|
|
117
|
+
tooltipTimeout: null,
|
|
118
|
+
initStatus: false,
|
|
119
|
+
isActivated: false
|
|
120
|
+
};
|
|
121
|
+
}
|
|
6
122
|
const getAllConvertColumns = (columns, parentColumn) => {
|
|
7
123
|
const result = [];
|
|
8
124
|
columns.forEach((column) => {
|
|
@@ -488,18 +604,9 @@ export function rowToVisible($xeTable, row) {
|
|
|
488
604
|
if (!isCustomCellHeight && showOverflow) {
|
|
489
605
|
return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * defaultRowHeight);
|
|
490
606
|
}
|
|
491
|
-
let scrollTop = 0;
|
|
492
607
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
493
608
|
const rHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
494
|
-
|
|
495
|
-
const currRow = afterFullData[i];
|
|
496
|
-
const currRowid = getRowid($xeTable, currRow);
|
|
497
|
-
if (currRow === row || currRowid === rowid) {
|
|
498
|
-
break;
|
|
499
|
-
}
|
|
500
|
-
const currRowRest = fullAllDataRowIdData[currRowid] || {};
|
|
501
|
-
scrollTop += currRowRest.resizeHeight || cellOpts.height || rowOpts.height || currRowRest.height || defaultRowHeight;
|
|
502
|
-
}
|
|
609
|
+
const scrollTop = rowRest.oTop;
|
|
503
610
|
if (scrollTop < bodyScrollTop) {
|
|
504
611
|
return $xeTable.scrollTo(null, scrollTop - leftFixedWidth - 1);
|
|
505
612
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { h, ref, computed, inject, createCommentVNode, reactive, nextTick } from 'vue';
|
|
1
|
+
import { h, ref, computed, inject, createCommentVNode, reactive, nextTick, onUnmounted } from 'vue';
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp';
|
|
3
3
|
import XEUtils from 'xe-utils';
|
|
4
4
|
import { VxeUI } from '../../ui';
|
|
5
5
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
6
6
|
import { warnLog, errLog } from '../../ui/src/log';
|
|
7
7
|
const { getConfig, getIcon, getI18n, renderer, commands, createEvent, useFns } = VxeUI;
|
|
8
|
+
function createInternalData() {
|
|
9
|
+
return {
|
|
10
|
+
connectTable: null
|
|
11
|
+
};
|
|
12
|
+
}
|
|
8
13
|
export default defineVxeComponent({
|
|
9
14
|
name: 'VxeToolbar',
|
|
10
15
|
props: {
|
|
@@ -54,9 +59,7 @@ export default defineVxeComponent({
|
|
|
54
59
|
connectFlag: 0,
|
|
55
60
|
columns: []
|
|
56
61
|
});
|
|
57
|
-
const internalData =
|
|
58
|
-
connectTable: null
|
|
59
|
-
};
|
|
62
|
+
const internalData = createInternalData();
|
|
60
63
|
const refElem = ref();
|
|
61
64
|
const refMaps = {
|
|
62
65
|
refElem
|
|
@@ -643,6 +646,9 @@ export default defineVxeComponent({
|
|
|
643
646
|
}
|
|
644
647
|
}
|
|
645
648
|
});
|
|
649
|
+
onUnmounted(() => {
|
|
650
|
+
XEUtils.assign(internalData, createInternalData());
|
|
651
|
+
});
|
|
646
652
|
return $xeToolbar;
|
|
647
653
|
},
|
|
648
654
|
render() {
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
package/lib/grid/src/grid.js
CHANGED
|
@@ -29,8 +29,13 @@ const {
|
|
|
29
29
|
renderEmptyElement
|
|
30
30
|
} = _ui.VxeUI;
|
|
31
31
|
const tableComponentPropKeys = Object.keys(_props.default);
|
|
32
|
-
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'setFilterByEvent', 'sort', 'setSort', 'setSortByEvent', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'setRowGroupExpand', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect'];
|
|
32
|
+
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'recalcRowHeight', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'setFilterByEvent', 'sort', 'setSort', 'setSortByEvent', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'setRowGroupExpand', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect'];
|
|
33
33
|
const gridComponentEmits = [..._emits.default, 'page-change', 'form-submit', 'form-submit-invalid', 'form-reset', 'form-collapse', 'form-toggle-collapse', 'proxy-query', 'proxy-delete', 'proxy-save', 'toolbar-button-click', 'toolbar-tool-click', 'zoom'];
|
|
34
|
+
function createInternalData() {
|
|
35
|
+
return {
|
|
36
|
+
connectTable: null
|
|
37
|
+
};
|
|
38
|
+
}
|
|
34
39
|
var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
35
40
|
name: 'VxeGrid',
|
|
36
41
|
props: Object.assign(Object.assign({}, _props.default), {
|
|
@@ -76,6 +81,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
76
81
|
currentPage: 1
|
|
77
82
|
}
|
|
78
83
|
});
|
|
84
|
+
const internalData = createInternalData();
|
|
79
85
|
const refElem = (0, _vue.ref)();
|
|
80
86
|
const refTable = (0, _vue.ref)();
|
|
81
87
|
const refForm = (0, _vue.ref)();
|
|
@@ -275,6 +281,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
275
281
|
props: props,
|
|
276
282
|
context,
|
|
277
283
|
reactData,
|
|
284
|
+
internalData,
|
|
278
285
|
getRefMaps: () => refMaps,
|
|
279
286
|
getComputeMaps: () => computeMaps
|
|
280
287
|
};
|
|
@@ -1737,6 +1744,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1737
1744
|
});
|
|
1738
1745
|
(0, _vue.onUnmounted)(() => {
|
|
1739
1746
|
globalEvents.off($xeGrid, 'keydown');
|
|
1747
|
+
_xeUtils.default.assign(internalData, createInternalData());
|
|
1740
1748
|
});
|
|
1741
1749
|
$xeGrid.renderVN = renderVN;
|
|
1742
1750
|
(0, _vue.provide)('$xeGrid', $xeGrid);
|