vxe-table 3.4.8 → 3.4.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.
@@ -1241,36 +1241,28 @@ const Methods = {
1241
1241
  XEUtils.eachTree(afterTreeFullData, (row, index, items, path) => {
1242
1242
  const rowid = getRowid(this, row)
1243
1243
  const allrest = fullAllDataRowIdData[rowid]
1244
- const fullrest = fullDataRowIdData[rowid]
1245
1244
  const seq = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('')
1246
1245
  if (allrest) {
1247
1246
  allrest.seq = seq
1248
1247
  allrest._index = index
1249
- }
1250
- if (fullrest) {
1251
- fullrest.seq = seq
1252
- fullrest._index = index
1253
1248
  } else {
1254
- fullAllDataRowIdData[rowid] = { row, rowid, seq, index: -1, $index: -1, _index: index, items: [], parent: null, level: 0 }
1255
- fullDataRowIdData[rowid] = { row, rowid, seq, index: -1, $index: -1, _index: index, items: [], parent: null, level: 0 }
1249
+ const rest = { row, rowid, seq, index: -1, $index: -1, _index: index, items: [], parent: null, level: 0 }
1250
+ fullAllDataRowIdData[rowid] = rest
1251
+ fullDataRowIdData[rowid] = rest
1256
1252
  }
1257
1253
  }, { children: treeOpts.mapChildren })
1258
1254
  } else {
1259
1255
  afterFullData.forEach((row, index) => {
1260
1256
  const rowid = getRowid(this, row)
1261
1257
  const allrest = fullAllDataRowIdData[rowid]
1262
- const fullrest = fullDataRowIdData[rowid]
1263
1258
  const seq = index + 1
1264
1259
  if (allrest) {
1265
1260
  allrest.seq = seq
1266
1261
  allrest._index = index
1267
- }
1268
- if (fullrest) {
1269
- fullrest.seq = seq
1270
- fullrest._index = index
1271
1262
  } else {
1272
- fullAllDataRowIdData[rowid] = { row, rowid, seq, index: -1, $index: -1, _index: index, items: [], parent: null, level: 0 }
1273
- fullDataRowIdData[rowid] = { row, rowid, seq, index: -1, $index: -1, _index: index, items: [], parent: null, level: 0 }
1263
+ const rest = { row, rowid, seq, index: -1, $index: -1, _index: index, items: [], parent: null, level: 0 }
1264
+ fullAllDataRowIdData[rowid] = rest
1265
+ fullDataRowIdData[rowid] = rest
1274
1266
  }
1275
1267
  })
1276
1268
  }
@@ -3843,6 +3835,7 @@ const Methods = {
3843
3835
  return this.handleAsyncTreeExpandChilds(row)
3844
3836
  }).then(() => {
3845
3837
  if (transform) {
3838
+ this.handleVirtualTreeToList()
3846
3839
  return this.handleTableData()
3847
3840
  }
3848
3841
  }).then(() => {
@@ -4057,7 +4050,9 @@ const Methods = {
4057
4050
  return this.handleTableData().then(() => {
4058
4051
  if (transform) {
4059
4052
  this.handleVirtualTreeToList()
4053
+ return this.handleTableData()
4060
4054
  }
4055
+ }).then(() => {
4061
4056
  if (isExists) {
4062
4057
  this.recalculate()
4063
4058
  }
@@ -115,9 +115,12 @@ export function getColMinWidth (params) {
115
115
  }
116
116
 
117
117
  function countTreeExpand (prevRow, params) {
118
+ let count = 1
119
+ if (!prevRow) {
120
+ return count
121
+ }
118
122
  const { $table } = params
119
123
  const rowChildren = prevRow[$table.treeOpts.children]
120
- let count = 1
121
124
  if ($table.isTreeExpandByRow(prevRow)) {
122
125
  for (let index = 0; index < rowChildren.length; index++) {
123
126
  count += countTreeExpand(rowChildren[index], params)
@@ -130,13 +133,13 @@ export function getOffsetSize ($xetable) {
130
133
  return lineOffsetSizes[$xetable.vSize] || 0
131
134
  }
132
135
 
133
- export function calcTreeLine (params, items) {
134
- const { $table, $rowIndex } = params
136
+ export function calcTreeLine (params, items, rIndex) {
137
+ const { $table } = params
135
138
  let expandSize = 1
136
- if ($rowIndex) {
137
- expandSize = countTreeExpand(items[$rowIndex - 1], params)
139
+ if (rIndex) {
140
+ expandSize = countTreeExpand(items[rIndex - 1], params)
138
141
  }
139
- return $table.rowHeight * expandSize - ($rowIndex ? 1 : (12 - getOffsetSize($table)))
142
+ return $table.rowHeight * expandSize - (rIndex ? 1 : (12 - getOffsetSize($table)))
140
143
  }
141
144
 
142
145
  export function mergeBodyMethod (mergeList, _rowIndex, _columnIndex) {