vxe-table 4.11.14 → 4.12.0-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.
Files changed (128) hide show
  1. package/README.md +4 -3
  2. package/es/grid/src/grid.js +20 -13
  3. package/es/locale/lang/ar-EG.js +1 -0
  4. package/es/locale/lang/de-DE.js +1 -0
  5. package/es/locale/lang/en-US.js +3 -2
  6. package/es/locale/lang/es-ES.js +1 -0
  7. package/es/locale/lang/fr-FR.js +1 -0
  8. package/es/locale/lang/hu-HU.js +1 -0
  9. package/es/locale/lang/hy-AM.js +1 -0
  10. package/es/locale/lang/id-ID.js +1 -0
  11. package/es/locale/lang/it-IT.js +1 -0
  12. package/es/locale/lang/ja-JP.js +1 -0
  13. package/es/locale/lang/ko-KR.js +1 -0
  14. package/es/locale/lang/nb-NO.js +1 -0
  15. package/es/locale/lang/pt-BR.js +1 -0
  16. package/es/locale/lang/ru-RU.js +1 -0
  17. package/es/locale/lang/th-TH.js +1 -0
  18. package/es/locale/lang/ug-CN.js +1 -0
  19. package/es/locale/lang/uk-UA.js +1 -0
  20. package/es/locale/lang/vi-VN.js +1 -0
  21. package/es/locale/lang/zh-CHT.js +1 -0
  22. package/es/locale/lang/zh-CN.js +1 -0
  23. package/es/style.css +1 -1
  24. package/es/table/module/custom/panel.js +18 -16
  25. package/es/table/module/edit/hook.js +3 -1
  26. package/es/table/src/cell.js +3 -2
  27. package/es/table/src/table.js +401 -291
  28. package/es/ui/index.js +5 -5
  29. package/es/ui/src/log.js +1 -1
  30. package/lib/grid/src/grid.js +20 -14
  31. package/lib/grid/src/grid.min.js +1 -1
  32. package/lib/index.umd.js +2281 -2064
  33. package/lib/index.umd.min.js +1 -1
  34. package/lib/locale/lang/ar-EG.js +1 -0
  35. package/lib/locale/lang/ar-EG.min.js +1 -1
  36. package/lib/locale/lang/de-DE.js +1 -0
  37. package/lib/locale/lang/de-DE.min.js +1 -1
  38. package/lib/locale/lang/en-US.js +3 -2
  39. package/lib/locale/lang/en-US.min.js +1 -1
  40. package/lib/locale/lang/en-US.umd.js +3 -2
  41. package/lib/locale/lang/es-ES.js +1 -0
  42. package/lib/locale/lang/es-ES.min.js +1 -1
  43. package/lib/locale/lang/es-ES.umd.js +1 -0
  44. package/lib/locale/lang/fr-FR.js +1 -0
  45. package/lib/locale/lang/fr-FR.min.js +1 -1
  46. package/lib/locale/lang/hu-HU.js +1 -0
  47. package/lib/locale/lang/hu-HU.min.js +1 -1
  48. package/lib/locale/lang/hu-HU.umd.js +1 -0
  49. package/lib/locale/lang/hy-AM.js +1 -0
  50. package/lib/locale/lang/hy-AM.min.js +1 -1
  51. package/lib/locale/lang/id-ID.js +1 -0
  52. package/lib/locale/lang/id-ID.min.js +1 -1
  53. package/lib/locale/lang/it-IT.js +1 -0
  54. package/lib/locale/lang/it-IT.min.js +1 -1
  55. package/lib/locale/lang/ja-JP.js +1 -0
  56. package/lib/locale/lang/ja-JP.min.js +1 -1
  57. package/lib/locale/lang/ja-JP.umd.js +1 -0
  58. package/lib/locale/lang/ko-KR.js +1 -0
  59. package/lib/locale/lang/ko-KR.min.js +1 -1
  60. package/lib/locale/lang/ko-KR.umd.js +1 -0
  61. package/lib/locale/lang/nb-NO.js +1 -0
  62. package/lib/locale/lang/nb-NO.min.js +1 -1
  63. package/lib/locale/lang/pt-BR.js +1 -0
  64. package/lib/locale/lang/pt-BR.min.js +1 -1
  65. package/lib/locale/lang/pt-BR.umd.js +1 -0
  66. package/lib/locale/lang/ru-RU.js +1 -0
  67. package/lib/locale/lang/ru-RU.min.js +1 -1
  68. package/lib/locale/lang/ru-RU.umd.js +1 -0
  69. package/lib/locale/lang/th-TH.js +1 -0
  70. package/lib/locale/lang/th-TH.min.js +1 -1
  71. package/lib/locale/lang/ug-CN.js +1 -0
  72. package/lib/locale/lang/ug-CN.min.js +1 -1
  73. package/lib/locale/lang/uk-UA.js +1 -0
  74. package/lib/locale/lang/uk-UA.min.js +1 -1
  75. package/lib/locale/lang/uk-UA.umd.js +1 -0
  76. package/lib/locale/lang/vi-VN.js +1 -0
  77. package/lib/locale/lang/vi-VN.min.js +1 -1
  78. package/lib/locale/lang/zh-CHT.js +1 -0
  79. package/lib/locale/lang/zh-CHT.min.js +1 -1
  80. package/lib/locale/lang/zh-CN.js +1 -0
  81. package/lib/locale/lang/zh-CN.min.js +1 -1
  82. package/lib/locale/lang/zh-CN.umd.js +1 -0
  83. package/lib/style.css +1 -1
  84. package/lib/table/module/custom/panel.js +18 -16
  85. package/lib/table/module/custom/panel.min.js +1 -1
  86. package/lib/table/module/edit/hook.js +3 -1
  87. package/lib/table/module/edit/hook.min.js +1 -1
  88. package/lib/table/src/cell.js +4 -2
  89. package/lib/table/src/cell.min.js +1 -1
  90. package/lib/table/src/table.js +413 -295
  91. package/lib/table/src/table.min.js +1 -1
  92. package/lib/ui/index.js +5 -5
  93. package/lib/ui/index.min.js +1 -1
  94. package/lib/ui/src/log.js +1 -1
  95. package/lib/ui/src/log.min.js +1 -1
  96. package/package.json +2 -2
  97. package/packages/grid/src/grid.ts +20 -13
  98. package/packages/locale/lang/ar-EG.ts +1 -0
  99. package/packages/locale/lang/de-DE.ts +1 -0
  100. package/packages/locale/lang/en-US.ts +3 -2
  101. package/packages/locale/lang/es-ES.ts +1 -0
  102. package/packages/locale/lang/fr-FR.ts +1 -0
  103. package/packages/locale/lang/hu-HU.ts +1 -0
  104. package/packages/locale/lang/hy-AM.ts +1 -0
  105. package/packages/locale/lang/id-ID.ts +1 -0
  106. package/packages/locale/lang/it-IT.ts +1 -0
  107. package/packages/locale/lang/ja-JP.ts +1 -0
  108. package/packages/locale/lang/ko-KR.ts +1 -0
  109. package/packages/locale/lang/nb-NO.ts +1 -0
  110. package/packages/locale/lang/pt-BR.ts +1 -0
  111. package/packages/locale/lang/ru-RU.ts +1 -0
  112. package/packages/locale/lang/th-TH.ts +1 -0
  113. package/packages/locale/lang/ug-CN.ts +1 -0
  114. package/packages/locale/lang/uk-UA.ts +1 -0
  115. package/packages/locale/lang/vi-VN.ts +1 -0
  116. package/packages/locale/lang/zh-CHT.ts +1 -0
  117. package/packages/locale/lang/zh-CN.ts +1 -0
  118. package/packages/table/module/custom/panel.ts +18 -16
  119. package/packages/table/module/edit/hook.ts +3 -1
  120. package/packages/table/src/cell.ts +3 -2
  121. package/packages/table/src/table.ts +406 -292
  122. package/packages/ui/index.ts +4 -4
  123. /package/es/{iconfont.1740640573077.ttf → iconfont.1740732137800.ttf} +0 -0
  124. /package/es/{iconfont.1740640573077.woff → iconfont.1740732137800.woff} +0 -0
  125. /package/es/{iconfont.1740640573077.woff2 → iconfont.1740732137800.woff2} +0 -0
  126. /package/lib/{iconfont.1740640573077.ttf → iconfont.1740732137800.ttf} +0 -0
  127. /package/lib/{iconfont.1740640573077.woff → iconfont.1740732137800.woff} +0 -0
  128. /package/lib/{iconfont.1740640573077.woff2 → iconfont.1740732137800.woff2} +0 -0
@@ -19,6 +19,8 @@ import TableExportPanelComponent from '../module/export/export-panel';
19
19
  import TableMenuPanelComponent from '../module/menu/panel';
20
20
  const { getConfig, getIcon, getI18n, renderer, formats, createEvent, globalResize, interceptor, hooks, globalEvents, GLOBAL_EVENT_KEYS, useFns, renderEmptyElement } = VxeUI;
21
21
  const customStorageKey = 'VXE_CUSTOM_STORE';
22
+ const maxYHeight = 5e6;
23
+ const maxXWidth = 5e6;
22
24
  export default defineComponent({
23
25
  name: 'VxeTable',
24
26
  props: tableProps,
@@ -840,27 +842,42 @@ export default defineComponent({
840
842
  return reserveList;
841
843
  };
842
844
  const handleVirtualXVisible = () => {
843
- const { elemStore, visibleColumn } = internalData;
845
+ const { isScrollXBig, scrollXWidth } = reactData;
846
+ const { elemStore, visibleColumn, fullColumnIdData } = internalData;
844
847
  const leftFixedWidth = computeLeftFixedWidth.value;
845
848
  const rightFixedWidth = computeRightFixedWidth.value;
846
849
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
847
850
  if (bodyScrollElem) {
848
- const { scrollLeft, clientWidth } = bodyScrollElem;
849
- const startWidth = scrollLeft + leftFixedWidth;
850
- const endWidth = scrollLeft + clientWidth - rightFixedWidth;
851
- let toVisibleIndex = -1;
852
- let cWidth = 0;
853
- let visibleSize = 0;
854
- for (let colIndex = 0, colLen = visibleColumn.length; colIndex < colLen; colIndex++) {
855
- cWidth += visibleColumn[colIndex].renderWidth;
856
- if (toVisibleIndex === -1 && startWidth < cWidth) {
857
- toVisibleIndex = colIndex;
851
+ const clientWidth = bodyScrollElem.clientWidth;
852
+ let scrollLeft = bodyScrollElem.scrollLeft;
853
+ if (isScrollXBig) {
854
+ scrollLeft = Math.ceil((scrollXWidth - clientWidth) * Math.min(1, (scrollLeft / (maxXWidth - clientWidth))));
855
+ }
856
+ const startLeft = scrollLeft + leftFixedWidth;
857
+ const endLeft = scrollLeft + clientWidth - rightFixedWidth;
858
+ let leftIndex = 0;
859
+ let rightIndex = visibleColumn.length;
860
+ while (leftIndex < rightIndex) {
861
+ const cIndex = Math.floor((leftIndex + rightIndex) / 2);
862
+ const column = visibleColumn[cIndex];
863
+ const colid = column.id;
864
+ const colRest = fullColumnIdData[colid] || {};
865
+ if (colRest.oLeft <= startLeft) {
866
+ leftIndex = cIndex + 1;
858
867
  }
859
- if (toVisibleIndex >= 0) {
860
- visibleSize++;
861
- if (cWidth > endWidth) {
862
- break;
863
- }
868
+ else {
869
+ rightIndex = cIndex;
870
+ }
871
+ }
872
+ let visibleSize = 0;
873
+ const toVisibleIndex = Math.max(0, leftIndex < visibleColumn.length ? leftIndex - 2 : 0);
874
+ for (let cIndex = toVisibleIndex, cLen = visibleColumn.length; cIndex < cLen; cIndex++) {
875
+ const column = visibleColumn[cIndex];
876
+ const colid = column.id;
877
+ const colRest = fullColumnIdData[colid] || {};
878
+ visibleSize++;
879
+ if (colRest.oLeft > endLeft || visibleSize >= 60) {
880
+ break;
864
881
  }
865
882
  }
866
883
  return { toVisibleIndex: Math.max(0, toVisibleIndex), visibleSize: Math.max(1, visibleSize) };
@@ -902,44 +919,51 @@ export default defineComponent({
902
919
  // 最低支持 18px 行高
903
920
  return Math.max(18, rowHeight);
904
921
  };
905
- const handleVirtualYVisible = (currScrollTop) => {
906
- const { isAllOverflow, expandColumn, rowExpandedMaps } = reactData;
922
+ const handleVirtualYVisible = () => {
923
+ const { isAllOverflow, expandColumn, isScrollYBig, scrollYHeight } = reactData;
907
924
  const { elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData } = internalData;
908
- const expandOpts = computeExpandOpts.value;
909
925
  const rowOpts = computeRowOpts.value;
910
926
  const cellOpts = computeCellOpts.value;
911
927
  const defaultRowHeight = computeDefaultRowHeight.value;
912
928
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
913
929
  if (bodyScrollElem) {
914
930
  const clientHeight = bodyScrollElem.clientHeight;
915
- const scrollTop = XEUtils.isNumber(currScrollTop) ? currScrollTop : bodyScrollElem.scrollTop;
916
- const endHeight = scrollTop + clientHeight;
931
+ let scrollTop = bodyScrollElem.scrollTop;
932
+ if (isScrollYBig) {
933
+ scrollTop = Math.ceil((scrollYHeight - clientHeight) * Math.min(1, (scrollTop / (maxYHeight - clientHeight))));
934
+ }
935
+ const startTop = scrollTop;
936
+ const endTop = scrollTop + clientHeight;
917
937
  let toVisibleIndex = -1;
918
- let offsetTop = 0;
919
938
  let visibleSize = 0;
920
939
  const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
921
940
  if (!isCustomCellHeight && !expandColumn && isAllOverflow) {
922
- toVisibleIndex = Math.floor(scrollTop / defaultRowHeight);
941
+ toVisibleIndex = Math.floor(startTop / defaultRowHeight) - 1;
923
942
  visibleSize = Math.ceil(clientHeight / defaultRowHeight) + 1;
924
943
  }
925
944
  else {
926
- for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
945
+ let leftIndex = 0;
946
+ let rightIndex = afterFullData.length;
947
+ while (leftIndex < rightIndex) {
948
+ const rIndex = Math.floor((leftIndex + rightIndex) / 2);
927
949
  const row = afterFullData[rIndex];
928
950
  const rowid = getRowid($xeTable, row);
929
951
  const rowRest = fullAllDataRowIdData[rowid] || {};
930
- offsetTop += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
931
- if (toVisibleIndex === -1 && scrollTop < offsetTop) {
932
- toVisibleIndex = rIndex;
933
- }
934
- if (toVisibleIndex >= 0) {
935
- visibleSize++;
936
- if (offsetTop > endHeight) {
937
- break;
938
- }
952
+ if (rowRest.oTop <= startTop) {
953
+ leftIndex = rIndex + 1;
939
954
  }
940
- // 是否展开行
941
- if (expandColumn && rowExpandedMaps[rowid]) {
942
- offsetTop += rowRest.expandHeight || expandOpts.height || 0;
955
+ else {
956
+ rightIndex = rIndex;
957
+ }
958
+ }
959
+ toVisibleIndex = Math.max(0, leftIndex < afterFullData.length ? leftIndex - 2 : 0);
960
+ for (let rIndex = toVisibleIndex, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
961
+ const row = afterFullData[rIndex];
962
+ const rowid = getRowid($xeTable, row);
963
+ const rowRest = fullAllDataRowIdData[rowid] || {};
964
+ visibleSize++;
965
+ if (rowRest.oTop > endTop || visibleSize >= 100) {
966
+ break;
943
967
  }
944
968
  }
945
969
  }
@@ -1318,7 +1342,7 @@ export default defineComponent({
1318
1342
  if (!xHandleEl) {
1319
1343
  return;
1320
1344
  }
1321
- let tableWidth = 0;
1345
+ let tWidth = 0;
1322
1346
  const minCellWidth = 40; // 列宽最少限制 40px
1323
1347
  const bodyWidth = bodyElem.clientWidth;
1324
1348
  let remainWidth = bodyWidth;
@@ -1329,51 +1353,51 @@ export default defineComponent({
1329
1353
  // 最小宽
1330
1354
  pxMinList.forEach((column) => {
1331
1355
  const minWidth = XEUtils.toInteger(column.minWidth);
1332
- tableWidth += minWidth;
1356
+ tWidth += minWidth;
1333
1357
  column.renderWidth = minWidth;
1334
1358
  });
1335
1359
  // 最小自适应
1336
1360
  autoMinList.forEach((column) => {
1337
1361
  const caWidth = Math.max(60, XEUtils.toInteger(column.renderAutoWidth));
1338
- tableWidth += caWidth;
1362
+ tWidth += caWidth;
1339
1363
  column.renderWidth = caWidth;
1340
1364
  });
1341
1365
  // 最小百分比
1342
1366
  scaleMinList.forEach((column) => {
1343
1367
  const smWidth = Math.floor(XEUtils.toInteger(column.minWidth) * meanWidth);
1344
- tableWidth += smWidth;
1368
+ tWidth += smWidth;
1345
1369
  column.renderWidth = smWidth;
1346
1370
  });
1347
1371
  // 固定百分比
1348
1372
  scaleList.forEach((column) => {
1349
1373
  const sfWidth = Math.floor(XEUtils.toInteger(column.width) * meanWidth);
1350
- tableWidth += sfWidth;
1374
+ tWidth += sfWidth;
1351
1375
  column.renderWidth = sfWidth;
1352
1376
  });
1353
1377
  // 固定宽
1354
1378
  pxList.forEach((column) => {
1355
1379
  const pWidth = XEUtils.toInteger(column.width);
1356
- tableWidth += pWidth;
1380
+ tWidth += pWidth;
1357
1381
  column.renderWidth = pWidth;
1358
1382
  });
1359
1383
  // 自适应宽
1360
1384
  autoList.forEach((column) => {
1361
1385
  const aWidth = Math.max(60, XEUtils.toInteger(column.renderAutoWidth));
1362
- tableWidth += aWidth;
1386
+ tWidth += aWidth;
1363
1387
  column.renderWidth = aWidth;
1364
1388
  });
1365
1389
  // 调整了列宽
1366
1390
  resizeList.forEach((column) => {
1367
1391
  const reWidth = XEUtils.toInteger(column.resizeWidth);
1368
- tableWidth += reWidth;
1392
+ tWidth += reWidth;
1369
1393
  column.renderWidth = reWidth;
1370
1394
  });
1371
- remainWidth -= tableWidth;
1395
+ remainWidth -= tWidth;
1372
1396
  meanWidth = remainWidth > 0 ? Math.floor(remainWidth / (scaleMinList.length + pxMinList.length + autoMinList.length + remainList.length)) : 0;
1373
1397
  if (fit) {
1374
1398
  if (remainWidth > 0) {
1375
1399
  scaleMinList.concat(pxMinList).concat(autoMinList).forEach((column) => {
1376
- tableWidth += meanWidth;
1400
+ tWidth += meanWidth;
1377
1401
  column.renderWidth += meanWidth;
1378
1402
  });
1379
1403
  }
@@ -1385,7 +1409,7 @@ export default defineComponent({
1385
1409
  remainList.forEach((column) => {
1386
1410
  const width = Math.max(meanWidth, minCellWidth);
1387
1411
  column.renderWidth = width;
1388
- tableWidth += width;
1412
+ tWidth += width;
1389
1413
  });
1390
1414
  if (fit) {
1391
1415
  /**
@@ -1395,13 +1419,13 @@ export default defineComponent({
1395
1419
  const dynamicList = scaleList.concat(scaleMinList).concat(pxMinList).concat(autoMinList).concat(remainList);
1396
1420
  let dynamicSize = dynamicList.length - 1;
1397
1421
  if (dynamicSize > 0) {
1398
- let i = bodyWidth - tableWidth;
1422
+ let i = bodyWidth - tWidth;
1399
1423
  if (i > 0) {
1400
1424
  while (i > 0 && dynamicSize >= 0) {
1401
1425
  i--;
1402
1426
  dynamicList[dynamicSize--].renderWidth++;
1403
1427
  }
1404
- tableWidth = bodyWidth;
1428
+ tWidth = bodyWidth;
1405
1429
  }
1406
1430
  }
1407
1431
  }
@@ -1409,17 +1433,18 @@ export default defineComponent({
1409
1433
  const overflowY = yHandleEl.scrollHeight > yHandleEl.clientHeight;
1410
1434
  reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth);
1411
1435
  reactData.overflowY = overflowY;
1412
- internalData.tableWidth = tableWidth;
1436
+ reactData.scrollXWidth = tWidth;
1413
1437
  internalData.tableHeight = tableHeight;
1414
1438
  const headerTableElem = getRefElem(elemStore['main-header-table']);
1415
1439
  const footerTableElem = getRefElem(elemStore['main-footer-table']);
1416
1440
  const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0;
1417
- const overflowX = tableWidth > bodyWidth;
1441
+ const overflowX = tWidth > bodyWidth;
1418
1442
  const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0;
1419
1443
  reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight);
1420
1444
  internalData.headerHeight = headerHeight;
1421
1445
  internalData.footerHeight = footerHeight;
1422
1446
  reactData.overflowX = overflowX;
1447
+ updateColumnOffsetLeft();
1423
1448
  updateHeight();
1424
1449
  reactData.parentHeight = Math.max(internalData.headerHeight + footerHeight + 20, $xeTable.getParentHeight());
1425
1450
  if (overflowX) {
@@ -1721,8 +1746,8 @@ export default defineComponent({
1721
1746
  };
1722
1747
  const updateStyle = () => {
1723
1748
  const { border, showHeaderOverflow: allColumnHeaderOverflow, showFooterOverflow: allColumnFooterOverflow, mouseConfig, spanMethod, footerSpanMethod } = props;
1724
- const { isGroup, currentRow, tableColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, overflowY, scrollbarHeight, columnStore, editStore, isAllOverflow, expandColumn } = reactData;
1725
- const { visibleColumn, fullColumnIdData, tableHeight, tableWidth, headerHeight, footerHeight, elemStore, customHeight, customMinHeight, customMaxHeight } = internalData;
1749
+ const { isGroup, currentRow, tableColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isAllOverflow, expandColumn } = reactData;
1750
+ const { visibleColumn, fullColumnIdData, tableHeight, headerHeight, footerHeight, elemStore, customHeight, customMinHeight, customMaxHeight } = internalData;
1726
1751
  const el = refElem.value;
1727
1752
  if (!el) {
1728
1753
  return;
@@ -1760,9 +1785,9 @@ export default defineComponent({
1760
1785
  }
1761
1786
  bodyHeight = Math.max(bodyMinHeight, bodyHeight);
1762
1787
  }
1788
+ const scrollbarXToTop = computeScrollbarXToTop.value;
1763
1789
  const xLeftCornerEl = refScrollXLeftCornerElem.value;
1764
1790
  const xRightCornerEl = refScrollXRightCornerElem.value;
1765
- const scrollbarXToTop = computeScrollbarXToTop.value;
1766
1791
  const scrollXVirtualEl = refScrollXVirtualElem.value;
1767
1792
  if (scrollXVirtualEl) {
1768
1793
  scrollXVirtualEl.style.height = `${osbHeight}px`;
@@ -1852,7 +1877,7 @@ export default defineComponent({
1852
1877
  if (fixedType) {
1853
1878
  if (isGroup) {
1854
1879
  if (wrapperElem) {
1855
- wrapperElem.style.width = tableWidth ? `${tableWidth}px` : '';
1880
+ wrapperElem.style.width = scrollXWidth ? `${scrollXWidth}px` : '';
1856
1881
  }
1857
1882
  }
1858
1883
  else {
@@ -1863,7 +1888,7 @@ export default defineComponent({
1863
1888
  }
1864
1889
  else {
1865
1890
  if (wrapperElem) {
1866
- wrapperElem.style.width = tableWidth ? `${tableWidth}px` : '';
1891
+ wrapperElem.style.width = scrollXWidth ? `${scrollXWidth}px` : '';
1867
1892
  }
1868
1893
  }
1869
1894
  }
@@ -1941,7 +1966,7 @@ export default defineComponent({
1941
1966
  }
1942
1967
  else {
1943
1968
  if (wrapperElem) {
1944
- wrapperElem.style.width = tableWidth ? `${tableWidth}px` : '';
1969
+ wrapperElem.style.width = scrollXWidth ? `${scrollXWidth}px` : '';
1945
1970
  }
1946
1971
  }
1947
1972
  }
@@ -1982,7 +2007,7 @@ export default defineComponent({
1982
2007
  }
1983
2008
  else {
1984
2009
  if (wrapperElem) {
1985
- wrapperElem.style.width = tableWidth ? `${tableWidth}px` : '';
2010
+ wrapperElem.style.width = scrollXWidth ? `${scrollXWidth}px` : '';
1986
2011
  }
1987
2012
  }
1988
2013
  }
@@ -2598,6 +2623,9 @@ export default defineComponent({
2598
2623
  calcCellWidth();
2599
2624
  autoCellWidth();
2600
2625
  updateStyle();
2626
+ if (reFull) {
2627
+ updateRowOffsetTop();
2628
+ }
2601
2629
  updateRowExpandStyle();
2602
2630
  return computeScrollLoad().then(() => {
2603
2631
  if (reFull === true) {
@@ -2605,6 +2633,9 @@ export default defineComponent({
2605
2633
  calcCellWidth();
2606
2634
  autoCellWidth();
2607
2635
  updateStyle();
2636
+ if (reFull) {
2637
+ updateRowOffsetTop();
2638
+ }
2608
2639
  updateRowExpandStyle();
2609
2640
  return computeScrollLoad();
2610
2641
  }
@@ -2743,6 +2774,7 @@ export default defineComponent({
2743
2774
  }
2744
2775
  reactData.isRowLoading = false;
2745
2776
  calcCellHeight();
2777
+ updateRowOffsetTop();
2746
2778
  // 是否变更虚拟滚动
2747
2779
  if (oldScrollYLoad === sYLoad) {
2748
2780
  restoreScrollLocation($xeTable, targetScrollLeft, targetScrollTop)
@@ -2803,16 +2835,16 @@ export default defineComponent({
2803
2835
  cacheColumnMap();
2804
2836
  };
2805
2837
  const loadScrollXData = () => {
2806
- const { mergeList, mergeFooterList } = reactData;
2838
+ const { mergeList, mergeFooterList, isScrollXBig } = reactData;
2807
2839
  const { scrollXStore } = internalData;
2808
2840
  const { preloadSize, startIndex, endIndex, offsetSize } = scrollXStore;
2809
2841
  const { toVisibleIndex, visibleSize } = handleVirtualXVisible();
2810
2842
  const offsetItem = {
2811
- startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize - preloadSize),
2812
- endIndex: toVisibleIndex + visibleSize + offsetSize + preloadSize
2843
+ startIndex: Math.max(0, isScrollXBig ? toVisibleIndex - 1 : toVisibleIndex - 1 - offsetSize - preloadSize),
2844
+ endIndex: isScrollXBig ? toVisibleIndex + visibleSize : toVisibleIndex + visibleSize + offsetSize + preloadSize
2813
2845
  };
2814
- scrollXStore.visibleStartIndex = toVisibleIndex;
2815
- scrollXStore.visibleEndIndex = toVisibleIndex + visibleSize;
2846
+ scrollXStore.visibleStartIndex = toVisibleIndex - 1;
2847
+ scrollXStore.visibleEndIndex = toVisibleIndex + visibleSize + 1;
2816
2848
  calculateMergerOffsetIndex(mergeList.concat(mergeFooterList), offsetItem, 'col');
2817
2849
  const { startIndex: offsetStartIndex, endIndex: offsetEndIndex } = offsetItem;
2818
2850
  if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
@@ -2955,6 +2987,7 @@ export default defineComponent({
2955
2987
  internalData.visibleColumn = visibleColumn;
2956
2988
  handleTableColumn();
2957
2989
  if (isReset) {
2990
+ updateColumnOffsetLeft();
2958
2991
  return $xeTable.updateFooter().then(() => {
2959
2992
  return $xeTable.recalculate();
2960
2993
  }).then(() => {
@@ -3121,18 +3154,18 @@ export default defineComponent({
3121
3154
  /**
3122
3155
  * 纵向 Y 可视渲染处理
3123
3156
  */
3124
- const loadScrollYData = (scrollTop) => {
3125
- const { mergeList, isAllOverflow } = reactData;
3157
+ const loadScrollYData = () => {
3158
+ const { mergeList, isAllOverflow, isScrollYBig } = reactData;
3126
3159
  const { scrollYStore } = internalData;
3127
3160
  const { preloadSize, startIndex, endIndex, offsetSize } = scrollYStore;
3128
3161
  const autoOffsetYSize = isAllOverflow ? offsetSize : offsetSize + 1;
3129
- const { toVisibleIndex, visibleSize } = handleVirtualYVisible(scrollTop);
3162
+ const { toVisibleIndex, visibleSize } = handleVirtualYVisible();
3130
3163
  const offsetItem = {
3131
- startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize - preloadSize),
3132
- endIndex: toVisibleIndex + visibleSize + autoOffsetYSize + preloadSize
3164
+ startIndex: Math.max(0, isScrollYBig ? toVisibleIndex - 1 : toVisibleIndex - 1 - offsetSize - preloadSize),
3165
+ endIndex: isScrollYBig ? (toVisibleIndex + visibleSize) : (toVisibleIndex + visibleSize + autoOffsetYSize + preloadSize)
3133
3166
  };
3134
- scrollYStore.visibleStartIndex = toVisibleIndex;
3135
- scrollYStore.visibleEndIndex = toVisibleIndex + visibleSize;
3167
+ scrollYStore.visibleStartIndex = toVisibleIndex - 1;
3168
+ scrollYStore.visibleEndIndex = toVisibleIndex + visibleSize + 1;
3136
3169
  calculateMergerOffsetIndex(mergeList, offsetItem, 'row');
3137
3170
  const { startIndex: offsetStartIndex, endIndex: offsetEndIndex } = offsetItem;
3138
3171
  if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
@@ -3228,6 +3261,7 @@ export default defineComponent({
3228
3261
  $xeTable.updateScrollYSpace();
3229
3262
  });
3230
3263
  }
3264
+ updateRowExpandStyle();
3231
3265
  $xeTable.updateCellAreas();
3232
3266
  }, 200);
3233
3267
  };
@@ -3314,48 +3348,75 @@ export default defineComponent({
3314
3348
  setTimeout(() => $xeTable.recalculate(true), 300);
3315
3349
  });
3316
3350
  };
3351
+ const updateColumnOffsetLeft = () => {
3352
+ const { visibleColumn, fullColumnIdData } = internalData;
3353
+ let offsetLeft = 0;
3354
+ for (let cIndex = 0, rLen = visibleColumn.length; cIndex < rLen; cIndex++) {
3355
+ const column = visibleColumn[cIndex];
3356
+ const colid = column.id;
3357
+ const colRest = fullColumnIdData[colid];
3358
+ colRest.oLeft = offsetLeft;
3359
+ offsetLeft += column.renderWidth;
3360
+ }
3361
+ };
3362
+ const updateRowOffsetTop = () => {
3363
+ const { expandColumn, rowExpandedMaps } = reactData;
3364
+ const { afterFullData, fullAllDataRowIdData } = internalData;
3365
+ const expandOpts = computeExpandOpts.value;
3366
+ const rowOpts = computeRowOpts.value;
3367
+ const cellOpts = computeCellOpts.value;
3368
+ const defaultRowHeight = computeDefaultRowHeight.value;
3369
+ let offsetTop = 0;
3370
+ for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
3371
+ const row = afterFullData[rIndex];
3372
+ const rowid = getRowid($xeTable, row);
3373
+ const rowRest = fullAllDataRowIdData[rowid] || {};
3374
+ rowRest.oTop = offsetTop;
3375
+ offsetTop += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
3376
+ // 是否展开行
3377
+ if (expandColumn && rowExpandedMaps[rowid]) {
3378
+ offsetTop += rowRest.expandHeight || expandOpts.height || 0;
3379
+ }
3380
+ }
3381
+ };
3317
3382
  const updateRowExpandStyle = () => {
3318
- const { expandColumn, scrollYLoad, rowExpandedMaps } = reactData;
3383
+ const { expandColumn, scrollYLoad, scrollYTop, isScrollYBig } = reactData;
3319
3384
  const expandOpts = computeExpandOpts.value;
3320
3385
  const rowOpts = computeRowOpts.value;
3321
3386
  const cellOpts = computeCellOpts.value;
3322
3387
  const defaultRowHeight = computeDefaultRowHeight.value;
3323
3388
  const { mode } = expandOpts;
3324
3389
  if (expandColumn && mode === 'fixed') {
3325
- const { elemStore, afterFullData, fullAllDataRowIdData } = internalData;
3390
+ const { elemStore, fullAllDataRowIdData } = internalData;
3326
3391
  const rowExpandEl = refRowExpandElem.value;
3327
3392
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
3328
3393
  if (rowExpandEl && bodyScrollElem) {
3329
3394
  let isUpdateHeight = false;
3330
- if (scrollYLoad) {
3331
- let offsetTop = 0;
3332
- for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
3333
- const row = afterFullData[rIndex];
3334
- const rowid = getRowid($xeTable, row);
3335
- const rowRest = fullAllDataRowIdData[rowid] || {};
3336
- rowRest.oTop = offsetTop;
3337
- offsetTop += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
3338
- // 是否展开行
3339
- if (expandColumn && rowExpandedMaps[rowid]) {
3340
- offsetTop += rowRest.expandHeight || expandOpts.height || 0;
3341
- }
3342
- }
3343
- }
3344
3395
  XEUtils.arrayEach(rowExpandEl.children, reEl => {
3345
3396
  const expandEl = reEl;
3346
3397
  const rowid = expandEl.getAttribute('rowid') || '';
3347
3398
  const rowRest = fullAllDataRowIdData[rowid];
3348
3399
  if (rowRest) {
3349
3400
  const expandHeight = expandEl.offsetHeight + 1;
3401
+ const trEl = bodyScrollElem.querySelector(`.vxe-body--row[rowid="${rowid}"]`);
3402
+ let offsetTop = 0;
3350
3403
  if (scrollYLoad) {
3351
- expandEl.style.top = toCssUnit(rowRest.oTop + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight));
3404
+ if (isScrollYBig && trEl) {
3405
+ offsetTop = trEl.offsetTop + trEl.offsetHeight;
3406
+ }
3407
+ else {
3408
+ offsetTop = rowRest.oTop + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
3409
+ }
3352
3410
  }
3353
3411
  else {
3354
- const trEl = bodyScrollElem.querySelector(`.vxe-body--row[rowid="${rowid}"]`);
3355
3412
  if (trEl) {
3356
- expandEl.style.top = toCssUnit(trEl.offsetTop + trEl.offsetHeight);
3413
+ offsetTop = trEl.offsetTop + trEl.offsetHeight;
3357
3414
  }
3358
3415
  }
3416
+ if (isScrollYBig) {
3417
+ offsetTop += scrollYTop;
3418
+ }
3419
+ expandEl.style.top = toCssUnit(offsetTop);
3359
3420
  if (!isUpdateHeight) {
3360
3421
  if (rowRest.expandHeight !== expandHeight) {
3361
3422
  isUpdateHeight = true;
@@ -3366,6 +3427,9 @@ export default defineComponent({
3366
3427
  });
3367
3428
  if (isUpdateHeight) {
3368
3429
  reactData.rowExpandHeightFlag++;
3430
+ nextTick(() => {
3431
+ updateRowOffsetTop();
3432
+ });
3369
3433
  }
3370
3434
  }
3371
3435
  }
@@ -4283,6 +4347,7 @@ export default defineComponent({
4283
4347
  }
4284
4348
  }
4285
4349
  return nextTick().then(() => {
4350
+ updateRowOffsetTop();
4286
4351
  return { status };
4287
4352
  });
4288
4353
  },
@@ -5159,12 +5224,12 @@ export default defineComponent({
5159
5224
  }
5160
5225
  reactData.rowExpandedMaps = rExpandedMaps;
5161
5226
  return Promise.all(lazyRests)
5162
- .then(() => $xeTable.recalculate())
5227
+ .then(() => nextTick())
5228
+ .then(() => $xeTable.recalculate(true))
5163
5229
  .then(() => {
5164
- if (expandColumn) {
5165
- updateRowExpandStyle();
5166
- handleRowExpandScroll();
5167
- }
5230
+ updateRowOffsetTop();
5231
+ updateRowExpandStyle();
5232
+ handleRowExpandScroll();
5168
5233
  return $xeTable.updateCellAreas();
5169
5234
  });
5170
5235
  },
@@ -5191,16 +5256,21 @@ export default defineComponent({
5191
5256
  const { tableFullData } = internalData;
5192
5257
  const expandOpts = computeExpandOpts.value;
5193
5258
  const { reserve } = expandOpts;
5194
- const expList = tableMethods.getRowExpandRecords();
5259
+ const expList = $xeTable.getRowExpandRecords();
5195
5260
  reactData.rowExpandedMaps = {};
5196
5261
  if (reserve) {
5197
5262
  tableFullData.forEach((row) => handleRowExpandReserve(row, false));
5198
5263
  }
5199
5264
  return nextTick().then(() => {
5200
5265
  if (expList.length) {
5201
- tableMethods.recalculate();
5266
+ return $xeTable.recalculate(true);
5202
5267
  }
5203
- }).then(() => $xeTable.updateCellAreas());
5268
+ }).then(() => {
5269
+ updateRowOffsetTop();
5270
+ updateRowExpandStyle();
5271
+ handleRowExpandScroll();
5272
+ return $xeTable.updateCellAreas();
5273
+ });
5204
5274
  },
5205
5275
  clearRowExpandReserve() {
5206
5276
  internalData.rowExpandedReserveRowMap = {};
@@ -6408,8 +6478,8 @@ export default defineComponent({
6408
6478
  const wrapperRect = el.getBoundingClientRect();
6409
6479
  const osbWidth = overflowY ? scrollbarWidth : 0;
6410
6480
  const osbHeight = overflowX ? scrollbarHeight : 0;
6411
- const tableWidth = el.clientWidth;
6412
- const tableHeight = el.clientHeight;
6481
+ const tableWrapperWidth = el.clientWidth;
6482
+ const tableWrapperHeight = el.clientHeight;
6413
6483
  if (trEl) {
6414
6484
  const rdLineEl = refDragRowLineElem.value;
6415
6485
  if (rdLineEl) {
@@ -6418,14 +6488,14 @@ export default defineComponent({
6418
6488
  const trRect = trEl.getBoundingClientRect();
6419
6489
  let trHeight = trEl.clientHeight;
6420
6490
  const offsetTop = Math.max(1, trRect.y - wrapperRect.y);
6421
- if (offsetTop + trHeight > tableHeight - osbHeight) {
6422
- trHeight = tableHeight - offsetTop - osbHeight;
6491
+ if (offsetTop + trHeight > tableWrapperHeight - osbHeight) {
6492
+ trHeight = tableWrapperHeight - offsetTop - osbHeight;
6423
6493
  }
6424
6494
  rdLineEl.style.display = 'block';
6425
6495
  rdLineEl.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`;
6426
6496
  rdLineEl.style.top = `${offsetTop}px`;
6427
6497
  rdLineEl.style.height = `${trHeight}px`;
6428
- rdLineEl.style.width = `${tableWidth - osbWidth}px`;
6498
+ rdLineEl.style.width = `${tableWrapperWidth - osbWidth}px`;
6429
6499
  rdLineEl.setAttribute('drag-pos', dragPos);
6430
6500
  rdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
6431
6501
  }
@@ -6452,7 +6522,7 @@ export default defineComponent({
6452
6522
  thWidth -= startX - offsetLeft;
6453
6523
  offsetLeft = startX;
6454
6524
  }
6455
- const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 : osbWidth);
6525
+ const endX = tableWrapperWidth - rightContainerWidth - (rightContainerWidth ? 0 : osbWidth);
6456
6526
  if (offsetLeft + thWidth > endX) {
6457
6527
  thWidth = endX - offsetLeft;
6458
6528
  }
@@ -6464,7 +6534,7 @@ export default defineComponent({
6464
6534
  cdLineEl.style.height = `${thRect.height}px`;
6465
6535
  }
6466
6536
  else {
6467
- cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 : osbHeight)}px`;
6537
+ cdLineEl.style.height = `${tableWrapperHeight - offsetTop - (scrollbarXToTop ? 0 : osbHeight)}px`;
6468
6538
  }
6469
6539
  cdLineEl.setAttribute('drag-pos', dragPos);
6470
6540
  cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
@@ -6860,7 +6930,7 @@ export default defineComponent({
6860
6930
  resizeBarElem.style.height = `${scrollbarXToTop ? tableHeight - osbHeight : tableHeight}px`;
6861
6931
  if (resizableOpts.showDragTip && resizeTipElem) {
6862
6932
  resizeTipElem.textContent = getI18n('vxe.table.resizeColTip', [resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
6863
- const tableWidth = tableEl.clientWidth;
6933
+ const tableWrapperWidth = tableEl.clientWidth;
6864
6934
  const wrapperRect = wrapperElem.getBoundingClientRect();
6865
6935
  const resizeBarWidth = resizeBarElem.clientWidth;
6866
6936
  const resizeTipWidth = resizeTipElem.clientWidth;
@@ -6869,8 +6939,8 @@ export default defineComponent({
6869
6939
  if (resizeBarLeft < resizeTipWidth + resizeBarWidth) {
6870
6940
  resizeTipLeft = 0;
6871
6941
  }
6872
- else if (resizeBarLeft > tableWidth) {
6873
- resizeTipLeft += tableWidth - resizeBarLeft;
6942
+ else if (resizeBarLeft > tableWrapperWidth) {
6943
+ resizeTipLeft += tableWrapperWidth - resizeBarLeft;
6874
6944
  }
6875
6945
  resizeTipElem.style.left = `${resizeTipLeft}px`;
6876
6946
  resizeTipElem.style.top = `${Math.min(tableHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`;
@@ -7002,7 +7072,7 @@ export default defineComponent({
7002
7072
  const updateEvent = (evnt) => {
7003
7073
  evnt.stopPropagation();
7004
7074
  evnt.preventDefault();
7005
- const tableWidth = tableEl.clientWidth - osbWidth;
7075
+ const rtWidth = tableEl.clientWidth - osbWidth;
7006
7076
  const tableHeight = tableEl.clientHeight - osbHeight;
7007
7077
  let dragTop = evnt.clientY - tableRect.y - targetOffsetY;
7008
7078
  if (dragTop < minTop) {
@@ -7013,15 +7083,15 @@ export default defineComponent({
7013
7083
  }
7014
7084
  resizeBarElem.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`;
7015
7085
  resizeBarElem.style.top = `${dragTop}px`;
7016
- resizeBarElem.style.width = `${tableWidth}px`;
7086
+ resizeBarElem.style.width = `${rtWidth}px`;
7017
7087
  if (resizableOpts.showDragTip && resizeTipElem) {
7018
7088
  resizeTipElem.textContent = getI18n('vxe.table.resizeRowTip', [resizeHeight]);
7019
7089
  const resizeTipWidth = resizeTipElem.clientWidth;
7020
7090
  const resizeTipHeight = resizeTipElem.clientHeight;
7021
7091
  let resizeBarLeft = Math.max(2, evnt.clientX - tableRect.x);
7022
7092
  let resizeBarTop = 0;
7023
- if (resizeBarLeft + resizeTipWidth >= tableWidth - 2) {
7024
- resizeBarLeft = tableWidth - resizeTipWidth - 2;
7093
+ if (resizeBarLeft + resizeTipWidth >= rtWidth - 2) {
7094
+ resizeBarLeft = rtWidth - resizeTipWidth - 2;
7025
7095
  }
7026
7096
  if (dragTop + resizeTipHeight >= tableHeight) {
7027
7097
  resizeBarTop = tableHeight - (dragTop + resizeTipHeight);
@@ -7052,6 +7122,7 @@ export default defineComponent({
7052
7122
  else {
7053
7123
  rowRest.resizeHeight = resizeHeight;
7054
7124
  handleUpdateRowResize(evnt, resizeParams);
7125
+ updateRowOffsetTop();
7055
7126
  }
7056
7127
  }
7057
7128
  removeClass(tableEl, 'row-drag--resize');
@@ -7998,6 +8069,7 @@ export default defineComponent({
7998
8069
  const dragParams = {
7999
8070
  oldRow: dragRow,
8000
8071
  newRow: prevDragRow,
8072
+ dragRow,
8001
8073
  dragPos: prevDragPos,
8002
8074
  dragToChild: !!prevDragToChild,
8003
8075
  offsetIndex: dragOffsetIndex
@@ -8138,6 +8210,7 @@ export default defineComponent({
8138
8210
  dispatchEvent('row-dragend', {
8139
8211
  oldRow: dragRow,
8140
8212
  newRow: prevDragRow,
8213
+ dragRow,
8141
8214
  dragPos: prevDragPos,
8142
8215
  dragToChild: isDragToChildFlag,
8143
8216
  offsetIndex: dragOffsetIndex,
@@ -8280,11 +8353,12 @@ export default defineComponent({
8280
8353
  if (prevDragCol && dragCol) {
8281
8354
  // 判断是否有拖动
8282
8355
  if (prevDragCol !== dragCol) {
8283
- const oldColumn = dragCol;
8356
+ const dragColumn = dragCol;
8284
8357
  const newColumn = prevDragCol;
8285
8358
  const dragParams = {
8286
- oldColumn,
8359
+ oldColumn: dragColumn,
8287
8360
  newColumn,
8361
+ dragColumn,
8288
8362
  dragPos: prevDragPos,
8289
8363
  dragToChild: !!prevDragToChild,
8290
8364
  offsetIndex: dragOffsetIndex
@@ -8297,14 +8371,14 @@ export default defineComponent({
8297
8371
  let oafIndex = -1;
8298
8372
  let nafIndex = -1;
8299
8373
  const oldAllMaps = {};
8300
- XEUtils.eachTree([oldColumn], column => {
8374
+ XEUtils.eachTree([dragColumn], column => {
8301
8375
  oldAllMaps[column.id] = column;
8302
8376
  });
8303
8377
  let isSelfToChildStatus = false;
8304
- if (oldColumn.parentId && newColumn.parentId) {
8378
+ if (dragColumn.parentId && newColumn.parentId) {
8305
8379
  // 子到子
8306
8380
  if (isPeerDrag && !isCrossDrag) {
8307
- if (oldColumn.parentId !== newColumn.parentId) {
8381
+ if (dragColumn.parentId !== newColumn.parentId) {
8308
8382
  // 非同级
8309
8383
  return;
8310
8384
  }
@@ -8327,7 +8401,7 @@ export default defineComponent({
8327
8401
  }
8328
8402
  }
8329
8403
  }
8330
- else if (oldColumn.parentId) {
8404
+ else if (dragColumn.parentId) {
8331
8405
  // 子到根
8332
8406
  if (!isCrossDrag) {
8333
8407
  return;
@@ -8354,17 +8428,17 @@ export default defineComponent({
8354
8428
  else {
8355
8429
  // 根到根
8356
8430
  }
8357
- const oldewMatchRest = XEUtils.findTree(collectColumn, item => item.id === oldColumn.id);
8431
+ const oldewMatchRest = XEUtils.findTree(collectColumn, item => item.id === dragColumn.id);
8358
8432
  // 改变层级
8359
8433
  if (isSelfToChildStatus && (isCrossDrag && isSelfToChildDrag)) {
8360
8434
  if (oldewMatchRest) {
8361
8435
  const { items: oCols, index: oIndex } = oldewMatchRest;
8362
- const childList = oldColumn.children || [];
8436
+ const childList = dragColumn.children || [];
8363
8437
  childList.forEach(column => {
8364
- column.parentId = oldColumn.parentId;
8438
+ column.parentId = dragColumn.parentId;
8365
8439
  });
8366
8440
  oCols.splice(oIndex, 1, ...childList);
8367
- oldColumn.children = [];
8441
+ dragColumn.children = [];
8368
8442
  }
8369
8443
  }
8370
8444
  else {
@@ -8381,12 +8455,12 @@ export default defineComponent({
8381
8455
  const { items: nCols, index: nIndex, parent: nParent } = newMatchRest;
8382
8456
  // 转子级
8383
8457
  if ((isCrossDrag && isToChildDrag) && isDragToChildFlag) {
8384
- oldColumn.parentId = newColumn.id;
8385
- newColumn.children = (newColumn.children || []).concat([oldColumn]);
8458
+ dragColumn.parentId = newColumn.id;
8459
+ newColumn.children = (newColumn.children || []).concat([dragColumn]);
8386
8460
  }
8387
8461
  else {
8388
- oldColumn.parentId = newColumn.parentId;
8389
- nCols.splice(nIndex + dragOffsetIndex, 0, oldColumn);
8462
+ dragColumn.parentId = newColumn.parentId;
8463
+ nCols.splice(nIndex + dragOffsetIndex, 0, dragColumn);
8390
8464
  }
8391
8465
  if (!nParent) {
8392
8466
  nafIndex = nIndex;
@@ -8409,8 +8483,9 @@ export default defineComponent({
8409
8483
  }
8410
8484
  }
8411
8485
  dispatchEvent('column-dragend', {
8412
- oldColumn,
8486
+ oldColumn: dragColumn,
8413
8487
  newColumn,
8488
+ dragColumn,
8414
8489
  dragPos: prevDragPos,
8415
8490
  dragToChild: isDragToChildFlag,
8416
8491
  offsetIndex: dragOffsetIndex,
@@ -8487,22 +8562,22 @@ export default defineComponent({
8487
8562
  const scrollTargetEl = xHandleEl || tableBodyElem;
8488
8563
  if (scrollTargetEl) {
8489
8564
  const wrapperRect = el.getBoundingClientRect();
8490
- const tableWidth = el.clientWidth;
8565
+ const tableWrapperWidth = el.clientWidth;
8491
8566
  const leftContainerElem = refLeftContainer.value;
8492
8567
  const leftContainerWidth = leftContainerElem ? leftContainerElem.clientWidth : 0;
8493
8568
  const rightContainerElem = refRightContainer.value;
8494
8569
  const rightContainerWidth = rightContainerElem ? rightContainerElem.clientWidth : 0;
8495
8570
  const srartX = wrapperRect.x + leftContainerWidth;
8496
- const endX = wrapperRect.x + tableWidth - rightContainerWidth;
8571
+ const endX = wrapperRect.x + tableWrapperWidth - rightContainerWidth;
8497
8572
  const distSize = 28;
8498
8573
  const startDistSize = clientX - srartX;
8499
8574
  const endDistSize = endX - clientX;
8500
8575
  if (startDistSize > 0 && startDistSize <= distSize) {
8501
- const scrollRatio = Math.floor(tableWidth / (startDistSize > distSize / 2 ? 240 : 120));
8576
+ const scrollRatio = Math.floor(tableWrapperWidth / (startDistSize > distSize / 2 ? 240 : 120));
8502
8577
  scrollTargetEl.scrollLeft -= scrollRatio * (distSize - startDistSize);
8503
8578
  }
8504
8579
  else if (endDistSize > 0 && endDistSize <= distSize) {
8505
- const scrollRatio = Math.floor(tableWidth / (endDistSize > distSize / 2 ? 240 : 120));
8580
+ const scrollRatio = Math.floor(tableWrapperWidth / (endDistSize > distSize / 2 ? 240 : 120));
8506
8581
  scrollTargetEl.scrollLeft += scrollRatio * (distSize - endDistSize);
8507
8582
  }
8508
8583
  }
@@ -8815,7 +8890,7 @@ export default defineComponent({
8815
8890
  });
8816
8891
  },
8817
8892
  triggerBodyWheelEvent(evnt) {
8818
- const { target, deltaY, deltaX } = evnt;
8893
+ const { target, deltaY, deltaX, shiftKey } = evnt;
8819
8894
  if (target && /^textarea$/i.test(target.tagName)) {
8820
8895
  return;
8821
8896
  }
@@ -8846,8 +8921,8 @@ export default defineComponent({
8846
8921
  return;
8847
8922
  }
8848
8923
  const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
8849
- const deltaTop = Math.ceil(deltaY * wheelSpeed);
8850
- const deltaLeft = Math.ceil(deltaX * wheelSpeed);
8924
+ const deltaTop = Math.ceil((shiftKey ? deltaX : deltaY) * wheelSpeed);
8925
+ const deltaLeft = Math.ceil((shiftKey ? deltaY : deltaX) * wheelSpeed);
8851
8926
  const isTopWheel = deltaTop < 0;
8852
8927
  const currScrollTop = bodyScrollElem.scrollTop;
8853
8928
  // 如果滚动位置已经是顶部或底部,则不需要触发
@@ -8997,43 +9072,66 @@ export default defineComponent({
8997
9072
  updateScrollYStatus,
8998
9073
  // 更新横向 X 可视渲染上下剩余空间大小
8999
9074
  updateScrollXSpace() {
9000
- const { isGroup, scrollXLoad, overflowX } = reactData;
9001
- const { visibleColumn, scrollXStore, elemStore, tableWidth } = internalData;
9002
- const tableHeader = refTableHeader.value;
9075
+ const { isGroup, scrollXLoad, overflowX, scrollXWidth } = reactData;
9076
+ const { visibleColumn, scrollXStore, elemStore, fullColumnIdData } = internalData;
9003
9077
  const tableBody = refTableBody.value;
9004
- const tableFooter = refTableFooter.value;
9005
9078
  const tableBodyElem = tableBody ? tableBody.$el : null;
9006
9079
  if (tableBodyElem) {
9007
- const tableHeaderElem = tableHeader ? tableHeader.$el : null;
9008
- const tableFooterElem = tableFooter ? tableFooter.$el : null;
9009
- const headerElem = tableHeaderElem ? tableHeaderElem.querySelector('.vxe-table--header') : null;
9010
- const bodyElem = tableBodyElem.querySelector('.vxe-table--body');
9011
- const footerElem = tableFooterElem ? tableFooterElem.querySelector('.vxe-table--footer') : null;
9012
- const leftSpaceWidth = visibleColumn.slice(0, scrollXStore.startIndex).reduce((previous, column) => previous + column.renderWidth, 0);
9080
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
9081
+ const bodyTableElem = getRefElem(elemStore['main-body-table']);
9082
+ const headerTableElem = getRefElem(elemStore['main-header-table']);
9083
+ const footerTableElem = getRefElem(elemStore['main-footer-table']);
9084
+ let xSpaceLeft = 0;
9085
+ const firstColumn = visibleColumn[scrollXStore.startIndex];
9086
+ if (firstColumn) {
9087
+ const colRest = fullColumnIdData[firstColumn.id] || {};
9088
+ xSpaceLeft = colRest.oLeft;
9089
+ }
9090
+ let clientWidth = 0;
9091
+ if (bodyScrollElem) {
9092
+ clientWidth = bodyScrollElem.clientWidth;
9093
+ }
9094
+ // 虚拟渲染
9095
+ let isScrollXBig = false;
9096
+ let ySpaceWidth = scrollXWidth;
9097
+ if (scrollXWidth > maxXWidth) {
9098
+ // 触右
9099
+ if (bodyScrollElem && bodyTableElem && bodyScrollElem.scrollLeft + clientWidth >= maxXWidth) {
9100
+ xSpaceLeft = maxXWidth - bodyTableElem.clientWidth;
9101
+ }
9102
+ else {
9103
+ xSpaceLeft = (maxXWidth - clientWidth) * (xSpaceLeft / (scrollXWidth - clientWidth));
9104
+ }
9105
+ ySpaceWidth = maxXWidth;
9106
+ isScrollXBig = true;
9107
+ }
9013
9108
  let marginLeft = '';
9014
9109
  if (scrollXLoad && overflowX) {
9015
- marginLeft = `${leftSpaceWidth}px`;
9110
+ marginLeft = `${xSpaceLeft}px`;
9016
9111
  }
9017
- if (headerElem) {
9018
- headerElem.style.marginLeft = isGroup ? '' : marginLeft;
9112
+ if (headerTableElem) {
9113
+ headerTableElem.style.marginLeft = isGroup ? '' : marginLeft;
9114
+ }
9115
+ if (bodyTableElem) {
9116
+ bodyTableElem.style.marginLeft = marginLeft;
9019
9117
  }
9020
- bodyElem.style.marginLeft = marginLeft;
9021
- if (footerElem) {
9022
- footerElem.style.marginLeft = marginLeft;
9118
+ if (footerTableElem) {
9119
+ footerTableElem.style.marginLeft = marginLeft;
9023
9120
  }
9121
+ reactData.isScrollXBig = isScrollXBig;
9024
9122
  const containerList = ['main'];
9025
9123
  containerList.forEach(name => {
9026
9124
  const layoutList = ['header', 'body', 'footer'];
9027
9125
  layoutList.forEach(layout => {
9028
9126
  const xSpaceElem = getRefElem(elemStore[`${name}-${layout}-xSpace`]);
9029
9127
  if (xSpaceElem) {
9030
- xSpaceElem.style.width = scrollXLoad ? `${tableWidth}px` : '';
9128
+ xSpaceElem.style.width = scrollXLoad ? `${ySpaceWidth}px` : '';
9031
9129
  }
9032
9130
  });
9033
9131
  });
9034
9132
  const scrollXSpaceEl = refScrollXSpaceElem.value;
9035
9133
  if (scrollXSpaceEl) {
9036
- scrollXSpaceEl.style.width = `${tableWidth}px`;
9134
+ scrollXSpaceEl.style.width = `${ySpaceWidth}px`;
9037
9135
  }
9038
9136
  nextTick(() => {
9039
9137
  updateStyle();
@@ -9049,49 +9147,66 @@ export default defineComponent({
9049
9147
  const rowOpts = computeRowOpts.value;
9050
9148
  const cellOpts = computeCellOpts.value;
9051
9149
  const defaultRowHeight = computeDefaultRowHeight.value;
9150
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
9052
9151
  const bodyTableElem = getRefElem(elemStore['main-body-table']);
9053
9152
  const containerList = ['main', 'left', 'right'];
9054
- let topSpaceHeight = 0;
9055
- let ySpaceHeight = 0;
9153
+ let ySpaceTop = 0;
9154
+ let scrollYHeight = 0;
9155
+ let isScrollYBig = false;
9056
9156
  if (scrollYLoad) {
9057
9157
  const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
9058
9158
  if (!isCustomCellHeight && !expandColumn && isAllOverflow) {
9059
- ySpaceHeight = afterFullData.length * defaultRowHeight;
9060
- topSpaceHeight = Math.max(0, startIndex * defaultRowHeight);
9159
+ scrollYHeight = afterFullData.length * defaultRowHeight;
9160
+ if (scrollYHeight > maxYHeight) {
9161
+ isScrollYBig = true;
9162
+ }
9163
+ ySpaceTop = Math.max(0, startIndex * defaultRowHeight);
9061
9164
  }
9062
9165
  else {
9063
- for (let i = 0; i < afterFullData.length; i++) {
9064
- const row = afterFullData[i];
9065
- const rowid = getRowid($xeTable, row);
9066
- const rowRest = fullAllDataRowIdData[rowid] || {};
9067
- ySpaceHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
9068
- // 是否展开行
9069
- if (expandColumn && rowExpandedMaps[rowid]) {
9070
- ySpaceHeight += rowRest.expandHeight || expandOpts.height || 0;
9071
- }
9166
+ const firstRow = afterFullData[startIndex];
9167
+ let rowid = getRowid($xeTable, firstRow);
9168
+ let rowRest = fullAllDataRowIdData[rowid] || {};
9169
+ ySpaceTop = rowRest.oTop;
9170
+ const lastRow = afterFullData[afterFullData.length - 1];
9171
+ rowid = getRowid($xeTable, lastRow);
9172
+ rowRest = fullAllDataRowIdData[rowid] || {};
9173
+ scrollYHeight = rowRest.oTop + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
9174
+ // 是否展开行
9175
+ if (expandColumn && rowExpandedMaps[rowid]) {
9176
+ scrollYHeight += rowRest.expandHeight || expandOpts.height || 0;
9072
9177
  }
9073
- for (let i = 0; i < startIndex; i++) {
9074
- const row = afterFullData[i];
9075
- const rowid = getRowid($xeTable, row);
9076
- const rowRest = fullAllDataRowIdData[rowid] || {};
9077
- topSpaceHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
9078
- // 是否展开行
9079
- if (expandColumn && rowExpandedMaps[rowid]) {
9080
- topSpaceHeight += rowRest.expandHeight || expandOpts.height || 0;
9081
- }
9178
+ if (scrollYHeight > maxYHeight) {
9179
+ isScrollYBig = true;
9082
9180
  }
9083
9181
  }
9084
9182
  }
9085
9183
  else {
9086
9184
  if (bodyTableElem) {
9087
- ySpaceHeight = bodyTableElem.clientHeight;
9185
+ scrollYHeight = bodyTableElem.clientHeight;
9186
+ }
9187
+ }
9188
+ let clientHeight = 0;
9189
+ if (bodyScrollElem) {
9190
+ clientHeight = bodyScrollElem.clientHeight;
9191
+ }
9192
+ // 虚拟渲染
9193
+ let ySpaceHeight = scrollYHeight;
9194
+ let scrollYTop = ySpaceTop;
9195
+ if (isScrollYBig) {
9196
+ // 触底
9197
+ if (bodyScrollElem && bodyTableElem && bodyScrollElem.scrollTop + clientHeight >= maxYHeight) {
9198
+ scrollYTop = maxYHeight - bodyTableElem.clientHeight;
9088
9199
  }
9200
+ else {
9201
+ scrollYTop = (maxYHeight - clientHeight) * (ySpaceTop / (scrollYHeight - clientHeight));
9202
+ }
9203
+ ySpaceHeight = maxYHeight;
9089
9204
  }
9090
9205
  containerList.forEach(name => {
9091
9206
  const layoutList = ['header', 'body', 'footer'];
9092
9207
  const tableElem = getRefElem(elemStore[`${name}-body-table`]);
9093
9208
  if (tableElem) {
9094
- tableElem.style.marginTop = topSpaceHeight ? `${topSpaceHeight}px` : '';
9209
+ tableElem.style.marginTop = scrollYTop ? `${scrollYTop}px` : '';
9095
9210
  }
9096
9211
  layoutList.forEach(layout => {
9097
9212
  const ySpaceElem = getRefElem(elemStore[`${name}-${layout}-ySpace`]);
@@ -9108,6 +9223,9 @@ export default defineComponent({
9108
9223
  if (rowExpandYSpaceEl) {
9109
9224
  rowExpandYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
9110
9225
  }
9226
+ reactData.scrollYTop = scrollYTop;
9227
+ reactData.scrollYHeight = scrollYHeight;
9228
+ reactData.isScrollYBig = isScrollYBig;
9111
9229
  return nextTick().then(() => {
9112
9230
  updateStyle();
9113
9231
  });
@@ -9983,7 +10101,7 @@ export default defineComponent({
9983
10101
  initTpImg();
9984
10102
  }
9985
10103
  nextTick(() => {
9986
- const { data, treeConfig, showOverflow } = props;
10104
+ const { data, exportConfig, importConfig, treeConfig, showOverflow } = props;
9987
10105
  const { scrollXStore, scrollYStore } = internalData;
9988
10106
  const sYOpts = computeSYOpts.value;
9989
10107
  const editOpts = computeEditOpts.value;
@@ -9992,129 +10110,121 @@ export default defineComponent({
9992
10110
  const checkboxOpts = computeCheckboxOpts.value;
9993
10111
  const expandOpts = computeExpandOpts.value;
9994
10112
  const rowOpts = computeRowOpts.value;
9995
- if (process.env.NODE_ENV === 'development') {
9996
- if (props.rowId) {
9997
- warnLog('vxe.error.delProp', ['row-id', 'row-config.keyField']);
9998
- }
9999
- if (props.rowKey) {
10000
- warnLog('vxe.error.delProp', ['row-key', 'row-config.useKey']);
10001
- }
10002
- if (props.columnKey) {
10003
- warnLog('vxe.error.delProp', ['column-id', 'column-config.useKey']);
10004
- }
10005
- if (!(props.rowId || rowOpts.keyField) && (checkboxOpts.reserve || checkboxOpts.checkRowKeys || radioOpts.reserve || radioOpts.checkRowKey || expandOpts.expandRowKeys || treeOpts.expandRowKeys)) {
10006
- warnLog('vxe.error.reqProp', ['row-config.keyField']);
10007
- }
10008
- if (props.editConfig && (editOpts.showStatus || editOpts.showUpdateStatus || editOpts.showInsertStatus) && !props.keepSource) {
10009
- warnLog('vxe.error.reqProp', ['keep-source']);
10010
- }
10011
- if (treeConfig && (treeOpts.showLine || treeOpts.line) && (!(props.rowKey || rowOpts.useKey) || !showOverflow)) {
10012
- warnLog('vxe.error.reqProp', ['row-config.useKey | show-overflow']);
10013
- }
10014
- if (treeConfig && !treeOpts.transform && props.stripe) {
10015
- warnLog('vxe.error.noTree', ['stripe']);
10016
- }
10017
- if (props.showFooter && !(props.footerMethod || props.footerData)) {
10018
- warnLog('vxe.error.reqProp', ['footer-data | footer-method']);
10019
- }
10020
- if (rowOpts.height) {
10021
- warnLog('vxe.error.delProp', ['row-config.height', 'cell-config.height']);
10022
- }
10023
- // if (props.highlightCurrentRow) {
10024
- // warnLog('vxe.error.delProp', ['highlight-current-row', 'row-config.isCurrent'])
10025
- // }
10026
- // if (props.highlightHoverRow) {
10027
- // warnLog('vxe.error.delProp', ['highlight-hover-row', 'row-config.isHover'])
10028
- // }
10029
- // if (props.highlightCurrentColumn) {
10030
- // warnLog('vxe.error.delProp', ['highlight-current-column', 'column-config.isCurrent'])
10031
- // }
10032
- // if (props.highlightHoverColumn) {
10033
- // warnLog('vxe.error.delProp', ['highlight-hover-column', 'column-config.isHover'])
10034
- // }
10035
- // 检查导入导出类型,如果自定义导入导出方法,则不校验类型
10036
- const { exportConfig, importConfig } = props;
10037
- const exportOpts = computeExportOpts.value;
10038
- const importOpts = computeImportOpts.value;
10039
- if (importConfig && importOpts.types && !importOpts.importMethod && !XEUtils.includeArrays(XEUtils.keys(importOpts._typeMaps), importOpts.types)) {
10040
- warnLog('vxe.error.errProp', [`export-config.types=${importOpts.types.join(',')}`, importOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(importOpts._typeMaps), type)).join(',') || XEUtils.keys(importOpts._typeMaps).join(',')]);
10041
- }
10042
- if (exportConfig && exportOpts.types && !exportOpts.exportMethod && !XEUtils.includeArrays(XEUtils.keys(exportOpts._typeMaps), exportOpts.types)) {
10043
- warnLog('vxe.error.errProp', [`export-config.types=${exportOpts.types.join(',')}`, exportOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(exportOpts._typeMaps), type)).join(',') || XEUtils.keys(exportOpts._typeMaps).join(',')]);
10044
- }
10113
+ const customOpts = computeCustomOpts.value;
10114
+ const mouseOpts = computeMouseOpts.value;
10115
+ const exportOpts = computeExportOpts.value;
10116
+ const importOpts = computeImportOpts.value;
10117
+ if (props.rowId) {
10118
+ warnLog('vxe.error.delProp', ['row-id', 'row-config.keyField']);
10045
10119
  }
10046
- if (process.env.NODE_ENV === 'development') {
10047
- const customOpts = computeCustomOpts.value;
10048
- const mouseOpts = computeMouseOpts.value;
10049
- const rowOpts = computeRowOpts.value;
10050
- if (!props.id) {
10051
- if ((props.customConfig ? isEnableConf(customOpts) : customOpts.enabled) && customOpts.storage) {
10052
- errLog('vxe.error.reqProp', ['id']);
10053
- }
10054
- }
10055
- if (props.treeConfig && checkboxOpts.range) {
10056
- errLog('vxe.error.noTree', ['checkbox-config.range']);
10057
- }
10058
- if (rowOpts.height && !props.showOverflow) {
10059
- warnLog('vxe.error.notProp', ['table.show-overflow']);
10060
- }
10061
- if (!$xeTable.handleMousedownCellAreaEvent) {
10062
- if (props.areaConfig) {
10063
- warnLog('vxe.error.notProp', ['area-config']);
10064
- }
10065
- if (props.clipConfig) {
10066
- warnLog('vxe.error.notProp', ['clip-config']);
10067
- }
10068
- if (props.fnrConfig) {
10069
- warnLog('vxe.error.notProp', ['fnr-config']);
10070
- }
10071
- if (mouseOpts.area) {
10072
- errLog('vxe.error.notProp', ['mouse-config.area']);
10073
- return;
10074
- }
10075
- }
10076
- if (props.dragConfig) {
10077
- warnLog('vxe.error.delProp', ['drag-config', 'row-drag-config']);
10078
- }
10079
- if (props.treeConfig && treeOpts.children) {
10080
- warnLog('vxe.error.delProp', ['tree-config.children', 'tree-config.childrenField']);
10081
- }
10082
- if (props.treeConfig && treeOpts.line) {
10083
- warnLog('vxe.error.delProp', ['tree-config.line', 'tree-config.showLine']);
10084
- }
10085
- if (mouseOpts.area && mouseOpts.selected) {
10086
- warnLog('vxe.error.errConflicts', ['mouse-config.area', 'mouse-config.selected']);
10120
+ if (props.rowKey) {
10121
+ warnLog('vxe.error.delProp', ['row-key', 'row-config.useKey']);
10122
+ }
10123
+ if (props.columnKey) {
10124
+ warnLog('vxe.error.delProp', ['column-id', 'column-config.useKey']);
10125
+ }
10126
+ if (!(props.rowId || rowOpts.keyField) && (checkboxOpts.reserve || checkboxOpts.checkRowKeys || radioOpts.reserve || radioOpts.checkRowKey || expandOpts.expandRowKeys || treeOpts.expandRowKeys)) {
10127
+ warnLog('vxe.error.reqProp', ['row-config.keyField']);
10128
+ }
10129
+ if (props.editConfig && (editOpts.showStatus || editOpts.showUpdateStatus || editOpts.showInsertStatus) && !props.keepSource) {
10130
+ warnLog('vxe.error.reqProp', ['keep-source']);
10131
+ }
10132
+ if (treeConfig && (treeOpts.showLine || treeOpts.line) && (!(props.rowKey || rowOpts.useKey) || !showOverflow)) {
10133
+ warnLog('vxe.error.reqProp', ['row-config.useKey | show-overflow']);
10134
+ }
10135
+ if (treeConfig && !treeOpts.transform && props.stripe) {
10136
+ warnLog('vxe.error.noTree', ['stripe']);
10137
+ }
10138
+ if (props.showFooter && !(props.footerMethod || props.footerData)) {
10139
+ warnLog('vxe.error.reqProp', ['footer-data | footer-method']);
10140
+ }
10141
+ if (rowOpts.height) {
10142
+ warnLog('vxe.error.delProp', ['row-config.height', 'cell-config.height']);
10143
+ }
10144
+ if (props.highlightCurrentRow) {
10145
+ warnLog('vxe.error.delProp', ['highlight-current-row', 'row-config.isCurrent']);
10146
+ }
10147
+ if (props.highlightHoverRow) {
10148
+ warnLog('vxe.error.delProp', ['highlight-hover-row', 'row-config.isHover']);
10149
+ }
10150
+ if (props.highlightCurrentColumn) {
10151
+ warnLog('vxe.error.delProp', ['highlight-current-column', 'column-config.isCurrent']);
10152
+ }
10153
+ if (props.highlightHoverColumn) {
10154
+ warnLog('vxe.error.delProp', ['highlight-hover-column', 'column-config.isHover']);
10155
+ }
10156
+ // 检查导入导出类型,如果自定义导入导出方法,则不校验类型
10157
+ if (importConfig && importOpts.types && !importOpts.importMethod && !XEUtils.includeArrays(XEUtils.keys(importOpts._typeMaps), importOpts.types)) {
10158
+ warnLog('vxe.error.errProp', [`export-config.types=${importOpts.types.join(',')}`, importOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(importOpts._typeMaps), type)).join(',') || XEUtils.keys(importOpts._typeMaps).join(',')]);
10159
+ }
10160
+ if (exportConfig && exportOpts.types && !exportOpts.exportMethod && !XEUtils.includeArrays(XEUtils.keys(exportOpts._typeMaps), exportOpts.types)) {
10161
+ warnLog('vxe.error.errProp', [`export-config.types=${exportOpts.types.join(',')}`, exportOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(exportOpts._typeMaps), type)).join(',') || XEUtils.keys(exportOpts._typeMaps).join(',')]);
10162
+ }
10163
+ if (!props.id) {
10164
+ if ((props.customConfig ? isEnableConf(customOpts) : customOpts.enabled) && customOpts.storage) {
10165
+ errLog('vxe.error.reqProp', ['id']);
10087
10166
  }
10088
- // if (mouseOpts.area && checkboxOpts.range) {
10089
- // warnLog('vxe.error.errConflicts', ['mouse-config.area', 'checkbox-config.range'])
10090
- // }
10091
- if (mouseOpts.area && (props.treeConfig && !treeOpts.transform)) {
10092
- errLog('vxe.error.noTree', ['mouse-config.area']);
10167
+ }
10168
+ if (props.treeConfig && checkboxOpts.range) {
10169
+ errLog('vxe.error.noTree', ['checkbox-config.range']);
10170
+ }
10171
+ if (rowOpts.height && !props.showOverflow) {
10172
+ warnLog('vxe.error.notProp', ['table.show-overflow']);
10173
+ }
10174
+ if (!$xeTable.handleMousedownCellAreaEvent) {
10175
+ if (props.areaConfig) {
10176
+ warnLog('vxe.error.notProp', ['area-config']);
10093
10177
  }
10094
- if (props.editConfig && editOpts.activeMethod) {
10095
- warnLog('vxe.error.delProp', ['edit-config.activeMethod', 'edit-config.beforeEditMethod']);
10178
+ if (props.clipConfig) {
10179
+ warnLog('vxe.error.notProp', ['clip-config']);
10096
10180
  }
10097
- if (props.treeConfig && checkboxOpts.isShiftKey) {
10098
- errLog('vxe.error.errConflicts', ['tree-config', 'checkbox-config.isShiftKey']);
10181
+ if (props.fnrConfig) {
10182
+ warnLog('vxe.error.notProp', ['fnr-config']);
10099
10183
  }
10100
- if (checkboxOpts.halfField) {
10101
- warnLog('vxe.error.delProp', ['checkbox-config.halfField', 'checkbox-config.indeterminateField']);
10184
+ if (mouseOpts.area) {
10185
+ errLog('vxe.error.notProp', ['mouse-config.area']);
10186
+ return;
10102
10187
  }
10103
10188
  }
10189
+ if (treeConfig && rowOpts.drag && !treeOpts.transform) {
10190
+ errLog('vxe.error.notSupportProp', ['column-config.drag', 'tree-config.transform=false', 'tree-config.transform=true']);
10191
+ }
10192
+ if (props.dragConfig) {
10193
+ warnLog('vxe.error.delProp', ['drag-config', 'row-drag-config']);
10194
+ }
10195
+ if (props.treeConfig && treeOpts.children) {
10196
+ warnLog('vxe.error.delProp', ['tree-config.children', 'tree-config.childrenField']);
10197
+ }
10198
+ if (props.treeConfig && treeOpts.line) {
10199
+ warnLog('vxe.error.delProp', ['tree-config.line', 'tree-config.showLine']);
10200
+ }
10201
+ if (mouseOpts.area && mouseOpts.selected) {
10202
+ warnLog('vxe.error.errConflicts', ['mouse-config.area', 'mouse-config.selected']);
10203
+ }
10204
+ if (mouseOpts.area && (props.treeConfig && !treeOpts.transform)) {
10205
+ errLog('vxe.error.noTree', ['mouse-config.area']);
10206
+ }
10207
+ if (props.editConfig && editOpts.activeMethod) {
10208
+ warnLog('vxe.error.delProp', ['edit-config.activeMethod', 'edit-config.beforeEditMethod']);
10209
+ }
10210
+ if (props.treeConfig && checkboxOpts.isShiftKey) {
10211
+ errLog('vxe.error.errConflicts', ['tree-config', 'checkbox-config.isShiftKey']);
10212
+ }
10213
+ if (checkboxOpts.halfField) {
10214
+ warnLog('vxe.error.delProp', ['checkbox-config.halfField', 'checkbox-config.indeterminateField']);
10215
+ }
10104
10216
  // 检查是否有安装需要的模块
10105
- if (process.env.NODE_ENV === 'development') {
10106
- if (props.editConfig && !$xeTable.insert) {
10107
- errLog('vxe.error.reqModule', ['Edit']);
10108
- }
10109
- if (props.editRules && !$xeTable.validate) {
10110
- errLog('vxe.error.reqModule', ['Validator']);
10111
- }
10112
- if ((checkboxOpts.range || props.keyboardConfig || props.mouseConfig) && !$xeTable.handleCellMousedownEvent) {
10113
- errLog('vxe.error.reqModule', ['Keyboard']);
10114
- }
10115
- if ((props.printConfig || props.importConfig || props.exportConfig) && !$xeTable.exportData) {
10116
- errLog('vxe.error.reqModule', ['Export']);
10117
- }
10217
+ if (props.editConfig && !$xeTable.insert) {
10218
+ errLog('vxe.error.reqModule', ['Edit']);
10219
+ }
10220
+ if (props.editRules && !$xeTable.validate) {
10221
+ errLog('vxe.error.reqModule', ['Validator']);
10222
+ }
10223
+ if ((checkboxOpts.range || props.keyboardConfig || props.mouseConfig) && !$xeTable.handleCellMousedownEvent) {
10224
+ errLog('vxe.error.reqModule', ['Keyboard']);
10225
+ }
10226
+ if ((props.printConfig || props.importConfig || props.exportConfig) && !$xeTable.exportData) {
10227
+ errLog('vxe.error.reqModule', ['Export']);
10118
10228
  }
10119
10229
  Object.assign(scrollYStore, {
10120
10230
  startIndex: 0,