vxe-table 3.12.7 → 3.12.9

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.
@@ -309,10 +309,7 @@ function handleVirtualYVisible($xeTable) {
309
309
  const row = afterFullData[rIndex];
310
310
  const rowid = getRowid($xeTable, row);
311
311
  const rowRest = fullAllDataRowIdData[rowid];
312
- if (!rowRest) {
313
- break;
314
- }
315
- offsetTop += rowRest.height || rowHeight;
312
+ offsetTop += rowRest ? (rowRest.height || rowHeight) : rowHeight;
316
313
  if (toVisibleIndex === -1 && scrollTop < offsetTop) {
317
314
  toVisibleIndex = rIndex;
318
315
  }
@@ -2245,30 +2242,6 @@ const Methods = {
2245
2242
  this.afterTreeFullData = tableTree;
2246
2243
  this.updateAfterDataIndex();
2247
2244
  },
2248
- updateTreeDataIndex() {
2249
- const $xeTable = this;
2250
- const props = $xeTable;
2251
- const internalData = $xeTable;
2252
- const { treeConfig } = props;
2253
- const { afterFullData, fullDataRowIdData, fullAllDataRowIdData } = internalData;
2254
- const treeOpts = $xeTable.computeTreeOpts;
2255
- if (treeConfig) {
2256
- if (treeOpts.transform) {
2257
- afterFullData.forEach((row, index) => {
2258
- const rowid = getRowid($xeTable, row);
2259
- const rowRest = fullAllDataRowIdData[rowid];
2260
- if (rowRest) {
2261
- rowRest._index = index;
2262
- }
2263
- else {
2264
- const rest = { row, rowid, seq: '-1', index: -1, $index: -1, _index: index, items: [], parent: null, level: 0, height: 0, oTop: 0 };
2265
- fullAllDataRowIdData[rowid] = rest;
2266
- fullDataRowIdData[rowid] = rest;
2267
- }
2268
- });
2269
- }
2270
- }
2271
- },
2272
2245
  /**
2273
2246
  * 预编译
2274
2247
  * 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
@@ -2298,7 +2271,6 @@ const Methods = {
2298
2271
  }
2299
2272
  fullMaps[rowid] = row;
2300
2273
  }, { children: treeOpts.transform ? treeOpts.mapChildrenField : childrenField });
2301
- $xeTable.updateTreeDataIndex();
2302
2274
  }
2303
2275
  else {
2304
2276
  afterFullData.forEach((row, index) => {
@@ -6688,7 +6660,7 @@ const Methods = {
6688
6660
  return this.$nextTick().then(() => {
6689
6661
  if (transform) {
6690
6662
  this.handleTableData();
6691
- this.updateTreeDataIndex();
6663
+ this.updateAfterDataIndex();
6692
6664
  return this.$nextTick();
6693
6665
  }
6694
6666
  });
@@ -6804,7 +6776,7 @@ const Methods = {
6804
6776
  return this.handleBaseTreeExpand(rows, expanded).then(() => {
6805
6777
  handleVirtualTreeToList($xeTable);
6806
6778
  this.handleTableData();
6807
- this.updateTreeDataIndex();
6779
+ this.updateAfterDataIndex();
6808
6780
  }).then(() => {
6809
6781
  return this.recalculate();
6810
6782
  }).then(() => {
@@ -7337,6 +7309,10 @@ const Methods = {
7337
7309
  */
7338
7310
  scrollToRow(row, fieldOrColumn) {
7339
7311
  const $xeTable = this;
7312
+ const props = $xeTable;
7313
+ const reactData = $xeTable;
7314
+ const { showOverflow } = props;
7315
+ const { scrollYLoad, scrollXLoad } = reactData;
7340
7316
  const rest = [];
7341
7317
  if (row) {
7342
7318
  if (this.treeConfig) {
@@ -7349,7 +7325,15 @@ const Methods = {
7349
7325
  if (fieldOrColumn) {
7350
7326
  rest.push(handleScrollToRowColumn($xeTable, fieldOrColumn, row));
7351
7327
  }
7352
- return Promise.all(rest);
7328
+ return Promise.all(rest).then(() => {
7329
+ if (row) {
7330
+ if (!showOverflow && (scrollYLoad || scrollXLoad)) {
7331
+ calcCellHeight($xeTable);
7332
+ calcCellWidth($xeTable);
7333
+ }
7334
+ return $xeTable.$nextTick();
7335
+ }
7336
+ });
7353
7337
  },
7354
7338
  /**
7355
7339
  * 如果有滚动条,则滚动到对应的列
@@ -61,11 +61,6 @@ export const convertHeaderColumnToRows = (originColumns) => {
61
61
  });
62
62
  return rows;
63
63
  };
64
- const lineOffsetSizes = {
65
- mini: 3,
66
- small: 2,
67
- medium: 1
68
- };
69
64
  export function restoreScrollLocation($xeTable, scrollLeft, scrollTop) {
70
65
  const internalData = $xeTable;
71
66
  return $xeTable.clearScroll().then(() => {
@@ -229,15 +224,21 @@ export function getColReMinWidth(params) {
229
224
  }
230
225
  return mWidth;
231
226
  }
227
+ const lineOffsetSizes = {
228
+ mini: 3,
229
+ small: 2,
230
+ medium: 1
231
+ };
232
232
  function countTreeExpand(prevRow, params) {
233
233
  let count = 1;
234
234
  if (!prevRow) {
235
235
  return count;
236
236
  }
237
237
  const { $table } = params;
238
- const { treeOpts } = $table;
238
+ const treeOpts = $table.computeTreeOpts;
239
+ const { transform, mapChildrenField } = treeOpts;
239
240
  const childrenField = treeOpts.children || treeOpts.childrenField;
240
- const rowChildren = prevRow[childrenField];
241
+ const rowChildren = prevRow[transform ? mapChildrenField : childrenField];
241
242
  if (rowChildren && $table.isTreeExpandByRow(prevRow)) {
242
243
  for (let index = 0; index < rowChildren.length; index++) {
243
244
  count += countTreeExpand(rowChildren[index], params);
@@ -245,17 +246,21 @@ function countTreeExpand(prevRow, params) {
245
246
  }
246
247
  return count;
247
248
  }
248
- export function getOffsetSize($xetable) {
249
- const vSize = $xetable.computeSize;
250
- return lineOffsetSizes[vSize] || 0;
249
+ export function getOffsetSize($xeTable) {
250
+ const vSize = $xeTable.computeSize;
251
+ if (vSize) {
252
+ return lineOffsetSizes[vSize] || 0;
253
+ }
254
+ return 0;
251
255
  }
252
- export function calcTreeLine(params, items, rIndex) {
256
+ export function calcTreeLine(params, prevRow) {
253
257
  const { $table } = params;
258
+ const tableReactData = $table;
254
259
  let expandSize = 1;
255
- if (rIndex) {
256
- expandSize = countTreeExpand(items[rIndex - 1], params);
260
+ if (prevRow) {
261
+ expandSize = countTreeExpand(prevRow, params);
257
262
  }
258
- return $table.rowHeight * expandSize - (rIndex ? 1 : (12 - getOffsetSize($table)));
263
+ return tableReactData.rowHeight * expandSize - (prevRow ? 1 : (12 - getOffsetSize($table)));
259
264
  }
260
265
  export function mergeBodyMethod(mergeList, _rowIndex, _columnIndex) {
261
266
  for (let mIndex = 0; mIndex < mergeList.length; mIndex++) {
@@ -320,6 +325,7 @@ export function rowToVisible($xeTable, row) {
320
325
  const tableBody = $xeTable.$refs.tableBody;
321
326
  const { columnStore, scrollYLoad } = reactData;
322
327
  const { afterFullData, scrollYStore, fullAllDataRowIdData } = internalData;
328
+ const { rowHeight } = scrollYStore;
323
329
  const { leftList, rightList } = columnStore;
324
330
  const bodyElem = tableBody ? tableBody.$el : null;
325
331
  const rowid = getRowid($xeTable, row);
@@ -351,19 +357,19 @@ export function rowToVisible($xeTable, row) {
351
357
  // 如果是虚拟渲染滚动
352
358
  if (scrollYLoad) {
353
359
  if (showOverflow) {
354
- return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * scrollYStore.rowHeight);
360
+ return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * rowHeight);
355
361
  }
356
362
  let scrollTop = 0;
357
- const rest = fullAllDataRowIdData[rowid];
358
- const rHeight = rest ? rest.height : 0;
363
+ const rowRest = fullAllDataRowIdData[rowid];
364
+ const rHeight = rowRest ? (rowRest.height || rowHeight) : rowHeight;
359
365
  for (let i = 0; i < afterFullData.length; i++) {
360
366
  const currRow = afterFullData[i];
361
367
  const currRowid = getRowid($xeTable, currRow);
362
368
  if (currRow === row || currRowid === rowid) {
363
369
  break;
364
370
  }
365
- const rest = fullAllDataRowIdData[currRowid];
366
- scrollTop += rest ? rest.height : 0;
371
+ const rowRest = fullAllDataRowIdData[currRowid];
372
+ scrollTop += rowRest ? (rowRest.height || rowHeight) : rowHeight;
367
373
  }
368
374
  if (scrollTop < bodyScrollTop) {
369
375
  return $xeTable.scrollTo(null, scrollTop - offsetFixedLeft - 1);
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.12.7";
3
+ export const version = "3.12.9";
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.12.7"}`;
3
+ const version = `table v${"3.12.9"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
2220
2220
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2221
2221
 
2222
2222
 
2223
- const version = "3.12.7";
2223
+ const version = "3.12.9";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2814,7 +2814,7 @@ function isNodeElement(elem) {
2814
2814
  const {
2815
2815
  log: log_log
2816
2816
  } = core_.VxeUI;
2817
- const log_version = `table v${"3.12.7"}`;
2817
+ const log_version = `table v${"3.12.9"}`;
2818
2818
  const warnLog = log_log.create('warn', log_version);
2819
2819
  const errLog = log_log.create('error', log_version);
2820
2820
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -3055,11 +3055,6 @@ const convertHeaderColumnToRows = originColumns => {
3055
3055
  });
3056
3056
  return rows;
3057
3057
  };
3058
- const lineOffsetSizes = {
3059
- mini: 3,
3060
- small: 2,
3061
- medium: 1
3062
- };
3063
3058
  function restoreScrollLocation($xeTable, scrollLeft, scrollTop) {
3064
3059
  const internalData = $xeTable;
3065
3060
  return $xeTable.clearScroll().then(() => {
@@ -3255,6 +3250,11 @@ function getColReMinWidth(params) {
3255
3250
  }
3256
3251
  return mWidth;
3257
3252
  }
3253
+ const lineOffsetSizes = {
3254
+ mini: 3,
3255
+ small: 2,
3256
+ medium: 1
3257
+ };
3258
3258
  function countTreeExpand(prevRow, params) {
3259
3259
  let count = 1;
3260
3260
  if (!prevRow) {
@@ -3263,11 +3263,13 @@ function countTreeExpand(prevRow, params) {
3263
3263
  const {
3264
3264
  $table
3265
3265
  } = params;
3266
+ const treeOpts = $table.computeTreeOpts;
3266
3267
  const {
3267
- treeOpts
3268
- } = $table;
3268
+ transform,
3269
+ mapChildrenField
3270
+ } = treeOpts;
3269
3271
  const childrenField = treeOpts.children || treeOpts.childrenField;
3270
- const rowChildren = prevRow[childrenField];
3272
+ const rowChildren = prevRow[transform ? mapChildrenField : childrenField];
3271
3273
  if (rowChildren && $table.isTreeExpandByRow(prevRow)) {
3272
3274
  for (let index = 0; index < rowChildren.length; index++) {
3273
3275
  count += countTreeExpand(rowChildren[index], params);
@@ -3275,19 +3277,23 @@ function countTreeExpand(prevRow, params) {
3275
3277
  }
3276
3278
  return count;
3277
3279
  }
3278
- function getOffsetSize($xetable) {
3279
- const vSize = $xetable.computeSize;
3280
- return lineOffsetSizes[vSize] || 0;
3280
+ function getOffsetSize($xeTable) {
3281
+ const vSize = $xeTable.computeSize;
3282
+ if (vSize) {
3283
+ return lineOffsetSizes[vSize] || 0;
3284
+ }
3285
+ return 0;
3281
3286
  }
3282
- function calcTreeLine(params, items, rIndex) {
3287
+ function calcTreeLine(params, prevRow) {
3283
3288
  const {
3284
3289
  $table
3285
3290
  } = params;
3291
+ const tableReactData = $table;
3286
3292
  let expandSize = 1;
3287
- if (rIndex) {
3288
- expandSize = countTreeExpand(items[rIndex - 1], params);
3293
+ if (prevRow) {
3294
+ expandSize = countTreeExpand(prevRow, params);
3289
3295
  }
3290
- return $table.rowHeight * expandSize - (rIndex ? 1 : 12 - getOffsetSize($table));
3296
+ return tableReactData.rowHeight * expandSize - (prevRow ? 1 : 12 - getOffsetSize($table));
3291
3297
  }
3292
3298
  function mergeBodyMethod(mergeList, _rowIndex, _columnIndex) {
3293
3299
  for (let mIndex = 0; mIndex < mergeList.length; mIndex++) {
@@ -3372,6 +3378,9 @@ function rowToVisible($xeTable, row) {
3372
3378
  scrollYStore,
3373
3379
  fullAllDataRowIdData
3374
3380
  } = internalData;
3381
+ const {
3382
+ rowHeight
3383
+ } = scrollYStore;
3375
3384
  const {
3376
3385
  leftList,
3377
3386
  rightList
@@ -3404,19 +3413,19 @@ function rowToVisible($xeTable, row) {
3404
3413
  // 如果是虚拟渲染滚动
3405
3414
  if (scrollYLoad) {
3406
3415
  if (showOverflow) {
3407
- return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * scrollYStore.rowHeight);
3416
+ return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * rowHeight);
3408
3417
  }
3409
3418
  let scrollTop = 0;
3410
- const rest = fullAllDataRowIdData[rowid];
3411
- const rHeight = rest ? rest.height : 0;
3419
+ const rowRest = fullAllDataRowIdData[rowid];
3420
+ const rHeight = rowRest ? rowRest.height || rowHeight : rowHeight;
3412
3421
  for (let i = 0; i < afterFullData.length; i++) {
3413
3422
  const currRow = afterFullData[i];
3414
3423
  const currRowid = getRowid($xeTable, currRow);
3415
3424
  if (currRow === row || currRowid === rowid) {
3416
3425
  break;
3417
3426
  }
3418
- const rest = fullAllDataRowIdData[currRowid];
3419
- scrollTop += rest ? rest.height : 0;
3427
+ const rowRest = fullAllDataRowIdData[currRowid];
3428
+ scrollTop += rowRest ? rowRest.height || rowHeight : rowHeight;
3420
3429
  }
3421
3430
  if (scrollTop < bodyScrollTop) {
3422
3431
  return $xeTable.scrollTo(null, scrollTop - offsetFixedLeft - 1);
@@ -3589,6 +3598,7 @@ function renderCellDragIcon(h, params) {
3589
3598
  const {
3590
3599
  $table
3591
3600
  } = params;
3601
+ const tableSlots = $table.$scopedSlots;
3592
3602
  const tableProps = $table;
3593
3603
  const {
3594
3604
  dragConfig
@@ -3601,6 +3611,7 @@ function renderCellDragIcon(h, params) {
3601
3611
  } = rowDragOpts;
3602
3612
  const rDisabledMethod = disabledMethod || (dragConfig ? dragConfig.rowDisabledMethod : null);
3603
3613
  const isDisabled = rDisabledMethod && rDisabledMethod(params);
3614
+ const rowDragIconSlot = tableSlots.rowDragIcon || tableSlots['row-drag-icon'];
3604
3615
  const ons = {};
3605
3616
  if (trigger !== 'cell') {
3606
3617
  ons.mousedown = evnt => {
@@ -3616,7 +3627,7 @@ function renderCellDragIcon(h, params) {
3616
3627
  'is--disabled': isDisabled
3617
3628
  }],
3618
3629
  on: ons
3619
- }, [h('i', {
3630
+ }, rowDragIconSlot ? $table.callSlot(rowDragIconSlot, params, h) : [h('i', {
3620
3631
  class: icon || (dragConfig ? dragConfig.rowIcon : '') || cell_getIcon().TABLE_DRAG_ROW
3621
3632
  })]);
3622
3633
  }
@@ -3660,6 +3671,10 @@ function renderHeaderCellDragIcon(h, params) {
3660
3671
  $table,
3661
3672
  column
3662
3673
  } = params;
3674
+ const tableSlots = $table.$scopedSlots;
3675
+ const {
3676
+ slots
3677
+ } = column;
3663
3678
  const columnOpts = $table.computeColumnOpts;
3664
3679
  const columnDragOpts = $table.computeColumnDragOpts;
3665
3680
  const {
@@ -3674,6 +3689,7 @@ function renderHeaderCellDragIcon(h, params) {
3674
3689
  if (columnOpts.drag && showIcon && (!visibleMethod || visibleMethod(params))) {
3675
3690
  if (!column.fixed && (isPeerDrag || isCrossDrag || !column.parentId)) {
3676
3691
  const isDisabled = disabledMethod && disabledMethod(params);
3692
+ const columnDragIconSlot = (slots ? slots.columnDragIcon || slots['column-drag-icon'] : null) || tableSlots.columnDragIcon || tableSlots['column-drag-icon'];
3677
3693
  const ons = {};
3678
3694
  if (trigger !== 'cell') {
3679
3695
  ons.mousedown = evnt => {
@@ -3689,7 +3705,7 @@ function renderHeaderCellDragIcon(h, params) {
3689
3705
  'is--disabled': isDisabled
3690
3706
  }],
3691
3707
  on: ons
3692
- }, [h('i', {
3708
+ }, columnDragIconSlot ? $table.callSlot(columnDragIconSlot, params, h) : [h('i', {
3693
3709
  class: icon || cell_getIcon().TABLE_DRAG_COLUMN
3694
3710
  })]);
3695
3711
  }
@@ -5364,10 +5380,7 @@ function handleVirtualYVisible($xeTable) {
5364
5380
  const row = afterFullData[rIndex];
5365
5381
  const rowid = getRowid($xeTable, row);
5366
5382
  const rowRest = fullAllDataRowIdData[rowid];
5367
- if (!rowRest) {
5368
- break;
5369
- }
5370
- offsetTop += rowRest.height || rowHeight;
5383
+ offsetTop += rowRest ? rowRest.height || rowHeight : rowHeight;
5371
5384
  if (toVisibleIndex === -1 && scrollTop < offsetTop) {
5372
5385
  toVisibleIndex = rIndex;
5373
5386
  }
@@ -7639,47 +7652,6 @@ const Methods = {
7639
7652
  this.afterTreeFullData = tableTree;
7640
7653
  this.updateAfterDataIndex();
7641
7654
  },
7642
- updateTreeDataIndex() {
7643
- const $xeTable = this;
7644
- const props = $xeTable;
7645
- const internalData = $xeTable;
7646
- const {
7647
- treeConfig
7648
- } = props;
7649
- const {
7650
- afterFullData,
7651
- fullDataRowIdData,
7652
- fullAllDataRowIdData
7653
- } = internalData;
7654
- const treeOpts = $xeTable.computeTreeOpts;
7655
- if (treeConfig) {
7656
- if (treeOpts.transform) {
7657
- afterFullData.forEach((row, index) => {
7658
- const rowid = getRowid($xeTable, row);
7659
- const rowRest = fullAllDataRowIdData[rowid];
7660
- if (rowRest) {
7661
- rowRest._index = index;
7662
- } else {
7663
- const rest = {
7664
- row,
7665
- rowid,
7666
- seq: '-1',
7667
- index: -1,
7668
- $index: -1,
7669
- _index: index,
7670
- items: [],
7671
- parent: null,
7672
- level: 0,
7673
- height: 0,
7674
- oTop: 0
7675
- };
7676
- fullAllDataRowIdData[rowid] = rest;
7677
- fullDataRowIdData[rowid] = rest;
7678
- }
7679
- });
7680
- }
7681
- }
7682
- },
7683
7655
  /**
7684
7656
  * 预编译
7685
7657
  * 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
@@ -7729,7 +7701,6 @@ const Methods = {
7729
7701
  }, {
7730
7702
  children: treeOpts.transform ? treeOpts.mapChildrenField : childrenField
7731
7703
  });
7732
- $xeTable.updateTreeDataIndex();
7733
7704
  } else {
7734
7705
  afterFullData.forEach((row, index) => {
7735
7706
  const rowid = getRowid($xeTable, row);
@@ -12927,7 +12898,7 @@ const Methods = {
12927
12898
  return this.$nextTick().then(() => {
12928
12899
  if (transform) {
12929
12900
  this.handleTableData();
12930
- this.updateTreeDataIndex();
12901
+ this.updateAfterDataIndex();
12931
12902
  return this.$nextTick();
12932
12903
  }
12933
12904
  });
@@ -13071,7 +13042,7 @@ const Methods = {
13071
13042
  return this.handleBaseTreeExpand(rows, expanded).then(() => {
13072
13043
  handleVirtualTreeToList($xeTable);
13073
13044
  this.handleTableData();
13074
- this.updateTreeDataIndex();
13045
+ this.updateAfterDataIndex();
13075
13046
  }).then(() => {
13076
13047
  return this.recalculate();
13077
13048
  }).then(() => {
@@ -13691,6 +13662,15 @@ const Methods = {
13691
13662
  */
13692
13663
  scrollToRow(row, fieldOrColumn) {
13693
13664
  const $xeTable = this;
13665
+ const props = $xeTable;
13666
+ const reactData = $xeTable;
13667
+ const {
13668
+ showOverflow
13669
+ } = props;
13670
+ const {
13671
+ scrollYLoad,
13672
+ scrollXLoad
13673
+ } = reactData;
13694
13674
  const rest = [];
13695
13675
  if (row) {
13696
13676
  if (this.treeConfig) {
@@ -13702,7 +13682,15 @@ const Methods = {
13702
13682
  if (fieldOrColumn) {
13703
13683
  rest.push(handleScrollToRowColumn($xeTable, fieldOrColumn, row));
13704
13684
  }
13705
- return Promise.all(rest);
13685
+ return Promise.all(rest).then(() => {
13686
+ if (row) {
13687
+ if (!showOverflow && (scrollYLoad || scrollXLoad)) {
13688
+ calcCellHeight($xeTable);
13689
+ calcCellWidth($xeTable);
13690
+ }
13691
+ return $xeTable.$nextTick();
13692
+ }
13693
+ });
13706
13694
  },
13707
13695
  /**
13708
13696
  * 如果有滚动条,则滚动到对应的列
@@ -14066,43 +14054,47 @@ const renderType = 'body';
14066
14054
  function isVMScrollProcess($xetable) {
14067
14055
  return $xetable._isResize || $xetable.lastScrollTime && Date.now() < $xetable.lastScrollTime + $xetable.delayHover;
14068
14056
  }
14069
- function renderLine(h, _vm, $xetable, params) {
14057
+ function renderLine(h, _vm, $xeTable, params) {
14058
+ const tableProps = $xeTable;
14059
+ const tableInternalData = $xeTable;
14070
14060
  const {
14071
14061
  row,
14072
14062
  column
14073
14063
  } = params;
14074
14064
  const {
14075
- afterFullData,
14076
- treeOpts,
14077
- treeConfig,
14078
- fullAllDataRowIdData
14079
- } = $xetable;
14065
+ afterFullData
14066
+ } = tableInternalData;
14067
+ const {
14068
+ treeConfig
14069
+ } = tableProps;
14070
+ const treeOpts = $xeTable.computeTreeOpts;
14080
14071
  const {
14081
14072
  slots,
14082
14073
  treeNode
14083
14074
  } = column;
14084
- const rowid = getRowid($xetable, row);
14075
+ const {
14076
+ fullAllDataRowIdData
14077
+ } = tableInternalData;
14078
+ if (slots && slots.line) {
14079
+ return $xeTable.callSlot(slots.line, params, h);
14080
+ }
14081
+ const rowid = getRowid($xeTable, row);
14085
14082
  const rest = fullAllDataRowIdData[rowid];
14086
14083
  let rLevel = 0;
14087
- let rIndex = 0;
14088
- let items = [];
14084
+ let prevRow = null;
14089
14085
  if (rest) {
14090
14086
  rLevel = rest.level;
14091
- rIndex = rest._index;
14092
- items = rest.items;
14093
- }
14094
- if (slots && slots.line) {
14095
- return $xetable.callSlot(slots.line, params, h);
14087
+ prevRow = rest.items[rest._index - 1];
14096
14088
  }
14097
- const isFirstRow = $xetable.eqRow(afterFullData[0], row);
14089
+ const isFirstRow = $xeTable.eqRow(afterFullData[0], row);
14098
14090
  if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
14099
14091
  return [h('div', {
14100
14092
  class: 'vxe-tree--line-wrapper'
14101
14093
  }, [h('div', {
14102
14094
  class: 'vxe-tree--line',
14103
14095
  style: {
14104
- height: `${isFirstRow ? 1 : calcTreeLine(params, items, rIndex)}px`,
14105
- left: `${rLevel * treeOpts.indent + (rLevel ? 2 - getOffsetSize($xetable) : 0) + 16}px`
14096
+ height: `${isFirstRow ? 1 : calcTreeLine(params, prevRow)}px`,
14097
+ left: `${rLevel * treeOpts.indent + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
14106
14098
  }
14107
14099
  })])];
14108
14100
  }