vxe-table 4.19.13 → 4.19.14

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.
package/dist/all.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  export { VxeUI } from '@vxe-ui/core';
3
- import XEUtils from 'xe-utils';
3
+ import XEUtils, { isNaN as isNaN$1 } from 'xe-utils';
4
4
  import DomZIndex from 'dom-zindex';
5
5
  import { defineComponent, watch, reactive, h, ref, inject, createCommentVNode, onMounted, onUnmounted, provide, nextTick, TransitionGroup, computed, Teleport, resolveComponent, onActivated, onDeactivated, onBeforeUnmount } from 'vue';
6
6
 
@@ -44,7 +44,7 @@ function eqEmptyValue(cellValue) {
44
44
  return cellValue === '' || XEUtils.eqNull(cellValue);
45
45
  }
46
46
 
47
- const version$1 = "4.19.13";
47
+ const version$1 = "4.19.14";
48
48
  VxeUI.version = version$1;
49
49
  VxeUI.tableVersion = version$1;
50
50
  VxeUI.setConfig({
@@ -743,7 +743,7 @@ function wheelScrollTopTo(diffNum, cb) {
743
743
  }
744
744
 
745
745
  const { log } = VxeUI;
746
- const version = `table v${"4.19.13"}`;
746
+ const version = `table v${"4.19.14"}`;
747
747
  const warnLog = log.create('warn', version);
748
748
  const errLog = log.create('error', version);
749
749
 
@@ -9201,7 +9201,7 @@ hooks$5.add('tableEditModule', {
9201
9201
  }
9202
9202
  pChilds[funcName](item);
9203
9203
  pMapChilds[funcName](item);
9204
- const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: pChilds, parent: parentRow, level: parentLevel + 1, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
9204
+ const rest = { row: item, rowid, _seq: -1, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: pChilds, parent: parentRow, level: parentLevel + 1, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
9205
9205
  fullDataRowIdData[rowid] = rest;
9206
9206
  fullAllDataRowIdData[rowid] = rest;
9207
9207
  }
@@ -9211,7 +9211,7 @@ hooks$5.add('tableEditModule', {
9211
9211
  }
9212
9212
  afterFullData[funcName](item);
9213
9213
  tableFullTreeData[funcName](item);
9214
- const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: tableFullTreeData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
9214
+ const rest = { row: item, rowid, _seq: -1, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: tableFullTreeData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
9215
9215
  fullDataRowIdData[rowid] = rest;
9216
9216
  fullAllDataRowIdData[rowid] = rest;
9217
9217
  }
@@ -9261,7 +9261,7 @@ hooks$5.add('tableEditModule', {
9261
9261
  else {
9262
9262
  newRecords.forEach(item => {
9263
9263
  const rowid = getRowid($xeTable, item);
9264
- const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: afterFullData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
9264
+ const rest = { row: item, rowid, _seq: -1, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: afterFullData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
9265
9265
  fullDataRowIdData[rowid] = rest;
9266
9266
  fullAllDataRowIdData[rowid] = rest;
9267
9267
  afterFullData.unshift(item);
@@ -9293,7 +9293,7 @@ hooks$5.add('tableEditModule', {
9293
9293
  else {
9294
9294
  newRecords.forEach(item => {
9295
9295
  const rowid = getRowid($xeTable, item);
9296
- const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, treeIndex: -1, _tIndex: -1, $index: -1, items: afterFullData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
9296
+ const rest = { row: item, rowid, _seq: -1, seq: -1, index: -1, _index: -1, treeIndex: -1, _tIndex: -1, $index: -1, items: afterFullData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
9297
9297
  fullDataRowIdData[rowid] = rest;
9298
9298
  fullAllDataRowIdData[rowid] = rest;
9299
9299
  afterFullData.push(item);
@@ -9333,7 +9333,7 @@ hooks$5.add('tableEditModule', {
9333
9333
  });
9334
9334
  XEUtils.eachTree(treeRecords, (item) => {
9335
9335
  const rowid = getRowid($xeTable, item);
9336
- const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: parentMapChilds, parent: parentRow, level: parentLevel + 1, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
9336
+ const rest = { row: item, rowid, _seq: -1, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: parentMapChilds, parent: parentRow, level: parentLevel + 1, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
9337
9337
  if (item[childrenField]) {
9338
9338
  item[mapChildrenField] = item[childrenField];
9339
9339
  }
@@ -15413,22 +15413,32 @@ var VxeTableComponent = defineVxeComponent({
15413
15413
  const { tableFullColumn } = internalData;
15414
15414
  const { updateColFlag } = reactData;
15415
15415
  const editDirtyOpts = computeEditDirtyOpts.value;
15416
- const { includeFields, excludeFields } = editDirtyOpts;
15416
+ const { extraFields, includeFields, excludeFields } = editDirtyOpts;
15417
15417
  const kpFields = [];
15418
15418
  if (updateColFlag) {
15419
15419
  if (includeFields && includeFields.length) {
15420
15420
  return includeFields;
15421
15421
  }
15422
- const exfMaps = {};
15422
+ const excludeFdMaps = {};
15423
15423
  if (excludeFields && excludeFields.length) {
15424
15424
  excludeFields.forEach(field => {
15425
- exfMaps[field] = 1;
15425
+ excludeFdMaps[field] = 1;
15426
+ });
15427
+ }
15428
+ const addFdMaps = {};
15429
+ if (extraFields && extraFields.length) {
15430
+ extraFields.forEach(field => {
15431
+ if (!addFdMaps[field]) {
15432
+ addFdMaps[field] = 1;
15433
+ kpFields.push(field);
15434
+ }
15426
15435
  });
15427
15436
  }
15428
15437
  for (let i = 0; i < tableFullColumn.length; i++) {
15429
15438
  const column = tableFullColumn[i];
15430
15439
  const { field, type, editRender, cellRender } = column;
15431
- if (field && !type && (editRender || cellRender) && !exfMaps[field]) {
15440
+ if (field && !type && (editRender || cellRender) && !addFdMaps[field] && !excludeFdMaps[field]) {
15441
+ addFdMaps[field] = 1;
15432
15442
  kpFields.push(field);
15433
15443
  }
15434
15444
  }
@@ -16863,7 +16873,7 @@ var VxeTableComponent = defineVxeComponent({
16863
16873
  cellValue = $xeTable.getCellLabel(row, column);
16864
16874
  }
16865
16875
  if (!sortType || sortType === 'auto') {
16866
- return isNaN(cellValue) ? cellValue : XEUtils.toNumber(cellValue);
16876
+ return isNaN$1(cellValue) ? cellValue : XEUtils.toNumber(cellValue);
16867
16877
  }
16868
16878
  else if (sortType === 'number') {
16869
16879
  return XEUtils.toNumber(cellValue);
@@ -16882,7 +16892,7 @@ var VxeTableComponent = defineVxeComponent({
16882
16892
  cellValue = $xeTable.getCellLabel(row, column);
16883
16893
  }
16884
16894
  if (!sortType || sortType === 'auto') {
16885
- return isNaN(cellValue) ? cellValue : XEUtils.toNumber(cellValue);
16895
+ return isNaN$1(cellValue) ? cellValue : XEUtils.toNumber(cellValue);
16886
16896
  }
16887
16897
  else if (sortType === 'number') {
16888
16898
  return XEUtils.toNumber(cellValue);
@@ -16893,26 +16903,63 @@ var VxeTableComponent = defineVxeComponent({
16893
16903
  return cellValue;
16894
16904
  };
16895
16905
  };
16906
+ const updateAfterTreeIndex = () => {
16907
+ const { fullDataRowIdData, fullAllDataRowIdData, afterFullData, afterTreeFullData } = internalData;
16908
+ const treeOpts = computeTreeOpts.value;
16909
+ const { transform, mapChildrenField } = treeOpts;
16910
+ const childrenField = treeOpts.children || treeOpts.childrenField;
16911
+ const fullMaps = {};
16912
+ let rowNum = 0;
16913
+ const { handleGetRowId } = createHandleGetRowId($xeTable);
16914
+ XEUtils.eachTree(afterTreeFullData, (row, index, items, path) => {
16915
+ const rowid = handleGetRowId(row);
16916
+ const rowRest = fullAllDataRowIdData[rowid];
16917
+ const seq = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('');
16918
+ if (rowRest) {
16919
+ rowRest.seq = seq;
16920
+ rowRest._seq = rowNum;
16921
+ rowRest.treeIndex = index;
16922
+ rowRest._tIndex = rowNum;
16923
+ }
16924
+ else {
16925
+ const rest = { row, rowid, _seq: rowNum, seq, index: -1, $index: -1, _index: -1, treeIndex: -1, _tIndex: rowNum, items: [], parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
16926
+ fullAllDataRowIdData[rowid] = rest;
16927
+ fullDataRowIdData[rowid] = rest;
16928
+ }
16929
+ rowNum++;
16930
+ fullMaps[rowid] = row;
16931
+ }, { children: transform ? mapChildrenField : childrenField });
16932
+ if (transform) {
16933
+ afterFullData.forEach((row, index) => {
16934
+ const rowid = handleGetRowId(row);
16935
+ const rowRest = fullAllDataRowIdData[rowid];
16936
+ if (rowRest) {
16937
+ rowRest._index = index;
16938
+ }
16939
+ });
16940
+ }
16941
+ internalData.afterFullRowMaps = fullMaps;
16942
+ };
16896
16943
  const updateAfterListIndex = () => {
16897
- const { treeConfig } = props;
16898
16944
  const { afterFullData, fullDataRowIdData, fullAllDataRowIdData } = internalData;
16899
16945
  const { handleGetRowId } = createHandleGetRowId($xeTable);
16900
16946
  const fullMaps = {};
16947
+ let rowNum = 0;
16901
16948
  afterFullData.forEach((row, index) => {
16902
16949
  const rowid = handleGetRowId(row);
16903
16950
  const rowRest = fullAllDataRowIdData[rowid];
16904
16951
  const seq = index + 1;
16905
16952
  if (rowRest) {
16906
- if (!treeConfig) {
16907
- rowRest.seq = seq;
16908
- }
16953
+ rowRest.seq = seq;
16954
+ rowRest._seq = rowNum;
16909
16955
  rowRest._index = index;
16910
16956
  }
16911
16957
  else {
16912
- const rest = { row, rowid, seq, index: -1, $index: -1, _index: index, treeIndex: -1, _tIndex: -1, items: [], parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
16958
+ const rest = { row, rowid, _seq: rowNum, seq, index: -1, $index: -1, _index: index, treeIndex: -1, _tIndex: -1, items: [], parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
16913
16959
  fullAllDataRowIdData[rowid] = rest;
16914
16960
  fullDataRowIdData[rowid] = rest;
16915
16961
  }
16962
+ rowNum++;
16916
16963
  fullMaps[rowid] = row;
16917
16964
  });
16918
16965
  internalData.afterFullRowMaps = fullMaps;
@@ -16923,45 +16970,8 @@ var VxeTableComponent = defineVxeComponent({
16923
16970
  */
16924
16971
  const updateAfterDataIndex = () => {
16925
16972
  const { treeConfig } = props;
16926
- const { fullDataRowIdData, fullAllDataRowIdData, afterFullData, afterTreeFullData } = internalData;
16927
- const treeOpts = computeTreeOpts.value;
16928
- const { transform } = treeOpts;
16929
- const childrenField = treeOpts.children || treeOpts.childrenField;
16930
- const fullMaps = {};
16931
16973
  if (treeConfig) {
16932
- let _treeIndex = 0;
16933
- const { handleGetRowId } = createHandleGetRowId($xeTable);
16934
- XEUtils.eachTree(afterTreeFullData, (row, index, items, path) => {
16935
- const rowid = handleGetRowId(row);
16936
- const rowRest = fullAllDataRowIdData[rowid];
16937
- const seq = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('');
16938
- if (rowRest) {
16939
- rowRest.seq = seq;
16940
- rowRest.treeIndex = index;
16941
- rowRest._tIndex = _treeIndex;
16942
- }
16943
- else {
16944
- const rest = { row, rowid, seq, index: -1, $index: -1, _index: -1, treeIndex: -1, _tIndex: _treeIndex, items: [], parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
16945
- fullAllDataRowIdData[rowid] = rest;
16946
- fullDataRowIdData[rowid] = rest;
16947
- }
16948
- _treeIndex++;
16949
- fullMaps[rowid] = row;
16950
- }, { children: transform ? treeOpts.mapChildrenField : childrenField });
16951
- if (transform) {
16952
- afterFullData.forEach((row, index) => {
16953
- const rowid = handleGetRowId(row);
16954
- const rowRest = fullAllDataRowIdData[rowid];
16955
- const seq = index + 1;
16956
- if (rowRest) {
16957
- if (!treeConfig) {
16958
- rowRest.seq = seq;
16959
- }
16960
- rowRest._index = index;
16961
- }
16962
- });
16963
- }
16964
- internalData.afterFullRowMaps = fullMaps;
16974
+ updateAfterTreeIndex();
16965
16975
  }
16966
16976
  else {
16967
16977
  updateAfterListIndex();
@@ -18157,8 +18167,9 @@ var VxeTableComponent = defineVxeComponent({
18157
18167
  }
18158
18168
  });
18159
18169
  };
18160
- const minRunDelay = 50;
18161
- const handleLazyRecalculate = (reFull, reWidth, reHeight) => {
18170
+ const defaultMinRunDelay = 50;
18171
+ const handleLazyRecalculate = (reFull, reWidth, reHeight, options) => {
18172
+ const minRunDelay = (options ? options.minRunDelay : defaultMinRunDelay) || defaultMinRunDelay;
18162
18173
  return new Promise(resolve => {
18163
18174
  const $xeGanttView = internalData.xeGanttView;
18164
18175
  const { customStore } = reactData;
@@ -18185,6 +18196,7 @@ var VxeTableComponent = defineVxeComponent({
18185
18196
  }
18186
18197
  if (rceTimeout) {
18187
18198
  clearTimeout(rceTimeout);
18199
+ // 多少毫秒内至少执行一次
18188
18200
  if (rceRunTime && rceRunTime + minRunDelay < Date.now()) {
18189
18201
  resolve(handleRecalculateStyle(reFull, reWidth, reHeight));
18190
18202
  }
@@ -18209,16 +18221,17 @@ var VxeTableComponent = defineVxeComponent({
18209
18221
  }, reDelay);
18210
18222
  });
18211
18223
  };
18212
- let resizePending = false;
18213
18224
  const handleResizeEvent = () => {
18214
- if (resizePending) {
18225
+ if (internalData.rsePending) {
18215
18226
  return;
18216
18227
  }
18217
- resizePending = true;
18218
- handleLazyRecalculate(true, true, true).then(() => {
18219
- resizePending = false;
18228
+ internalData.rsePending = true;
18229
+ handleLazyRecalculate(true, true, true, {
18230
+ minRunDelay: 200
18231
+ }).then(() => {
18232
+ internalData.rsePending = false;
18220
18233
  }).catch(() => {
18221
- resizePending = false;
18234
+ internalData.rsePending = false;
18222
18235
  });
18223
18236
  };
18224
18237
  const handleUpdateAggValues = () => {
@@ -19806,7 +19819,7 @@ var VxeTableComponent = defineVxeComponent({
19806
19819
  XEUtils.eachTree(rows, (childRow, index, items, path, parentItem, nodes) => {
19807
19820
  const rowid = getRowid($xeTable, childRow);
19808
19821
  const parentRow = parentItem || parentRest.row;
19809
- const rest = { row: childRow, rowid, seq: -1, index, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items, parent: parentRow, level: parentLevel + nodes.length, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
19822
+ const rest = { row: childRow, rowid, _seq: -1, seq: -1, index, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items, parent: parentRow, level: parentLevel + nodes.length, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
19810
19823
  fullDataRowIdData[rowid] = rest;
19811
19824
  fullAllDataRowIdData[rowid] = rest;
19812
19825
  }, { children: childrenField });
@@ -24206,18 +24219,20 @@ var VxeTableComponent = defineVxeComponent({
24206
24219
  const fullDataRowIdMaps = {};
24207
24220
  const idMaps = {};
24208
24221
  const { handleUpdateRowId } = createHandleUpdateRowId($xeTable);
24222
+ let rowNum = 0;
24209
24223
  const handleRowCache = (row, index, items, currIndex, parentRow, rowid, level, seq) => {
24210
24224
  let rowRest = fullAllDataRowIdMaps[rowid];
24211
24225
  if (idMaps[rowid]) {
24212
24226
  errLog('vxe.error.repeatKey', [currKeyField, rowid]);
24213
24227
  }
24214
24228
  if (!rowRest) {
24215
- rowRest = { row, rowid, seq, index: -1, _index: -1, $index: -1, treeIndex: index, _tIndex: -1, items, parent: parentRow, level, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
24229
+ rowRest = { row, rowid, _seq: -1, seq, index: -1, _index: -1, $index: -1, treeIndex: index, _tIndex: -1, items, parent: parentRow, level, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
24216
24230
  fullDataRowIdMaps[rowid] = rowRest;
24217
24231
  fullAllDataRowIdMaps[rowid] = rowRest;
24218
24232
  }
24219
24233
  rowRest.treeLoaded = false;
24220
24234
  rowRest.expandLoaded = false;
24235
+ rowRest._seq = rowNum++;
24221
24236
  rowRest.row = row;
24222
24237
  rowRest.items = items;
24223
24238
  rowRest.parent = parentRow;
@@ -24231,6 +24246,7 @@ var VxeTableComponent = defineVxeComponent({
24231
24246
  if (rowExpandedMaps[rowid]) {
24232
24247
  rowExpandedMaps[rowid] = row;
24233
24248
  }
24249
+ rowNum++;
24234
24250
  idMaps[rowid] = true;
24235
24251
  fullDataRowIdMaps[rowid] = rowRest;
24236
24252
  fullAllDataRowIdMaps[rowid] = rowRest;
@@ -25531,31 +25547,162 @@ var VxeTableComponent = defineVxeComponent({
25531
25547
  const { treeConfig } = props;
25532
25548
  const { row } = params;
25533
25549
  const { isRowGroupStatus } = reactData;
25534
- const { afterFullData } = internalData;
25550
+ const { fullAllDataRowIdData, afterFullData, afterTreeFullData, afterGroupFullData } = internalData;
25535
25551
  const checkboxOpts = computeCheckboxOpts.value;
25536
- const { checkMethod, trigger } = checkboxOpts;
25552
+ const aggregateOpts = computeAggregateOpts.value;
25553
+ const treeOpts = computeTreeOpts.value;
25554
+ const { checkMethod, trigger, checkStrictly } = checkboxOpts;
25537
25555
  if (trigger === 'manual') {
25538
25556
  return;
25539
25557
  }
25540
25558
  evnt.stopPropagation();
25541
- if (checkboxOpts.isShiftKey && evnt.shiftKey && !(treeConfig || isRowGroupStatus)) {
25559
+ if (checkboxOpts.isShiftKey && evnt.shiftKey) {
25560
+ const { handleGetRowId } = createHandleGetRowId($xeTable);
25542
25561
  const checkboxRecords = $xeTable.getCheckboxRecords();
25543
- if (checkboxRecords.length) {
25544
- const firstRow = checkboxRecords[0];
25545
- const _rowIndex = $xeTable.getVTRowIndex(row);
25546
- const _firstRowIndex = $xeTable.getVTRowIndex(firstRow);
25547
- if (_rowIndex !== _firstRowIndex) {
25562
+ let currSeq = -1;
25563
+ let currRow = null;
25564
+ const currRowid = handleGetRowId(row);
25565
+ const rowRest = fullAllDataRowIdData[currRowid];
25566
+ if (rowRest) {
25567
+ currRow = rowRest.row;
25568
+ currSeq = rowRest._seq;
25569
+ }
25570
+ if (currRow && checkboxRecords.length) {
25571
+ let rangeRows = [];
25572
+ let firstSeq = -1;
25573
+ let firstRow = null;
25574
+ let firstRowid = '';
25575
+ let lastSeq = -1;
25576
+ let lastRow = null;
25577
+ let lastRowid = '';
25578
+ // 根据序号取出范围最小/最大的行
25579
+ const selectMaps = {};
25580
+ checkboxRecords.forEach(item => {
25581
+ const rowid = handleGetRowId(item);
25582
+ const rowRest = fullAllDataRowIdData[rowid];
25583
+ if (rowRest) {
25584
+ if (!firstRow || firstSeq > rowRest._seq) {
25585
+ firstRowid = rowRest.rowid;
25586
+ firstRow = rowRest.row;
25587
+ firstSeq = rowRest._seq;
25588
+ }
25589
+ if (!lastRow || lastSeq < rowRest._seq) {
25590
+ lastRowid = rowRest.rowid;
25591
+ lastRow = rowRest.row;
25592
+ lastSeq = rowRest._seq;
25593
+ }
25594
+ }
25595
+ selectMaps[rowid] = item;
25596
+ });
25597
+ // 如果已选只有一条并选择当前则跳过
25598
+ if (firstRow && lastRow && (checkboxRecords.length > 1 || currRowid !== firstRowid) && (Math.abs(firstSeq - lastSeq) > 1 || Math.abs(currSeq - firstSeq) > 1 || Math.abs(currSeq - lastSeq) > 1)) {
25599
+ // 树与分组
25600
+ if (treeConfig || isRowGroupStatus) {
25601
+ const { transform } = treeOpts;
25602
+ const childrenField = treeOpts.children || treeOpts.childrenField;
25603
+ const iteratorChildField = treeConfig ? (transform ? treeOpts.mapChildrenField : childrenField) : aggregateOpts.mapChildrenField;
25604
+ let isMatchFirst = false;
25605
+ let matchStartRowid = '';
25606
+ let matchEndRowid = '';
25607
+ const handleGetChildRowid = (rowid, isLast) => {
25608
+ const rowRest = fullAllDataRowIdData[rowid];
25609
+ if (rowRest) {
25610
+ const item = rowRest.row;
25611
+ const childList = item[iteratorChildField];
25612
+ if (childList && childList.length) {
25613
+ const targetRow = isLast ? XEUtils.last(childList) : XEUtils.first(childList);
25614
+ return handleGetChildRowid(handleGetRowId(targetRow), isLast);
25615
+ }
25616
+ }
25617
+ return rowid;
25618
+ };
25619
+ const handleGetSelectParentRowid = (rowid) => {
25620
+ const rowRest = fullAllDataRowIdData[rowid];
25621
+ if (rowRest) {
25622
+ const parentItem = rowRest.parent;
25623
+ if (parentItem) {
25624
+ const parentRowid = handleGetRowId(parentItem);
25625
+ if (selectMaps[parentRowid]) {
25626
+ return handleGetSelectParentRowid(parentRowid);
25627
+ }
25628
+ }
25629
+ }
25630
+ return rowid;
25631
+ };
25632
+ const handleGetRootRow = (row) => {
25633
+ const rowid = handleGetRowId(row);
25634
+ if (rowid) {
25635
+ const rest = fullAllDataRowIdData[rowid];
25636
+ if (rest) {
25637
+ return rest.parent ? handleGetRootRow(rest.parent) : rest;
25638
+ }
25639
+ }
25640
+ return null;
25641
+ };
25642
+ if (currSeq < firstSeq) {
25643
+ matchStartRowid = handleGetChildRowid(currRowid, 0);
25644
+ matchEndRowid = handleGetChildRowid(firstRowid, 1);
25645
+ }
25646
+ else {
25647
+ if (currSeq > lastSeq) {
25648
+ matchStartRowid = handleGetSelectParentRowid(lastRowid);
25649
+ }
25650
+ else {
25651
+ matchStartRowid = handleGetChildRowid(firstRowid, 0);
25652
+ }
25653
+ matchEndRowid = handleGetChildRowid(currRowid, 1);
25654
+ }
25655
+ const handleRangeRow = (item) => {
25656
+ const rowid = handleGetRowId(item);
25657
+ const childList = item[iteratorChildField];
25658
+ if (!isMatchFirst && rowid === matchStartRowid) {
25659
+ isMatchFirst = true;
25660
+ }
25661
+ // 如果是父子关联,则排除父节点
25662
+ if (isMatchFirst && (checkStrictly || !childList || !childList.length)) {
25663
+ rangeRows.push(item);
25664
+ }
25665
+ // break
25666
+ return rowid === matchEndRowid;
25667
+ };
25668
+ if (treeConfig) {
25669
+ const matchStartRowRest = fullAllDataRowIdData[matchStartRowid];
25670
+ const firstRootRowRest = matchStartRowRest ? handleGetRootRow(matchStartRowRest.row) : null;
25671
+ if (firstRootRowRest) {
25672
+ // 优化查找复杂度
25673
+ XEUtils.findTree(afterTreeFullData.slice(firstRootRowRest.treeIndex), handleRangeRow, { children: iteratorChildField });
25674
+ }
25675
+ else {
25676
+ XEUtils.findTree(afterTreeFullData, handleRangeRow, { children: iteratorChildField });
25677
+ }
25678
+ }
25679
+ else {
25680
+ XEUtils.findTree(afterGroupFullData, handleRangeRow, { children: iteratorChildField });
25681
+ }
25682
+ }
25683
+ else {
25684
+ const _currRowIndex = $xeTable.getVTRowIndex(currRow);
25685
+ const _firstRowIndex = $xeTable.getVTRowIndex(firstRow);
25686
+ const _lastRowIndex = $xeTable.getVTRowIndex(lastRow);
25687
+ if (_currRowIndex < _firstRowIndex) {
25688
+ rangeRows = afterFullData.slice(_currRowIndex, _firstRowIndex + 1);
25689
+ }
25690
+ else if (_currRowIndex > _lastRowIndex) {
25691
+ rangeRows = afterFullData.slice(_lastRowIndex, _currRowIndex + 1);
25692
+ }
25693
+ else {
25694
+ rangeRows = afterFullData.slice(_firstRowIndex, _currRowIndex + 1);
25695
+ }
25696
+ }
25548
25697
  $xeTable.setAllCheckboxRow(false);
25549
- const rangeRows = _rowIndex < _firstRowIndex ? afterFullData.slice(_rowIndex, _firstRowIndex + 1) : afterFullData.slice(_firstRowIndex, _rowIndex + 1);
25550
25698
  nextTick(() => {
25551
25699
  handleCheckedCheckboxRow(rangeRows, true, false);
25552
25700
  });
25553
25701
  dispatchEvent('checkbox-range-select', Object.assign({ rangeRecords: rangeRows }, params), evnt);
25554
- return;
25555
25702
  }
25556
25703
  }
25557
25704
  }
25558
- if (isRowGroupStatus || !checkMethod || checkMethod({ $table: $xeTable, row })) {
25705
+ if (!checkMethod || checkMethod({ $table: $xeTable, row })) {
25559
25706
  $xeTable.handleBatchSelectRows([row], checked);
25560
25707
  $xeTable.checkSelectionStatus();
25561
25708
  dispatchEvent('checkbox-change', Object.assign({
@@ -29044,9 +29191,6 @@ var VxeTableComponent = defineVxeComponent({
29044
29191
  if (props.editConfig && editOpts.activeMethod) {
29045
29192
  warnLog('vxe.error.delProp', ['edit-config.activeMethod', 'edit-config.beforeEditMethod']);
29046
29193
  }
29047
- if (props.treeConfig && checkboxOpts.isShiftKey) {
29048
- errLog('vxe.error.reqSupportProp', ['tree-config', 'checkbox-config.isShiftKey=false']);
29049
- }
29050
29194
  if (checkboxOpts.halfField) {
29051
29195
  warnLog('vxe.error.delProp', ['checkbox-config.halfField', 'checkbox-config.indeterminateField']);
29052
29196
  }