vxe-table 3.12.14 → 3.12.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/es/style.css +1 -1
  2. package/es/table/module/edit/mixin.js +250 -168
  3. package/es/table/module/export/mixin.js +3 -2
  4. package/es/table/module/validator/mixin.js +6 -1
  5. package/es/table/src/body.js +1 -0
  6. package/es/table/src/methods.js +166 -100
  7. package/es/table/src/table.js +0 -1
  8. package/es/ui/index.js +1 -1
  9. package/es/ui/src/log.js +1 -1
  10. package/lib/index.umd.js +540 -375
  11. package/lib/index.umd.min.js +1 -1
  12. package/lib/style.css +1 -1
  13. package/lib/table/module/edit/mixin.js +305 -225
  14. package/lib/table/module/edit/mixin.min.js +1 -1
  15. package/lib/table/module/export/mixin.js +3 -2
  16. package/lib/table/module/export/mixin.min.js +1 -1
  17. package/lib/table/module/validator/mixin.js +8 -0
  18. package/lib/table/module/validator/mixin.min.js +1 -1
  19. package/lib/table/src/body.js +1 -0
  20. package/lib/table/src/body.min.js +1 -1
  21. package/lib/table/src/methods.js +219 -143
  22. package/lib/table/src/methods.min.js +1 -1
  23. package/lib/table/src/table.js +0 -1
  24. package/lib/table/src/table.min.js +1 -1
  25. package/lib/ui/index.js +1 -1
  26. package/lib/ui/index.min.js +1 -1
  27. package/lib/ui/src/log.js +1 -1
  28. package/lib/ui/src/log.min.js +1 -1
  29. package/package.json +1 -1
  30. package/packages/table/module/edit/mixin.ts +273 -168
  31. package/packages/table/module/export/mixin.ts +3 -2
  32. package/packages/table/module/validator/mixin.ts +6 -1
  33. package/packages/table/src/body.ts +1 -0
  34. package/packages/table/src/methods.ts +172 -96
  35. package/packages/table/src/table.ts +0 -1
  36. /package/es/{iconfont.1739181382716.ttf → iconfont.1739333092714.ttf} +0 -0
  37. /package/es/{iconfont.1739181382716.woff → iconfont.1739333092714.woff} +0 -0
  38. /package/es/{iconfont.1739181382716.woff2 → iconfont.1739333092714.woff2} +0 -0
  39. /package/lib/{iconfont.1739181382716.ttf → iconfont.1739333092714.ttf} +0 -0
  40. /package/lib/{iconfont.1739181382716.woff → iconfont.1739333092714.woff} +0 -0
  41. /package/lib/{iconfont.1739181382716.woff2 → iconfont.1739333092714.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
2220
2220
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2221
2221
 
2222
2222
 
2223
- const version = "3.12.14";
2223
+ const version = "3.12.16";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2842,7 +2842,7 @@ function isNodeElement(elem) {
2842
2842
  const {
2843
2843
  log: log_log
2844
2844
  } = core_.VxeUI;
2845
- const log_version = `table v${"3.12.14"}`;
2845
+ const log_version = `table v${"3.12.16"}`;
2846
2846
  const warnLog = log_log.create('warn', log_version);
2847
2847
  const errLog = log_log.create('error', log_version);
2848
2848
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -6320,7 +6320,7 @@ const calcCellHeight = $xeTable => {
6320
6320
  reactData.calcCellHeightFlag++;
6321
6321
  }
6322
6322
  };
6323
- function getOrderField(_vm, column) {
6323
+ function getOrderField($xeTable, column) {
6324
6324
  const {
6325
6325
  sortBy,
6326
6326
  sortType
@@ -6333,7 +6333,7 @@ function getOrderField(_vm, column) {
6333
6333
  column
6334
6334
  }) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, sortBy);
6335
6335
  } else {
6336
- cellValue = _vm.getCellLabel(row, column);
6336
+ cellValue = $xeTable.getCellLabel(row, column);
6337
6337
  }
6338
6338
  if (!sortType || sortType === 'auto') {
6339
6339
  return isNaN(cellValue) ? cellValue : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);
@@ -8395,15 +8395,26 @@ const Methods = {
8395
8395
  */
8396
8396
  updateAfterFullData() {
8397
8397
  const $xeTable = this;
8398
+ const props = $xeTable;
8399
+ const internalData = $xeTable;
8400
+ const {
8401
+ treeConfig
8402
+ } = props;
8398
8403
  const {
8399
8404
  tableFullColumn,
8400
8405
  tableFullData,
8401
- filterOpts,
8402
- sortOpts,
8403
- treeConfig,
8404
- treeOpts,
8405
8406
  tableFullTreeData
8406
- } = this;
8407
+ } = internalData;
8408
+ const filterOpts = $xeTable.computeFilterOpts;
8409
+ const sortOpts = $xeTable.computeSortOpts;
8410
+ const treeOpts = $xeTable.computeTreeOpts;
8411
+ const childrenField = treeOpts.children || treeOpts.childrenField;
8412
+ const {
8413
+ transform,
8414
+ rowField,
8415
+ parentField,
8416
+ mapChildrenField
8417
+ } = treeOpts;
8407
8418
  const {
8408
8419
  remote: allRemoteFilter,
8409
8420
  filterMethod: allFilterMethod
@@ -8414,63 +8425,61 @@ const Methods = {
8414
8425
  multiple: sortMultiple,
8415
8426
  chronological
8416
8427
  } = sortOpts;
8417
- const {
8418
- transform
8419
- } = treeOpts;
8420
- const childrenField = treeOpts.children || treeOpts.childrenField;
8421
8428
  let tableData = [];
8422
8429
  let tableTree = [];
8423
- const filterColumns = [];
8424
- let orderColumns = [];
8425
- tableFullColumn.forEach(column => {
8426
- const {
8427
- field,
8428
- sortable,
8429
- order,
8430
- filters
8431
- } = column;
8432
- if (!allRemoteFilter && filters && filters.length) {
8433
- const valueList = [];
8434
- const itemList = [];
8435
- filters.forEach(item => {
8436
- if (item.checked) {
8437
- itemList.push(item);
8438
- valueList.push(item.value);
8430
+ // 处理数据
8431
+ if (!allRemoteFilter || !allRemoteSort) {
8432
+ const filterColumns = [];
8433
+ let orderColumns = [];
8434
+ tableFullColumn.forEach(column => {
8435
+ const {
8436
+ field,
8437
+ sortable,
8438
+ order,
8439
+ filters
8440
+ } = column;
8441
+ if (!allRemoteFilter && filters && filters.length) {
8442
+ const valueList = [];
8443
+ const itemList = [];
8444
+ filters.forEach(item => {
8445
+ if (item.checked) {
8446
+ itemList.push(item);
8447
+ valueList.push(item.value);
8448
+ }
8449
+ });
8450
+ if (itemList.length) {
8451
+ filterColumns.push({
8452
+ column,
8453
+ valueList,
8454
+ itemList
8455
+ });
8439
8456
  }
8440
- });
8441
- if (itemList.length) {
8442
- filterColumns.push({
8457
+ }
8458
+ if (!allRemoteSort && sortable && order) {
8459
+ orderColumns.push({
8443
8460
  column,
8444
- valueList,
8445
- itemList
8461
+ field,
8462
+ property: field,
8463
+ order: order,
8464
+ sortTime: column.sortTime
8446
8465
  });
8447
8466
  }
8448
- }
8449
- if (!allRemoteSort && sortable && order) {
8450
- orderColumns.push({
8451
- column,
8452
- field,
8453
- property: field,
8454
- order,
8455
- sortTime: column.sortTime
8456
- });
8457
- }
8458
- });
8459
- if (sortMultiple && chronological && orderColumns.length > 1) {
8460
- orderColumns = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(orderColumns, 'sortTime');
8461
- }
8462
- if (filterColumns.length) {
8463
- const handleFilter = row => {
8464
- return filterColumns.every(({
8465
- column,
8466
- valueList,
8467
- itemList
8468
- }) => {
8469
- if (valueList.length && !allRemoteFilter) {
8467
+ });
8468
+ if (sortMultiple && chronological && orderColumns.length > 1) {
8469
+ orderColumns = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(orderColumns, 'sortTime');
8470
+ }
8471
+ // 处理筛选
8472
+ // 支持单列、多列、组合筛选
8473
+ if (!allRemoteFilter && filterColumns.length) {
8474
+ const handleFilter = row => {
8475
+ return filterColumns.every(({
8476
+ column,
8477
+ valueList,
8478
+ itemList
8479
+ }) => {
8470
8480
  const {
8471
8481
  filterMethod,
8472
- filterRender,
8473
- field
8482
+ filterRender
8474
8483
  } = column;
8475
8484
  const compConf = isEnableConf(filterRender) ? methods_renderer.get(filterRender.name) : null;
8476
8485
  const compFilterMethod = compConf ? compConf.tableFilterMethod || compConf.filterMethod : null;
@@ -8483,7 +8492,7 @@ const Methods = {
8483
8492
  cellValue,
8484
8493
  row,
8485
8494
  column,
8486
- $table: this
8495
+ $table: $xeTable
8487
8496
  }));
8488
8497
  } else if (compFilterMethod) {
8489
8498
  return itemList.some(item => compFilterMethod({
@@ -8492,7 +8501,7 @@ const Methods = {
8492
8501
  cellValue,
8493
8502
  row,
8494
8503
  column,
8495
- $table: this
8504
+ $table: $xeTable
8496
8505
  }));
8497
8506
  } else if (allFilterMethod) {
8498
8507
  return allFilterMethod({
@@ -8509,96 +8518,119 @@ const Methods = {
8509
8518
  cellValue,
8510
8519
  row,
8511
8520
  column,
8512
- $table: this
8521
+ $table: $xeTable
8513
8522
  }));
8514
8523
  }
8515
- return valueList.indexOf(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, field)) > -1;
8516
- }
8517
- return true;
8518
- });
8519
- };
8520
- if (treeConfig && transform) {
8521
- // 筛选虚拟树
8522
- tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData, handleFilter, {
8523
- original: true,
8524
- isEvery: true,
8525
- children: treeOpts.mapChildrenField,
8526
- mapChildren: childrenField
8527
- });
8528
- tableData = tableTree;
8529
- } else {
8530
- tableData = treeConfig ? tableFullTreeData.filter(handleFilter) : tableFullData.filter(handleFilter);
8531
- tableTree = tableData;
8532
- }
8533
- } else {
8534
- if (treeConfig && transform) {
8535
- // 还原虚拟树
8536
- tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData, () => true, {
8537
- original: true,
8538
- isEvery: true,
8539
- children: treeOpts.mapChildrenField,
8540
- mapChildren: childrenField
8541
- });
8542
- tableData = tableTree;
8543
- } else {
8544
- tableData = treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0);
8545
- tableTree = tableData;
8546
- }
8547
- }
8548
- const firstOrderColumn = orderColumns[0];
8549
- if (!allRemoteSort && firstOrderColumn) {
8550
- if (treeConfig && transform) {
8551
- // 虚拟树和列表一样,只能排序根级节点
8552
- if (allSortMethod) {
8553
- const sortRests = allSortMethod({
8554
- data: tableTree,
8555
- sortList: orderColumns,
8556
- $table: this
8524
+ return valueList.indexOf(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field)) > -1;
8525
+ });
8526
+ };
8527
+ if (treeConfig && transform) {
8528
+ // 筛选虚拟树
8529
+ tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData, handleFilter, {
8530
+ original: true,
8531
+ isEvery: true,
8532
+ children: mapChildrenField,
8533
+ mapChildren: childrenField
8557
8534
  });
8558
- tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortRests) ? sortRests : tableTree;
8535
+ tableData = tableTree;
8559
8536
  } else {
8560
- tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(tableTree, orderColumns.map(({
8561
- column,
8562
- order
8563
- }) => [getOrderField(this, column), order]));
8537
+ tableData = treeConfig ? tableFullTreeData.filter(handleFilter) : tableFullData.filter(handleFilter);
8538
+ tableTree = tableData;
8564
8539
  }
8565
- tableData = tableTree;
8566
8540
  } else {
8567
- if (allSortMethod) {
8568
- const sortRests = allSortMethod({
8569
- data: tableData,
8570
- column: firstOrderColumn.column,
8571
- property: firstOrderColumn.field,
8572
- field: firstOrderColumn.field,
8573
- order: firstOrderColumn.order,
8574
- sortList: orderColumns,
8575
- $table: this
8541
+ if (treeConfig && transform) {
8542
+ // 还原虚拟树
8543
+ tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData, () => true, {
8544
+ original: true,
8545
+ isEvery: true,
8546
+ children: mapChildrenField,
8547
+ mapChildren: childrenField
8576
8548
  });
8577
- tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortRests) ? sortRests : tableData;
8549
+ tableData = tableTree;
8578
8550
  } else {
8579
- // 兼容 v4
8580
- if (sortMultiple) {
8581
- tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(tableData, orderColumns.map(({
8551
+ tableData = treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0);
8552
+ tableTree = tableData;
8553
+ }
8554
+ }
8555
+ // 处理排序(不能用于树形结构)
8556
+ // 支持单列、多列、组合排序
8557
+ if (!allRemoteSort && orderColumns.length) {
8558
+ if (treeConfig && transform) {
8559
+ // 虚拟树和列表一样,只能排序根级节点
8560
+ if (allSortMethod) {
8561
+ const sortRests = allSortMethod({
8562
+ data: tableTree,
8563
+ sortList: orderColumns,
8564
+ $table: $xeTable
8565
+ });
8566
+ tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortRests) ? sortRests : tableTree;
8567
+ } else {
8568
+ const treeList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray(tableTree, {
8569
+ children: mapChildrenField
8570
+ });
8571
+ tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(treeList, orderColumns.map(({
8582
8572
  column,
8583
8573
  order
8584
- }) => [getOrderField(this, column), order]));
8574
+ }) => [getOrderField($xeTable, column), order])), {
8575
+ key: rowField,
8576
+ parentKey: parentField,
8577
+ children: childrenField,
8578
+ mapChildren: mapChildrenField
8579
+ });
8580
+ }
8581
+ tableData = tableTree;
8582
+ } else {
8583
+ if (allSortMethod) {
8584
+ const sortRests = allSortMethod({
8585
+ data: tableData,
8586
+ sortList: orderColumns,
8587
+ $table: $xeTable
8588
+ });
8589
+ tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortRests) ? sortRests : tableData;
8585
8590
  } else {
8586
- // 兼容 v2,在 v4 中废弃, sortBy 不能为数组
8587
- let sortByConfs;
8588
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(firstOrderColumn.sortBy)) {
8589
- sortByConfs = firstOrderColumn.sortBy.map(item => [item, firstOrderColumn.order]);
8591
+ // 兼容 v4
8592
+ if (sortMultiple) {
8593
+ tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(tableData, orderColumns.map(({
8594
+ column,
8595
+ order
8596
+ }) => [getOrderField(this, column), order]));
8597
+ } else {
8598
+ const firstOrderColumn = orderColumns[0];
8599
+ let sortByConfs;
8600
+ // 已废弃,兼容 v2,在 v4 中废弃, sortBy 不能为数组
8601
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(firstOrderColumn.sortBy)) {
8602
+ sortByConfs = firstOrderColumn.sortBy.map(item => [item, firstOrderColumn.order]);
8603
+ }
8604
+ tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(tableData, sortByConfs || [firstOrderColumn].map(({
8605
+ column,
8606
+ order
8607
+ }) => [getOrderField(this, column), order]));
8590
8608
  }
8591
- tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(tableData, sortByConfs || [firstOrderColumn].map(({
8609
+ tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(tableData, orderColumns.map(({
8592
8610
  column,
8593
8611
  order
8594
- }) => [getOrderField(this, column), order]));
8612
+ }) => [getOrderField($xeTable, column), order]));
8595
8613
  }
8614
+ tableTree = tableData;
8596
8615
  }
8616
+ }
8617
+ } else {
8618
+ if (treeConfig && transform) {
8619
+ // 还原虚拟树
8620
+ tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData, () => true, {
8621
+ original: true,
8622
+ isEvery: true,
8623
+ children: treeOpts.mapChildrenField,
8624
+ mapChildren: childrenField
8625
+ });
8626
+ tableData = tableTree;
8627
+ } else {
8628
+ tableData = treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0);
8597
8629
  tableTree = tableData;
8598
8630
  }
8599
8631
  }
8600
- this.afterFullData = tableData;
8601
- this.afterTreeFullData = tableTree;
8632
+ internalData.afterFullData = tableData;
8633
+ internalData.afterTreeFullData = tableTree;
8602
8634
  updateAfterDataIndex($xeTable);
8603
8635
  },
8604
8636
  /**
@@ -13021,6 +13053,19 @@ const Methods = {
13021
13053
  reactData.pendingRowMaps = pendingMaps;
13022
13054
  return $xeTable.$nextTick();
13023
13055
  },
13056
+ hasPendingByRow(row) {
13057
+ const $xeTable = this;
13058
+ return $xeTable.isPendingByRow(row);
13059
+ },
13060
+ isPendingByRow(row) {
13061
+ const $xeTable = this;
13062
+ const reactData = $xeTable;
13063
+ const {
13064
+ pendingRowMaps
13065
+ } = reactData;
13066
+ const rowid = getRowid($xeTable, row);
13067
+ return !!pendingRowMaps[rowid];
13068
+ },
13024
13069
  getPendingRecords() {
13025
13070
  const $xeTable = this;
13026
13071
  const reactData = $xeTable;
@@ -13039,13 +13084,6 @@ const Methods = {
13039
13084
  });
13040
13085
  return insertRecords;
13041
13086
  },
13042
- hasPendingByRow(row) {
13043
- const {
13044
- pendingRowMaps
13045
- } = this;
13046
- const rowid = getRowid(this, row);
13047
- return !!pendingRowMaps[rowid];
13048
- },
13049
13087
  clearPendingRow() {
13050
13088
  this.pendingRowMaps = {};
13051
13089
  return this.$nextTick();
@@ -14239,7 +14277,12 @@ const Methods = {
14239
14277
  },
14240
14278
  triggerBodyScrollEvent(evnt, fixedType) {
14241
14279
  const $xeTable = this;
14280
+ const reactData = $xeTable;
14242
14281
  const internalData = $xeTable;
14282
+ const {
14283
+ scrollYLoad,
14284
+ scrollXLoad
14285
+ } = reactData;
14243
14286
  const {
14244
14287
  elemStore,
14245
14288
  intoRunScroll,
@@ -14305,13 +14348,17 @@ const Methods = {
14305
14348
  setScrollTop(rightScrollElem, scrollTop);
14306
14349
  }
14307
14350
  setScrollTop(yHandleEl, scrollTop);
14308
- $xeTable.triggerScrollYEvent(evnt);
14351
+ if (scrollYLoad) {
14352
+ $xeTable.triggerScrollYEvent(evnt);
14353
+ }
14309
14354
  }
14310
14355
  if (isRollX) {
14311
14356
  setScrollLeft(xHandleEl, scrollLeft);
14312
14357
  setScrollLeft(headerScrollElem, scrollLeft);
14313
14358
  setScrollLeft(footerScrollElem, scrollLeft);
14314
- $xeTable.triggerScrollXEvent(evnt);
14359
+ if (scrollXLoad) {
14360
+ $xeTable.triggerScrollXEvent(evnt);
14361
+ }
14315
14362
  }
14316
14363
  $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
14317
14364
  type: 'body',
@@ -14320,7 +14367,11 @@ const Methods = {
14320
14367
  },
14321
14368
  triggerHeaderScrollEvent(evnt, fixedType) {
14322
14369
  const $xeTable = this;
14370
+ const reactData = $xeTable;
14323
14371
  const internalData = $xeTable;
14372
+ const {
14373
+ scrollXLoad
14374
+ } = reactData;
14324
14375
  const {
14325
14376
  elemStore,
14326
14377
  intoRunScroll,
@@ -14357,7 +14408,9 @@ const Methods = {
14357
14408
  setScrollLeft(xHandleEl, scrollLeft);
14358
14409
  setScrollLeft(footerScrollElem, scrollLeft);
14359
14410
  setScrollLeft(bodyScrollElem, scrollLeft);
14360
- $xeTable.triggerScrollXEvent(evnt);
14411
+ if (scrollXLoad) {
14412
+ $xeTable.triggerScrollXEvent(evnt);
14413
+ }
14361
14414
  $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
14362
14415
  type: 'header',
14363
14416
  fixed: fixedType
@@ -14365,7 +14418,11 @@ const Methods = {
14365
14418
  },
14366
14419
  triggerFooterScrollEvent(evnt, fixedType) {
14367
14420
  const $xeTable = this;
14421
+ const reactData = $xeTable;
14368
14422
  const internalData = $xeTable;
14423
+ const {
14424
+ scrollXLoad
14425
+ } = reactData;
14369
14426
  const {
14370
14427
  elemStore,
14371
14428
  intoRunScroll,
@@ -14402,7 +14459,9 @@ const Methods = {
14402
14459
  setScrollLeft(xHandleEl, scrollLeft);
14403
14460
  setScrollLeft(headerScrollElem, scrollLeft);
14404
14461
  setScrollLeft(bodyScrollElem, scrollLeft);
14405
- $xeTable.triggerScrollXEvent(evnt);
14462
+ if (scrollXLoad) {
14463
+ $xeTable.triggerScrollXEvent(evnt);
14464
+ }
14406
14465
  $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
14407
14466
  type: 'footer',
14408
14467
  fixed: fixedType
@@ -14424,6 +14483,9 @@ const Methods = {
14424
14483
  const {
14425
14484
  highlightHoverRow
14426
14485
  } = tableProps;
14486
+ const {
14487
+ scrollYLoad
14488
+ } = reactData;
14427
14489
  const {
14428
14490
  elemStore,
14429
14491
  lastScrollTop,
@@ -14470,7 +14532,9 @@ const Methods = {
14470
14532
  setScrollTop(bodyScrollElem, currTopNum);
14471
14533
  setScrollTop(leftScrollElem, currTopNum);
14472
14534
  setScrollTop(rightScrollElem, currTopNum);
14473
- $xeTable.triggerScrollYEvent(evnt);
14535
+ if (scrollYLoad) {
14536
+ $xeTable.triggerScrollYEvent(evnt);
14537
+ }
14474
14538
  $xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
14475
14539
  type: 'table',
14476
14540
  fixed: ''
@@ -14490,7 +14554,11 @@ const Methods = {
14490
14554
  },
14491
14555
  triggerVirtualScrollXEvent(evnt) {
14492
14556
  const $xeTable = this;
14557
+ const reactData = $xeTable;
14493
14558
  const internalData = $xeTable;
14559
+ const {
14560
+ scrollXLoad
14561
+ } = reactData;
14494
14562
  const {
14495
14563
  elemStore,
14496
14564
  inWheelScroll,
@@ -14524,7 +14592,9 @@ const Methods = {
14524
14592
  setScrollLeft(bodyScrollElem, scrollLeft);
14525
14593
  setScrollLeft(headerScrollElem, scrollLeft);
14526
14594
  setScrollLeft(footerScrollElem, scrollLeft);
14527
- $xeTable.triggerScrollXEvent(evnt);
14595
+ if (scrollXLoad) {
14596
+ $xeTable.triggerScrollXEvent(evnt);
14597
+ }
14528
14598
  $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
14529
14599
  type: 'table',
14530
14600
  fixed: ''
@@ -14532,7 +14602,11 @@ const Methods = {
14532
14602
  },
14533
14603
  triggerVirtualScrollYEvent(evnt) {
14534
14604
  const $xeTable = this;
14605
+ const reactData = $xeTable;
14535
14606
  const internalData = $xeTable;
14607
+ const {
14608
+ scrollYLoad
14609
+ } = reactData;
14536
14610
  const {
14537
14611
  elemStore,
14538
14612
  inWheelScroll,
@@ -14566,7 +14640,9 @@ const Methods = {
14566
14640
  setScrollTop(bodyScrollElem, scrollTop);
14567
14641
  setScrollTop(leftScrollElem, scrollTop);
14568
14642
  setScrollTop(rightScrollElem, scrollTop);
14569
- $xeTable.triggerScrollYEvent(evnt);
14643
+ if (scrollYLoad) {
14644
+ $xeTable.triggerScrollYEvent(evnt);
14645
+ }
14570
14646
  $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
14571
14647
  type: 'table',
14572
14648
  fixed: ''
@@ -15550,6 +15626,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
15550
15626
  'fixed--width': !isAutoCellWidth,
15551
15627
  'fixed--hidden': fixedHiddenColumn,
15552
15628
  'is--padding': isCellPadding,
15629
+ 'is--progress': fixedHiddenColumn && isAllOverflow || isVNPreEmptyStatus,
15553
15630
  'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
15554
15631
  'is--drag-disabled': isDisabledDrag,
15555
15632
  'col--dirty': isDirty,
@@ -20230,6 +20307,58 @@ const {
20230
20307
  renderer: edit_mixin_renderer,
20231
20308
  getI18n: mixin_getI18n
20232
20309
  } = core_.VxeUI;
20310
+ function getEditColumnModel(row, column) {
20311
+ const {
20312
+ model,
20313
+ editRender
20314
+ } = column;
20315
+ if (editRender) {
20316
+ model.value = getCellValue(row, column);
20317
+ model.update = false;
20318
+ }
20319
+ }
20320
+ function setEditColumnModel(row, column) {
20321
+ const {
20322
+ model,
20323
+ editRender
20324
+ } = column;
20325
+ if (editRender && model.update) {
20326
+ setCellValue(row, column, model.value);
20327
+ model.update = false;
20328
+ model.value = null;
20329
+ }
20330
+ }
20331
+ function removeCellSelectedClass($xeTable) {
20332
+ const el = $xeTable.$refs.refElem;
20333
+ if (el) {
20334
+ const cell = el.querySelector('.col--selected');
20335
+ if (cell) {
20336
+ removeClass(cell, 'col--selected');
20337
+ }
20338
+ }
20339
+ }
20340
+ function syncActivedCell($xeTable) {
20341
+ const reactData = $xeTable;
20342
+ const {
20343
+ editStore,
20344
+ tableColumn
20345
+ } = reactData;
20346
+ const editOpts = $xeTable.computeEditOpts;
20347
+ const {
20348
+ actived
20349
+ } = editStore;
20350
+ const {
20351
+ row,
20352
+ column
20353
+ } = actived;
20354
+ if (row || column) {
20355
+ if (editOpts.mode === 'row') {
20356
+ tableColumn.forEach(column => setEditColumnModel(row, column));
20357
+ } else {
20358
+ setEditColumnModel(row, column);
20359
+ }
20360
+ }
20361
+ }
20233
20362
  function insertTreeRow(_vm, newRecords, isAppend) {
20234
20363
  const {
20235
20364
  tableFullTreeData,
@@ -20584,6 +20713,216 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
20584
20713
  rows: []
20585
20714
  });
20586
20715
  }
20716
+ function handleClearEdit($xeTable, evnt, targetRow) {
20717
+ const props = $xeTable;
20718
+ const reactData = $xeTable;
20719
+ const {
20720
+ mouseConfig
20721
+ } = props;
20722
+ const {
20723
+ editStore
20724
+ } = reactData;
20725
+ const {
20726
+ actived,
20727
+ focused
20728
+ } = editStore;
20729
+ const {
20730
+ row,
20731
+ column
20732
+ } = actived;
20733
+ const validOpts = $xeTable.computeValidOpts;
20734
+ const mouseOpts = $xeTable.computeMouseOpts;
20735
+ if (row || column) {
20736
+ if (targetRow && getRowid($xeTable, targetRow) !== getRowid($xeTable, row)) {
20737
+ return $xeTable.$nextTick();
20738
+ }
20739
+ syncActivedCell($xeTable);
20740
+ actived.args = null;
20741
+ actived.row = null;
20742
+ actived.column = null;
20743
+ $xeTable.updateFooter();
20744
+ $xeTable.dispatchEvent('edit-closed', {
20745
+ row,
20746
+ rowIndex: $xeTable.getRowIndex(row),
20747
+ $rowIndex: $xeTable.getVMRowIndex(row),
20748
+ column,
20749
+ columnIndex: $xeTable.getColumnIndex(column),
20750
+ $columnIndex: $xeTable.getVMColumnIndex(column)
20751
+ }, evnt || null);
20752
+ }
20753
+ focused.row = null;
20754
+ focused.column = null;
20755
+ if (validOpts.autoClear) {
20756
+ if (validOpts.msgMode !== 'full' || mixin_getConfig().cellVaildMode === 'obsolete') {
20757
+ if ($xeTable.clearValidate) {
20758
+ return $xeTable.clearValidate();
20759
+ }
20760
+ }
20761
+ }
20762
+ return $xeTable.$nextTick().then(() => {
20763
+ if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreas) {
20764
+ return $xeTable.handleRecalculateCellAreas();
20765
+ }
20766
+ });
20767
+ }
20768
+ function handleEditActive($xeTable, params, evnt, isFocus) {
20769
+ const props = $xeTable;
20770
+ const reactData = $xeTable;
20771
+ const {
20772
+ editConfig,
20773
+ mouseConfig
20774
+ } = props;
20775
+ const {
20776
+ editStore,
20777
+ tableColumn
20778
+ } = reactData;
20779
+ const editOpts = $xeTable.computeEditOpts;
20780
+ const {
20781
+ mode
20782
+ } = editOpts;
20783
+ const {
20784
+ actived,
20785
+ focused
20786
+ } = editStore;
20787
+ const {
20788
+ row,
20789
+ column
20790
+ } = params;
20791
+ const {
20792
+ editRender
20793
+ } = column;
20794
+ const cell = params.cell || $xeTable.getCellElement(row, column);
20795
+ const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
20796
+ params.cell = cell;
20797
+ if (cell && isEnableConf(editConfig) && isEnableConf(editRender)) {
20798
+ // 激活编辑
20799
+ if (!$xeTable.isPendingByRow(row)) {
20800
+ if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
20801
+ // 判断是否禁用编辑
20802
+ let type = 'edit-disabled';
20803
+ if (!beforeEditMethod || beforeEditMethod({
20804
+ ...params,
20805
+ $table: $xeTable,
20806
+ $grid: $xeTable.xegrid
20807
+ })) {
20808
+ if (mouseConfig) {
20809
+ $xeTable.clearSelected();
20810
+ if ($xeTable.clearCellAreas) {
20811
+ $xeTable.clearCellAreas();
20812
+ $xeTable.clearCopyCellArea();
20813
+ }
20814
+ }
20815
+ $xeTable.closeTooltip();
20816
+ if (actived.column) {
20817
+ handleClearEdit($xeTable, evnt);
20818
+ }
20819
+ type = 'edit-activated';
20820
+ column.renderHeight = cell.offsetHeight;
20821
+ actived.args = params;
20822
+ actived.row = row;
20823
+ actived.column = column;
20824
+ if (mode === 'row') {
20825
+ tableColumn.forEach(column => getEditColumnModel(row, column));
20826
+ } else {
20827
+ getEditColumnModel(row, column);
20828
+ }
20829
+ const afterEditMethod = editOpts.afterEditMethod;
20830
+ $xeTable.$nextTick(() => {
20831
+ if (isFocus) {
20832
+ $xeTable.handleFocus(params, evnt);
20833
+ }
20834
+ if (afterEditMethod) {
20835
+ afterEditMethod({
20836
+ ...params,
20837
+ $table: $xeTable,
20838
+ $grid: $xeTable.xegrid
20839
+ });
20840
+ }
20841
+ });
20842
+ }
20843
+ $xeTable.dispatchEvent(type, {
20844
+ row,
20845
+ rowIndex: $xeTable.getRowIndex(row),
20846
+ $rowIndex: $xeTable.getVMRowIndex(row),
20847
+ column,
20848
+ columnIndex: $xeTable.getColumnIndex(column),
20849
+ $columnIndex: $xeTable.getVMColumnIndex(column)
20850
+ }, evnt);
20851
+ // v4已废弃
20852
+ if (type === 'edit-activated') {
20853
+ $xeTable.dispatchEvent('edit-actived', {
20854
+ row,
20855
+ rowIndex: $xeTable.getRowIndex(row),
20856
+ $rowIndex: $xeTable.getVMRowIndex(row),
20857
+ column,
20858
+ columnIndex: $xeTable.getColumnIndex(column),
20859
+ $columnIndex: $xeTable.getVMColumnIndex(column)
20860
+ }, evnt);
20861
+ }
20862
+ } else {
20863
+ const {
20864
+ column: oldColumn
20865
+ } = actived;
20866
+ if (mouseConfig) {
20867
+ $xeTable.clearSelected();
20868
+ if ($xeTable.clearCellAreas) {
20869
+ $xeTable.clearCellAreas();
20870
+ $xeTable.clearCopyCellArea();
20871
+ }
20872
+ }
20873
+ if (oldColumn !== column) {
20874
+ const {
20875
+ model: oldModel
20876
+ } = oldColumn;
20877
+ if (oldModel.update) {
20878
+ setCellValue(row, oldColumn, oldModel.value);
20879
+ }
20880
+ if ($xeTable.clearValidate) {
20881
+ $xeTable.clearValidate(row, column);
20882
+ }
20883
+ }
20884
+ column.renderHeight = cell.offsetHeight;
20885
+ actived.args = params;
20886
+ actived.column = column;
20887
+ if (isFocus) {
20888
+ setTimeout(() => {
20889
+ $xeTable.handleFocus(params, evnt);
20890
+ });
20891
+ }
20892
+ }
20893
+ focused.column = null;
20894
+ focused.row = null;
20895
+ $xeTable.focus();
20896
+ }
20897
+ }
20898
+ return $xeTable.$nextTick();
20899
+ }
20900
+ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
20901
+ const props = $xeTable;
20902
+ const internalData = $xeTable;
20903
+ const {
20904
+ editConfig
20905
+ } = props;
20906
+ const column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
20907
+ if (row && column && isEnableConf(editConfig) && isEnableConf(column.editRender)) {
20908
+ return Promise.resolve(isPos ? $xeTable.scrollToRow(row, column) : null).then(() => {
20909
+ const cell = $xeTable.getCellElement(row, column);
20910
+ if (cell) {
20911
+ handleEditActive($xeTable, {
20912
+ row,
20913
+ rowIndex: $xeTable.getRowIndex(row),
20914
+ column,
20915
+ columnIndex: $xeTable.getColumnIndex(column),
20916
+ cell,
20917
+ $table: $xeTable
20918
+ }, null, false);
20919
+ internalData._lastCallTime = Date.now();
20920
+ }
20921
+ return $xeTable.$nextTick();
20922
+ });
20923
+ }
20924
+ return $xeTable.$nextTick();
20925
+ }
20587
20926
  /* harmony default export */ var edit_mixin = ({
20588
20927
  methods: {
20589
20928
  /**
@@ -20651,7 +20990,7 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
20651
20990
  const childrenField = treeOpts.children || treeOpts.childrenField;
20652
20991
  const {
20653
20992
  actived,
20654
- removeList,
20993
+ removeMaps,
20655
20994
  insertMaps
20656
20995
  } = editStore;
20657
20996
  const {
@@ -20666,7 +21005,8 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
20666
21005
  // 如果是新增,则保存记录
20667
21006
  rows.forEach(row => {
20668
21007
  if (!$xeTable.isInsertByRow(row)) {
20669
- removeList.push(row);
21008
+ const rowid = getRowid($xeTable, row);
21009
+ removeMaps[rowid] = row;
20670
21010
  }
20671
21011
  });
20672
21012
  // 如果绑定了多选属性,则更新状态
@@ -20843,7 +21183,19 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
20843
21183
  * 获取已删除的数据
20844
21184
  */
20845
21185
  _getRemoveRecords() {
20846
- return this.editStore.removeList;
21186
+ const $xeTable = this;
21187
+ const reactData = $xeTable;
21188
+ const {
21189
+ editStore
21190
+ } = reactData;
21191
+ const {
21192
+ removeMaps
21193
+ } = editStore;
21194
+ const removeRecords = [];
21195
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(removeMaps, row => {
21196
+ removeRecords.push(row);
21197
+ });
21198
+ return removeRecords;
20847
21199
  },
20848
21200
  /**
20849
21201
  * 获取更新数据
@@ -20851,6 +21203,7 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
20851
21203
  * 如果是树表格,子节点更改状态不会影响父节点的更新状态
20852
21204
  */
20853
21205
  _getUpdateRecords() {
21206
+ const $xeTable = this;
20854
21207
  const {
20855
21208
  keepSource,
20856
21209
  tableFullData,
@@ -20868,7 +21221,7 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
20868
21221
  column
20869
21222
  } = actived;
20870
21223
  if (row || column) {
20871
- this._syncActivedCell();
21224
+ syncActivedCell($xeTable);
20872
21225
  }
20873
21226
  if (treeConfig) {
20874
21227
  return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().filterTree(tableFullData, row => isUpdateByRow(row), treeOpts);
@@ -20881,107 +21234,8 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
20881
21234
  * 处理激活编辑
20882
21235
  */
20883
21236
  handleEdit(params, evnt) {
20884
- const {
20885
- editStore,
20886
- editOpts,
20887
- tableColumn,
20888
- editConfig,
20889
- mouseConfig
20890
- } = this;
20891
- const {
20892
- mode
20893
- } = editOpts;
20894
- const {
20895
- actived,
20896
- focused
20897
- } = editStore;
20898
- const {
20899
- row,
20900
- column
20901
- } = params;
20902
- const {
20903
- editRender
20904
- } = column;
20905
- const cell = params.cell = params.cell || this.getCellElement(row, column);
20906
- const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
20907
- if (cell && isEnableConf(editConfig) && isEnableConf(editRender)) {
20908
- // 激活编辑
20909
- if (!this.hasPendingByRow(row)) {
20910
- if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
20911
- // 判断是否禁用编辑
20912
- let type = 'edit-disabled';
20913
- if (!beforeEditMethod || beforeEditMethod({
20914
- ...params,
20915
- $table: this,
20916
- $grid: this.$xegrid
20917
- })) {
20918
- if (mouseConfig) {
20919
- this.clearSelected(evnt);
20920
- this.clearCellAreas(evnt);
20921
- this.clearCopyCellArea(evnt);
20922
- }
20923
- this.closeTooltip();
20924
- if (actived.column) {
20925
- this.handleClearEdit(evnt);
20926
- }
20927
- type = 'edit-activated';
20928
- column.renderHeight = cell.offsetHeight;
20929
- actived.args = params;
20930
- actived.row = row;
20931
- actived.column = column;
20932
- if (mode === 'row') {
20933
- tableColumn.forEach(column => this._getColumnModel(row, column));
20934
- } else {
20935
- this._getColumnModel(row, column);
20936
- }
20937
- const afterEditMethod = editOpts.afterEditMethod;
20938
- this.$nextTick(() => {
20939
- this.handleFocus(params, evnt);
20940
- if (afterEditMethod) {
20941
- afterEditMethod({
20942
- ...params,
20943
- $table: this,
20944
- $grid: this.$xegrid
20945
- });
20946
- }
20947
- });
20948
- }
20949
- this.emitEvent(type, params, evnt);
20950
- // v4已废弃
20951
- if (type === 'edit-activated') {
20952
- this.emitEvent('edit-actived', params, evnt);
20953
- }
20954
- } else {
20955
- const {
20956
- column: oldColumn
20957
- } = actived;
20958
- if (mouseConfig) {
20959
- this.clearSelected(evnt);
20960
- this.clearCellAreas(evnt);
20961
- this.clearCopyCellArea(evnt);
20962
- }
20963
- if (oldColumn !== column) {
20964
- const {
20965
- model: oldModel
20966
- } = oldColumn;
20967
- if (oldModel.update) {
20968
- setCellValue(row, oldColumn, oldModel.value);
20969
- }
20970
- this.clearValidate();
20971
- }
20972
- column.renderHeight = cell.offsetHeight;
20973
- actived.args = params;
20974
- actived.column = column;
20975
- setTimeout(() => {
20976
- this.handleFocus(params, evnt);
20977
- });
20978
- }
20979
- focused.column = null;
20980
- focused.row = null;
20981
- this.focus();
20982
- }
20983
- }
20984
- return this.$nextTick();
21237
+ const $xeTable = this;
21238
+ return handleEditActive($xeTable, params, evnt, true);
20985
21239
  },
20986
21240
  /**
20987
21241
  * @deprecated
@@ -20990,46 +21244,14 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
20990
21244
  return this.handleEdit(params, evnt);
20991
21245
  },
20992
21246
  _getColumnModel(row, column) {
20993
- const {
20994
- model,
20995
- editRender
20996
- } = column;
20997
- if (editRender) {
20998
- model.value = getCellValue(row, column);
20999
- model.update = false;
21000
- }
21247
+ getEditColumnModel(row, column);
21001
21248
  },
21002
21249
  _setColumnModel(row, column) {
21003
- const {
21004
- model,
21005
- editRender
21006
- } = column;
21007
- if (editRender && model.update) {
21008
- setCellValue(row, column, model.value);
21009
- model.update = false;
21010
- model.value = null;
21011
- }
21250
+ setEditColumnModel(row, column);
21012
21251
  },
21013
21252
  _syncActivedCell() {
21014
- const {
21015
- tableColumn,
21016
- editStore,
21017
- editOpts
21018
- } = this;
21019
- const {
21020
- actived
21021
- } = editStore;
21022
- const {
21023
- row,
21024
- column
21025
- } = actived;
21026
- if (row || column) {
21027
- if (editOpts.mode === 'row') {
21028
- tableColumn.forEach(column => this._setColumnModel(row, column));
21029
- } else {
21030
- this._setColumnModel(row, column);
21031
- }
21032
- }
21253
+ const $xeTable = this;
21254
+ syncActivedCell($xeTable);
21033
21255
  },
21034
21256
  _clearActived(row) {
21035
21257
  if (true) {
@@ -21042,63 +21264,15 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
21042
21264
  * 清除激活的编辑
21043
21265
  */
21044
21266
  _clearEdit(row) {
21045
- return this.handleClearEdit(null, row);
21267
+ const $xeTable = this;
21268
+ return handleClearEdit($xeTable, null, row);
21046
21269
  },
21047
21270
  /**
21048
21271
  * 取消编辑
21049
21272
  */
21050
21273
  handleClearEdit(evnt, targetRow) {
21051
21274
  const $xeTable = this;
21052
- const props = $xeTable;
21053
- const reactData = $xeTable;
21054
- const {
21055
- mouseConfig
21056
- } = props;
21057
- const {
21058
- editStore
21059
- } = reactData;
21060
- const {
21061
- actived,
21062
- focused
21063
- } = editStore;
21064
- const {
21065
- row,
21066
- column
21067
- } = actived;
21068
- const validOpts = $xeTable.validOpts;
21069
- const mouseOpts = $xeTable.computeMouseOpts;
21070
- if (row || column) {
21071
- if (targetRow && getRowid($xeTable, targetRow) !== getRowid($xeTable, row)) {
21072
- return $xeTable.$nextTick();
21073
- }
21074
- $xeTable._syncActivedCell();
21075
- actived.args = null;
21076
- actived.row = null;
21077
- actived.column = null;
21078
- $xeTable.updateFooter();
21079
- $xeTable.emitEvent('edit-closed', {
21080
- row,
21081
- rowIndex: $xeTable.getRowIndex(row),
21082
- $rowIndex: $xeTable.getVMRowIndex(row),
21083
- column,
21084
- columnIndex: $xeTable.getColumnIndex(column),
21085
- $columnIndex: $xeTable.getVMColumnIndex(column)
21086
- }, evnt);
21087
- }
21088
- focused.row = null;
21089
- focused.column = null;
21090
- if (validOpts.autoClear) {
21091
- if (validOpts.msgMode !== 'full' || mixin_getConfig().cellVaildMode === 'obsolete') {
21092
- if ($xeTable.clearValidate) {
21093
- return $xeTable.clearValidate();
21094
- }
21095
- }
21096
- }
21097
- return $xeTable.$nextTick().then(() => {
21098
- if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreas) {
21099
- return $xeTable.handleRecalculateCellAreas();
21100
- }
21101
- });
21275
+ return handleClearEdit($xeTable, evnt, targetRow);
21102
21276
  },
21103
21277
  _getActiveRecord() {
21104
21278
  if (true) {
@@ -21215,11 +21389,12 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
21215
21389
  * 激活行编辑
21216
21390
  */
21217
21391
  _setEditRow(row, fieldOrColumn) {
21392
+ const $xeTable = this;
21218
21393
  let column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().find(this.visibleColumn, column => isEnableConf(column.editRender));
21219
21394
  if (fieldOrColumn) {
21220
21395
  column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
21221
21396
  }
21222
- return this.setEditCell(row, column);
21397
+ return handleEditCell($xeTable, row, column, false);
21223
21398
  },
21224
21399
  _setActiveCell(row, fieldOrColumn) {
21225
21400
  if (true) {
@@ -21232,27 +21407,8 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
21232
21407
  * 激活单元格编辑
21233
21408
  */
21234
21409
  _setEditCell(row, fieldOrColumn) {
21235
- const {
21236
- editConfig
21237
- } = this;
21238
- const column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
21239
- if (row && column && isEnableConf(editConfig) && isEnableConf(column.editRender)) {
21240
- return this.scrollToRow(row, true).then(() => {
21241
- const cell = this.getCellElement(row, column);
21242
- if (cell) {
21243
- this.handleEdit({
21244
- row,
21245
- rowIndex: this.getRowIndex(row),
21246
- column,
21247
- columnIndex: this.getColumnIndex(column),
21248
- cell,
21249
- $table: this
21250
- });
21251
- this.lastCallTime = Date.now();
21252
- }
21253
- });
21254
- }
21255
- return this.$nextTick();
21410
+ const $xeTable = this;
21411
+ return handleEditCell($xeTable, row, fieldOrColumn, true);
21256
21412
  },
21257
21413
  /**
21258
21414
  * 只对 trigger=dblclick 有效,选中单元格
@@ -21284,6 +21440,7 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
21284
21440
  * 处理选中源
21285
21441
  */
21286
21442
  handleSelected(params, evnt) {
21443
+ const $xeTable = this;
21287
21444
  const {
21288
21445
  mouseConfig,
21289
21446
  mouseOpts,
@@ -21302,7 +21459,7 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
21302
21459
  const selectMethod = () => {
21303
21460
  if (isMouseSelected && (selected.row !== row || selected.column !== column)) {
21304
21461
  if (actived.row !== row || (editOpts.mode === 'cell' ? actived.column !== column : false)) {
21305
- this.handleClearEdit(evnt);
21462
+ handleClearEdit($xeTable, evnt);
21306
21463
  this.clearSelected(evnt);
21307
21464
  this.clearCellAreas(evnt);
21308
21465
  this.clearCopyCellArea(evnt);
@@ -21310,7 +21467,7 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
21310
21467
  selected.row = row;
21311
21468
  selected.column = column;
21312
21469
  if (isMouseSelected) {
21313
- this.addColSdCls();
21470
+ this.addCellSelectedClass();
21314
21471
  }
21315
21472
  this.focus();
21316
21473
  if (evnt) {
@@ -21339,13 +21496,14 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
21339
21496
  * 清除所选中源状态
21340
21497
  */
21341
21498
  _clearSelected() {
21499
+ const $xeTable = this;
21342
21500
  const {
21343
21501
  selected
21344
21502
  } = this.editStore;
21345
21503
  selected.row = null;
21346
21504
  selected.column = null;
21347
21505
  this.reColTitleSdCls();
21348
- this.reColSdCls();
21506
+ removeCellSelectedClass($xeTable);
21349
21507
  return this.$nextTick();
21350
21508
  },
21351
21509
  reColTitleSdCls() {
@@ -21354,23 +21512,22 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
21354
21512
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(headerElem.querySelectorAll('.col--title-selected'), elem => removeClass(elem, 'col--title-selected'));
21355
21513
  }
21356
21514
  },
21357
- reColSdCls() {
21358
- const cell = this.$el.querySelector('.col--selected');
21359
- if (cell) {
21360
- removeClass(cell, 'col--selected');
21361
- }
21362
- },
21363
- addColSdCls() {
21515
+ addCellSelectedClass() {
21516
+ const $xeTable = this;
21517
+ const reactData = $xeTable;
21518
+ const {
21519
+ editStore
21520
+ } = reactData;
21364
21521
  const {
21365
21522
  selected
21366
- } = this.editStore;
21523
+ } = editStore;
21367
21524
  const {
21368
21525
  row,
21369
21526
  column
21370
21527
  } = selected;
21371
- this.reColSdCls();
21528
+ removeCellSelectedClass($xeTable);
21372
21529
  if (row && column) {
21373
- const cell = this.getCellElement(row, column);
21530
+ const cell = $xeTable.getCellElement(row, column);
21374
21531
  if (cell) {
21375
21532
  addClass(cell, 'col--selected');
21376
21533
  }
@@ -21409,6 +21566,7 @@ function createHtmlPage(opts, content) {
21409
21566
 
21410
21567
 
21411
21568
 
21569
+
21412
21570
  const {
21413
21571
  getI18n: export_mixin_getI18n,
21414
21572
  renderer: export_mixin_renderer
@@ -21541,7 +21699,7 @@ function getBodyLabelData($xeTable, opts, columns, datas) {
21541
21699
  cellValue = htmlCellElem.innerText.trim();
21542
21700
  } else {
21543
21701
  const cell = $xeTable.getCellElement(row, column);
21544
- if (cell) {
21702
+ if (cell && !hasClass(cell, 'is--progress')) {
21545
21703
  cellValue = cell.innerText.trim();
21546
21704
  }
21547
21705
  }
@@ -21611,7 +21769,7 @@ function getBodyLabelData($xeTable, opts, columns, datas) {
21611
21769
  cellValue = htmlCellElem.innerText.trim();
21612
21770
  } else {
21613
21771
  const cell = $xeTable.getCellElement(row, column);
21614
- if (cell) {
21772
+ if (cell && !hasClass(cell, 'is--progress')) {
21615
21773
  cellValue = cell.innerText.trim();
21616
21774
  }
21617
21775
  }
@@ -23938,11 +24096,15 @@ function validErrorRuleValue(rule, val) {
23938
24096
  treeConfig
23939
24097
  } = props;
23940
24098
  const {
24099
+ editStore,
23941
24100
  pendingRowMaps
23942
24101
  } = reactData;
23943
24102
  const {
23944
24103
  afterFullData
23945
24104
  } = internalData;
24105
+ const {
24106
+ removeMaps
24107
+ } = editStore;
23946
24108
  const treeOpts = $xeTable.computeTreeOpts;
23947
24109
  const childrenField = treeOpts.children || treeOpts.childrenField;
23948
24110
  let validList;
@@ -23967,6 +24129,10 @@ function validErrorRuleValue(rule, val) {
23967
24129
  const columns = cols && cols.length ? cols : this.getColumns();
23968
24130
  const handleVaild = row => {
23969
24131
  const rowid = getRowid($xeTable, row);
24132
+ // 是否删除
24133
+ if (removeMaps[rowid]) {
24134
+ return;
24135
+ }
23970
24136
  // 是否标记删除
23971
24137
  if (pendingRowMaps[rowid]) {
23972
24138
  return;
@@ -25151,7 +25317,6 @@ function renderBody(h, $xeTable) {
25151
25317
  column: null
25152
25318
  },
25153
25319
  insertMaps: {},
25154
- removeList: [],
25155
25320
  removeMaps: {}
25156
25321
  },
25157
25322
  // 存放 tooltip 相关信息