vxe-table 3.13.19 → 3.13.21

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 (37) hide show
  1. package/es/grid/src/grid.js +17 -8
  2. package/es/style.css +1 -1
  3. package/es/table/src/body.js +11 -6
  4. package/es/table/src/footer.js +7 -2
  5. package/es/table/src/methods.js +197 -62
  6. package/es/table/src/util.js +18 -5
  7. package/es/ui/index.js +1 -1
  8. package/es/ui/src/log.js +1 -1
  9. package/lib/grid/src/grid.js +17 -8
  10. package/lib/grid/src/grid.min.js +1 -1
  11. package/lib/index.umd.js +284 -97
  12. package/lib/index.umd.min.js +1 -1
  13. package/lib/style.css +1 -1
  14. package/lib/table/src/body.js +10 -5
  15. package/lib/table/src/body.min.js +1 -1
  16. package/lib/table/src/footer.js +7 -2
  17. package/lib/table/src/footer.min.js +1 -1
  18. package/lib/table/src/methods.js +228 -75
  19. package/lib/table/src/methods.min.js +1 -1
  20. package/lib/table/src/util.js +21 -5
  21. package/lib/table/src/util.min.js +1 -1
  22. package/lib/ui/index.js +1 -1
  23. package/lib/ui/index.min.js +1 -1
  24. package/lib/ui/src/log.js +1 -1
  25. package/lib/ui/src/log.min.js +1 -1
  26. package/package.json +2 -2
  27. package/packages/grid/src/grid.ts +18 -8
  28. package/packages/table/src/body.ts +10 -5
  29. package/packages/table/src/footer.ts +7 -2
  30. package/packages/table/src/methods.ts +218 -69
  31. package/packages/table/src/util.ts +20 -5
  32. /package/es/{iconfont.1741224103306.ttf → iconfont.1741336846919.ttf} +0 -0
  33. /package/es/{iconfont.1741224103306.woff → iconfont.1741336846919.woff} +0 -0
  34. /package/es/{iconfont.1741224103306.woff2 → iconfont.1741336846919.woff2} +0 -0
  35. /package/lib/{iconfont.1741224103306.ttf → iconfont.1741336846919.ttf} +0 -0
  36. /package/lib/{iconfont.1741224103306.woff → iconfont.1741336846919.woff} +0 -0
  37. /package/lib/{iconfont.1741224103306.woff2 → iconfont.1741336846919.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -3201,7 +3201,7 @@ function getClass(property, params) {
3201
3201
  ;// ./packages/ui/index.ts
3202
3202
 
3203
3203
 
3204
- const version = "3.13.19";
3204
+ const version = "3.13.21";
3205
3205
  core_.VxeUI.version = version;
3206
3206
  core_.VxeUI.tableVersion = version;
3207
3207
  core_.VxeUI.setConfig({
@@ -3828,7 +3828,7 @@ var es_iterator_map = __webpack_require__(1701);
3828
3828
  const {
3829
3829
  log: log_log
3830
3830
  } = core_.VxeUI;
3831
- const log_version = `table v${"3.13.19"}`;
3831
+ const log_version = `table v${"3.13.21"}`;
3832
3832
  const warnLog = log_log.create('warn', log_version);
3833
3833
  const errLog = log_log.create('error', log_version);
3834
3834
  ;// ./packages/table/src/columnInfo.ts
@@ -4100,13 +4100,19 @@ function getRowUniqueId() {
4100
4100
  return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId('row_');
4101
4101
  }
4102
4102
  // 行主键 key
4103
- function getRowkey($xetable) {
4104
- return $xetable.rowOpts.keyField || $xetable.rowId || '_X_ROW_KEY';
4103
+ function getRowkey($xeTable) {
4104
+ const props = $xeTable;
4105
+ const rowOpts = $xeTable.computeRowOpts;
4106
+ return `${props.rowId || rowOpts.keyField || '_X_ROW_KEY'}`;
4105
4107
  }
4106
4108
  // 行主键 value
4107
4109
  function getRowid($xetable, row) {
4108
4110
  const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, getRowkey($xetable));
4109
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(rowid) ? '' : encodeURIComponent(rowid);
4111
+ return encodeRowid(rowid);
4112
+ }
4113
+ // 编码行主键
4114
+ function encodeRowid(rowVal) {
4115
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(rowVal) ? '' : encodeURIComponent(rowVal);
4110
4116
  }
4111
4117
  function getPaddingLeftRightSize(elem) {
4112
4118
  if (elem) {
@@ -4132,12 +4138,19 @@ function getCellHeight(height) {
4132
4138
  }
4133
4139
  return height || 0;
4134
4140
  }
4135
- function handleFieldOrColumn(_vm, fieldOrColumn) {
4141
+ function handleFieldOrColumn($xeTable, fieldOrColumn) {
4136
4142
  if (fieldOrColumn) {
4137
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(fieldOrColumn) ? _vm.getColumnByField(`${fieldOrColumn}`) : fieldOrColumn;
4143
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(fieldOrColumn) ? $xeTable.getColumnByField(`${fieldOrColumn}`) : fieldOrColumn;
4138
4144
  }
4139
4145
  return null;
4140
4146
  }
4147
+ const handleRowidOrRow = ($xeTable, rowidOrRow) => {
4148
+ if (rowidOrRow) {
4149
+ const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(rowidOrRow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(rowidOrRow) ? rowidOrRow : getRowid($xeTable, rowidOrRow);
4150
+ return $xeTable.getRowById(rowid);
4151
+ }
4152
+ return null;
4153
+ };
4141
4154
  // 组装列配置
4142
4155
  function assembleColumn(_vm) {
4143
4156
  const {
@@ -8613,6 +8626,10 @@ const Methods = {
8613
8626
  }
8614
8627
  return [];
8615
8628
  },
8629
+ getEl() {
8630
+ const $xeTable = this;
8631
+ return $xeTable.$refs.refElem;
8632
+ },
8616
8633
  /**
8617
8634
  * 获取父容器元素
8618
8635
  */
@@ -9080,24 +9097,26 @@ const Methods = {
9080
9097
  reactData.treeExpandedMaps = treeTempExpandedMaps;
9081
9098
  },
9082
9099
  cacheSourceMap(fullData) {
9100
+ const $xeTable = this;
9101
+ const props = $xeTable;
9102
+ const internalData = $xeTable;
9103
+ const {
9104
+ treeConfig
9105
+ } = props;
9106
+ const treeOpts = $xeTable.computeTreeOpts;
9083
9107
  let {
9084
- treeConfig,
9085
- treeOpts,
9086
9108
  sourceDataRowIdData
9087
- } = this;
9109
+ } = internalData;
9088
9110
  const sourceData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(fullData, true);
9089
- const rowkey = getRowkey(this);
9090
- sourceDataRowIdData = this.sourceDataRowIdData = {};
9111
+ const rowkey = getRowkey($xeTable);
9112
+ sourceDataRowIdData = internalData.sourceDataRowIdData = {};
9091
9113
  const handleSourceRow = row => {
9092
- let rowid = getRowid(this, row);
9114
+ let rowid = getRowid($xeTable, row);
9093
9115
  if (eqEmptyValue(rowid)) {
9094
9116
  rowid = getRowUniqueId();
9095
9117
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, rowkey, rowid);
9096
9118
  }
9097
- sourceDataRowIdData[rowid] = {
9098
- row,
9099
- rowid
9100
- };
9119
+ sourceDataRowIdData[rowid] = row;
9101
9120
  };
9102
9121
  // 源数据缓存
9103
9122
  if (treeConfig) {
@@ -9108,7 +9127,7 @@ const Methods = {
9108
9127
  } else {
9109
9128
  sourceData.forEach(handleSourceRow);
9110
9129
  }
9111
- this.tableSourceData = sourceData;
9130
+ internalData.tableSourceData = sourceData;
9112
9131
  },
9113
9132
  getParams() {
9114
9133
  return this.params;
@@ -9486,6 +9505,9 @@ const Methods = {
9486
9505
  keepSource,
9487
9506
  treeConfig
9488
9507
  } = props;
9508
+ const {
9509
+ editStore
9510
+ } = reactData;
9489
9511
  const {
9490
9512
  fullAllDataRowIdData,
9491
9513
  fullDataRowIdData,
@@ -9494,6 +9516,9 @@ const Methods = {
9494
9516
  tableFullData,
9495
9517
  afterFullData
9496
9518
  } = internalData;
9519
+ const removeTempMaps = {
9520
+ ...editStore.removeMaps
9521
+ };
9497
9522
  const treeOpts = $xeTable.computeTreeOpts;
9498
9523
  const {
9499
9524
  transform
@@ -9528,6 +9553,7 @@ const Methods = {
9528
9553
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().destructuring(row, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(oRow, true));
9529
9554
  }
9530
9555
  if (!fullDataRowIdData[rowid] && $xeTable.isRemoveByRow(row)) {
9556
+ delete removeTempMaps[rowid];
9531
9557
  tableFullData.unshift(row);
9532
9558
  afterFullData.unshift(row);
9533
9559
  reDelFlag = true;
@@ -9539,6 +9565,7 @@ const Methods = {
9539
9565
  }
9540
9566
  if (rows) {
9541
9567
  if (reDelFlag) {
9568
+ editStore.removeMaps = removeTempMaps;
9542
9569
  $xeTable.updateFooter();
9543
9570
  $xeTable.cacheRowMap(false);
9544
9571
  $xeTable.handleTableData(treeConfig && transform);
@@ -9717,25 +9744,31 @@ const Methods = {
9717
9744
  },
9718
9745
  /**
9719
9746
  * 检查行或列数据是否发生改变
9720
- * @param {Row} row 行对象
9747
+ * @param {Row} rowOrId 行对象
9721
9748
  * @param {String} field 字段名
9722
9749
  */
9723
- isUpdateByRow(row, field) {
9750
+ isUpdateByRow(rowOrId, field) {
9751
+ const $xeTable = this;
9752
+ const props = $xeTable;
9753
+ const internalData = $xeTable;
9754
+ const {
9755
+ keepSource
9756
+ } = props;
9724
9757
  const {
9725
9758
  tableFullColumn,
9726
- keepSource,
9727
- sourceDataRowIdData,
9728
- fullDataRowIdData
9729
- } = this;
9759
+ fullDataRowIdData,
9760
+ sourceDataRowIdData
9761
+ } = internalData;
9730
9762
  if (keepSource) {
9731
- const rowid = getRowid(this, row);
9763
+ const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(rowOrId) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(rowOrId) ? rowOrId : getRowid($xeTable, rowOrId);
9764
+ const rowRest = fullDataRowIdData[rowid];
9732
9765
  // 新增的数据不需要检测
9733
- if (!fullDataRowIdData[rowid]) {
9766
+ if (!rowRest) {
9734
9767
  return false;
9735
9768
  }
9736
- const oldRest = sourceDataRowIdData[rowid];
9737
- if (oldRest) {
9738
- const oRow = oldRest.row;
9769
+ const row = rowRest.row;
9770
+ const oRow = sourceDataRowIdData[rowid];
9771
+ if (oRow) {
9739
9772
  if (arguments.length > 1) {
9740
9773
  return !eqCellValue(oRow, row, field);
9741
9774
  }
@@ -9797,6 +9830,113 @@ const Methods = {
9797
9830
  tableColumn: this.tableColumn.slice(0)
9798
9831
  };
9799
9832
  },
9833
+ /**
9834
+ * 移动列到指定列的位置
9835
+ * @param fieldOrColumn
9836
+ * @param targetFieldOrColumn
9837
+ * @param options
9838
+ */
9839
+ moveColumnTo(fieldOrColumn, targetFieldOrColumn, options) {
9840
+ const $xeTable = this;
9841
+ const internalData = $xeTable;
9842
+ const {
9843
+ fullColumnIdData,
9844
+ visibleColumn
9845
+ } = internalData;
9846
+ const {
9847
+ dragToChild,
9848
+ dragPos,
9849
+ isCrossDrag
9850
+ } = Object.assign({}, options);
9851
+ const dragCol = handleFieldOrColumn($xeTable, fieldOrColumn);
9852
+ let prevDragCol = null;
9853
+ const colRest = dragCol ? fullColumnIdData[dragCol.id] : null;
9854
+ let defPos = 'left';
9855
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(targetFieldOrColumn)) {
9856
+ if (colRest && targetFieldOrColumn) {
9857
+ let currList = colRest.items;
9858
+ let offsetIndex = colRest._index + targetFieldOrColumn;
9859
+ if (isCrossDrag) {
9860
+ currList = visibleColumn;
9861
+ offsetIndex = colRest._index + targetFieldOrColumn;
9862
+ }
9863
+ if (offsetIndex > 0 && offsetIndex < currList.length - 1) {
9864
+ prevDragCol = currList[offsetIndex];
9865
+ }
9866
+ if (targetFieldOrColumn > 0) {
9867
+ defPos = 'right';
9868
+ }
9869
+ }
9870
+ } else {
9871
+ prevDragCol = handleFieldOrColumn($xeTable, targetFieldOrColumn);
9872
+ const targetColRest = prevDragCol ? fullColumnIdData[prevDragCol.id] : null;
9873
+ if (colRest && targetColRest) {
9874
+ if (targetColRest._index > colRest._index) {
9875
+ defPos = 'right';
9876
+ }
9877
+ }
9878
+ }
9879
+ return $xeTable.handleColDragSwapEvent(null, true, dragCol, prevDragCol, dragPos || defPos, dragToChild === true);
9880
+ },
9881
+ /**
9882
+ * 移动行到指定行的位置
9883
+ * @param rowidOrRow
9884
+ * @param targetRowidOrRow
9885
+ * @param options
9886
+ */
9887
+ moveRowTo(rowidOrRow, targetRowidOrRow, options) {
9888
+ const $xeTable = this;
9889
+ const props = $xeTable;
9890
+ const internalData = $xeTable;
9891
+ const {
9892
+ treeConfig
9893
+ } = props;
9894
+ const {
9895
+ fullAllDataRowIdData,
9896
+ afterFullData
9897
+ } = internalData;
9898
+ const {
9899
+ dragToChild,
9900
+ dragPos,
9901
+ isCrossDrag
9902
+ } = Object.assign({}, options);
9903
+ const treeOpts = $xeTable.computeTreeOpts;
9904
+ const dragRow = handleRowidOrRow($xeTable, rowidOrRow);
9905
+ let prevDragRow = null;
9906
+ let defPos = 'top';
9907
+ const rowRest = dragRow ? fullAllDataRowIdData[getRowid($xeTable, dragRow)] : null;
9908
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(targetRowidOrRow)) {
9909
+ if (rowRest && targetRowidOrRow) {
9910
+ let currList = afterFullData;
9911
+ let offsetIndex = rowRest._index + targetRowidOrRow;
9912
+ if (treeConfig) {
9913
+ currList = rowRest.items;
9914
+ if (treeOpts.transform) {
9915
+ offsetIndex = rowRest.treeIndex + targetRowidOrRow;
9916
+ if (isCrossDrag) {
9917
+ currList = afterFullData;
9918
+ offsetIndex = rowRest._index + targetRowidOrRow;
9919
+ }
9920
+ }
9921
+ }
9922
+ if (offsetIndex >= 0 && offsetIndex <= currList.length - 1) {
9923
+ prevDragRow = currList[offsetIndex];
9924
+ }
9925
+ if (targetRowidOrRow > 0) {
9926
+ defPos = 'bottom';
9927
+ }
9928
+ }
9929
+ } else {
9930
+ prevDragRow = handleRowidOrRow($xeTable, targetRowidOrRow);
9931
+ const targetRowRest = prevDragRow ? fullAllDataRowIdData[getRowid($xeTable, prevDragRow)] : null;
9932
+ if (rowRest && targetRowRest) {
9933
+ if (targetRowRest._index > rowRest._index) {
9934
+ defPos = 'bottom';
9935
+ }
9936
+ }
9937
+ }
9938
+ return $xeTable.handleRowDragSwapEvent(null, true, dragRow, prevDragRow, dragPos || defPos, dragToChild === true);
9939
+ },
9800
9940
  /**
9801
9941
  * 获取表格的全量列
9802
9942
  */
@@ -9819,16 +9959,26 @@ const Methods = {
9819
9959
  * 用于多选行,获取已选中的数据
9820
9960
  */
9821
9961
  getCheckboxRecords(isFull) {
9962
+ const $xeTable = this;
9963
+ const props = $xeTable;
9964
+ const reactData = $xeTable;
9965
+ const internalData = $xeTable;
9966
+ const {
9967
+ treeConfig
9968
+ } = props;
9969
+ const {
9970
+ selectCheckboxMaps
9971
+ } = reactData;
9822
9972
  const {
9823
9973
  tableFullData,
9824
9974
  afterFullData,
9825
- treeConfig,
9826
- treeOpts,
9827
- checkboxOpts,
9828
- tableFullTreeData,
9829
9975
  afterTreeFullData,
9976
+ tableFullTreeData,
9977
+ fullDataRowIdData,
9830
9978
  afterFullRowMaps
9831
- } = this;
9979
+ } = internalData;
9980
+ const treeOpts = $xeTable.computeTreeOpts;
9981
+ const checkboxOpts = $xeTable.computeCheckboxOpts;
9832
9982
  const {
9833
9983
  transform,
9834
9984
  mapChildrenField
@@ -9837,21 +9987,18 @@ const Methods = {
9837
9987
  checkField
9838
9988
  } = checkboxOpts;
9839
9989
  const childrenField = treeOpts.children || treeOpts.childrenField;
9840
- const currTableData = isFull ? transform ? tableFullTreeData : tableFullData : transform ? afterTreeFullData : afterFullData;
9841
9990
  let rowList = [];
9842
9991
  if (checkField) {
9843
9992
  if (treeConfig) {
9993
+ const currTableData = isFull ? transform ? tableFullTreeData : tableFullData : transform ? afterTreeFullData : afterFullData;
9844
9994
  rowList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().filterTree(currTableData, row => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField), {
9845
9995
  children: transform ? mapChildrenField : childrenField
9846
9996
  });
9847
9997
  } else {
9998
+ const currTableData = isFull ? tableFullData : afterFullData;
9848
9999
  rowList = currTableData.filter(row => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField));
9849
10000
  }
9850
10001
  } else {
9851
- const {
9852
- selectCheckboxMaps,
9853
- fullDataRowIdData
9854
- } = this;
9855
10002
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(selectCheckboxMaps, (row, rowid) => {
9856
10003
  if (isFull) {
9857
10004
  if (fullDataRowIdData[rowid]) {
@@ -13623,6 +13770,9 @@ const Methods = {
13623
13770
  } = internalData;
13624
13771
  const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
13625
13772
  const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
13773
+ const errRest = {
13774
+ status: false
13775
+ };
13626
13776
  if (prevDragRow && dragRow) {
13627
13777
  // 判断是否有拖动
13628
13778
  if (prevDragRow !== dragRow) {
@@ -13637,7 +13787,7 @@ const Methods = {
13637
13787
  const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
13638
13788
  return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then(status => {
13639
13789
  if (!status) {
13640
- return;
13790
+ return errRest;
13641
13791
  }
13642
13792
  let oafIndex = -1;
13643
13793
  let nafIndex = -1;
@@ -13668,11 +13818,11 @@ const Methods = {
13668
13818
  if (isPeerDrag && !isCrossDrag) {
13669
13819
  if (oldRest.row[parentField] !== newRest.row[parentField]) {
13670
13820
  // 非同级
13671
- return;
13821
+ return errRest;
13672
13822
  }
13673
13823
  } else {
13674
13824
  if (!isCrossDrag) {
13675
- return;
13825
+ return errRest;
13676
13826
  }
13677
13827
  if (oldAllMaps[newRowid]) {
13678
13828
  isSelfToChildStatus = true;
@@ -13683,19 +13833,19 @@ const Methods = {
13683
13833
  content: methods_getI18n('vxe.error.treeDragChild')
13684
13834
  });
13685
13835
  }
13686
- return;
13836
+ return errRest;
13687
13837
  }
13688
13838
  }
13689
13839
  }
13690
13840
  } else if (oldLevel) {
13691
13841
  // 子到根
13692
13842
  if (!isCrossDrag) {
13693
- return;
13843
+ return errRest;
13694
13844
  }
13695
13845
  } else if (newLevel) {
13696
13846
  // 根到子
13697
13847
  if (!isCrossDrag) {
13698
- return;
13848
+ return errRest;
13699
13849
  }
13700
13850
  if (oldAllMaps[newRowid]) {
13701
13851
  isSelfToChildStatus = true;
@@ -13706,7 +13856,7 @@ const Methods = {
13706
13856
  content: methods_getI18n('vxe.error.treeDragChild')
13707
13857
  });
13708
13858
  }
13709
- return;
13859
+ return errRest;
13710
13860
  }
13711
13861
  }
13712
13862
  } else {
@@ -13764,26 +13914,34 @@ const Methods = {
13764
13914
  if (reactData.scrollYLoad) {
13765
13915
  $xeTable.updateScrollYSpace();
13766
13916
  }
13767
- $xeTable.$nextTick().then(() => {
13917
+ if (evnt) {
13918
+ $xeTable.dispatchEvent('row-dragend', {
13919
+ oldRow: dragRow,
13920
+ newRow: prevDragRow,
13921
+ dragRow,
13922
+ dragPos: prevDragPos,
13923
+ dragToChild: isDragToChildFlag,
13924
+ offsetIndex: dragOffsetIndex,
13925
+ _index: {
13926
+ newIndex: nafIndex,
13927
+ oldIndex: oafIndex
13928
+ }
13929
+ }, evnt);
13930
+ }
13931
+ return $xeTable.$nextTick().then(() => {
13768
13932
  $xeTable.updateCellAreas();
13769
13933
  $xeTable.recalculate();
13934
+ }).then(() => {
13935
+ return {
13936
+ status: true
13937
+ };
13770
13938
  });
13771
- $xeTable.dispatchEvent('row-dragend', {
13772
- oldRow: dragRow,
13773
- newRow: prevDragRow,
13774
- dragRow,
13775
- dragPos: prevDragPos,
13776
- dragToChild: isDragToChildFlag,
13777
- offsetIndex: dragOffsetIndex,
13778
- _index: {
13779
- newIndex: nafIndex,
13780
- oldIndex: oafIndex
13781
- }
13782
- }, evnt);
13783
- }).catch(() => {});
13939
+ }).catch(() => {
13940
+ return errRest;
13941
+ });
13784
13942
  }
13785
13943
  }
13786
- return Promise.resolve();
13944
+ return Promise.resolve(errRest);
13787
13945
  },
13788
13946
  handleRowDragDragendEvent(evnt) {
13789
13947
  const $xeTable = this;
@@ -13969,6 +14127,9 @@ const Methods = {
13969
14127
  collectColumn
13970
14128
  } = internalData;
13971
14129
  const dragOffsetIndex = prevDragPos === 'right' ? 1 : 0;
14130
+ const errRest = {
14131
+ status: false
14132
+ };
13972
14133
  if (prevDragCol && dragCol) {
13973
14134
  // 判断是否有拖动
13974
14135
  if (prevDragCol !== dragCol) {
@@ -13985,7 +14146,7 @@ const Methods = {
13985
14146
  const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
13986
14147
  return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then(status => {
13987
14148
  if (!status) {
13988
- return;
14149
+ return errRest;
13989
14150
  }
13990
14151
  let oafIndex = -1;
13991
14152
  let nafIndex = -1;
@@ -13999,11 +14160,11 @@ const Methods = {
13999
14160
  if (isPeerDrag && !isCrossDrag) {
14000
14161
  if (dragColumn.parentId !== newColumn.parentId) {
14001
14162
  // 非同级
14002
- return;
14163
+ return errRest;
14003
14164
  }
14004
14165
  } else {
14005
14166
  if (!isCrossDrag) {
14006
- return;
14167
+ return errRest;
14007
14168
  }
14008
14169
  if (oldAllMaps[newColumn.id]) {
14009
14170
  isSelfToChildStatus = true;
@@ -14014,19 +14175,19 @@ const Methods = {
14014
14175
  content: methods_getI18n('vxe.error.treeDragChild')
14015
14176
  });
14016
14177
  }
14017
- return;
14178
+ return errRest;
14018
14179
  }
14019
14180
  }
14020
14181
  }
14021
14182
  } else if (dragColumn.parentId) {
14022
14183
  // 子到根
14023
14184
  if (!isCrossDrag) {
14024
- return;
14185
+ return errRest;
14025
14186
  }
14026
14187
  } else if (newColumn.parentId) {
14027
14188
  // 根到子
14028
14189
  if (!isCrossDrag) {
14029
- return;
14190
+ return errRest;
14030
14191
  }
14031
14192
  if (oldAllMaps[newColumn.id]) {
14032
14193
  isSelfToChildStatus = true;
@@ -14037,7 +14198,7 @@ const Methods = {
14037
14198
  content: methods_getI18n('vxe.error.treeDragChild')
14038
14199
  });
14039
14200
  }
14040
- return;
14201
+ return errRest;
14041
14202
  }
14042
14203
  }
14043
14204
  } else {
@@ -14106,25 +14267,32 @@ const Methods = {
14106
14267
  $xeTable.clearCopyCellArea();
14107
14268
  }
14108
14269
  }
14109
- $xeTable.dispatchEvent('column-dragend', {
14110
- oldColumn: dragColumn,
14111
- newColumn,
14112
- dragColumn,
14113
- dragPos: prevDragPos,
14114
- dragToChild: isDragToChildFlag,
14115
- offsetIndex: dragOffsetIndex,
14116
- _index: {
14117
- newIndex: nafIndex,
14118
- oldIndex: oafIndex
14119
- }
14120
- }, evnt);
14270
+ if (evnt) {
14271
+ $xeTable.dispatchEvent('column-dragend', {
14272
+ oldColumn: dragColumn,
14273
+ newColumn,
14274
+ dragColumn,
14275
+ dragPos: prevDragPos,
14276
+ dragToChild: isDragToChildFlag,
14277
+ offsetIndex: dragOffsetIndex,
14278
+ _index: {
14279
+ newIndex: nafIndex,
14280
+ oldIndex: oafIndex
14281
+ }
14282
+ }, evnt);
14283
+ }
14121
14284
  if (isSyncColumn) {
14122
14285
  $xeTable.handleColDragSwapColumn();
14123
14286
  }
14124
- }).catch(() => {});
14287
+ return {
14288
+ status: true
14289
+ };
14290
+ }).catch(() => {
14291
+ return errRest;
14292
+ });
14125
14293
  }
14126
14294
  }
14127
- return Promise.resolve();
14295
+ return Promise.resolve(errRest);
14128
14296
  },
14129
14297
  handleHeaderCellDragDragendEvent(evnt) {
14130
14298
  const $xeTable = this;
@@ -16790,6 +16958,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
16790
16958
  tdOns.dblclick = evnt => {
16791
16959
  $xeTable.triggerCellDblclickEvent(evnt, cellParams);
16792
16960
  };
16961
+ let isMergeCell = false;
16793
16962
  // 合并行或列
16794
16963
  if (mergeList.length) {
16795
16964
  const spanRest = mergeBodyMethod(mergeList, _rowIndex, _columnIndex);
@@ -16802,9 +16971,11 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
16802
16971
  return null;
16803
16972
  }
16804
16973
  if (rowspan > 1) {
16974
+ isMergeCell = true;
16805
16975
  tdAttrs.rowspan = rowspan;
16806
16976
  }
16807
16977
  if (colspan > 1) {
16978
+ isMergeCell = true;
16808
16979
  tdAttrs.colspan = colspan;
16809
16980
  }
16810
16981
  }
@@ -16839,11 +17010,13 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
16839
17010
  const isLastColumn = $columnIndex === columns.length - 1;
16840
17011
  const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
16841
17012
  let isVNPreEmptyStatus = false;
16842
- if (!dragRow || getRowid($xeTable, dragRow) !== rowid) {
16843
- if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
16844
- isVNPreEmptyStatus = true;
16845
- } else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
16846
- isVNPreEmptyStatus = true;
17013
+ if (!isMergeCell) {
17014
+ if (!dragRow || getRowid($xeTable, dragRow) !== rowid) {
17015
+ if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
17016
+ isVNPreEmptyStatus = true;
17017
+ } else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
17018
+ isVNPreEmptyStatus = true;
17019
+ }
16847
17020
  }
16848
17021
  }
16849
17022
  const tcStyle = {};
@@ -18064,6 +18237,7 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
18064
18237
  cell: evnt.currentTarget
18065
18238
  }, cellParams), evnt);
18066
18239
  };
18240
+ let isMergeCell = false;
18067
18241
  // 合并行或列
18068
18242
  if (mergeFooterList.length) {
18069
18243
  const spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
@@ -18076,9 +18250,11 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
18076
18250
  return null;
18077
18251
  }
18078
18252
  if (rowspan > 1) {
18253
+ isMergeCell = true;
18079
18254
  attrs.rowspan = rowspan;
18080
18255
  }
18081
18256
  if (colspan > 1) {
18257
+ isMergeCell = true;
18082
18258
  attrs.colspan = colspan;
18083
18259
  }
18084
18260
  }
@@ -18101,8 +18277,10 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
18101
18277
  const isLastColumn = $columnIndex === tableColumn.length - 1;
18102
18278
  const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
18103
18279
  let isVNPreEmptyStatus = false;
18104
- if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
18105
- isVNPreEmptyStatus = true;
18280
+ if (!isMergeCell) {
18281
+ if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
18282
+ isVNPreEmptyStatus = true;
18283
+ }
18106
18284
  }
18107
18285
  const tcStyle = {};
18108
18286
  if (hasEllipsis) {
@@ -29673,6 +29851,10 @@ Object.keys(table.methods).forEach(name => {
29673
29851
  }
29674
29852
  return [];
29675
29853
  },
29854
+ getEl() {
29855
+ const $xeGrid = this;
29856
+ return $xeGrid.$refs.refElem;
29857
+ },
29676
29858
  /**
29677
29859
  * 获取需要排除的高度
29678
29860
  */
@@ -29683,20 +29865,25 @@ Object.keys(table.methods).forEach(name => {
29683
29865
  isZMax
29684
29866
  } = reactData;
29685
29867
  const el = $xeGrid.$refs.refElem;
29686
- const formWrapper = $xeGrid.$refs.refFormWrapper;
29687
- const toolbarWrapper = $xeGrid.$refs.refToolbarWrapper;
29688
- const topWrapper = $xeGrid.$refs.refTopWrapper;
29689
- const bottomWrapper = $xeGrid.$refs.refBottomWrapper;
29690
- const pagerWrapper = $xeGrid.$refs.refPagerWrapper;
29691
- const parentPaddingSize = isZMax ? 0 : getPaddingTopBottomSize(el.parentNode);
29692
- return parentPaddingSize + getPaddingTopBottomSize(el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper);
29868
+ if (el) {
29869
+ const formWrapper = $xeGrid.$refs.refFormWrapper;
29870
+ const toolbarWrapper = $xeGrid.$refs.refToolbarWrapper;
29871
+ const topWrapper = $xeGrid.$refs.refTopWrapper;
29872
+ const bottomWrapper = $xeGrid.$refs.refBottomWrapper;
29873
+ const pagerWrapper = $xeGrid.$refs.refPagerWrapper;
29874
+ const parentEl = el.parentElement;
29875
+ const parentPaddingSize = isZMax ? 0 : parentEl ? getPaddingTopBottomSize(parentEl) : 0;
29876
+ return parentPaddingSize + getPaddingTopBottomSize(el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper);
29877
+ }
29878
+ return 0;
29693
29879
  },
29694
29880
  getParentHeight() {
29695
29881
  const $xeGrid = this;
29696
29882
  const reactData = $xeGrid;
29697
29883
  const el = $xeGrid.$refs.refElem;
29698
29884
  if (el) {
29699
- return (reactData.isZMax ? getDomNode().visibleHeight : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(el.parentNode).height)) - $xeGrid.getExcludeHeight();
29885
+ const parentEl = el.parentElement;
29886
+ return (reactData.isZMax ? getDomNode().visibleHeight : parentEl ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(parentEl).height) : 0) - $xeGrid.getExcludeHeight();
29700
29887
  }
29701
29888
  return 0;
29702
29889
  },