@visactor/vtable 1.19.4 → 1.19.6

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 (109) hide show
  1. package/cjs/ListTable.d.ts +0 -4
  2. package/cjs/ListTable.js +0 -10
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotChart.js +4 -2
  5. package/cjs/PivotChart.js.map +1 -1
  6. package/cjs/PivotTable.d.ts +0 -8
  7. package/cjs/PivotTable.js +0 -28
  8. package/cjs/PivotTable.js.map +1 -1
  9. package/cjs/core/BaseTable.js +5 -3
  10. package/cjs/core/BaseTable.js.map +1 -1
  11. package/cjs/core/record-helper.js +115 -11
  12. package/cjs/core/record-helper.js.map +1 -1
  13. package/cjs/data/CachedDataSource.d.ts +1 -1
  14. package/cjs/data/CachedDataSource.js +5 -5
  15. package/cjs/data/CachedDataSource.js.map +1 -1
  16. package/cjs/event/listener/table-group.js +1 -1
  17. package/cjs/event/listener/table-group.js.map +1 -1
  18. package/cjs/event/self-event-listener/list-table/checkbox.js +1 -1
  19. package/cjs/event/self-event-listener/list-table/checkbox.js.map +1 -1
  20. package/cjs/index.d.ts +1 -1
  21. package/cjs/index.js +1 -1
  22. package/cjs/index.js.map +1 -1
  23. package/cjs/layout/index.js +1 -2
  24. package/cjs/layout/pivot-header-layout.js +1 -1
  25. package/cjs/layout/pivot-layout.js +0 -2
  26. package/cjs/layout/row-height-map.js +1 -1
  27. package/cjs/layout/simple-header-layout.js +1 -1
  28. package/cjs/layout/tree-helper.js +1 -1
  29. package/cjs/plugins/custom-cell-style.js +2 -1
  30. package/cjs/plugins/index.js +1 -1
  31. package/cjs/plugins/interface.js +1 -1
  32. package/cjs/plugins/invert-highlight.js +1 -1
  33. package/cjs/plugins/list-tree-stick-cell.js +1 -1
  34. package/cjs/plugins/plugin-manager.js +1 -1
  35. package/cjs/scenegraph/graphic/chart.js +1 -1
  36. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  37. package/cjs/scenegraph/icon/icon-update.js +1 -1
  38. package/cjs/scenegraph/icon/icon-update.js.map +1 -1
  39. package/cjs/scenegraph/layout/compute-col-width.js +47 -2
  40. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  41. package/cjs/scenegraph/layout/update-height.js +1 -1
  42. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  43. package/cjs/scenegraph/scenegraph.js +1 -1
  44. package/cjs/scenegraph/scenegraph.js.map +1 -1
  45. package/cjs/scenegraph/utils/text-icon-layout.js +1 -0
  46. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  47. package/cjs/state/checkbox/checkbox.js +2 -1
  48. package/cjs/state/checkbox/checkbox.js.map +1 -1
  49. package/cjs/ts-types/base-table.d.ts +11 -0
  50. package/cjs/ts-types/base-table.js.map +1 -1
  51. package/cjs/ts-types/table-engine.d.ts +21 -14
  52. package/cjs/ts-types/table-engine.js.map +1 -1
  53. package/cjs/vrender.js.map +1 -1
  54. package/dist/vtable.js +270 -87
  55. package/dist/vtable.min.js +2 -2
  56. package/es/ListTable.d.ts +0 -4
  57. package/es/ListTable.js +0 -10
  58. package/es/ListTable.js.map +1 -1
  59. package/es/PivotChart.js +4 -2
  60. package/es/PivotChart.js.map +1 -1
  61. package/es/PivotTable.d.ts +0 -8
  62. package/es/PivotTable.js +0 -28
  63. package/es/PivotTable.js.map +1 -1
  64. package/es/core/BaseTable.js +5 -3
  65. package/es/core/BaseTable.js.map +1 -1
  66. package/es/core/record-helper.js +114 -8
  67. package/es/core/record-helper.js.map +1 -1
  68. package/es/data/CachedDataSource.d.ts +1 -1
  69. package/es/data/CachedDataSource.js +5 -5
  70. package/es/data/CachedDataSource.js.map +1 -1
  71. package/es/event/listener/table-group.js +1 -1
  72. package/es/event/listener/table-group.js.map +1 -1
  73. package/es/event/self-event-listener/list-table/checkbox.js +1 -1
  74. package/es/event/self-event-listener/list-table/checkbox.js.map +1 -1
  75. package/es/index.d.ts +1 -1
  76. package/es/index.js +1 -1
  77. package/es/index.js.map +1 -1
  78. package/es/layout/index.js +1 -2
  79. package/es/layout/pivot-header-layout.js +1 -1
  80. package/es/layout/pivot-layout.js +0 -2
  81. package/es/layout/row-height-map.js +1 -1
  82. package/es/layout/simple-header-layout.js +1 -1
  83. package/es/layout/tree-helper.js +1 -1
  84. package/es/plugins/custom-cell-style.js +2 -1
  85. package/es/plugins/index.js +1 -1
  86. package/es/plugins/interface.js +1 -1
  87. package/es/plugins/invert-highlight.js +1 -1
  88. package/es/plugins/list-tree-stick-cell.js +1 -1
  89. package/es/plugins/plugin-manager.js +1 -1
  90. package/es/scenegraph/graphic/chart.js +1 -1
  91. package/es/scenegraph/graphic/chart.js.map +1 -1
  92. package/es/scenegraph/icon/icon-update.js +1 -1
  93. package/es/scenegraph/icon/icon-update.js.map +1 -1
  94. package/es/scenegraph/layout/compute-col-width.js +47 -2
  95. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  96. package/es/scenegraph/layout/update-height.js +1 -1
  97. package/es/scenegraph/layout/update-height.js.map +1 -1
  98. package/es/scenegraph/scenegraph.js +1 -1
  99. package/es/scenegraph/scenegraph.js.map +1 -1
  100. package/es/scenegraph/utils/text-icon-layout.js +1 -0
  101. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  102. package/es/state/checkbox/checkbox.js +2 -1
  103. package/es/state/checkbox/checkbox.js.map +1 -1
  104. package/es/ts-types/base-table.d.ts +11 -0
  105. package/es/ts-types/base-table.js.map +1 -1
  106. package/es/ts-types/table-engine.d.ts +21 -14
  107. package/es/ts-types/table-engine.js.map +1 -1
  108. package/es/vrender.js.map +1 -1
  109. package/package.json +4 -4
@@ -30,7 +30,7 @@ Object.defineProperty(exports, "__esModule", {
30
30
  value: !0
31
31
  }), exports.listTableUpdateRecords = exports.listTableDeleteRecords = exports.listTableAddRecords = exports.listTableAddRecord = exports.sortRecords = exports.listTableChangeCellValues = exports.listTableChangeCellValue = void 0;
32
32
 
33
- const compute_col_width_1 = require("../scenegraph/layout/compute-col-width"), compute_row_height_1 = require("../scenegraph/layout/compute-row-height"), helper_1 = require("../tools/helper"), util_1 = require("../tools/util"), TABLE_EVENT_TYPE_1 = require("./TABLE_EVENT_TYPE");
33
+ const compute_col_width_1 = require("../scenegraph/layout/compute-col-width"), compute_row_height_1 = require("../scenegraph/layout/compute-row-height"), helper_1 = require("../tools/helper"), util_1 = require("../tools/util"), TABLE_EVENT_TYPE_1 = require("./TABLE_EVENT_TYPE"), vutils_1 = require("@visactor/vutils");
34
34
 
35
35
  function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
36
36
  if (workOnEditableCell && table.isHasEditorDefine(col, row) || !1 === workOnEditableCell) {
@@ -173,12 +173,14 @@ function listTableAddRecord(record, recordIndex, table) {
173
173
  if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, [ record ], recordIndex),
174
174
  table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table),
175
175
  table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(); else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, [ record ], recordIndex),
176
- table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table),
176
+ adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1), table.refreshRowColCount(),
177
+ table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table),
177
178
  table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(); else if (table.sortState) table.dataSource.addRecordForSorted(record),
178
- sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(); else {
179
+ table.stateManager.checkedState.clear(), sortRecords(table), table.refreshRowColCount(),
180
+ table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(); else {
179
181
  (void 0 === recordIndex || recordIndex > table.dataSource.sourceLength) && (recordIndex = table.dataSource.sourceLength);
180
182
  const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
181
- table.dataSource.addRecord(record, recordIndex);
183
+ table.dataSource.addRecord(record, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);
182
184
  const oldRowCount = table.rowCount;
183
185
  if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(),
184
186
  void table.scenegraph.createSceneGraph();
@@ -244,12 +246,13 @@ function listTableAddRecords(records, recordIndex, table) {
244
246
  if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).addRecordsForGroup) || void 0 === _b || _b.call(_a, records, recordIndex),
245
247
  table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table),
246
248
  table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(); else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).addRecordsForTree) || void 0 === _d || _d.call(_c, records, recordIndex),
247
- table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table),
249
+ adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length), table.refreshRowColCount(),
250
+ table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table),
248
251
  table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(); else if (table.sortState) table.dataSource.addRecordsForSorted(records),
249
252
  sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(); else {
250
253
  void 0 === recordIndex || recordIndex > table.dataSource.sourceLength ? recordIndex = table.dataSource.sourceLength : recordIndex < 0 && (recordIndex = 0);
251
254
  const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
252
- table.dataSource.addRecords(records, recordIndex);
255
+ table.dataSource.addRecords(records, recordIndex), adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);
253
256
  const oldRowCount = table.transpose ? table.colCount : table.rowCount;
254
257
  if (table.refreshRowColCount(), 0 === table.scenegraph.proxy.totalActualBodyRowCount) return table.scenegraph.clearCells(),
255
258
  void table.scenegraph.createSceneGraph();
@@ -314,9 +317,13 @@ function listTableDeleteRecords(recordIndexs, table) {
314
317
  var _a, _b, _c, _d, _e, _f, _g, _h;
315
318
  if ((null == recordIndexs ? void 0 : recordIndexs.length) > 0) if (table.internalProps.groupBy) null === (_b = (_a = table.dataSource).deleteRecordsForGroup) || void 0 === _b || _b.call(_a, recordIndexs),
316
319
  table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table),
317
- table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(); else if ("tree" === table.dataSource.rowHierarchyType) null === (_d = (_c = table.dataSource).deleteRecordsForTree) || void 0 === _d || _d.call(_c, recordIndexs),
318
- table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table),
319
- table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(); else if (table.sortState) table.dataSource.deleteRecordsForSorted(recordIndexs),
320
+ table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(); else if ("tree" === table.dataSource.rowHierarchyType) {
321
+ const deletedRecordIndexs = null === (_d = (_c = table.dataSource).deleteRecordsForTree) || void 0 === _d ? void 0 : _d.call(_c, recordIndexs);
322
+ if (0 === deletedRecordIndexs.length) return;
323
+ for (let index = 0; index < deletedRecordIndexs.length; index++) adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);
324
+ table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.sortState && sortRecords(table),
325
+ table.scenegraph.clearCells(), table.scenegraph.createSceneGraph();
326
+ } else if (table.sortState) table.dataSource.deleteRecordsForSorted(recordIndexs),
320
327
  sortRecords(table), table.refreshRowColCount(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(); else {
321
328
  const deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs);
322
329
  if (0 === deletedRecordIndexs.length) return;
@@ -457,8 +464,105 @@ function listTableUpdateRecords(records, recordIndexs, table) {
457
464
  }
458
465
  }
459
466
 
467
+ function adjustCheckBoxStateMapWithDeleteRecordIndex(table, recordIndex, count) {
468
+ const {checkedState: checkedState} = table.stateManager;
469
+ if (checkedState) if ("tree" === table.dataSource.rowHierarchyType) {
470
+ let toOperateIndexArr;
471
+ toOperateIndexArr = (0, vutils_1.isNumber)(recordIndex) ? [ recordIndex ] : recordIndex;
472
+ const toOperateIndexArrLength = toOperateIndexArr.length, targetResult = [];
473
+ checkedState.forEach(((value, key) => {
474
+ var _a;
475
+ const keyArray = key.split(",");
476
+ if (keyArray.length >= toOperateIndexArr.length) for (let i = 0; i < keyArray.length; i++) {
477
+ const toOperateIndex = null !== (_a = toOperateIndexArr[i]) && void 0 !== _a ? _a : -1, keyIndex = Number(keyArray[i]);
478
+ if (!(toOperateIndex === keyIndex && i < keyArray.length - 1)) {
479
+ if (toOperateIndex === keyIndex && i === keyArray.length - 1 || -1 === toOperateIndex) {
480
+ targetResult.push({
481
+ originKey: key,
482
+ value: value
483
+ });
484
+ break;
485
+ }
486
+ if (toOperateIndex < keyIndex && i === toOperateIndexArrLength - 1) {
487
+ keyArray[i] = (keyIndex - count).toString(), targetResult.push({
488
+ originKey: key,
489
+ targetKey: keyArray.toString(),
490
+ value: value
491
+ });
492
+ break;
493
+ }
494
+ break;
495
+ }
496
+ }
497
+ })), targetResult.sort(((a, b) => {
498
+ const aArray = a.originKey.split(","), bArray = b.originKey.split(","), aLength = aArray.length, bLength = bArray.length, minLength = Math.min(aLength, bLength);
499
+ for (let i = 0; i < minLength; i++) {
500
+ const aIndex = Number(aArray[i]), bIndex = Number(bArray[i]);
501
+ if (aIndex !== bIndex) return aIndex - bIndex;
502
+ }
503
+ return aLength - bLength;
504
+ })), targetResult.forEach((({originKey: originKey, targetKey: targetKey, value: value}) => {
505
+ checkedState.delete(originKey), targetKey && checkedState.set(targetKey, value);
506
+ }));
507
+ } else {
508
+ for (let key = checkedState.size - 1; key >= recordIndex; key--) {
509
+ const record = checkedState.get(key.toString());
510
+ checkedState.delete(key.toString()), checkedState.set((key - count).toString(), record);
511
+ }
512
+ }
513
+ }
514
+
515
+ function adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, count) {
516
+ const {checkedState: checkedState} = table.stateManager;
517
+ if (checkedState) if ("tree" === table.dataSource.rowHierarchyType) {
518
+ let toOperateIndexArr;
519
+ toOperateIndexArr = (0, vutils_1.isNumber)(recordIndex) ? [ recordIndex ] : recordIndex;
520
+ const toOperateIndexArrLength = toOperateIndexArr.length, targetResult = [];
521
+ checkedState.forEach(((value, key) => {
522
+ var _a;
523
+ const keyArray = key.split(",");
524
+ if (keyArray.length >= toOperateIndexArr.length) for (let i = 0; i < keyArray.length; i++) {
525
+ const toOperateIndex = null !== (_a = toOperateIndexArr[i]) && void 0 !== _a ? _a : -1, keyIndex = Number(keyArray[i]);
526
+ if (toOperateIndex === keyIndex && (i === keyArray.length - 1 || i === toOperateIndexArrLength - 1)) {
527
+ keyArray[i] = (keyIndex + count).toString(), targetResult.push({
528
+ originKey: key,
529
+ targetKey: keyArray.toString(),
530
+ value: value
531
+ });
532
+ break;
533
+ }
534
+ if (!(toOperateIndex === keyIndex && i < keyArray.length - 1)) {
535
+ if (toOperateIndex < keyIndex && i === toOperateIndexArrLength - 1) {
536
+ keyArray[i] = (keyIndex + count).toString(), targetResult.push({
537
+ originKey: key,
538
+ targetKey: keyArray.toString(),
539
+ value: value
540
+ });
541
+ break;
542
+ }
543
+ break;
544
+ }
545
+ }
546
+ })), targetResult.sort(((a, b) => {
547
+ const aArray = a.originKey.split(","), bArray = b.originKey.split(","), aLength = aArray.length, bLength = bArray.length, minLength = Math.min(aLength, bLength);
548
+ for (let i = 0; i < minLength; i++) {
549
+ const aIndex = Number(aArray[i]), bIndex = Number(bArray[i]);
550
+ if (aIndex !== bIndex) return -aIndex + bIndex;
551
+ }
552
+ return -aLength + bLength;
553
+ })), targetResult.forEach((({originKey: originKey, targetKey: targetKey, value: value}) => {
554
+ checkedState.delete(originKey), targetKey && checkedState.set(targetKey, value);
555
+ }));
556
+ } else {
557
+ for (let key = checkedState.size - 1; key >= recordIndex; key--) {
558
+ const record = checkedState.get(key.toString());
559
+ checkedState.delete(key.toString()), checkedState.set((key + count).toString(), record);
560
+ }
561
+ }
562
+ }
563
+
564
+ //# sourceMappingURL=record-helper.js.map
460
565
  exports.listTableChangeCellValue = listTableChangeCellValue, exports.listTableChangeCellValues = listTableChangeCellValues,
461
566
  exports.sortRecords = sortRecords, exports.listTableAddRecord = listTableAddRecord,
462
567
  exports.listTableAddRecords = listTableAddRecords, exports.listTableDeleteRecords = listTableDeleteRecords,
463
- exports.listTableUpdateRecords = listTableUpdateRecords;
464
- //# sourceMappingURL=record-helper.js.map
568
+ exports.listTableUpdateRecords = listTableUpdateRecords;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/record-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,8EAAyE;AACzE,gFAA2E;AAC3E,4CAA4C;AAC5C,wCAA+C;AAE/C,yDAAsD;AAUtD,SAAgB,wBAAwB,CACtC,GAAW,EACX,GAAW,EACX,KAA6B,EAC7B,kBAA2B,EAC3B,YAAqB,EACrB,KAAgB;IAEhB,IAAI,CAAC,kBAAkB,IAAI,KAAK,CAAC,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,kBAAkB,KAAK,KAAK,EAAE;QAC7F,MAAM,WAAW,GAAG,KAAK,CAAC,wBAAwB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC7D,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAClE,MAAM,iBAAiB,GAAG,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC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,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;qBAClC;iBACF;gBACD,KAAK,CAAC,SAAS;oBACb,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,UAAU,CAAC;oBAChD,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;aACpD;SACF;KAEF;AACH,CAAC;AA9GD,wDA8GC","file":"record-helper.js","sourcesContent":["/* eslint-disable max-depth */\nimport type { ListTable } from '../ListTable';\nimport type { CachedDataSource } from '../data';\nimport { computeColWidth } from '../scenegraph/layout/compute-col-width';\nimport { computeRowHeight } from '../scenegraph/layout/compute-row-height';\nimport { isPromise } from '../tools/helper';\nimport { defaultOrderFn } from '../tools/util';\nimport type { ListTableProtected, SortState } from '../ts-types';\nimport { TABLE_EVENT_TYPE } from './TABLE_EVENT_TYPE';\n\n/**\n * 更改单元格数据 会触发change_cell_value事件\n * @param col\n * @param row\n * @param value 更改后的值\n * @param workOnEditableCell 限制只能更改配置了编辑器的单元格值。快捷键paste这里配置的true,限制只能修改可编辑单元格值\n * @param triggerEvent 是否在值发生改变的时候触发change_cell_value事件\n */\nexport function listTableChangeCellValue(\n col: number,\n row: number,\n value: string | number | null,\n workOnEditableCell: boolean,\n triggerEvent: boolean,\n table: ListTable\n) {\n if ((workOnEditableCell && table.isHasEditorDefine(col, row)) || workOnEditableCell === false) {\n const recordIndex = table.getRecordShowIndexByCell(col, row);\n const { field } = table.internalProps.layoutMap.getBody(col, row);\n const beforeChangeValue = table.getCellRawValue(col, row);\n const oldValue = table.getCellOriginValue(col, row);\n if (table.isHeader(col, row)) {\n table.internalProps.layoutMap.updateColumnTitle(col, row, value as string);\n } else {\n table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);\n }\n const range = table.getCellRange(col, row);\n //改变单元格的值后 聚合值做重新计算\n const aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);\n if (aggregators) {\n if (Array.isArray(aggregators)) {\n for (let i = 0; i < aggregators?.length; i++) {\n aggregators[i].recalculate();\n }\n } else {\n aggregators.recalculate();\n }\n const aggregatorCells = table.internalProps.layoutMap.getAggregatorCellAddress(\n range.start.col,\n range.start.row,\n range.end.col,\n range.end.row\n );\n for (let i = 0; i < aggregatorCells.length; i++) {\n const range = table.getCellRange(aggregatorCells[i].col, aggregatorCells[i].row);\n for (let sCol = range.start.col; sCol <= range.end.col; sCol++) {\n for (let sRow = range.start.row; sRow <= range.end.row; sRow++) {\n table.scenegraph.updateCellContent(sCol, sRow);\n }\n }\n }\n }\n\n // const cell_value = table.getCellValue(col, row);\n\n for (let sCol = range.start.col; sCol <= range.end.col; sCol++) {\n for (let sRow = range.start.row; sRow <= range.end.row; sRow++) {\n table.scenegraph.updateCellContent(sCol, sRow);\n }\n }\n if (table.widthMode === 'adaptive' || (table.autoFillWidth && table.getAllColsWidth() <= table.tableNoFrameWidth)) {\n if (table.internalProps._widthResizedColMap.size === 0) {\n //如果没有手动调整过行高列宽 则重新计算一遍并重新分配\n table.scenegraph.recalculateColWidths();\n }\n } else if (!table.internalProps._widthResizedColMap.has(col)) {\n const oldWidth = table.getColWidth(col);\n const newWidth = computeColWidth(col, 0, table.rowCount - 1, table, false);\n if (newWidth !== oldWidth) {\n table.scenegraph.updateColWidth(col, newWidth - oldWidth);\n }\n }\n if (\n table.heightMode === 'adaptive' ||\n (table.autoFillHeight && table.getAllRowsHeight() <= table.tableNoFrameHeight)\n ) {\n if (table.internalProps._heightResizedRowMap.size === 0) {\n table.scenegraph.recalculateRowHeights();\n }\n } else if (table.isAutoRowHeight(row) && !table.internalProps._heightResizedRowMap.has(row)) {\n const oldHeight = table.getRowHeight(row);\n const newHeight = computeRowHeight(row, 0, table.colCount - 1, table);\n table.scenegraph.updateRowHeight(row, newHeight - oldHeight);\n }\n const changedValue = table.getCellOriginValue(col, row);\n if (oldValue !== changedValue && triggerEvent) {\n table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {\n col,\n row,\n rawValue: beforeChangeValue,\n currentValue: oldValue,\n changedValue\n });\n }\n table.scenegraph.updateNextFrame();\n }\n}\n/**\n * 批量更新多个单元格的数据\n * @param col 粘贴数据的起始列号\n * @param row 粘贴数据的起始行号\n * @param values 多个单元格的数据数组\n * @param workOnEditableCell 是否仅更改可编辑单元格\n * @param triggerEvent 是否在值发生改变的时候触发change_cell_value事件\n */\nexport async function listTableChangeCellValues(\n startCol: number,\n startRow: number,\n values: (string | number)[][],\n workOnEditableCell: boolean,\n triggerEvent: boolean,\n table: ListTable\n): Promise<boolean[][]> {\n const changedCellResults: boolean[][] = [];\n let pasteColEnd = startCol;\n let pasteRowEnd = startRow;\n // const rowCount = values.length;\n //#region 提前组织好未更改前的数据\n const beforeChangeValues: (string | number)[][] = [];\n const oldValues: (string | number)[][] = [];\n let cellUpdateType: 'normal' | 'sort' | 'group';\n\n for (let i = 0; i < values.length; i++) {\n if (startRow + i > table.rowCount - 1) {\n break;\n }\n const rowValues = values[i];\n const rawRowValues: (string | number)[] = [];\n const oldRowValues: (string | number)[] = [];\n beforeChangeValues.push(rawRowValues);\n oldValues.push(oldRowValues);\n for (let j = 0; j < rowValues.length; j++) {\n if (startCol + j > table.colCount - 1) {\n break;\n }\n cellUpdateType = getCellUpdateType(startCol + j, startRow + i, table, cellUpdateType);\n const beforeChangeValue = table.getCellRawValue(startCol + j, startRow + i);\n rawRowValues.push(beforeChangeValue);\n const oldValue = table.getCellOriginValue(startCol + j, startRow + i);\n oldRowValues.push(oldValue);\n }\n }\n //#endregion\n for (let i = 0; i < values.length; i++) {\n if (startRow + i > table.rowCount - 1) {\n break;\n }\n changedCellResults[i] = [];\n pasteRowEnd = startRow + i;\n const rowValues = values[i];\n let thisRowPasteColEnd = startCol;\n for (let j = 0; j < rowValues.length; j++) {\n if (startCol + j > table.colCount - 1) {\n break;\n }\n thisRowPasteColEnd = startCol + j;\n let isCanChange = false;\n if (workOnEditableCell === false) {\n isCanChange = true;\n } else {\n if (table.isHasEditorDefine(startCol + j, startRow + i)) {\n const editor = table.getEditor(startCol + j, startRow + i);\n const oldValue = oldValues[i][j];\n const value = rowValues[j];\n const maybePromiseOrValue =\n editor?.validateValue?.(value, oldValue, { col: startCol + j, row: startRow + i }, table) ?? true;\n if (isPromise(maybePromiseOrValue)) {\n const validateResult = await maybePromiseOrValue;\n isCanChange =\n validateResult === true || validateResult === 'validate-exit' || validateResult === 'validate-not-exit';\n } else {\n isCanChange =\n maybePromiseOrValue === true ||\n maybePromiseOrValue === 'validate-exit' ||\n maybePromiseOrValue === 'validate-not-exit';\n }\n }\n }\n // if ((workOnEditableCell && table.isHasEditorDefine(startCol + j, startRow + i)) || workOnEditableCell === false) {\n if (isCanChange) {\n changedCellResults[i][j] = true;\n const value = rowValues[j];\n const recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i);\n const { field } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i);\n // const beforeChangeValue = table.getCellRawValue(startCol + j, startRow + i);\n // const oldValue = table.getCellOriginValue(startCol + j, startRow + i);\n const beforeChangeValue = beforeChangeValues[i][j];\n const oldValue = oldValues[i][j];\n if (table.isHeader(startCol + j, startRow + i)) {\n table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value as string);\n } else {\n table.dataSource.changeFieldValue(value, recordIndex, field, startCol + j, startRow + i, table);\n }\n const changedValue = table.getCellOriginValue(startCol + j, startRow + i);\n if (oldValue !== changedValue && triggerEvent) {\n table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {\n col: startCol + j,\n row: startRow + i,\n rawValue: beforeChangeValue,\n currentValue: oldValue,\n changedValue\n });\n }\n } else {\n changedCellResults[i][j] = false;\n }\n }\n pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);\n }\n\n // const cell_value = table.getCellValue(col, row);\n const startRange = table.getCellRange(startCol, startRow);\n const range = table.getCellRange(pasteColEnd, pasteRowEnd);\n\n //改变单元格的值后 聚合值做重新计算\n const aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(\n startRange.start.col,\n startRange.start.row,\n range.end.col,\n range.end.row\n );\n\n if (aggregators) {\n for (let i = 0; i < aggregators?.length; i++) {\n aggregators[i].recalculate();\n }\n\n if (cellUpdateType === 'normal') {\n const aggregatorCells = table.internalProps.layoutMap.getAggregatorCellAddress(\n startRange.start.col,\n startRange.start.row,\n range.end.col,\n range.end.row\n );\n for (let i = 0; i < aggregatorCells.length; i++) {\n const range = table.getCellRange(aggregatorCells[i].col, aggregatorCells[i].row);\n for (let sCol = range.start.col; sCol <= range.end.col; sCol++) {\n for (let sRow = range.start.row; sRow <= range.end.row; sRow++) {\n table.scenegraph.updateCellContent(sCol, sRow);\n }\n }\n }\n }\n }\n\n if (cellUpdateType === 'group') {\n (table.dataSource as CachedDataSource).updateRecordsForGroup([], []);\n }\n\n if (cellUpdateType === 'sort' || cellUpdateType === 'group') {\n (table.dataSource as any).sortedIndexMap.clear();\n sortRecords(table);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n return changedCellResults;\n }\n\n for (let sCol = startRange.start.col; sCol <= range.end.col; sCol++) {\n for (let sRow = startRange.start.row; sRow <= range.end.row; sRow++) {\n table.scenegraph.updateCellContent(sCol, sRow);\n }\n }\n if (table.widthMode === 'adaptive' || (table.autoFillWidth && table.getAllColsWidth() <= table.tableNoFrameWidth)) {\n if (table.internalProps._widthResizedColMap.size === 0) {\n //如果没有手动调整过行高列宽 则重新计算一遍并重新分配\n table.scenegraph.recalculateColWidths();\n }\n } else {\n for (let sCol = startCol; sCol <= range.end.col; sCol++) {\n if (!table.internalProps._widthResizedColMap.has(sCol)) {\n const oldWidth = table.getColWidth(sCol);\n const newWidth = computeColWidth(sCol, 0, table.rowCount - 1, table, false);\n if (newWidth !== oldWidth) {\n table.scenegraph.updateColWidth(sCol, newWidth - oldWidth);\n }\n }\n }\n }\n if (\n table.heightMode === 'adaptive' ||\n (table.autoFillHeight && table.getAllRowsHeight() <= table.tableNoFrameHeight)\n ) {\n table.scenegraph.recalculateRowHeights();\n } else if (table.isAutoRowHeight(startRow)) {\n const rows: number[] = [];\n const deltaYs: number[] = [];\n for (let sRow = startRow; sRow <= range.end.row; sRow++) {\n if (table.rowHeightsMap.get(sRow)) {\n // 已经计算过行高的才走更新逻辑\n const oldHeight = table.getRowHeight(sRow);\n const newHeight = computeRowHeight(sRow, 0, table.colCount - 1, table);\n rows.push(sRow);\n deltaYs.push(newHeight - oldHeight);\n }\n }\n table.scenegraph.updateRowsHeight(rows, deltaYs);\n }\n\n table.scenegraph.updateNextFrame();\n return changedCellResults;\n}\n\ntype CellUpdateType = 'normal' | 'sort' | 'group';\nfunction getCellUpdateType(\n col: number,\n row: number,\n table: ListTable,\n oldCellUpdateType: CellUpdateType | undefined\n): CellUpdateType {\n if (oldCellUpdateType === 'group') {\n return oldCellUpdateType;\n }\n if (oldCellUpdateType === 'sort' && !(table.internalProps as ListTableProtected).groupBy) {\n return oldCellUpdateType;\n }\n let cellUpdateType: CellUpdateType = 'normal';\n if ((table.internalProps as ListTableProtected).groupBy) {\n cellUpdateType = 'group';\n } else if (!table.isHeader(col, row) && (table.dataSource as any).lastOrderField) {\n const field = table.getBodyField(col, row);\n if (field === (table.dataSource as any).lastOrderField) {\n cellUpdateType = 'sort';\n }\n }\n return cellUpdateType;\n}\n\nexport function sortRecords(table: ListTable) {\n let sortState = table.sortState;\n sortState = !sortState || Array.isArray(sortState) ? sortState : [sortState];\n\n if (sortState) {\n sortState = (sortState as SortState[]).map(item => {\n item.orderFn = table._getSortFuncFromHeaderOption(undefined, item.field) ?? defaultOrderFn;\n //const hd = table.internalProps.layoutMap.headerObjects.find((col: any) => col && col.field === item.field);\n return item;\n });\n\n table.dataSource.sort(sortState);\n }\n}\n\n/**\n * 添加数据 单条数据\n * @param record 数据\n * @param recordIndex 向数据源中要插入的位置,从0开始。不设置recordIndex的话 默认追加到最后。\n * 如果设置了排序规则recordIndex无效,会自动适应排序逻辑确定插入顺序。\n * recordIndex 可以通过接口getRecordShowIndexByCell获取\n */\nexport function listTableAddRecord(record: any, recordIndex: number | number[], table: ListTable) {\n if ((table.internalProps as ListTableProtected).groupBy) {\n (table.dataSource as CachedDataSource).addRecordsForGroup?.([record], recordIndex);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n table.sortState && sortRecords(table);\n\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if ((table.dataSource as CachedDataSource).rowHierarchyType === 'tree') {\n (table.dataSource as CachedDataSource).addRecordsForTree?.([record], recordIndex);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n table.sortState && sortRecords(table);\n\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if (table.sortState) {\n table.dataSource.addRecordForSorted(record);\n sortRecords(table);\n table.refreshRowColCount();\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n recordIndex = recordIndex as number;\n if (recordIndex === undefined || recordIndex > table.dataSource.sourceLength) {\n recordIndex = table.dataSource.sourceLength;\n }\n const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;\n table.dataSource.addRecord(record, recordIndex);\n const oldRowCount = table.rowCount;\n table.refreshRowColCount();\n if (table.scenegraph.proxy.totalActualBodyRowCount === 0) {\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n return;\n }\n const newRowCount = table.transpose ? table.colCount : table.rowCount;\n if (table.pagination) {\n const { perPageCount, currentPage } = table.pagination;\n const startIndex = perPageCount * (currentPage || 0);\n const endIndex = startIndex + perPageCount;\n if (recordIndex < endIndex) {\n //插入当前页或者前面的数据才需要更新 如果是插入的是当前页后面的数据不需要更新场景树\n if (recordIndex < endIndex - perPageCount) {\n // 如果是当页之前的数据 则整个场景树都更新\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n //如果是插入当前页数据\n const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;\n if (oldRowCount - headerCount === table.pagination.perPageCount) {\n //如果当页数据是满的 则更新插入的部分行\n const updateRows = [];\n for (let row = rowNum; row < newRowCount; row++) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n table.transpose\n ? table.scenegraph.updateCol([], [], updateRows)\n : table.scenegraph.updateRow([], [], updateRows);\n } else {\n //如果当页数据不是满的 则插入新数据\n const addRows = [];\n for (let row = rowNum; row < Math.min(newRowCount, rowNum + 1); row++) {\n if (table.transpose) {\n addRows.push({ col: row, row: 0 });\n } else {\n addRows.push({ col: 0, row });\n }\n }\n table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);\n }\n }\n }\n } else {\n const addRows = [];\n for (let row = recordIndex + headerCount; row < recordIndex + headerCount + 1; row++) {\n if (table.transpose) {\n addRows.push({ col: row, row: 0 });\n } else {\n addRows.push({ col: 0, row });\n }\n }\n const updateRows = [];\n const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;\n const bottomAggregationCount = table.internalProps.layoutMap.hasAggregationOnBottomCount;\n for (let row = headerCount; row < headerCount + topAggregationCount; row++) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n for (\n let row = (table.transpose ? table.colCount : table.rowCount) - bottomAggregationCount;\n row < (table.transpose ? table.colCount : table.rowCount);\n row++\n ) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);\n }\n }\n // table.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, { row });\n}\n\n/**\n * 添加数据 支持多条数据\n * @param records 多条数据\n * @param recordIndex 向数据源中要插入的位置,从0开始。不设置recordIndex的话 默认追加到最后。\n * 如果设置了排序规则recordIndex无效,会自动适应排序逻辑确定插入顺序。\n * recordIndex 可以通过接口getRecordShowIndexByCell获取\n */\nexport function listTableAddRecords(records: any[], recordIndex: number | number[], table: ListTable) {\n if ((table.internalProps as ListTableProtected).groupBy) {\n (table.dataSource as CachedDataSource).addRecordsForGroup?.(records, recordIndex);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n table.sortState && sortRecords(table);\n\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if ((table.dataSource as CachedDataSource).rowHierarchyType === 'tree') {\n (table.dataSource as CachedDataSource).addRecordsForTree?.(records, recordIndex);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n table.sortState && sortRecords(table);\n\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if (table.sortState) {\n table.dataSource.addRecordsForSorted(records);\n sortRecords(table);\n table.refreshRowColCount();\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n recordIndex = recordIndex as number;\n if (recordIndex === undefined || recordIndex > table.dataSource.sourceLength) {\n recordIndex = table.dataSource.sourceLength;\n } else if (recordIndex < 0) {\n recordIndex = 0;\n }\n const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;\n table.dataSource.addRecords(records, recordIndex);\n const oldRowCount = table.transpose ? table.colCount : table.rowCount;\n table.refreshRowColCount();\n if (table.scenegraph.proxy.totalActualBodyRowCount === 0) {\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n return;\n }\n const newRowCount = table.transpose ? table.colCount : table.rowCount;\n if (table.pagination) {\n const { perPageCount, currentPage } = table.pagination;\n const startIndex = perPageCount * (currentPage || 0);\n const endIndex = startIndex + perPageCount;\n if (recordIndex < endIndex) {\n //插入当前页或者前面的数据才需要更新 如果是插入的是当前页后面的数据不需要更新场景树\n if (recordIndex < endIndex - perPageCount) {\n // 如果是当页之前的数据 则整个场景树都更新\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n //如果是插入当前页数据\n\n const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;\n if (oldRowCount - headerCount === table.pagination.perPageCount) {\n //如果当页数据是满的 则更新插入的部分行\n const updateRows = [];\n for (let row = rowNum; row < newRowCount; row++) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n table.transpose\n ? table.scenegraph.updateCol([], [], updateRows)\n : table.scenegraph.updateRow([], [], updateRows);\n } else {\n //如果当页数据不是满的 则插入新数据\n const addRows = [];\n for (\n let row = rowNum;\n row < Math.min(newRowCount, rowNum + (Array.isArray(records) ? records.length : 1));\n row++\n ) {\n if (table.transpose) {\n addRows.push({ col: row, row: 0 });\n } else {\n addRows.push({ col: 0, row });\n }\n }\n table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);\n }\n }\n }\n } else {\n const addRows = [];\n for (\n let row = recordIndex + headerCount;\n row < recordIndex + headerCount + (Array.isArray(records) ? records.length : 1);\n row++\n ) {\n if (table.transpose) {\n addRows.push({ col: row, row: 0 });\n } else {\n addRows.push({ col: 0, row });\n }\n }\n const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;\n const bottomAggregationCount = table.internalProps.layoutMap.hasAggregationOnBottomCount;\n const updateRows = [];\n for (let row = headerCount; row < headerCount + topAggregationCount; row++) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n for (\n let row = (table.transpose ? table.colCount : table.rowCount) - bottomAggregationCount;\n row < (table.transpose ? table.colCount : table.rowCount);\n row++\n ) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n table.transpose\n ? table.scenegraph.updateCol([], addRows, updateRows)\n : table.scenegraph.updateRow([], addRows, updateRows);\n }\n }\n // table.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, { row });\n}\n\n/**\n * 删除数据 支持多条数据\n * @param recordIndexs 要删除数据的索引(显示在body中的索引,即要修改的是body部分的第几行数据)\n */\nexport function listTableDeleteRecords(recordIndexs: number[] | number[][], table: ListTable) {\n if (recordIndexs?.length > 0) {\n if ((table.internalProps as ListTableProtected).groupBy) {\n (table.dataSource as CachedDataSource).deleteRecordsForGroup?.(recordIndexs);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n table.sortState && sortRecords(table);\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if ((table.dataSource as CachedDataSource).rowHierarchyType === 'tree') {\n (table.dataSource as CachedDataSource).deleteRecordsForTree?.(recordIndexs);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n table.sortState && sortRecords(table);\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if (table.sortState) {\n table.dataSource.deleteRecordsForSorted(recordIndexs as number[]);\n sortRecords(table);\n table.refreshRowColCount();\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n const deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs as number[]);\n if (deletedRecordIndexs.length === 0) {\n return;\n }\n const oldRowCount = table.transpose ? table.colCount : table.rowCount;\n table.refreshRowColCount();\n const newRowCount = table.transpose ? table.colCount : table.rowCount;\n const recordIndexsMinToMax = deletedRecordIndexs.sort((a, b) => a - b);\n const minRecordIndex = recordIndexsMinToMax[0];\n if (table.pagination) {\n const { perPageCount, currentPage } = table.pagination;\n const startIndex = perPageCount * (currentPage || 0);\n const endIndex = startIndex + perPageCount;\n if (minRecordIndex < endIndex) {\n //删除当前页或者前面的数据才需要更新 如果是删除的是当前页后面的数据不需要更新场景树\n if (minRecordIndex < endIndex - perPageCount) {\n // 如果删除包含当页之前的数据 则整个场景树都更新\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;\n const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;\n //如果是仅删除当前页数据\n const minRowNum =\n minRecordIndex -\n (endIndex - perPageCount) +\n (table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount) +\n topAggregationCount;\n //如果当页数据是满的 则更新影响的部分行\n const updateRows = [];\n const delRows = [];\n\n for (let row = minRowNum; row < newRowCount; row++) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n\n for (let row = headerCount; row < headerCount + topAggregationCount; row++) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n\n if (newRowCount < oldRowCount) {\n //如果如果删除后不满 需要有删除数据\n for (let row = newRowCount; row < oldRowCount; row++) {\n if (table.transpose) {\n delRows.push({ col: row, row: 0 });\n } else {\n delRows.push({ col: 0, row });\n }\n }\n }\n table.reactCustomLayout?.clearCache();\n table.transpose\n ? table.scenegraph.updateCol(delRows, [], updateRows)\n : table.scenegraph.updateRow(delRows, [], updateRows);\n table.reactCustomLayout?.updateAllCustomCell();\n }\n }\n } else {\n const delRows = [];\n const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;\n const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;\n const bottomAggregationCount = table.internalProps.layoutMap.hasAggregationOnBottomCount;\n for (let index = 0; index < recordIndexsMinToMax.length; index++) {\n const recordIndex = recordIndexsMinToMax[index];\n const rowNum = recordIndex + headerCount + topAggregationCount;\n if (table.transpose) {\n delRows.push({ col: rowNum, row: 0 });\n } else {\n delRows.push({ col: 0, row: rowNum });\n }\n }\n const updateRows = [];\n for (let row = headerCount; row < headerCount + topAggregationCount; row++) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n for (\n let row = (table.transpose ? table.colCount : table.rowCount) - bottomAggregationCount;\n row < (table.transpose ? table.colCount : table.rowCount);\n row++\n ) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n\n table.reactCustomLayout?.clearCache();\n table.transpose\n ? table.scenegraph.updateCol(delRows, [], updateRows)\n : table.scenegraph.updateRow(delRows, [], updateRows);\n table.reactCustomLayout?.updateAllCustomCell();\n }\n }\n // table.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, { row });\n }\n}\n\n/**\n * 修改数据 支持多条数据\n * @param records 修改数据条目\n * @param recordIndexs 对应修改数据的索引(显示在body中的索引,即要修改的是body部分的第几行数据)\n */\nexport function listTableUpdateRecords(records: any[], recordIndexs: (number | number[])[], table: ListTable) {\n if (recordIndexs?.length > 0) {\n if ((table.internalProps as ListTableProtected).groupBy) {\n (table.dataSource as CachedDataSource).updateRecordsForGroup?.(records, recordIndexs as number[]);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n table.sortState && sortRecords(table);\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if ((table.dataSource as CachedDataSource).rowHierarchyType === 'tree') {\n (table.dataSource as CachedDataSource).updateRecordsForTree?.(records, recordIndexs as number[]);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n table.sortState && sortRecords(table);\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if (table.sortState) {\n table.dataSource.updateRecordsForSorted(records, recordIndexs as number[]);\n sortRecords(table);\n table.refreshRowColCount();\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n const updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs);\n if (updateRecordIndexs.length === 0) {\n return;\n }\n const bodyRowIndex = updateRecordIndexs.map(index => table.getBodyRowIndexByRecordIndex(index));\n const recordIndexsMinToMax = bodyRowIndex.sort((a, b) => a - b);\n if (table.pagination) {\n const { perPageCount, currentPage } = table.pagination;\n const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;\n const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;\n const startIndex = perPageCount * (currentPage || 0);\n const endIndex = startIndex + perPageCount;\n const updateRows = [];\n for (let index = 0; index < recordIndexsMinToMax.length; index++) {\n const recordIndex = recordIndexsMinToMax[index];\n if (recordIndex < endIndex && recordIndex >= endIndex - perPageCount) {\n const rowNum =\n recordIndex -\n (endIndex - perPageCount) +\n (table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount) +\n topAggregationCount;\n updateRows.push(rowNum);\n }\n }\n if (updateRows.length >= 1) {\n const updateRowCells = [];\n for (let index = 0; index < updateRows.length; index++) {\n const updateRow = updateRows[index];\n if (table.transpose) {\n updateRowCells.push({ col: updateRow, row: 0 });\n } else {\n updateRowCells.push({ col: 0, row: updateRow });\n }\n }\n for (let row = headerCount; row < headerCount + topAggregationCount; row++) {\n if (table.transpose) {\n updateRowCells.push({ col: row, row: 0 });\n } else {\n updateRowCells.push({ col: 0, row });\n }\n }\n table.transpose\n ? table.scenegraph.updateCol([], [], updateRowCells)\n : table.scenegraph.updateRow([], [], updateRowCells);\n }\n } else {\n const updateRows = [];\n const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;\n const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;\n const bottomAggregationCount = table.internalProps.layoutMap.hasAggregationOnBottomCount;\n for (let index = 0; index < recordIndexsMinToMax.length; index++) {\n const recordIndex = recordIndexsMinToMax[index];\n const rowNum = recordIndex + headerCount + topAggregationCount;\n if (table.transpose) {\n updateRows.push({ col: rowNum, row: 0 });\n } else {\n updateRows.push({ col: 0, row: rowNum });\n }\n }\n for (let row = headerCount; row < headerCount + topAggregationCount; row++) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n for (\n let row = (table.transpose ? table.colCount : table.rowCount) - bottomAggregationCount;\n row < (table.transpose ? table.colCount : table.rowCount);\n row++\n ) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n table.transpose\n ? table.scenegraph.updateCol([], [], updateRows)\n : table.scenegraph.updateRow([], [], updateRows);\n }\n }\n // table.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, { row });\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/core/record-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,8EAAyE;AACzE,gFAA2E;AAC3E,4CAA4C;AAC5C,wCAA+C;AAE/C,yDAAsD;AACtD,6CAA4C;AAU5C,SAAgB,wBAAwB,CACtC,GAAW,EACX,GAAW,EACX,KAA6B,EAC7B,kBAA2B,EAC3B,YAAqB,EACrB,KAAgB;IAEhB,IAAI,CAAC,kBAAkB,IAAI,KAAK,CAAC,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,kBAAkB,KAAK,KAAK,EAAE;QAC7F,MAAM,WAAW,GAAG,KAAK,CAAC,wBAAwB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC7D,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAClE,MAAM,iBAAiB,GAAG,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC1D,MAAM,QAAQ,GAAG,KAAK,CAAC,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACpD,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;YAC5B,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C,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;gBAClC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;gBACjC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;gBACjC,IAAI,MAAM,KAAK,MAAM,EAAE;oBACrB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;iBACzB;aACF;YACD,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;QAC5B,CAAC,CAAC,CAAC;QACH,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE;YACvD,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAC/B,IAAI,SAAS,EAAE;gBACb,YAAY,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;aACpC;QACH,CAAC,CAAC,CAAC;KACJ;SAAM;QACL,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC;QACjC,KAAK,IAAI,GAAG,GAAG,MAAM,GAAG,CAAC,EAAE,GAAG,IAAK,WAAsB,EAAE,GAAG,EAAE,EAAE;YAChE,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;YAChD,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;YACpC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC;SACpD;KACF;AACH,CAAC","file":"record-helper.js","sourcesContent":["/* eslint-disable max-depth */\nimport type { ListTable } from '../ListTable';\nimport type { CachedDataSource } from '../data';\nimport { computeColWidth } from '../scenegraph/layout/compute-col-width';\nimport { computeRowHeight } from '../scenegraph/layout/compute-row-height';\nimport { isPromise } from '../tools/helper';\nimport { defaultOrderFn } from '../tools/util';\nimport type { ListTableProtected, SortState } from '../ts-types';\nimport { TABLE_EVENT_TYPE } from './TABLE_EVENT_TYPE';\nimport { isNumber } from '@visactor/vutils';\n\n/**\n * 更改单元格数据 会触发change_cell_value事件\n * @param col\n * @param row\n * @param value 更改后的值\n * @param workOnEditableCell 限制只能更改配置了编辑器的单元格值。快捷键paste这里配置的true,限制只能修改可编辑单元格值\n * @param triggerEvent 是否在值发生改变的时候触发change_cell_value事件\n */\nexport function listTableChangeCellValue(\n col: number,\n row: number,\n value: string | number | null,\n workOnEditableCell: boolean,\n triggerEvent: boolean,\n table: ListTable\n) {\n if ((workOnEditableCell && table.isHasEditorDefine(col, row)) || workOnEditableCell === false) {\n const recordIndex = table.getRecordShowIndexByCell(col, row);\n const { field } = table.internalProps.layoutMap.getBody(col, row);\n const beforeChangeValue = table.getCellRawValue(col, row);\n const oldValue = table.getCellOriginValue(col, row);\n if (table.isHeader(col, row)) {\n table.internalProps.layoutMap.updateColumnTitle(col, row, value as string);\n } else {\n table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);\n }\n const range = table.getCellRange(col, row);\n //改变单元格的值后 聚合值做重新计算\n const aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);\n if (aggregators) {\n if (Array.isArray(aggregators)) {\n for (let i = 0; i < aggregators?.length; i++) {\n aggregators[i].recalculate();\n }\n } else {\n aggregators.recalculate();\n }\n const aggregatorCells = table.internalProps.layoutMap.getAggregatorCellAddress(\n range.start.col,\n range.start.row,\n range.end.col,\n range.end.row\n );\n for (let i = 0; i < aggregatorCells.length; i++) {\n const range = table.getCellRange(aggregatorCells[i].col, aggregatorCells[i].row);\n for (let sCol = range.start.col; sCol <= range.end.col; sCol++) {\n for (let sRow = range.start.row; sRow <= range.end.row; sRow++) {\n table.scenegraph.updateCellContent(sCol, sRow);\n }\n }\n }\n }\n\n // const cell_value = table.getCellValue(col, row);\n\n for (let sCol = range.start.col; sCol <= range.end.col; sCol++) {\n for (let sRow = range.start.row; sRow <= range.end.row; sRow++) {\n table.scenegraph.updateCellContent(sCol, sRow);\n }\n }\n if (table.widthMode === 'adaptive' || (table.autoFillWidth && table.getAllColsWidth() <= table.tableNoFrameWidth)) {\n if (table.internalProps._widthResizedColMap.size === 0) {\n //如果没有手动调整过行高列宽 则重新计算一遍并重新分配\n table.scenegraph.recalculateColWidths();\n }\n } else if (!table.internalProps._widthResizedColMap.has(col)) {\n const oldWidth = table.getColWidth(col);\n const newWidth = computeColWidth(col, 0, table.rowCount - 1, table, false);\n if (newWidth !== oldWidth) {\n table.scenegraph.updateColWidth(col, newWidth - oldWidth);\n }\n }\n if (\n table.heightMode === 'adaptive' ||\n (table.autoFillHeight && table.getAllRowsHeight() <= table.tableNoFrameHeight)\n ) {\n if (table.internalProps._heightResizedRowMap.size === 0) {\n table.scenegraph.recalculateRowHeights();\n }\n } else if (table.isAutoRowHeight(row) && !table.internalProps._heightResizedRowMap.has(row)) {\n const oldHeight = table.getRowHeight(row);\n const newHeight = computeRowHeight(row, 0, table.colCount - 1, table);\n table.scenegraph.updateRowHeight(row, newHeight - oldHeight);\n }\n const changedValue = table.getCellOriginValue(col, row);\n if (oldValue !== changedValue && triggerEvent) {\n table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {\n col,\n row,\n rawValue: beforeChangeValue,\n currentValue: oldValue,\n changedValue\n });\n }\n table.scenegraph.updateNextFrame();\n }\n}\n/**\n * 批量更新多个单元格的数据\n * @param col 粘贴数据的起始列号\n * @param row 粘贴数据的起始行号\n * @param values 多个单元格的数据数组\n * @param workOnEditableCell 是否仅更改可编辑单元格\n * @param triggerEvent 是否在值发生改变的时候触发change_cell_value事件\n */\nexport async function listTableChangeCellValues(\n startCol: number,\n startRow: number,\n values: (string | number)[][],\n workOnEditableCell: boolean,\n triggerEvent: boolean,\n table: ListTable\n): Promise<boolean[][]> {\n const changedCellResults: boolean[][] = [];\n let pasteColEnd = startCol;\n let pasteRowEnd = startRow;\n // const rowCount = values.length;\n //#region 提前组织好未更改前的数据\n const beforeChangeValues: (string | number)[][] = [];\n const oldValues: (string | number)[][] = [];\n let cellUpdateType: 'normal' | 'sort' | 'group';\n\n for (let i = 0; i < values.length; i++) {\n if (startRow + i > table.rowCount - 1) {\n break;\n }\n const rowValues = values[i];\n const rawRowValues: (string | number)[] = [];\n const oldRowValues: (string | number)[] = [];\n beforeChangeValues.push(rawRowValues);\n oldValues.push(oldRowValues);\n for (let j = 0; j < rowValues.length; j++) {\n if (startCol + j > table.colCount - 1) {\n break;\n }\n cellUpdateType = getCellUpdateType(startCol + j, startRow + i, table, cellUpdateType);\n const beforeChangeValue = table.getCellRawValue(startCol + j, startRow + i);\n rawRowValues.push(beforeChangeValue);\n const oldValue = table.getCellOriginValue(startCol + j, startRow + i);\n oldRowValues.push(oldValue);\n }\n }\n //#endregion\n for (let i = 0; i < values.length; i++) {\n if (startRow + i > table.rowCount - 1) {\n break;\n }\n changedCellResults[i] = [];\n pasteRowEnd = startRow + i;\n const rowValues = values[i];\n let thisRowPasteColEnd = startCol;\n for (let j = 0; j < rowValues.length; j++) {\n if (startCol + j > table.colCount - 1) {\n break;\n }\n thisRowPasteColEnd = startCol + j;\n let isCanChange = false;\n if (workOnEditableCell === false) {\n isCanChange = true;\n } else {\n if (table.isHasEditorDefine(startCol + j, startRow + i)) {\n const editor = table.getEditor(startCol + j, startRow + i);\n const oldValue = oldValues[i][j];\n const value = rowValues[j];\n const maybePromiseOrValue =\n editor?.validateValue?.(value, oldValue, { col: startCol + j, row: startRow + i }, table) ?? true;\n if (isPromise(maybePromiseOrValue)) {\n const validateResult = await maybePromiseOrValue;\n isCanChange =\n validateResult === true || validateResult === 'validate-exit' || validateResult === 'validate-not-exit';\n } else {\n isCanChange =\n maybePromiseOrValue === true ||\n maybePromiseOrValue === 'validate-exit' ||\n maybePromiseOrValue === 'validate-not-exit';\n }\n }\n }\n // if ((workOnEditableCell && table.isHasEditorDefine(startCol + j, startRow + i)) || workOnEditableCell === false) {\n if (isCanChange) {\n changedCellResults[i][j] = true;\n const value = rowValues[j];\n const recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i);\n const { field } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i);\n // const beforeChangeValue = table.getCellRawValue(startCol + j, startRow + i);\n // const oldValue = table.getCellOriginValue(startCol + j, startRow + i);\n const beforeChangeValue = beforeChangeValues[i][j];\n const oldValue = oldValues[i][j];\n if (table.isHeader(startCol + j, startRow + i)) {\n table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value as string);\n } else {\n table.dataSource.changeFieldValue(value, recordIndex, field, startCol + j, startRow + i, table);\n }\n const changedValue = table.getCellOriginValue(startCol + j, startRow + i);\n if (oldValue !== changedValue && triggerEvent) {\n table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {\n col: startCol + j,\n row: startRow + i,\n rawValue: beforeChangeValue,\n currentValue: oldValue,\n changedValue\n });\n }\n } else {\n changedCellResults[i][j] = false;\n }\n }\n pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);\n }\n\n // const cell_value = table.getCellValue(col, row);\n const startRange = table.getCellRange(startCol, startRow);\n const range = table.getCellRange(pasteColEnd, pasteRowEnd);\n\n //改变单元格的值后 聚合值做重新计算\n const aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(\n startRange.start.col,\n startRange.start.row,\n range.end.col,\n range.end.row\n );\n\n if (aggregators) {\n for (let i = 0; i < aggregators?.length; i++) {\n aggregators[i].recalculate();\n }\n\n if (cellUpdateType === 'normal') {\n const aggregatorCells = table.internalProps.layoutMap.getAggregatorCellAddress(\n startRange.start.col,\n startRange.start.row,\n range.end.col,\n range.end.row\n );\n for (let i = 0; i < aggregatorCells.length; i++) {\n const range = table.getCellRange(aggregatorCells[i].col, aggregatorCells[i].row);\n for (let sCol = range.start.col; sCol <= range.end.col; sCol++) {\n for (let sRow = range.start.row; sRow <= range.end.row; sRow++) {\n table.scenegraph.updateCellContent(sCol, sRow);\n }\n }\n }\n }\n }\n\n if (cellUpdateType === 'group') {\n (table.dataSource as CachedDataSource).updateRecordsForGroup([], []);\n }\n\n if (cellUpdateType === 'sort' || cellUpdateType === 'group') {\n (table.dataSource as any).sortedIndexMap.clear();\n sortRecords(table);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n return changedCellResults;\n }\n\n for (let sCol = startRange.start.col; sCol <= range.end.col; sCol++) {\n for (let sRow = startRange.start.row; sRow <= range.end.row; sRow++) {\n table.scenegraph.updateCellContent(sCol, sRow);\n }\n }\n if (table.widthMode === 'adaptive' || (table.autoFillWidth && table.getAllColsWidth() <= table.tableNoFrameWidth)) {\n if (table.internalProps._widthResizedColMap.size === 0) {\n //如果没有手动调整过行高列宽 则重新计算一遍并重新分配\n table.scenegraph.recalculateColWidths();\n }\n } else {\n for (let sCol = startCol; sCol <= range.end.col; sCol++) {\n if (!table.internalProps._widthResizedColMap.has(sCol)) {\n const oldWidth = table.getColWidth(sCol);\n const newWidth = computeColWidth(sCol, 0, table.rowCount - 1, table, false);\n if (newWidth !== oldWidth) {\n table.scenegraph.updateColWidth(sCol, newWidth - oldWidth);\n }\n }\n }\n }\n if (\n table.heightMode === 'adaptive' ||\n (table.autoFillHeight && table.getAllRowsHeight() <= table.tableNoFrameHeight)\n ) {\n table.scenegraph.recalculateRowHeights();\n } else if (table.isAutoRowHeight(startRow)) {\n const rows: number[] = [];\n const deltaYs: number[] = [];\n for (let sRow = startRow; sRow <= range.end.row; sRow++) {\n if (table.rowHeightsMap.get(sRow)) {\n // 已经计算过行高的才走更新逻辑\n const oldHeight = table.getRowHeight(sRow);\n const newHeight = computeRowHeight(sRow, 0, table.colCount - 1, table);\n rows.push(sRow);\n deltaYs.push(newHeight - oldHeight);\n }\n }\n table.scenegraph.updateRowsHeight(rows, deltaYs);\n }\n\n table.scenegraph.updateNextFrame();\n return changedCellResults;\n}\n\ntype CellUpdateType = 'normal' | 'sort' | 'group';\nfunction getCellUpdateType(\n col: number,\n row: number,\n table: ListTable,\n oldCellUpdateType: CellUpdateType | undefined\n): CellUpdateType {\n if (oldCellUpdateType === 'group') {\n return oldCellUpdateType;\n }\n if (oldCellUpdateType === 'sort' && !(table.internalProps as ListTableProtected).groupBy) {\n return oldCellUpdateType;\n }\n let cellUpdateType: CellUpdateType = 'normal';\n if ((table.internalProps as ListTableProtected).groupBy) {\n cellUpdateType = 'group';\n } else if (!table.isHeader(col, row) && (table.dataSource as any).lastOrderField) {\n const field = table.getBodyField(col, row);\n if (field === (table.dataSource as any).lastOrderField) {\n cellUpdateType = 'sort';\n }\n }\n return cellUpdateType;\n}\n\nexport function sortRecords(table: ListTable) {\n let sortState = table.sortState;\n sortState = !sortState || Array.isArray(sortState) ? sortState : [sortState];\n\n if (sortState) {\n sortState = (sortState as SortState[]).map(item => {\n item.orderFn = table._getSortFuncFromHeaderOption(undefined, item.field) ?? defaultOrderFn;\n //const hd = table.internalProps.layoutMap.headerObjects.find((col: any) => col && col.field === item.field);\n return item;\n });\n\n table.dataSource.sort(sortState);\n }\n}\n\n/**\n * 添加数据 单条数据\n * @param record 数据\n * @param recordIndex 向数据源中要插入的位置,从0开始。不设置recordIndex的话 默认追加到最后。\n * 如果设置了排序规则recordIndex无效,会自动适应排序逻辑确定插入顺序。\n * recordIndex 可以通过接口getRecordShowIndexByCell获取\n */\nexport function listTableAddRecord(record: any, recordIndex: number | number[], table: ListTable) {\n if ((table.internalProps as ListTableProtected).groupBy) {\n (table.dataSource as CachedDataSource).addRecordsForGroup?.([record], recordIndex);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n table.sortState && sortRecords(table);\n\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if ((table.dataSource as CachedDataSource).rowHierarchyType === 'tree') {\n (table.dataSource as CachedDataSource).addRecordsForTree?.([record], recordIndex);\n\n adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);\n\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n table.sortState && sortRecords(table);\n\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if (table.sortState) {\n table.dataSource.addRecordForSorted(record);\n // 清理checkedState\n table.stateManager.checkedState.clear();\n sortRecords(table);\n table.refreshRowColCount();\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n recordIndex = recordIndex as number;\n if (recordIndex === undefined || recordIndex > table.dataSource.sourceLength) {\n recordIndex = table.dataSource.sourceLength;\n }\n const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;\n table.dataSource.addRecord(record, recordIndex);\n adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, 1);\n const oldRowCount = table.rowCount;\n table.refreshRowColCount();\n if (table.scenegraph.proxy.totalActualBodyRowCount === 0) {\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n return;\n }\n const newRowCount = table.transpose ? table.colCount : table.rowCount;\n if (table.pagination) {\n const { perPageCount, currentPage } = table.pagination;\n const startIndex = perPageCount * (currentPage || 0);\n const endIndex = startIndex + perPageCount;\n if (recordIndex < endIndex) {\n //插入当前页或者前面的数据才需要更新 如果是插入的是当前页后面的数据不需要更新场景树\n if (recordIndex < endIndex - perPageCount) {\n // 如果是当页之前的数据 则整个场景树都更新\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n //如果是插入当前页数据\n const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;\n if (oldRowCount - headerCount === table.pagination.perPageCount) {\n //如果当页数据是满的 则更新插入的部分行\n const updateRows = [];\n for (let row = rowNum; row < newRowCount; row++) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n table.transpose\n ? table.scenegraph.updateCol([], [], updateRows)\n : table.scenegraph.updateRow([], [], updateRows);\n } else {\n //如果当页数据不是满的 则插入新数据\n const addRows = [];\n for (let row = rowNum; row < Math.min(newRowCount, rowNum + 1); row++) {\n if (table.transpose) {\n addRows.push({ col: row, row: 0 });\n } else {\n addRows.push({ col: 0, row });\n }\n }\n table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);\n }\n }\n }\n } else {\n const addRows = [];\n for (let row = recordIndex + headerCount; row < recordIndex + headerCount + 1; row++) {\n if (table.transpose) {\n addRows.push({ col: row, row: 0 });\n } else {\n addRows.push({ col: 0, row });\n }\n }\n const updateRows = [];\n const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;\n const bottomAggregationCount = table.internalProps.layoutMap.hasAggregationOnBottomCount;\n for (let row = headerCount; row < headerCount + topAggregationCount; row++) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n for (\n let row = (table.transpose ? table.colCount : table.rowCount) - bottomAggregationCount;\n row < (table.transpose ? table.colCount : table.rowCount);\n row++\n ) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);\n }\n }\n // table.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, { row });\n}\n\n/**\n * 添加数据 支持多条数据\n * @param records 多条数据\n * @param recordIndex 向数据源中要插入的位置,从0开始。不设置recordIndex的话 默认追加到最后。\n * 如果设置了排序规则recordIndex无效,会自动适应排序逻辑确定插入顺序。\n * recordIndex 可以通过接口getRecordShowIndexByCell获取\n */\nexport function listTableAddRecords(records: any[], recordIndex: number | number[], table: ListTable) {\n if ((table.internalProps as ListTableProtected).groupBy) {\n (table.dataSource as CachedDataSource).addRecordsForGroup?.(records, recordIndex);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n table.sortState && sortRecords(table);\n\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if ((table.dataSource as CachedDataSource).rowHierarchyType === 'tree') {\n (table.dataSource as CachedDataSource).addRecordsForTree?.(records, recordIndex);\n adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n table.sortState && sortRecords(table);\n\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if (table.sortState) {\n table.dataSource.addRecordsForSorted(records);\n sortRecords(table);\n table.refreshRowColCount();\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n recordIndex = recordIndex as number;\n if (recordIndex === undefined || recordIndex > table.dataSource.sourceLength) {\n recordIndex = table.dataSource.sourceLength;\n } else if (recordIndex < 0) {\n recordIndex = 0;\n }\n const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;\n table.dataSource.addRecords(records, recordIndex);\n adjustCheckBoxStateMapWithAddRecordIndex(table, recordIndex, records.length);\n const oldRowCount = table.transpose ? table.colCount : table.rowCount;\n table.refreshRowColCount();\n if (table.scenegraph.proxy.totalActualBodyRowCount === 0) {\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n return;\n }\n const newRowCount = table.transpose ? table.colCount : table.rowCount;\n if (table.pagination) {\n const { perPageCount, currentPage } = table.pagination;\n const startIndex = perPageCount * (currentPage || 0);\n const endIndex = startIndex + perPageCount;\n if (recordIndex < endIndex) {\n //插入当前页或者前面的数据才需要更新 如果是插入的是当前页后面的数据不需要更新场景树\n if (recordIndex < endIndex - perPageCount) {\n // 如果是当页之前的数据 则整个场景树都更新\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n //如果是插入当前页数据\n\n const rowNum = recordIndex - (endIndex - perPageCount) + headerCount;\n if (oldRowCount - headerCount === table.pagination.perPageCount) {\n //如果当页数据是满的 则更新插入的部分行\n const updateRows = [];\n for (let row = rowNum; row < newRowCount; row++) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n table.transpose\n ? table.scenegraph.updateCol([], [], updateRows)\n : table.scenegraph.updateRow([], [], updateRows);\n } else {\n //如果当页数据不是满的 则插入新数据\n const addRows = [];\n for (\n let row = rowNum;\n row < Math.min(newRowCount, rowNum + (Array.isArray(records) ? records.length : 1));\n row++\n ) {\n if (table.transpose) {\n addRows.push({ col: row, row: 0 });\n } else {\n addRows.push({ col: 0, row });\n }\n }\n table.transpose ? table.scenegraph.updateCol([], addRows, []) : table.scenegraph.updateRow([], addRows, []);\n }\n }\n }\n } else {\n const addRows = [];\n for (\n let row = recordIndex + headerCount;\n row < recordIndex + headerCount + (Array.isArray(records) ? records.length : 1);\n row++\n ) {\n if (table.transpose) {\n addRows.push({ col: row, row: 0 });\n } else {\n addRows.push({ col: 0, row });\n }\n }\n const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;\n const bottomAggregationCount = table.internalProps.layoutMap.hasAggregationOnBottomCount;\n const updateRows = [];\n for (let row = headerCount; row < headerCount + topAggregationCount; row++) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n for (\n let row = (table.transpose ? table.colCount : table.rowCount) - bottomAggregationCount;\n row < (table.transpose ? table.colCount : table.rowCount);\n row++\n ) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n table.transpose\n ? table.scenegraph.updateCol([], addRows, updateRows)\n : table.scenegraph.updateRow([], addRows, updateRows);\n }\n }\n // table.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, { row });\n}\n\n/**\n * 删除数据 支持多条数据\n * @param recordIndexs 要删除数据的索引(显示在body中的索引,即要修改的是body部分的第几行数据)\n */\nexport function listTableDeleteRecords(recordIndexs: number[] | number[][], table: ListTable) {\n if (recordIndexs?.length > 0) {\n if ((table.internalProps as ListTableProtected).groupBy) {\n (table.dataSource as CachedDataSource).deleteRecordsForGroup?.(recordIndexs);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n table.sortState && sortRecords(table);\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if ((table.dataSource as CachedDataSource).rowHierarchyType === 'tree') {\n const deletedRecordIndexs = (table.dataSource as CachedDataSource).deleteRecordsForTree?.(recordIndexs);\n if (deletedRecordIndexs.length === 0) {\n return;\n }\n for (let index = 0; index < deletedRecordIndexs.length; index++) {\n adjustCheckBoxStateMapWithDeleteRecordIndex(table, deletedRecordIndexs[index], 1);\n }\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n table.sortState && sortRecords(table);\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if (table.sortState) {\n table.dataSource.deleteRecordsForSorted(recordIndexs as number[]);\n sortRecords(table);\n table.refreshRowColCount();\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n const deletedRecordIndexs = table.dataSource.deleteRecords(recordIndexs as number[]);\n if (deletedRecordIndexs.length === 0) {\n return;\n }\n const oldRowCount = table.transpose ? table.colCount : table.rowCount;\n table.refreshRowColCount();\n const newRowCount = table.transpose ? table.colCount : table.rowCount;\n const recordIndexsMinToMax = deletedRecordIndexs.sort((a, b) => a - b);\n const minRecordIndex = recordIndexsMinToMax[0];\n if (table.pagination) {\n const { perPageCount, currentPage } = table.pagination;\n const startIndex = perPageCount * (currentPage || 0);\n const endIndex = startIndex + perPageCount;\n if (minRecordIndex < endIndex) {\n //删除当前页或者前面的数据才需要更新 如果是删除的是当前页后面的数据不需要更新场景树\n if (minRecordIndex < endIndex - perPageCount) {\n // 如果删除包含当页之前的数据 则整个场景树都更新\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;\n const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;\n //如果是仅删除当前页数据\n const minRowNum =\n minRecordIndex -\n (endIndex - perPageCount) +\n (table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount) +\n topAggregationCount;\n //如果当页数据是满的 则更新影响的部分行\n const updateRows = [];\n const delRows = [];\n\n for (let row = minRowNum; row < newRowCount; row++) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n\n for (let row = headerCount; row < headerCount + topAggregationCount; row++) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n\n if (newRowCount < oldRowCount) {\n //如果如果删除后不满 需要有删除数据\n for (let row = newRowCount; row < oldRowCount; row++) {\n if (table.transpose) {\n delRows.push({ col: row, row: 0 });\n } else {\n delRows.push({ col: 0, row });\n }\n }\n }\n table.reactCustomLayout?.clearCache();\n table.transpose\n ? table.scenegraph.updateCol(delRows, [], updateRows)\n : table.scenegraph.updateRow(delRows, [], updateRows);\n table.reactCustomLayout?.updateAllCustomCell();\n }\n }\n } else {\n const delRows = [];\n const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;\n const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;\n const bottomAggregationCount = table.internalProps.layoutMap.hasAggregationOnBottomCount;\n for (let index = 0; index < recordIndexsMinToMax.length; index++) {\n const recordIndex = recordIndexsMinToMax[index];\n const rowNum = recordIndex + headerCount + topAggregationCount;\n if (table.transpose) {\n delRows.push({ col: rowNum, row: 0 });\n } else {\n delRows.push({ col: 0, row: rowNum });\n }\n }\n const updateRows = [];\n for (let row = headerCount; row < headerCount + topAggregationCount; row++) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n for (\n let row = (table.transpose ? table.colCount : table.rowCount) - bottomAggregationCount;\n row < (table.transpose ? table.colCount : table.rowCount);\n row++\n ) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n\n table.reactCustomLayout?.clearCache();\n table.transpose\n ? table.scenegraph.updateCol(delRows, [], updateRows)\n : table.scenegraph.updateRow(delRows, [], updateRows);\n table.reactCustomLayout?.updateAllCustomCell();\n }\n }\n // table.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, { row });\n }\n}\n\n/**\n * 修改数据 支持多条数据\n * @param records 修改数据条目\n * @param recordIndexs 对应修改数据的索引(显示在body中的索引,即要修改的是body部分的第几行数据)\n */\nexport function listTableUpdateRecords(records: any[], recordIndexs: (number | number[])[], table: ListTable) {\n if (recordIndexs?.length > 0) {\n if ((table.internalProps as ListTableProtected).groupBy) {\n (table.dataSource as CachedDataSource).updateRecordsForGroup?.(records, recordIndexs as number[]);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n table.sortState && sortRecords(table);\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if ((table.dataSource as CachedDataSource).rowHierarchyType === 'tree') {\n (table.dataSource as CachedDataSource).updateRecordsForTree?.(records, recordIndexs as number[]);\n table.refreshRowColCount();\n table.internalProps.layoutMap.clearCellRangeMap();\n table.sortState && sortRecords(table);\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else if (table.sortState) {\n table.dataSource.updateRecordsForSorted(records, recordIndexs as number[]);\n sortRecords(table);\n table.refreshRowColCount();\n // 更新整个场景树\n table.scenegraph.clearCells();\n table.scenegraph.createSceneGraph();\n } else {\n const updateRecordIndexs = table.dataSource.updateRecords(records, recordIndexs);\n if (updateRecordIndexs.length === 0) {\n return;\n }\n const bodyRowIndex = updateRecordIndexs.map(index => table.getBodyRowIndexByRecordIndex(index));\n const recordIndexsMinToMax = bodyRowIndex.sort((a, b) => a - b);\n if (table.pagination) {\n const { perPageCount, currentPage } = table.pagination;\n const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;\n const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;\n const startIndex = perPageCount * (currentPage || 0);\n const endIndex = startIndex + perPageCount;\n const updateRows = [];\n for (let index = 0; index < recordIndexsMinToMax.length; index++) {\n const recordIndex = recordIndexsMinToMax[index];\n if (recordIndex < endIndex && recordIndex >= endIndex - perPageCount) {\n const rowNum =\n recordIndex -\n (endIndex - perPageCount) +\n (table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount) +\n topAggregationCount;\n updateRows.push(rowNum);\n }\n }\n if (updateRows.length >= 1) {\n const updateRowCells = [];\n for (let index = 0; index < updateRows.length; index++) {\n const updateRow = updateRows[index];\n if (table.transpose) {\n updateRowCells.push({ col: updateRow, row: 0 });\n } else {\n updateRowCells.push({ col: 0, row: updateRow });\n }\n }\n for (let row = headerCount; row < headerCount + topAggregationCount; row++) {\n if (table.transpose) {\n updateRowCells.push({ col: row, row: 0 });\n } else {\n updateRowCells.push({ col: 0, row });\n }\n }\n table.transpose\n ? table.scenegraph.updateCol([], [], updateRowCells)\n : table.scenegraph.updateRow([], [], updateRowCells);\n }\n } else {\n const updateRows = [];\n const headerCount = table.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;\n const topAggregationCount = table.internalProps.layoutMap.hasAggregationOnTopCount;\n const bottomAggregationCount = table.internalProps.layoutMap.hasAggregationOnBottomCount;\n for (let index = 0; index < recordIndexsMinToMax.length; index++) {\n const recordIndex = recordIndexsMinToMax[index];\n const rowNum = recordIndex + headerCount + topAggregationCount;\n if (table.transpose) {\n updateRows.push({ col: rowNum, row: 0 });\n } else {\n updateRows.push({ col: 0, row: rowNum });\n }\n }\n for (let row = headerCount; row < headerCount + topAggregationCount; row++) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n for (\n let row = (table.transpose ? table.colCount : table.rowCount) - bottomAggregationCount;\n row < (table.transpose ? table.colCount : table.rowCount);\n row++\n ) {\n if (table.transpose) {\n updateRows.push({ col: row, row: 0 });\n } else {\n updateRows.push({ col: 0, row });\n }\n }\n table.transpose\n ? table.scenegraph.updateCol([], [], updateRows)\n : table.scenegraph.updateRow([], [], updateRows);\n }\n }\n // table.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, { row });\n }\n}\nfunction adjustCheckBoxStateMapWithDeleteRecordIndex(table: ListTable, recordIndex: number | number[], count: number) {\n const { checkedState } = table.stateManager;\n if (!checkedState) {\n return;\n }\n if (table.dataSource.rowHierarchyType === 'tree') {\n let toOperateIndexArr: number[];\n if (isNumber(recordIndex)) {\n toOperateIndexArr = [recordIndex];\n } else {\n toOperateIndexArr = recordIndex;\n }\n const toOperateIndexArrLength = toOperateIndexArr.length;\n const targetResult: { originKey: string; targetKey?: string; value: any }[] = [];\n checkedState.forEach((value, key: string) => {\n const keyArray = key.split(',');\n if (keyArray.length >= toOperateIndexArr.length) {\n //toOperateIndexArr 的增删只会影响checkedState中keyArray.length大于等于toOperateIndexArr.length的key\n // const length = Math.max(keyArray.length, toOperateIndexArr.length);\n\n for (let i = 0; i < keyArray.length; i++) {\n const toOperateIndex = toOperateIndexArr[i] ?? -1;\n const keyIndex = Number(keyArray[i]);\n if (toOperateIndex === keyIndex && i < keyArray.length - 1) {\n } else if ((toOperateIndex === keyIndex && i === keyArray.length - 1) || toOperateIndex === -1) {\n //这个条件符合则表示和toOperateIndexArr一模一样则要删除\n targetResult.push({\n originKey: key,\n value\n });\n break;\n } else if (toOperateIndex < keyIndex && i === toOperateIndexArrLength - 1) {\n keyArray[i] = (keyIndex - count).toString();\n targetResult.push({\n originKey: key,\n targetKey: keyArray.toString(),\n value\n });\n break;\n } else {\n break;\n }\n }\n }\n });\n //需要将targetResult按originKey排序进行升序排序,因为originKey是展示index的join,需要拆分后排序,如'1,0','1,0,0'要排在'0,1'及'0,1,0'后面,如'1,1','1,1,0'要排在1,0','1,0,0'后面\n targetResult.sort((a, b) => {\n const aArray = a.originKey.split(',');\n const bArray = b.originKey.split(',');\n const aLength = aArray.length;\n const bLength = bArray.length;\n const minLength = Math.min(aLength, bLength);\n for (let i = 0; i < minLength; i++) {\n const aIndex = Number(aArray[i]);\n const bIndex = Number(bArray[i]);\n if (aIndex !== bIndex) {\n return aIndex - bIndex;\n }\n }\n return aLength - bLength;\n });\n targetResult.forEach(({ originKey, targetKey, value }) => {\n checkedState.delete(originKey);\n if (targetKey) {\n checkedState.set(targetKey, value);\n }\n });\n } else {\n // super.adjustBeforeChangedRecordsMap(insertIndex as number, insertCount, type);\n const length = checkedState.size;\n for (let key = length - 1; key >= (recordIndex as number); key--) {\n const record = checkedState.get(key.toString());\n checkedState.delete(key.toString());\n checkedState.set((key - count).toString(), record);\n }\n }\n}\n\nfunction adjustCheckBoxStateMapWithAddRecordIndex(table: ListTable, recordIndex: number | number[], count: number) {\n const { checkedState } = table.stateManager;\n if (!checkedState) {\n return;\n }\n if (table.dataSource.rowHierarchyType === 'tree') {\n let toOperateIndexArr: number[];\n if (isNumber(recordIndex)) {\n toOperateIndexArr = [recordIndex];\n } else {\n toOperateIndexArr = recordIndex;\n }\n const toOperateIndexArrLength = toOperateIndexArr.length;\n const targetResult: { originKey: string; targetKey?: string; value: any }[] = [];\n checkedState.forEach((value, key: string) => {\n const keyArray = key.split(',');\n if (keyArray.length >= toOperateIndexArr.length) {\n //toOperateIndexArr 的增删只会影响checkedState中keyArray.length大于等于toOperateIndexArr.length的key\n // const length = Math.max(keyArray.length, toOperateIndexArr.length);\n for (let i = 0; i < keyArray.length; i++) {\n const toOperateIndex = toOperateIndexArr[i] ?? -1;\n const keyIndex = Number(keyArray[i]);\n if (toOperateIndex === keyIndex && (i === keyArray.length - 1 || i === toOperateIndexArrLength - 1)) {\n //这个条件符合则表示和toOperateIndexArr一模一样\n keyArray[i] = (keyIndex + count).toString();\n targetResult.push({\n originKey: key,\n targetKey: keyArray.toString(),\n value\n });\n break;\n } else if (toOperateIndex === keyIndex && i < keyArray.length - 1) {\n } else if (toOperateIndex < keyIndex && i === toOperateIndexArrLength - 1) {\n keyArray[i] = (keyIndex + count).toString();\n targetResult.push({\n originKey: key,\n targetKey: keyArray.toString(),\n value\n });\n break;\n } else {\n break;\n }\n }\n }\n });\n //需要将targetResult按originKey排序进行降序排序,因为originKey是展示index的join,需要拆分后排序,如'1,0','1,0,0'要排在'0,1'及'0,1,0'前面,如'1,1','1,1,0'要排在1,0','1,0,0'前面\n targetResult.sort((a, b) => {\n const aArray = a.originKey.split(',');\n const bArray = b.originKey.split(',');\n const aLength = aArray.length;\n const bLength = bArray.length;\n const minLength = Math.min(aLength, bLength);\n for (let i = 0; i < minLength; i++) {\n const aIndex = Number(aArray[i]);\n const bIndex = Number(bArray[i]);\n if (aIndex !== bIndex) {\n return -aIndex + bIndex;\n }\n }\n return -aLength + bLength;\n });\n targetResult.forEach(({ originKey, targetKey, value }) => {\n checkedState.delete(originKey);\n if (targetKey) {\n checkedState.set(targetKey, value);\n }\n });\n } else {\n const length = checkedState.size;\n for (let key = length - 1; key >= (recordIndex as number); key--) {\n const record = checkedState.get(key.toString());\n checkedState.delete(key.toString());\n checkedState.set((key + count).toString(), record);\n }\n }\n}\n"]}
@@ -28,7 +28,7 @@ export declare class CachedDataSource extends DataSource {
28
28
  deleteRecordsForGroup(recordIndexs: (number | number[])[]): void;
29
29
  updateRecordsForGroup(records: any[], recordIndexs: (number | number[])[]): void;
30
30
  addRecordsForTree(recordArr: any[], recordIndex?: number | number[]): void;
31
- deleteRecordsForTree(recordIndexs: (number | number[])[]): void;
31
+ deleteRecordsForTree(recordIndexs: (number | number[])[]): (number | number[])[];
32
32
  updateRecordsForTree(records: any[], recordIndexs: (number | number[])[]): void;
33
33
  adjustBeforeChangedRecordsMap(insertIndex: number | number[], insertCount: number, type?: 'add' | 'delete'): void;
34
34
  cacheBeforeChangedRecord(dataIndex: number | number[], table?: BaseTableAPI): void;
@@ -146,12 +146,12 @@ class CachedDataSource extends DataSource_1.DataSource {
146
146
  const recordIndex_copy = [ ...recordIndex ], index = recordIndex_copy.pop(), parentRecord = this.getOriginalRecord(recordIndex_copy);
147
147
  parentRecord.children ? parentRecord.children.splice(index, 0, ...recordArr) : parentRecord.children = recordArr;
148
148
  }
149
- this.initTreeHierarchyState(), this.updatePagerData();
149
+ this.initTreeHierarchyState(), this.updatePagination();
150
150
  }
151
151
  }
152
152
  deleteRecordsForTree(recordIndexs) {
153
- if (!(0, vutils_1.isArray)(recordIndexs) || 0 === recordIndexs.length) return;
154
- const recordIndexsMaxToMin = (0, DataSource_1.sortRecordIndexs)(recordIndexs, -1);
153
+ if (!(0, vutils_1.isArray)(recordIndexs) || 0 === recordIndexs.length) return [];
154
+ const recordIndexsMaxToMin = (0, DataSource_1.sortRecordIndexs)(recordIndexs, -1), deletedRecordIndexs = [];
155
155
  for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
156
156
  const recordIndex = recordIndexsMaxToMin[index];
157
157
  if (!(0, vutils_1.isNumber)(recordIndex) || !(recordIndex >= this.sourceLength || recordIndex < 0)) {
@@ -159,10 +159,10 @@ class CachedDataSource extends DataSource_1.DataSource {
159
159
  const recordIndex_copy = [ ...recordIndex ], index = recordIndex_copy.pop();
160
160
  this.getOriginalRecord(recordIndex_copy).children.splice(index, 1);
161
161
  }
162
- this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete");
162
+ this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete"), deletedRecordIndexs.push(recordIndex);
163
163
  }
164
164
  }
165
- this.initTreeHierarchyState(), this.updatePagerData();
165
+ return this.initTreeHierarchyState(), this.updatePagination(), deletedRecordIndexs;
166
166
  }
167
167
  updateRecordsForTree(records, recordIndexs) {
168
168
  for (let index = 0; index < recordIndexs.length; index++) {