vxe-table 3.19.8 → 3.19.10

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 (37) hide show
  1. package/es/style.css +1 -1
  2. package/es/table/src/column.js +6 -0
  3. package/es/table/src/columnInfo.js +3 -0
  4. package/es/table/src/header.js +1 -7
  5. package/es/table/src/methods.js +105 -43
  6. package/es/table/src/table.js +2 -10
  7. package/es/ui/index.js +1 -1
  8. package/es/ui/src/log.js +1 -1
  9. package/lib/index.umd.js +122 -65
  10. package/lib/index.umd.min.js +1 -1
  11. package/lib/style.css +1 -1
  12. package/lib/table/src/column.js +6 -0
  13. package/lib/table/src/column.min.js +1 -1
  14. package/lib/table/src/columnInfo.js +3 -0
  15. package/lib/table/src/columnInfo.min.js +1 -1
  16. package/lib/table/src/header.js +1 -7
  17. package/lib/table/src/header.min.js +1 -1
  18. package/lib/table/src/methods.js +109 -46
  19. package/lib/table/src/methods.min.js +1 -1
  20. package/lib/table/src/table.js +1 -10
  21. package/lib/table/src/table.min.js +1 -1
  22. package/lib/ui/index.js +1 -1
  23. package/lib/ui/index.min.js +1 -1
  24. package/lib/ui/src/log.js +1 -1
  25. package/lib/ui/src/log.min.js +1 -1
  26. package/package.json +1 -1
  27. package/packages/table/src/column.ts +8 -0
  28. package/packages/table/src/columnInfo.ts +5 -0
  29. package/packages/table/src/header.ts +2 -8
  30. package/packages/table/src/methods.ts +108 -47
  31. package/packages/table/src/table.ts +2 -10
  32. /package/es/{iconfont.1762324067655.ttf → iconfont.1762412469745.ttf} +0 -0
  33. /package/es/{iconfont.1762324067655.woff → iconfont.1762412469745.woff} +0 -0
  34. /package/es/{iconfont.1762324067655.woff2 → iconfont.1762412469745.woff2} +0 -0
  35. /package/lib/{iconfont.1762324067655.ttf → iconfont.1762412469745.ttf} +0 -0
  36. /package/lib/{iconfont.1762324067655.woff → iconfont.1762412469745.woff} +0 -0
  37. /package/lib/{iconfont.1762324067655.woff2 → iconfont.1762412469745.woff2} +0 -0
@@ -120,6 +120,9 @@ export class ColumnInfo {
120
120
  titlePrefix: _vm.titlePrefix,
121
121
  titleSuffix: _vm.titleSuffix,
122
122
  aggFunc: _vm.aggFunc,
123
+ copyMethod: _vm.copyMethod,
124
+ cutMethod: _vm.cutMethod,
125
+ pasteMethod: _vm.pasteMethod,
123
126
  // 自定义参数
124
127
  params: _vm.params,
125
128
  // 渲染属性
@@ -317,13 +317,7 @@ function renderFilterRows(h, _vm, isOptimizeMode, cols) {
317
317
  }, flSlot
318
318
  ? $xeTable.callSlot(flSlot, cellParams, h)
319
319
  : (rtFloatingFilter && firstFilterOption
320
- ? getSlotVNs(rtFloatingFilter.call($xeTable, h, filterRender, {
321
- $table: $xeTable,
322
- option: firstFilterOption,
323
- column: column,
324
- columnIndex,
325
- $columnIndex
326
- }))
320
+ ? getSlotVNs(rtFloatingFilter.call($xeTable, h, filterRender, cellParams))
327
321
  : []))
328
322
  ])
329
323
  ]);
@@ -2406,26 +2406,29 @@ const calcCellAutoHeight = ($xeTable, rowRest, wrapperEl) => {
2406
2406
  const reactData = $xeTable;
2407
2407
  const { scrollXLoad } = reactData;
2408
2408
  const wrapperElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
2409
- let colHeight = rowRest.height;
2409
+ let colHeight = 0;
2410
2410
  let firstCellStyle = null;
2411
2411
  let topBottomPadding = 0;
2412
2412
  for (let i = 0; i < wrapperElemList.length; i++) {
2413
2413
  const wrapperElem = wrapperElemList[i];
2414
2414
  const cellElem = wrapperElem.parentElement;
2415
+ const cellStyle = cellElem.style;
2416
+ const orHeight = cellStyle.height;
2417
+ if (!scrollXLoad) {
2418
+ cellStyle.height = '';
2419
+ }
2415
2420
  if (!firstCellStyle) {
2416
- const cellStyle = cellElem.style;
2417
- const orHeight = cellStyle.height;
2418
- if (!scrollXLoad) {
2419
- cellStyle.height = '';
2420
- }
2421
2421
  firstCellStyle = getComputedStyle(cellElem);
2422
2422
  topBottomPadding = firstCellStyle ? Math.ceil(XEUtils.toNumber(firstCellStyle.paddingTop) + XEUtils.toNumber(firstCellStyle.paddingBottom)) : 0;
2423
- if (!scrollXLoad) {
2424
- cellStyle.height = orHeight;
2425
- }
2423
+ }
2424
+ if (!scrollXLoad) {
2425
+ cellStyle.height = orHeight;
2426
2426
  }
2427
2427
  const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0;
2428
- colHeight = scrollXLoad ? Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding)) : Math.ceil(cellHeight + topBottomPadding);
2428
+ colHeight = Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding));
2429
+ }
2430
+ if (scrollXLoad) {
2431
+ colHeight = Math.max(colHeight, rowRest.height);
2429
2432
  }
2430
2433
  return colHeight;
2431
2434
  };
@@ -2442,7 +2445,7 @@ const calcCellHeight = ($xeTable) => {
2442
2445
  const treeOpts = $xeTable.computeTreeOpts;
2443
2446
  const defaultRowHeight = $xeTable.computeDefaultRowHeight;
2444
2447
  const el = $xeTable.$refs.refElem;
2445
- if (!isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine)) && el) {
2448
+ if (el && !isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine))) {
2446
2449
  const { handleGetRowId } = createHandleGetRowId($xeTable);
2447
2450
  el.setAttribute('data-calc-row', 'Y');
2448
2451
  tableData.forEach(row => {
@@ -2450,7 +2453,7 @@ const calcCellHeight = ($xeTable) => {
2450
2453
  const rowRest = fullAllDataRowIdData[rowid];
2451
2454
  if (rowRest) {
2452
2455
  const height = calcCellAutoHeight($xeTable, rowRest, el);
2453
- rowRest.height = Math.max(defaultRowHeight, scrollXLoad ? Math.max(rowRest.height, height) : height);
2456
+ rowRest.height = Math.max(defaultRowHeight, height);
2454
2457
  }
2455
2458
  el.removeAttribute('data-calc-row');
2456
2459
  });
@@ -3784,8 +3787,8 @@ function updateHeight($xeTable) {
3784
3787
  internalData.customHeight = calcTableHeight($xeTable, 'height');
3785
3788
  internalData.customMinHeight = calcTableHeight($xeTable, 'minHeight');
3786
3789
  internalData.customMaxHeight = calcTableHeight($xeTable, 'maxHeight');
3787
- // 如果启用虚拟滚动,默认高度
3788
- if (reactData.scrollYLoad && !(internalData.customHeight || internalData.customMinHeight)) {
3790
+ // 如果启用虚拟滚动,纠正高度
3791
+ if (reactData.scrollYLoad && !(internalData.customHeight || internalData.customMinHeight || internalData.customMaxHeight)) {
3789
3792
  internalData.customHeight = 300;
3790
3793
  }
3791
3794
  }
@@ -4220,6 +4223,26 @@ const Methods = {
4220
4223
  }
4221
4224
  return $xeTable.$nextTick();
4222
4225
  },
4226
+ initData() {
4227
+ const $xeTable = this;
4228
+ const props = $xeTable;
4229
+ const reactData = $xeTable;
4230
+ const internalData = $xeTable;
4231
+ const { data } = props;
4232
+ loadTableData($xeTable, data || [], true).then(() => {
4233
+ if (data && data.length) {
4234
+ internalData.inited = true;
4235
+ internalData.initStatus = true;
4236
+ handleLoadDefaults($xeTable);
4237
+ }
4238
+ handleInitDefaults($xeTable);
4239
+ updateStyle($xeTable);
4240
+ if (!reactData.isAllOverflow) {
4241
+ calcCellHeight($xeTable);
4242
+ updateRowOffsetTop($xeTable);
4243
+ }
4244
+ });
4245
+ },
4223
4246
  /**
4224
4247
  * 加载表格数据
4225
4248
  * @param {Array} datas 数据
@@ -4364,7 +4387,7 @@ const Methods = {
4364
4387
  const internalData = $xeTable;
4365
4388
  const { treeConfig } = props;
4366
4389
  const { isRowGroupStatus } = reactData;
4367
- const { currKeyField, fullAllDataRowIdData, tableFullData, tableFullTreeData, tableFullGroupData, treeExpandedMaps } = internalData;
4390
+ const { currKeyField, fullAllDataRowIdData, tableFullData, tableFullTreeData, tableFullGroupData, treeExpandedMaps, rowExpandedMaps, selectCheckboxMaps } = internalData;
4368
4391
  const fullAllDataRowIdMaps = isReset ? {} : Object.assign({}, fullAllDataRowIdData); // 存在已删除数据
4369
4392
  const fullDataRowIdMaps = {};
4370
4393
  const idMaps = {};
@@ -4385,6 +4408,13 @@ const Methods = {
4385
4408
  rowRest.level = level;
4386
4409
  rowRest.index = currIndex;
4387
4410
  rowRest.treeIndex = index;
4411
+ // 更新缓存
4412
+ if (selectCheckboxMaps[rowid]) {
4413
+ selectCheckboxMaps[rowid] = row;
4414
+ }
4415
+ if (rowExpandedMaps[rowid]) {
4416
+ rowExpandedMaps[rowid] = row;
4417
+ }
4388
4418
  idMaps[rowid] = true;
4389
4419
  fullDataRowIdMaps[rowid] = rowRest;
4390
4420
  fullAllDataRowIdMaps[rowid] = rowRest;
@@ -11210,14 +11240,28 @@ const Methods = {
11210
11240
  if (!(scrollXLoad && overflowX)) {
11211
11241
  xSpaceLeft = 0;
11212
11242
  }
11213
- if (headerTableElem) {
11214
- headerTableElem.style.transform = headerTableElem.getAttribute('xvm') ? `translate(${xSpaceLeft}px, 0px)` : '';
11215
- }
11216
- if (bodyTableElem) {
11217
- bodyTableElem.style.transform = `translate(${xSpaceLeft}px, ${reactData.scrollYTop || 0}px)`;
11243
+ if (getConfig().scrollMarginStyle) {
11244
+ // 已废弃方式
11245
+ if (headerTableElem) {
11246
+ headerTableElem.style.marginLeft = headerTableElem.getAttribute('xvm') ? `${xSpaceLeft}px` : '';
11247
+ }
11248
+ if (bodyTableElem) {
11249
+ bodyTableElem.style.marginLeft = `${xSpaceLeft}px`;
11250
+ }
11251
+ if (footerTableElem) {
11252
+ footerTableElem.style.marginLeft = footerTableElem.getAttribute('xvm') ? `${xSpaceLeft}px` : '';
11253
+ }
11218
11254
  }
11219
- if (footerTableElem) {
11220
- footerTableElem.style.transform = footerTableElem.getAttribute('xvm') ? `translate(${xSpaceLeft}px, 0px)` : '';
11255
+ else {
11256
+ if (headerTableElem) {
11257
+ headerTableElem.style.transform = headerTableElem.getAttribute('xvm') ? `translate(${xSpaceLeft}px, 0px)` : '';
11258
+ }
11259
+ if (bodyTableElem) {
11260
+ bodyTableElem.style.transform = `translate(${xSpaceLeft}px, ${reactData.scrollYTop || 0}px)`;
11261
+ }
11262
+ if (footerTableElem) {
11263
+ footerTableElem.style.transform = footerTableElem.getAttribute('xvm') ? `translate(${xSpaceLeft}px, 0px)` : '';
11264
+ }
11221
11265
  }
11222
11266
  const containerList = ['main'];
11223
11267
  containerList.forEach(name => {
@@ -11290,22 +11334,27 @@ const Methods = {
11290
11334
  }
11291
11335
  else {
11292
11336
  const firstRow = afterFullData[startIndex];
11293
- let rowid = getRowid($xeTable, firstRow);
11294
- let rowRest = fullAllDataRowIdData[rowid] || {};
11295
- ySpaceTop = (rowRest.oTop || 0);
11296
- const lastRow = afterFullData[afterFullData.length - 1];
11297
- rowid = getRowid($xeTable, lastRow);
11298
- rowRest = fullAllDataRowIdData[rowid] || {};
11299
- // 如果为空时还没计算完数据,保持原高度不变
11300
- if (rowRest.oTop) {
11301
- sYHeight = (rowRest.oTop || 0) + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
11302
- // 是否展开行
11303
- if (expandColumn && rowExpandedMaps[rowid]) {
11304
- sYHeight += rowRest.expandHeight || expandOpts.height || 0;
11337
+ if (firstRow) {
11338
+ let rowid = getRowid($xeTable, firstRow);
11339
+ let rowRest = fullAllDataRowIdData[rowid] || {};
11340
+ ySpaceTop = (rowRest.oTop || 0);
11341
+ const lastRow = afterFullData[afterFullData.length - 1];
11342
+ rowid = getRowid($xeTable, lastRow);
11343
+ rowRest = fullAllDataRowIdData[rowid] || {};
11344
+ // 如果为空时还没计算完数据,保持原高度不变
11345
+ if (rowRest.oTop) {
11346
+ sYHeight = (rowRest.oTop || 0) + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
11347
+ // 是否展开行
11348
+ if (expandColumn && rowExpandedMaps[rowid]) {
11349
+ sYHeight += rowRest.expandHeight || expandOpts.height || 0;
11350
+ }
11351
+ }
11352
+ if (sYHeight > maxYHeight) {
11353
+ isScrollYBig = true;
11305
11354
  }
11306
11355
  }
11307
- if (sYHeight > maxYHeight) {
11308
- isScrollYBig = true;
11356
+ else {
11357
+ sYHeight = bodyTableElem ? bodyTableElem.clientHeight : 0;
11309
11358
  }
11310
11359
  }
11311
11360
  }
@@ -11334,14 +11383,27 @@ const Methods = {
11334
11383
  if (!(scrollYLoad && overflowY)) {
11335
11384
  scrollYTop = 0;
11336
11385
  }
11337
- if (leftBodyTableElem) {
11338
- leftBodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`;
11339
- }
11340
- if (bodyTableElem) {
11341
- bodyTableElem.style.transform = `translate(${reactData.scrollXLeft || 0}px, ${scrollYTop}px)`;
11386
+ if (getConfig().scrollMarginStyle) {
11387
+ if (leftBodyTableElem) {
11388
+ leftBodyTableElem.style.marginTop = `${scrollYTop}px`;
11389
+ }
11390
+ if (bodyTableElem) {
11391
+ bodyTableElem.style.marginTop = `${scrollYTop}px`;
11392
+ }
11393
+ if (rightbodyTableElem) {
11394
+ rightbodyTableElem.style.marginTop = `${scrollYTop}px`;
11395
+ }
11342
11396
  }
11343
- if (rightbodyTableElem) {
11344
- rightbodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`;
11397
+ else {
11398
+ if (leftBodyTableElem) {
11399
+ leftBodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`;
11400
+ }
11401
+ if (bodyTableElem) {
11402
+ bodyTableElem.style.transform = `translate(${reactData.scrollXLeft || 0}px, ${scrollYTop}px)`;
11403
+ }
11404
+ if (rightbodyTableElem) {
11405
+ rightbodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`;
11406
+ }
11345
11407
  }
11346
11408
  containerList.forEach(name => {
11347
11409
  const layoutList = ['header', 'body', 'footer'];
@@ -1598,7 +1598,7 @@ export default {
1598
1598
  const internalData = $xeTable;
1599
1599
  XEUtils.assign(internalData, createInternalData());
1600
1600
  handleKeyField($xeTable);
1601
- const { data, exportConfig, importConfig, treeConfig, highlightCurrentRow, highlightCurrentColumn } = props;
1601
+ const { exportConfig, importConfig, treeConfig, highlightCurrentRow, highlightCurrentColumn } = props;
1602
1602
  const { scrollXStore, scrollYStore } = internalData;
1603
1603
  const columnOpts = $xeTable.computeColumnOpts;
1604
1604
  const editOpts = $xeTable.computeEditOpts;
@@ -1851,15 +1851,7 @@ export default {
1851
1851
  visibleSize: 0
1852
1852
  });
1853
1853
  this.handleUpdateRowGroup(groupFields);
1854
- this.loadTableData(data, true).then(() => {
1855
- if (data && data.length) {
1856
- this.inited = true;
1857
- this.initStatus = true;
1858
- this.handleLoadDefaults();
1859
- }
1860
- this.handleInitDefaults();
1861
- this.updateStyle();
1862
- });
1854
+ this.initData();
1863
1855
  globalEvents.on($xeTable, 'paste', this.handleGlobalPasteEvent);
1864
1856
  globalEvents.on($xeTable, 'copy', this.handleGlobalCopyEvent);
1865
1857
  globalEvents.on($xeTable, 'cut', this.handleGlobalCutEvent);
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "3.19.8";
3
+ export const version = "3.19.10";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"3.19.8"}`;
3
+ const version = `table v${"3.19.10"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -2005,7 +2005,7 @@ function getClass(property, params) {
2005
2005
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2006
2006
 
2007
2007
 
2008
- const version = "3.19.8";
2008
+ const version = "3.19.10";
2009
2009
  core_.VxeUI.version = version;
2010
2010
  core_.VxeUI.tableVersion = version;
2011
2011
  core_.VxeUI.setConfig({
@@ -2713,7 +2713,7 @@ function isNodeElement(elem) {
2713
2713
  const {
2714
2714
  log: log_log
2715
2715
  } = core_.VxeUI;
2716
- const log_version = `table v${"3.19.8"}`;
2716
+ const log_version = `table v${"3.19.10"}`;
2717
2717
  const warnLog = log_log.create('warn', log_version);
2718
2718
  const errLog = log_log.create('error', log_version);
2719
2719
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -2853,6 +2853,9 @@ class ColumnInfo {
2853
2853
  titlePrefix: _vm.titlePrefix,
2854
2854
  titleSuffix: _vm.titleSuffix,
2855
2855
  aggFunc: _vm.aggFunc,
2856
+ copyMethod: _vm.copyMethod,
2857
+ cutMethod: _vm.cutMethod,
2858
+ pasteMethod: _vm.pasteMethod,
2856
2859
  // 自定义参数
2857
2860
  params: _vm.params,
2858
2861
  // 渲染属性
@@ -5370,6 +5373,12 @@ const columnProps = {
5370
5373
  contentRender: Object,
5371
5374
  // 聚合函数
5372
5375
  aggFunc: [String, Boolean],
5376
+ // 将单元格复制到剪贴板
5377
+ copyMethod: Function,
5378
+ // 将剪贴单元格的值清除
5379
+ cutMethod: Function,
5380
+ // 从剪贴板赋值到单元格
5381
+ pasteMethod: Function,
5373
5382
  // 额外的参数
5374
5383
  params: Object
5375
5384
  };
@@ -8806,26 +8815,29 @@ const calcCellAutoHeight = ($xeTable, rowRest, wrapperEl) => {
8806
8815
  scrollXLoad
8807
8816
  } = reactData;
8808
8817
  const wrapperElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
8809
- let colHeight = rowRest.height;
8818
+ let colHeight = 0;
8810
8819
  let firstCellStyle = null;
8811
8820
  let topBottomPadding = 0;
8812
8821
  for (let i = 0; i < wrapperElemList.length; i++) {
8813
8822
  const wrapperElem = wrapperElemList[i];
8814
8823
  const cellElem = wrapperElem.parentElement;
8824
+ const cellStyle = cellElem.style;
8825
+ const orHeight = cellStyle.height;
8826
+ if (!scrollXLoad) {
8827
+ cellStyle.height = '';
8828
+ }
8815
8829
  if (!firstCellStyle) {
8816
- const cellStyle = cellElem.style;
8817
- const orHeight = cellStyle.height;
8818
- if (!scrollXLoad) {
8819
- cellStyle.height = '';
8820
- }
8821
8830
  firstCellStyle = getComputedStyle(cellElem);
8822
8831
  topBottomPadding = firstCellStyle ? Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(firstCellStyle.paddingTop) + external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(firstCellStyle.paddingBottom)) : 0;
8823
- if (!scrollXLoad) {
8824
- cellStyle.height = orHeight;
8825
- }
8832
+ }
8833
+ if (!scrollXLoad) {
8834
+ cellStyle.height = orHeight;
8826
8835
  }
8827
8836
  const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0;
8828
- colHeight = scrollXLoad ? Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding)) : Math.ceil(cellHeight + topBottomPadding);
8837
+ colHeight = Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding));
8838
+ }
8839
+ if (scrollXLoad) {
8840
+ colHeight = Math.max(colHeight, rowRest.height);
8829
8841
  }
8830
8842
  return colHeight;
8831
8843
  };
@@ -8851,7 +8863,7 @@ const calcCellHeight = $xeTable => {
8851
8863
  const treeOpts = $xeTable.computeTreeOpts;
8852
8864
  const defaultRowHeight = $xeTable.computeDefaultRowHeight;
8853
8865
  const el = $xeTable.$refs.refElem;
8854
- if (!isAllOverflow && (scrollYLoad || scrollXLoad || treeConfig && treeOpts.showLine) && el) {
8866
+ if (el && !isAllOverflow && (scrollYLoad || scrollXLoad || treeConfig && treeOpts.showLine)) {
8855
8867
  const {
8856
8868
  handleGetRowId
8857
8869
  } = createHandleGetRowId($xeTable);
@@ -8861,7 +8873,7 @@ const calcCellHeight = $xeTable => {
8861
8873
  const rowRest = fullAllDataRowIdData[rowid];
8862
8874
  if (rowRest) {
8863
8875
  const height = calcCellAutoHeight($xeTable, rowRest, el);
8864
- rowRest.height = Math.max(defaultRowHeight, scrollXLoad ? Math.max(rowRest.height, height) : height);
8876
+ rowRest.height = Math.max(defaultRowHeight, height);
8865
8877
  }
8866
8878
  el.removeAttribute('data-calc-row');
8867
8879
  });
@@ -10359,8 +10371,8 @@ function updateHeight($xeTable) {
10359
10371
  internalData.customHeight = calcTableHeight($xeTable, 'height');
10360
10372
  internalData.customMinHeight = calcTableHeight($xeTable, 'minHeight');
10361
10373
  internalData.customMaxHeight = calcTableHeight($xeTable, 'maxHeight');
10362
- // 如果启用虚拟滚动,默认高度
10363
- if (reactData.scrollYLoad && !(internalData.customHeight || internalData.customMinHeight)) {
10374
+ // 如果启用虚拟滚动,纠正高度
10375
+ if (reactData.scrollYLoad && !(internalData.customHeight || internalData.customMinHeight || internalData.customMaxHeight)) {
10364
10376
  internalData.customHeight = 300;
10365
10377
  }
10366
10378
  }
@@ -10850,6 +10862,28 @@ const Methods = {
10850
10862
  }
10851
10863
  return $xeTable.$nextTick();
10852
10864
  },
10865
+ initData() {
10866
+ const $xeTable = this;
10867
+ const props = $xeTable;
10868
+ const reactData = $xeTable;
10869
+ const internalData = $xeTable;
10870
+ const {
10871
+ data
10872
+ } = props;
10873
+ loadTableData($xeTable, data || [], true).then(() => {
10874
+ if (data && data.length) {
10875
+ internalData.inited = true;
10876
+ internalData.initStatus = true;
10877
+ handleLoadDefaults($xeTable);
10878
+ }
10879
+ handleInitDefaults($xeTable);
10880
+ updateStyle($xeTable);
10881
+ if (!reactData.isAllOverflow) {
10882
+ calcCellHeight($xeTable);
10883
+ updateRowOffsetTop($xeTable);
10884
+ }
10885
+ });
10886
+ },
10853
10887
  /**
10854
10888
  * 加载表格数据
10855
10889
  * @param {Array} datas 数据
@@ -11013,7 +11047,9 @@ const Methods = {
11013
11047
  tableFullData,
11014
11048
  tableFullTreeData,
11015
11049
  tableFullGroupData,
11016
- treeExpandedMaps
11050
+ treeExpandedMaps,
11051
+ rowExpandedMaps,
11052
+ selectCheckboxMaps
11017
11053
  } = internalData;
11018
11054
  const fullAllDataRowIdMaps = isReset ? {} : {
11019
11055
  ...fullAllDataRowIdData
@@ -11055,6 +11091,13 @@ const Methods = {
11055
11091
  rowRest.level = level;
11056
11092
  rowRest.index = currIndex;
11057
11093
  rowRest.treeIndex = index;
11094
+ // 更新缓存
11095
+ if (selectCheckboxMaps[rowid]) {
11096
+ selectCheckboxMaps[rowid] = row;
11097
+ }
11098
+ if (rowExpandedMaps[rowid]) {
11099
+ rowExpandedMaps[rowid] = row;
11100
+ }
11058
11101
  idMaps[rowid] = true;
11059
11102
  fullDataRowIdMaps[rowid] = rowRest;
11060
11103
  fullAllDataRowIdMaps[rowid] = rowRest;
@@ -18981,14 +19024,27 @@ const Methods = {
18981
19024
  if (!(scrollXLoad && overflowX)) {
18982
19025
  xSpaceLeft = 0;
18983
19026
  }
18984
- if (headerTableElem) {
18985
- headerTableElem.style.transform = headerTableElem.getAttribute('xvm') ? `translate(${xSpaceLeft}px, 0px)` : '';
18986
- }
18987
- if (bodyTableElem) {
18988
- bodyTableElem.style.transform = `translate(${xSpaceLeft}px, ${reactData.scrollYTop || 0}px)`;
18989
- }
18990
- if (footerTableElem) {
18991
- footerTableElem.style.transform = footerTableElem.getAttribute('xvm') ? `translate(${xSpaceLeft}px, 0px)` : '';
19027
+ if (methods_getConfig().scrollMarginStyle) {
19028
+ // 已废弃方式
19029
+ if (headerTableElem) {
19030
+ headerTableElem.style.marginLeft = headerTableElem.getAttribute('xvm') ? `${xSpaceLeft}px` : '';
19031
+ }
19032
+ if (bodyTableElem) {
19033
+ bodyTableElem.style.marginLeft = `${xSpaceLeft}px`;
19034
+ }
19035
+ if (footerTableElem) {
19036
+ footerTableElem.style.marginLeft = footerTableElem.getAttribute('xvm') ? `${xSpaceLeft}px` : '';
19037
+ }
19038
+ } else {
19039
+ if (headerTableElem) {
19040
+ headerTableElem.style.transform = headerTableElem.getAttribute('xvm') ? `translate(${xSpaceLeft}px, 0px)` : '';
19041
+ }
19042
+ if (bodyTableElem) {
19043
+ bodyTableElem.style.transform = `translate(${xSpaceLeft}px, ${reactData.scrollYTop || 0}px)`;
19044
+ }
19045
+ if (footerTableElem) {
19046
+ footerTableElem.style.transform = footerTableElem.getAttribute('xvm') ? `translate(${xSpaceLeft}px, 0px)` : '';
19047
+ }
18992
19048
  }
18993
19049
  const containerList = ['main'];
18994
19050
  containerList.forEach(name => {
@@ -19075,22 +19131,26 @@ const Methods = {
19075
19131
  ySpaceTop = Math.max(0, startIndex * defaultRowHeight);
19076
19132
  } else {
19077
19133
  const firstRow = afterFullData[startIndex];
19078
- let rowid = getRowid($xeTable, firstRow);
19079
- let rowRest = fullAllDataRowIdData[rowid] || {};
19080
- ySpaceTop = rowRest.oTop || 0;
19081
- const lastRow = afterFullData[afterFullData.length - 1];
19082
- rowid = getRowid($xeTable, lastRow);
19083
- rowRest = fullAllDataRowIdData[rowid] || {};
19084
- // 如果为空时还没计算完数据,保持原高度不变
19085
- if (rowRest.oTop) {
19086
- sYHeight = (rowRest.oTop || 0) + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
19087
- // 是否展开行
19088
- if (expandColumn && rowExpandedMaps[rowid]) {
19089
- sYHeight += rowRest.expandHeight || expandOpts.height || 0;
19134
+ if (firstRow) {
19135
+ let rowid = getRowid($xeTable, firstRow);
19136
+ let rowRest = fullAllDataRowIdData[rowid] || {};
19137
+ ySpaceTop = rowRest.oTop || 0;
19138
+ const lastRow = afterFullData[afterFullData.length - 1];
19139
+ rowid = getRowid($xeTable, lastRow);
19140
+ rowRest = fullAllDataRowIdData[rowid] || {};
19141
+ // 如果为空时还没计算完数据,保持原高度不变
19142
+ if (rowRest.oTop) {
19143
+ sYHeight = (rowRest.oTop || 0) + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
19144
+ // 是否展开行
19145
+ if (expandColumn && rowExpandedMaps[rowid]) {
19146
+ sYHeight += rowRest.expandHeight || expandOpts.height || 0;
19147
+ }
19090
19148
  }
19091
- }
19092
- if (sYHeight > maxYHeight) {
19093
- isScrollYBig = true;
19149
+ if (sYHeight > maxYHeight) {
19150
+ isScrollYBig = true;
19151
+ }
19152
+ } else {
19153
+ sYHeight = bodyTableElem ? bodyTableElem.clientHeight : 0;
19094
19154
  }
19095
19155
  }
19096
19156
  } else {
@@ -19117,14 +19177,26 @@ const Methods = {
19117
19177
  if (!(scrollYLoad && overflowY)) {
19118
19178
  scrollYTop = 0;
19119
19179
  }
19120
- if (leftBodyTableElem) {
19121
- leftBodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`;
19122
- }
19123
- if (bodyTableElem) {
19124
- bodyTableElem.style.transform = `translate(${reactData.scrollXLeft || 0}px, ${scrollYTop}px)`;
19125
- }
19126
- if (rightbodyTableElem) {
19127
- rightbodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`;
19180
+ if (methods_getConfig().scrollMarginStyle) {
19181
+ if (leftBodyTableElem) {
19182
+ leftBodyTableElem.style.marginTop = `${scrollYTop}px`;
19183
+ }
19184
+ if (bodyTableElem) {
19185
+ bodyTableElem.style.marginTop = `${scrollYTop}px`;
19186
+ }
19187
+ if (rightbodyTableElem) {
19188
+ rightbodyTableElem.style.marginTop = `${scrollYTop}px`;
19189
+ }
19190
+ } else {
19191
+ if (leftBodyTableElem) {
19192
+ leftBodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`;
19193
+ }
19194
+ if (bodyTableElem) {
19195
+ bodyTableElem.style.transform = `translate(${reactData.scrollXLeft || 0}px, ${scrollYTop}px)`;
19196
+ }
19197
+ if (rightbodyTableElem) {
19198
+ rightbodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`;
19199
+ }
19128
19200
  }
19129
19201
  containerList.forEach(name => {
19130
19202
  const layoutList = ['header', 'body', 'footer'];
@@ -21072,13 +21144,7 @@ function renderFilterRows(h, _vm, isOptimizeMode, cols) {
21072
21144
  colid
21073
21145
  },
21074
21146
  class: 'vxe-cell--wrapper vxe-header-cell--wrapper'
21075
- }, flSlot ? $xeTable.callSlot(flSlot, cellParams, h) : rtFloatingFilter && firstFilterOption ? getSlotVNs(rtFloatingFilter.call($xeTable, h, filterRender, {
21076
- $table: $xeTable,
21077
- option: firstFilterOption,
21078
- column: column,
21079
- columnIndex,
21080
- $columnIndex
21081
- })) : [])])]);
21147
+ }, flSlot ? $xeTable.callSlot(flSlot, cellParams, h) : rtFloatingFilter && firstFilterOption ? getSlotVNs(rtFloatingFilter.call($xeTable, h, filterRender, cellParams)) : [])])]);
21082
21148
  });
21083
21149
  }
21084
21150
  function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
@@ -31909,7 +31975,6 @@ function renderBody(h, $xeTable) {
31909
31975
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(internalData, createInternalData());
31910
31976
  handleKeyField($xeTable);
31911
31977
  const {
31912
- data,
31913
31978
  exportConfig,
31914
31979
  importConfig,
31915
31980
  treeConfig,
@@ -32173,15 +32238,7 @@ function renderBody(h, $xeTable) {
32173
32238
  visibleSize: 0
32174
32239
  });
32175
32240
  this.handleUpdateRowGroup(groupFields);
32176
- this.loadTableData(data, true).then(() => {
32177
- if (data && data.length) {
32178
- this.inited = true;
32179
- this.initStatus = true;
32180
- this.handleLoadDefaults();
32181
- }
32182
- this.handleInitDefaults();
32183
- this.updateStyle();
32184
- });
32241
+ this.initData();
32185
32242
  table_globalEvents.on($xeTable, 'paste', this.handleGlobalPasteEvent);
32186
32243
  table_globalEvents.on($xeTable, 'copy', this.handleGlobalCopyEvent);
32187
32244
  table_globalEvents.on($xeTable, 'cut', this.handleGlobalCutEvent);