vxe-table 4.15.3 → 4.15.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.en.md +2 -6
  2. package/README.ja-JP.md +2 -6
  3. package/README.md +2 -6
  4. package/README.zh-TW.md +2 -6
  5. package/es/grid/src/grid.js +9 -1
  6. package/es/style.css +1 -1
  7. package/es/table/src/header.js +2 -2
  8. package/es/table/src/table.js +49 -141
  9. package/es/table/src/util.js +117 -10
  10. package/es/toolbar/src/toolbar.js +10 -4
  11. package/es/ui/index.js +1 -1
  12. package/es/ui/src/log.js +1 -1
  13. package/lib/grid/src/grid.js +9 -1
  14. package/lib/grid/src/grid.min.js +1 -1
  15. package/lib/index.umd.js +147 -65
  16. package/lib/index.umd.min.js +1 -1
  17. package/lib/style.css +1 -1
  18. package/lib/table/src/header.js +2 -2
  19. package/lib/table/src/table.js +8 -47
  20. package/lib/table/src/table.min.js +1 -1
  21. package/lib/table/src/util.js +118 -10
  22. package/lib/table/src/util.min.js +1 -1
  23. package/lib/toolbar/src/toolbar.js +9 -3
  24. package/lib/toolbar/src/toolbar.min.js +1 -1
  25. package/lib/ui/index.js +1 -1
  26. package/lib/ui/index.min.js +1 -1
  27. package/lib/ui/src/log.js +1 -1
  28. package/lib/ui/src/log.min.js +1 -1
  29. package/package.json +1 -1
  30. package/packages/grid/src/grid.ts +12 -2
  31. package/packages/table/src/header.ts +5 -5
  32. package/packages/table/src/table.ts +52 -146
  33. package/packages/table/src/util.ts +122 -11
  34. package/packages/toolbar/src/toolbar.ts +12 -4
  35. package/styles/cssvar.scss +0 -2
  36. /package/es/{iconfont.1754441841476.ttf → iconfont.1754615009926.ttf} +0 -0
  37. /package/es/{iconfont.1754441841476.woff → iconfont.1754615009926.woff} +0 -0
  38. /package/es/{iconfont.1754441841476.woff2 → iconfont.1754615009926.woff2} +0 -0
  39. /package/lib/{iconfont.1754441841476.ttf → iconfont.1754615009926.ttf} +0 -0
  40. /package/lib/{iconfont.1754441841476.woff → iconfont.1754615009926.woff} +0 -0
  41. /package/lib/{iconfont.1754441841476.woff2 → iconfont.1754615009926.woff2} +0 -0
@@ -4,7 +4,7 @@ import XEUtils from 'xe-utils'
4
4
  import { initTpImg, getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey } from '../../ui/src/dom'
5
5
  import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils'
6
6
  import { VxeUI } from '../../ui'
7
- import { getRowUniqueId, clearTableAllStatus, getColumnList, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getCalcHeight, getCellRestHeight } from './util'
7
+ import { createInternalData, getRowUniqueId, clearTableAllStatus, getColumnList, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getCalcHeight, getCellRestHeight } from './util'
8
8
  import { getSlotVNs } from '../../ui/src/vn'
9
9
  import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from './anime'
10
10
  import { warnLog, errLog } from '../../ui/src/log'
@@ -21,7 +21,7 @@ import TableExportPanelComponent from '../module/export/export-panel'
21
21
  import TableMenuPanelComponent from '../module/menu/panel'
22
22
 
23
23
  import type { VxeTooltipInstance, VxeTabsConstructor, VxeTabsPrivateMethods, ValueOf, VxeComponentSlotType } from 'vxe-pc-ui'
24
- import type { VxeGridConstructor, VxeGridPrivateMethods, VxeTableConstructor, TableReactData, TableInternalData, VxeTablePropTypes, VxeToolbarConstructor, TablePrivateMethods, VxeTablePrivateRef, VxeTablePrivateComputed, VxeTablePrivateMethods, TableMethods, VxeTableMethods, VxeTableDefines, VxeTableEmits, VxeTableProps, VxeColumnPropTypes, VxeTableCustomPanelConstructor } from '../../../types'
24
+ import type { VxeGridConstructor, VxeGridPrivateMethods, VxeTableConstructor, TableReactData, VxeTablePropTypes, VxeToolbarConstructor, TablePrivateMethods, VxeTablePrivateRef, VxeTablePrivateComputed, VxeTablePrivateMethods, TableMethods, VxeTableMethods, VxeTableDefines, VxeTableEmits, VxeTableProps, VxeColumnPropTypes, VxeTableCustomPanelConstructor } from '../../../types'
25
25
 
26
26
  const { getConfig, getIcon, getI18n, renderer, formats, createEvent, globalResize, interceptor, hooks, globalEvents, GLOBAL_EVENT_KEYS, useFns, renderEmptyElement } = VxeUI
27
27
 
@@ -298,123 +298,7 @@ export default defineVxeComponent({
298
298
  isColLoading: false
299
299
  })
300
300
 
301
- const internalData: TableInternalData = {
302
- tZindex: 0,
303
- currKeyField: '',
304
- isCurrDeepKey: false,
305
- elemStore: {},
306
- // 存放横向 X 虚拟滚动相关的信息
307
- scrollXStore: {
308
- preloadSize: 0,
309
- offsetSize: 0,
310
- visibleSize: 0,
311
- visibleStartIndex: 0,
312
- visibleEndIndex: 0,
313
- startIndex: 0,
314
- endIndex: 0
315
- },
316
- // 存放纵向 Y 虚拟滚动相关信息
317
- scrollYStore: {
318
- preloadSize: 0,
319
- offsetSize: 0,
320
- visibleSize: 0,
321
- visibleStartIndex: 0,
322
- visibleEndIndex: 0,
323
- startIndex: 0,
324
- endIndex: 0
325
- },
326
- // 表格宽度
327
- tableWidth: 0,
328
- // 表格高度
329
- tableHeight: 0,
330
- // 表头高度
331
- headerHeight: 0,
332
- // 表尾高度
333
- footerHeight: 0,
334
- customHeight: 0,
335
- customMinHeight: 0,
336
- customMaxHeight: 0,
337
- // 当前 hover 行
338
- hoverRow: null,
339
- // 最后滚动位置
340
- lastScrollLeft: 0,
341
- lastScrollTop: 0,
342
- // 单选框属性,已选中保留的行
343
- radioReserveRow: null,
344
- // 复选框属性,已选中保留的行集合
345
- checkboxReserveRowMap: {},
346
- // 行数据,已展开保留的行集合
347
- rowExpandedReserveRowMap: {},
348
- // 树结构数据,已展开保留的行集合
349
- treeExpandedReserveRowMap: {},
350
- // 树结构数据,不确定状态的集合
351
- treeIndeterminateRowMaps: {},
352
- // 列表完整数据、条件处理后
353
- tableFullData: [],
354
- afterFullData: [],
355
- afterTreeFullData: [],
356
- afterGroupFullData: [],
357
- // 列表条件处理后数据集合
358
- afterFullRowMaps: {},
359
- // 树结构完整数据、条件处理后
360
- tableFullTreeData: [],
361
- // 行分组全量数据、条件处理后
362
- tableFullGroupData: [],
363
- tableSynchData: [],
364
- tableSourceData: [],
365
- // 收集的列配置(带分组)
366
- collectColumn: [],
367
- // 完整所有列(不带分组)
368
- tableFullColumn: [],
369
- // 渲染所有列
370
- visibleColumn: [],
371
- // 全量数据集(包括当前和已删除)
372
- fullAllDataRowIdData: {},
373
- // 数据集(仅当前)
374
- fullDataRowIdData: {},
375
- // 数据集(仅可视)
376
- visibleDataRowIdData: {},
377
- // 渲染中缓存数据
378
- sourceDataRowIdData: {},
379
- fullColumnIdData: {},
380
- fullColumnFieldData: {},
381
-
382
- // 合并单元格的数据
383
- mergeBodyList: [],
384
- mergeBodyMaps: {},
385
- // 合并表尾的数据
386
- mergeFooterList: [],
387
- mergeFooterMaps: {},
388
- // 已合并单元格数据集合
389
- mergeBodyCellMaps: {},
390
- // 已合并表尾数据集合
391
- mergeFooterCellMaps: {},
392
- // 已展开的行集合
393
- rowExpandedMaps: {},
394
- // 懒加载中的展开行的集合
395
- rowExpandLazyLoadedMaps: {},
396
- // 已展开的分组行
397
- rowGroupExpandedMaps: {},
398
- // 已展开树节点集合
399
- treeExpandedMaps: {},
400
- // 懒加载中的树节点的集合
401
- treeExpandLazyLoadedMaps: {},
402
- // 复选框属性,已选中的行集合
403
- selectCheckboxMaps: {},
404
- // 已标记的对象集
405
- pendingRowMaps: {},
406
- // 已新增的临时行
407
- insertRowMaps: {},
408
- // 已删除行
409
- removeRowMaps: {},
410
-
411
- cvCacheMaps: {},
412
-
413
- inited: false,
414
- tooltipTimeout: null,
415
- initStatus: false,
416
- isActivated: false
417
- }
301
+ const internalData = createInternalData()
418
302
 
419
303
  let tableMethods = {} as TableMethods
420
304
  let tablePrivateMethods = {} as TablePrivateMethods
@@ -1991,12 +1875,17 @@ export default defineVxeComponent({
1991
1875
  const calcCellAutoHeight = (rowRest: VxeTableDefines.RowCacheItem, wrapperEl: HTMLDivElement) => {
1992
1876
  const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`)
1993
1877
  let colHeight = rowRest.height
1878
+ let firstCellStyle: CSSStyleDeclaration | null = null
1879
+ let topBottomPadding = 0
1994
1880
  for (let i = 0; i < cellElemList.length; i++) {
1995
- const cellElem = cellElemList[i] as HTMLElement
1996
- const tdEl = cellElem.parentElement as HTMLTableCellElement
1997
- const topBottomPadding = Math.ceil(XEUtils.toNumber(tdEl.style.paddingTop) + XEUtils.toNumber(tdEl.style.paddingBottom))
1998
- const cellHeight = cellElem ? cellElem.clientHeight : 0
1999
- colHeight = Math.max(colHeight - topBottomPadding, Math.ceil(cellHeight))
1881
+ const wrapperElem = cellElemList[i] as HTMLElement
1882
+ const cellElem = wrapperElem.parentElement as HTMLTableCellElement
1883
+ if (!firstCellStyle) {
1884
+ firstCellStyle = getComputedStyle(cellElem)
1885
+ topBottomPadding = firstCellStyle ? Math.ceil(XEUtils.toNumber(firstCellStyle.paddingTop) + XEUtils.toNumber(firstCellStyle.paddingBottom)) : 0
1886
+ }
1887
+ const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0
1888
+ colHeight = Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding))
2000
1889
  }
2001
1890
  return colHeight
2002
1891
  }
@@ -3536,9 +3425,7 @@ export default defineVxeComponent({
3536
3425
  internalData.cvCacheMaps = {}
3537
3426
  reactData.isRowLoading = true
3538
3427
  reactData.scrollVMLoading = false
3539
- // internalData.treeExpandedMaps = {}
3540
3428
  reactData.treeExpandedFlag++
3541
- // internalData.rowExpandedMaps = {}
3542
3429
  reactData.rowExpandedFlag++
3543
3430
  internalData.insertRowMaps = {}
3544
3431
  reactData.insertRowFlag++
@@ -5476,6 +5363,25 @@ export default defineVxeComponent({
5476
5363
  })
5477
5364
  return rest
5478
5365
  },
5366
+ recalcRowHeight (rowOrId) {
5367
+ const { fullAllDataRowIdData } = internalData
5368
+ const rows = XEUtils.isArray(rowOrId) ? rowOrId : [rowOrId]
5369
+ const el = refElem.value
5370
+ if (el) {
5371
+ const { handleGetRowId } = createHandleGetRowId($xeTable)
5372
+ el.setAttribute('data-calc-row', 'Y')
5373
+ rows.forEach(row => {
5374
+ const rowid = XEUtils.isString(row) || XEUtils.isNumber(row) ? row : handleGetRowId(row)
5375
+ const rowRest = fullAllDataRowIdData[rowid]
5376
+ if (rowRest) {
5377
+ rowRest.resizeHeight = calcCellAutoHeight(rowRest, el)
5378
+ }
5379
+ el.removeAttribute('data-calc-row')
5380
+ })
5381
+ reactData.calcCellHeightFlag++
5382
+ }
5383
+ return nextTick()
5384
+ },
5479
5385
  setRowHeight (rowOrId, height) {
5480
5386
  const { fullAllDataRowIdData } = internalData
5481
5387
  let status = false
@@ -8440,6 +8346,7 @@ export default defineVxeComponent({
8440
8346
  evnt.stopPropagation()
8441
8347
  evnt.preventDefault()
8442
8348
  const { row } = params
8349
+ const { showOverflow } = props
8443
8350
  const { overflowX, scrollbarWidth, overflowY, scrollbarHeight } = reactData
8444
8351
  const { elemStore, fullAllDataRowIdData } = internalData
8445
8352
  const osbWidth = overflowY ? scrollbarWidth : 0
@@ -8468,7 +8375,10 @@ export default defineVxeComponent({
8468
8375
  return
8469
8376
  }
8470
8377
  const defaultRowHeight = computeDefaultRowHeight.value
8471
- const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight
8378
+ let currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight
8379
+ if (!showOverflow) {
8380
+ currCellHeight = tdEl.clientHeight
8381
+ }
8472
8382
  const tableRect = tableEl.getBoundingClientRect()
8473
8383
  const trRect = trEl.getBoundingClientRect()
8474
8384
  const targetOffsetY = dragClientY - trRect.y - trEl.clientHeight
@@ -11889,7 +11799,7 @@ export default defineVxeComponent({
11889
11799
  if (value && value.length >= 50000) {
11890
11800
  warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)'])
11891
11801
  }
11892
- loadTableData(value, false).then(() => {
11802
+ loadTableData(value, true).then(() => {
11893
11803
  const { scrollXLoad, scrollYLoad, expandColumn } = reactData
11894
11804
  const expandOpts = computeExpandOpts.value
11895
11805
  internalData.inited = true
@@ -11943,29 +11853,22 @@ export default defineVxeComponent({
11943
11853
  })
11944
11854
  })
11945
11855
 
11946
- const reScrollFlag = ref(0)
11856
+ const reLayoutFlag = ref(0)
11947
11857
  watch(computeSize, () => {
11948
- reScrollFlag.value++
11858
+ reLayoutFlag.value++
11949
11859
  })
11950
11860
  watch(() => props.showHeader, () => {
11951
- reScrollFlag.value++
11861
+ reLayoutFlag.value++
11952
11862
  })
11953
11863
  watch(() => props.showFooter, () => {
11954
- reScrollFlag.value++
11864
+ reLayoutFlag.value++
11955
11865
  })
11956
11866
  watch(() => reactData.overflowX, () => {
11957
- reScrollFlag.value++
11867
+ reLayoutFlag.value++
11958
11868
  })
11959
11869
  watch(() => reactData.overflowY, () => {
11960
- reScrollFlag.value++
11961
- })
11962
- watch(reScrollFlag, () => {
11963
- nextTick(() => {
11964
- tableMethods.recalculate(true).then(() => tableMethods.refreshScroll())
11965
- })
11870
+ reLayoutFlag.value++
11966
11871
  })
11967
-
11968
- const reLayoutFlag = ref(0)
11969
11872
  watch(() => props.height, () => {
11970
11873
  reLayoutFlag.value++
11971
11874
  })
@@ -11982,7 +11885,7 @@ export default defineVxeComponent({
11982
11885
  reLayoutFlag.value++
11983
11886
  })
11984
11887
  watch(reLayoutFlag, () => {
11985
- nextTick(() => tableMethods.recalculate(true))
11888
+ $xeTable.recalculate(true)
11986
11889
  })
11987
11890
 
11988
11891
  const footFlag = ref(0)
@@ -11993,7 +11896,7 @@ export default defineVxeComponent({
11993
11896
  footFlag.value++
11994
11897
  })
11995
11898
  watch(footFlag, () => {
11996
- tableMethods.updateFooter()
11899
+ $xeTable.updateFooter()
11997
11900
  })
11998
11901
 
11999
11902
  watch(() => props.syncResize, (value) => {
@@ -12354,10 +12257,7 @@ export default defineVxeComponent({
12354
12257
  if ($xeTable.closeMenu) {
12355
12258
  $xeTable.closeMenu()
12356
12259
  }
12357
- tablePrivateMethods.preventEvent(null, 'beforeUnmount', { $table: $xeTable })
12358
- })
12359
12260
 
12360
- onUnmounted(() => {
12361
12261
  globalEvents.off($xeTable, 'paste')
12362
12262
  globalEvents.off($xeTable, 'copy')
12363
12263
  globalEvents.off($xeTable, 'cut')
@@ -12367,7 +12267,13 @@ export default defineVxeComponent({
12367
12267
  globalEvents.off($xeTable, 'keydown')
12368
12268
  globalEvents.off($xeTable, 'resize')
12369
12269
  globalEvents.off($xeTable, 'contextmenu')
12270
+
12271
+ tablePrivateMethods.preventEvent(null, 'beforeUnmount', { $table: $xeTable })
12272
+ })
12273
+
12274
+ onUnmounted(() => {
12370
12275
  tablePrivateMethods.preventEvent(null, 'unmounted', { $table: $xeTable })
12276
+ XEUtils.assign(internalData, createInternalData())
12371
12277
  })
12372
12278
 
12373
12279
  nextTick(() => {
@@ -4,7 +4,127 @@ import { ColumnInfo } from './columnInfo'
4
4
  import { isPx, isScale, queryElement } from '../../ui/src/dom'
5
5
  import { eqEmptyValue } from '../../ui/src/utils'
6
6
 
7
- import type { VxeTableConstructor, VxeTablePrivateMethods, VxeTableDefines, VxeTablePropTypes } from '../../../types'
7
+ import type { VxeTableConstructor, VxeTablePrivateMethods, VxeTableDefines, VxeTablePropTypes, TableInternalData } from '../../../types'
8
+
9
+ export function createInternalData (): TableInternalData {
10
+ return {
11
+ tZindex: 0,
12
+ currKeyField: '',
13
+ isCurrDeepKey: false,
14
+ elemStore: {},
15
+ // 存放横向 X 虚拟滚动相关的信息
16
+ scrollXStore: {
17
+ preloadSize: 0,
18
+ offsetSize: 0,
19
+ visibleSize: 0,
20
+ visibleStartIndex: 0,
21
+ visibleEndIndex: 0,
22
+ startIndex: 0,
23
+ endIndex: 0
24
+ },
25
+ // 存放纵向 Y 虚拟滚动相关信息
26
+ scrollYStore: {
27
+ preloadSize: 0,
28
+ offsetSize: 0,
29
+ visibleSize: 0,
30
+ visibleStartIndex: 0,
31
+ visibleEndIndex: 0,
32
+ startIndex: 0,
33
+ endIndex: 0
34
+ },
35
+ // 表格宽度
36
+ tableWidth: 0,
37
+ // 表格高度
38
+ tableHeight: 0,
39
+ // 表头高度
40
+ headerHeight: 0,
41
+ // 表尾高度
42
+ footerHeight: 0,
43
+ customHeight: 0,
44
+ customMinHeight: 0,
45
+ customMaxHeight: 0,
46
+ // 当前 hover 行
47
+ hoverRow: null,
48
+ // 最后滚动位置
49
+ lastScrollLeft: 0,
50
+ lastScrollTop: 0,
51
+ // 单选框属性,已选中保留的行
52
+ radioReserveRow: null,
53
+ // 复选框属性,已选中保留的行集合
54
+ checkboxReserveRowMap: {},
55
+ // 行数据,已展开保留的行集合
56
+ rowExpandedReserveRowMap: {},
57
+ // 树结构数据,已展开保留的行集合
58
+ treeExpandedReserveRowMap: {},
59
+ // 树结构数据,不确定状态的集合
60
+ treeIndeterminateRowMaps: {},
61
+ // 列表完整数据、条件处理后
62
+ tableFullData: [],
63
+ afterFullData: [],
64
+ afterTreeFullData: [],
65
+ afterGroupFullData: [],
66
+ // 列表条件处理后数据集合
67
+ afterFullRowMaps: {},
68
+ // 树结构完整数据、条件处理后
69
+ tableFullTreeData: [],
70
+ // 行分组全量数据、条件处理后
71
+ tableFullGroupData: [],
72
+ tableSynchData: [],
73
+ tableSourceData: [],
74
+ // 收集的列配置(带分组)
75
+ collectColumn: [],
76
+ // 完整所有列(不带分组)
77
+ tableFullColumn: [],
78
+ // 渲染所有列
79
+ visibleColumn: [],
80
+ // 全量数据集(包括当前和已删除)
81
+ fullAllDataRowIdData: {},
82
+ // 数据集(仅当前)
83
+ fullDataRowIdData: {},
84
+ // 数据集(仅可视)
85
+ visibleDataRowIdData: {},
86
+ // 渲染中缓存数据
87
+ sourceDataRowIdData: {},
88
+ fullColumnIdData: {},
89
+ fullColumnFieldData: {},
90
+
91
+ // 合并单元格的数据
92
+ mergeBodyList: [],
93
+ mergeBodyMaps: {},
94
+ // 合并表尾的数据
95
+ mergeFooterList: [],
96
+ mergeFooterMaps: {},
97
+ // 已合并单元格数据集合
98
+ mergeBodyCellMaps: {},
99
+ // 已合并表尾数据集合
100
+ mergeFooterCellMaps: {},
101
+ // 已展开的行集合
102
+ rowExpandedMaps: {},
103
+ // 懒加载中的展开行的集合
104
+ rowExpandLazyLoadedMaps: {},
105
+ // 已展开的分组行
106
+ rowGroupExpandedMaps: {},
107
+ // 已展开树节点集合
108
+ treeExpandedMaps: {},
109
+ // 懒加载中的树节点的集合
110
+ treeExpandLazyLoadedMaps: {},
111
+ // 复选框属性,已选中的行集合
112
+ selectCheckboxMaps: {},
113
+ // 已标记的对象集
114
+ pendingRowMaps: {},
115
+ // 已新增的临时行
116
+ insertRowMaps: {},
117
+ // 已删除行
118
+ removeRowMaps: {},
119
+
120
+ cvCacheMaps: {},
121
+
122
+ inited: false,
123
+ tooltipTimeout: null,
124
+ initStatus: false,
125
+ isActivated: false
126
+ }
127
+ }
8
128
 
9
129
  const getAllConvertColumns = (columns: any, parentColumn?: any) => {
10
130
  const result: any[] = []
@@ -551,18 +671,9 @@ export function rowToVisible ($xeTable: VxeTableConstructor & VxeTablePrivateMet
551
671
  if (!isCustomCellHeight && showOverflow) {
552
672
  return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * defaultRowHeight)
553
673
  }
554
- let scrollTop = 0
555
674
  const rowRest = fullAllDataRowIdData[rowid] || {}
556
675
  const rHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight
557
- for (let i = 0; i < afterFullData.length; i++) {
558
- const currRow = afterFullData[i]
559
- const currRowid = getRowid($xeTable, currRow)
560
- if (currRow === row || currRowid === rowid) {
561
- break
562
- }
563
- const currRowRest = fullAllDataRowIdData[currRowid] || {}
564
- scrollTop += currRowRest.resizeHeight || cellOpts.height || rowOpts.height || currRowRest.height || defaultRowHeight
565
- }
676
+ const scrollTop = rowRest.oTop
566
677
  if (scrollTop < bodyScrollTop) {
567
678
  return $xeTable.scrollTo(null, scrollTop - leftFixedWidth - 1)
568
679
  }
@@ -1,4 +1,4 @@
1
- import { h, ref, computed, inject, createCommentVNode, VNode, reactive, nextTick, PropType } from 'vue'
1
+ import { h, ref, computed, inject, createCommentVNode, VNode, reactive, nextTick, PropType, onUnmounted } from 'vue'
2
2
  import { defineVxeComponent } from '../../ui/src/comp'
3
3
  import XEUtils from 'xe-utils'
4
4
  import { VxeUI } from '../../ui'
@@ -10,6 +10,12 @@ import type { VxeGridConstructor, GridPrivateMethods, ToolbarMethods, ToolbarInt
10
10
 
11
11
  const { getConfig, getIcon, getI18n, renderer, commands, createEvent, useFns } = VxeUI
12
12
 
13
+ function createInternalData (): ToolbarInternalData {
14
+ return {
15
+ connectTable: null
16
+ }
17
+ }
18
+
13
19
  export default defineVxeComponent({
14
20
  name: 'VxeToolbar',
15
21
  props: {
@@ -64,9 +70,7 @@ export default defineVxeComponent({
64
70
  columns: []
65
71
  })
66
72
 
67
- const internalData: ToolbarInternalData = {
68
- connectTable: null
69
- }
73
+ const internalData = createInternalData()
70
74
 
71
75
  const refElem = ref<HTMLDivElement>()
72
76
 
@@ -708,6 +712,10 @@ export default defineVxeComponent({
708
712
  }
709
713
  })
710
714
 
715
+ onUnmounted(() => {
716
+ XEUtils.assign(internalData, createInternalData())
717
+ })
718
+
711
719
  return $xeToolbar
712
720
  },
713
721
  render () {
@@ -1,3 +1 @@
1
- /*已废弃*/
2
-
3
1
  @use './base.scss';