vxe-table 3.13.18 → 3.13.20

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/grid/src/grid.js +4 -0
  2. package/es/style.css +1 -1
  3. package/es/table/render/index.js +88 -57
  4. package/es/table/src/body.js +11 -6
  5. package/es/table/src/footer.js +7 -2
  6. package/es/table/src/methods.js +222 -77
  7. package/es/table/src/util.js +18 -5
  8. package/es/ui/index.js +1 -1
  9. package/es/ui/src/log.js +1 -1
  10. package/lib/grid/src/grid.js +4 -0
  11. package/lib/grid/src/grid.min.js +1 -1
  12. package/lib/index.umd.js +384 -164
  13. package/lib/index.umd.min.js +1 -1
  14. package/lib/style.css +1 -1
  15. package/lib/table/render/index.js +96 -62
  16. package/lib/table/render/index.min.js +1 -1
  17. package/lib/table/src/body.js +10 -5
  18. package/lib/table/src/body.min.js +1 -1
  19. package/lib/table/src/footer.js +7 -2
  20. package/lib/table/src/footer.min.js +1 -1
  21. package/lib/table/src/methods.js +247 -88
  22. package/lib/table/src/methods.min.js +1 -1
  23. package/lib/table/src/util.js +21 -5
  24. package/lib/table/src/util.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 +2 -2
  30. package/packages/grid/src/grid.ts +5 -0
  31. package/packages/table/render/index.ts +87 -55
  32. package/packages/table/src/body.ts +10 -5
  33. package/packages/table/src/footer.ts +7 -2
  34. package/packages/table/src/methods.ts +242 -84
  35. package/packages/table/src/util.ts +20 -5
  36. /package/es/{iconfont.1741140503645.ttf → iconfont.1741333380103.ttf} +0 -0
  37. /package/es/{iconfont.1741140503645.woff → iconfont.1741333380103.woff} +0 -0
  38. /package/es/{iconfont.1741140503645.woff2 → iconfont.1741333380103.woff2} +0 -0
  39. /package/lib/{iconfont.1741140503645.ttf → iconfont.1741333380103.ttf} +0 -0
  40. /package/lib/{iconfont.1741140503645.woff → iconfont.1741333380103.woff} +0 -0
  41. /package/lib/{iconfont.1741140503645.woff2 → iconfont.1741333380103.woff2} +0 -0
@@ -2546,6 +2546,10 @@ const Methods = {
2546
2546
  }
2547
2547
  return [];
2548
2548
  },
2549
+ getEl() {
2550
+ const $xeTable = this;
2551
+ return $xeTable.$refs.refElem;
2552
+ },
2549
2553
  /**
2550
2554
  * 获取父容器元素
2551
2555
  */
@@ -2560,14 +2564,27 @@ const Methods = {
2560
2564
  * 获取父容器的高度
2561
2565
  */
2562
2566
  getParentHeight() {
2567
+ const $xeTable = this;
2568
+ const $xeGrid = $xeTable.$xeGrid;
2569
+ const props = $xeTable;
2563
2570
  const {
2564
- $el,
2565
- $xegrid,
2566
2571
  height
2567
- } = this;
2568
- const parentElem = $el.parentNode;
2569
- const parentPaddingSize = height === '100%' || height === 'auto' ? (0, _dom.getPaddingTopBottomSize)(parentElem) : 0;
2570
- return Math.floor($xegrid ? $xegrid.getParentHeight() : _xeUtils.default.toNumber(getComputedStyle(parentElem).height) - parentPaddingSize);
2572
+ } = props;
2573
+ const el = $xeTable.$refs.refElem;
2574
+ if (el) {
2575
+ const parentElem = el.parentNode;
2576
+ const parentPaddingSize = height === '100%' || height === 'auto' ? (0, _dom.getPaddingTopBottomSize)(parentElem) : 0;
2577
+ let parentWrapperHeight = 0;
2578
+ if (parentElem) {
2579
+ if ($xeGrid && (0, _dom.hasClass)(parentElem, 'vxe-grid--table-wrapper')) {
2580
+ parentWrapperHeight = $xeGrid.getParentHeight();
2581
+ } else {
2582
+ parentWrapperHeight = parentElem.clientHeight;
2583
+ }
2584
+ }
2585
+ return Math.floor(parentWrapperHeight - parentPaddingSize);
2586
+ }
2587
+ return 0;
2571
2588
  },
2572
2589
  /**
2573
2590
  * 获取需要排除的高度
@@ -2770,7 +2787,7 @@ const Methods = {
2770
2787
  // warnLog('vxe.error.reqProp', ['table.show-overflow'])
2771
2788
  // }
2772
2789
  if (this.spanMethod) {
2773
- (0, _log.warnLog)('vxe.error.scrollErrProp', ['table.span-method']);
2790
+ (0, _log.errLog)('vxe.error.scrollErrProp', ['table.span-method']);
2774
2791
  }
2775
2792
  }
2776
2793
  handleReserveStatus($xeTable);
@@ -3402,6 +3419,7 @@ const Methods = {
3402
3419
  } = props;
3403
3420
  const {
3404
3421
  fullAllDataRowIdData,
3422
+ fullDataRowIdData,
3405
3423
  tableSourceData,
3406
3424
  sourceDataRowIdData,
3407
3425
  tableFullData,
@@ -3413,7 +3431,7 @@ const Methods = {
3413
3431
  } = treeOpts;
3414
3432
  if (!keepSource) {
3415
3433
  if (process.env.NODE_ENV === 'development') {
3416
- (0, _log.warnLog)('vxe.error.reqProp', ['keep-source']);
3434
+ (0, _log.errLog)('vxe.error.reqProp', ['keep-source']);
3417
3435
  }
3418
3436
  return $xeTable.$nextTick();
3419
3437
  }
@@ -3427,22 +3445,22 @@ const Methods = {
3427
3445
  }
3428
3446
  let reDelFlag = false;
3429
3447
  if (targetRows.length) {
3430
- targetRows.forEach(row => {
3431
- if (!$xeTable.isInsertByRow(row)) {
3432
- const rowid = (0, _util.getRowid)($xeTable, row);
3433
- const oRow = sourceDataRowIdData[rowid];
3434
- if (oRow && row) {
3435
- if (field) {
3436
- _xeUtils.default.set(row, field, _xeUtils.default.clone(_xeUtils.default.get(oRow, field), true));
3437
- } else {
3438
- _xeUtils.default.destructuring(row, _xeUtils.default.clone(oRow, true));
3439
- }
3440
- if ($xeTable.isRemoveByRow(row)) {
3441
- const rowRest = fullAllDataRowIdData[rowid];
3442
- if (rowRest) {
3443
- const reRow = rowRest.row;
3444
- tableFullData.unshift(reRow);
3445
- afterFullData.unshift(reRow);
3448
+ targetRows.forEach(item => {
3449
+ const rowid = (0, _util.getRowid)($xeTable, item);
3450
+ const rowRest = fullAllDataRowIdData[rowid];
3451
+ if (rowRest) {
3452
+ const row = rowRest.row;
3453
+ if (!$xeTable.isInsertByRow(row)) {
3454
+ const oRow = sourceDataRowIdData[rowid];
3455
+ if (oRow && row) {
3456
+ if (field) {
3457
+ _xeUtils.default.set(row, field, _xeUtils.default.clone(_xeUtils.default.get(oRow, field), true));
3458
+ } else {
3459
+ _xeUtils.default.destructuring(row, _xeUtils.default.clone(oRow, true));
3460
+ }
3461
+ if (!fullDataRowIdData[rowid] && $xeTable.isRemoveByRow(row)) {
3462
+ tableFullData.unshift(row);
3463
+ afterFullData.unshift(row);
3446
3464
  reDelFlag = true;
3447
3465
  }
3448
3466
  }
@@ -3630,25 +3648,31 @@ const Methods = {
3630
3648
  },
3631
3649
  /**
3632
3650
  * 检查行或列数据是否发生改变
3633
- * @param {Row} row 行对象
3651
+ * @param {Row} rowOrId 行对象
3634
3652
  * @param {String} field 字段名
3635
3653
  */
3636
- isUpdateByRow(row, field) {
3654
+ isUpdateByRow(rowOrId, field) {
3655
+ const $xeTable = this;
3656
+ const props = $xeTable;
3657
+ const internalData = $xeTable;
3658
+ const {
3659
+ keepSource
3660
+ } = props;
3637
3661
  const {
3638
3662
  tableFullColumn,
3639
- keepSource,
3640
- sourceDataRowIdData,
3641
- fullDataRowIdData
3642
- } = this;
3663
+ fullDataRowIdData,
3664
+ sourceDataRowIdData
3665
+ } = internalData;
3643
3666
  if (keepSource) {
3644
- const rowid = (0, _util.getRowid)(this, row);
3667
+ const rowid = _xeUtils.default.isString(rowOrId) || _xeUtils.default.isNumber(rowOrId) ? rowOrId : (0, _util.getRowid)($xeTable, rowOrId);
3668
+ const rowRest = fullDataRowIdData[rowid];
3645
3669
  // 新增的数据不需要检测
3646
- if (!fullDataRowIdData[rowid]) {
3670
+ if (!rowRest) {
3647
3671
  return false;
3648
3672
  }
3649
- const oldRest = sourceDataRowIdData[rowid];
3650
- if (oldRest) {
3651
- const oRow = oldRest.row;
3673
+ const row = rowRest.row;
3674
+ const oRow = sourceDataRowIdData[rowid];
3675
+ if (oRow) {
3652
3676
  if (arguments.length > 1) {
3653
3677
  return !eqCellValue(oRow, row, field);
3654
3678
  }
@@ -3710,6 +3734,113 @@ const Methods = {
3710
3734
  tableColumn: this.tableColumn.slice(0)
3711
3735
  };
3712
3736
  },
3737
+ /**
3738
+ * 移动列到指定列的位置
3739
+ * @param fieldOrColumn
3740
+ * @param targetFieldOrColumn
3741
+ * @param options
3742
+ */
3743
+ moveColumnTo(fieldOrColumn, targetFieldOrColumn, options) {
3744
+ const $xeTable = this;
3745
+ const internalData = $xeTable;
3746
+ const {
3747
+ fullColumnIdData,
3748
+ visibleColumn
3749
+ } = internalData;
3750
+ const {
3751
+ dragToChild,
3752
+ dragPos,
3753
+ isCrossDrag
3754
+ } = Object.assign({}, options);
3755
+ const dragCol = (0, _util.handleFieldOrColumn)($xeTable, fieldOrColumn);
3756
+ let prevDragCol = null;
3757
+ const colRest = dragCol ? fullColumnIdData[dragCol.id] : null;
3758
+ let defPos = 'left';
3759
+ if (_xeUtils.default.isNumber(targetFieldOrColumn)) {
3760
+ if (colRest && targetFieldOrColumn) {
3761
+ let currList = colRest.items;
3762
+ let offsetIndex = colRest._index + targetFieldOrColumn;
3763
+ if (isCrossDrag) {
3764
+ currList = visibleColumn;
3765
+ offsetIndex = colRest._index + targetFieldOrColumn;
3766
+ }
3767
+ if (offsetIndex > 0 && offsetIndex < currList.length - 1) {
3768
+ prevDragCol = currList[offsetIndex];
3769
+ }
3770
+ if (targetFieldOrColumn > 0) {
3771
+ defPos = 'right';
3772
+ }
3773
+ }
3774
+ } else {
3775
+ prevDragCol = (0, _util.handleFieldOrColumn)($xeTable, targetFieldOrColumn);
3776
+ const targetColRest = prevDragCol ? fullColumnIdData[prevDragCol.id] : null;
3777
+ if (colRest && targetColRest) {
3778
+ if (targetColRest._index > colRest._index) {
3779
+ defPos = 'right';
3780
+ }
3781
+ }
3782
+ }
3783
+ return $xeTable.handleColDragSwapEvent(null, true, dragCol, prevDragCol, dragPos || defPos, dragToChild === true);
3784
+ },
3785
+ /**
3786
+ * 移动行到指定行的位置
3787
+ * @param rowidOrRow
3788
+ * @param targetRowidOrRow
3789
+ * @param options
3790
+ */
3791
+ moveRowTo(rowidOrRow, targetRowidOrRow, options) {
3792
+ const $xeTable = this;
3793
+ const props = $xeTable;
3794
+ const internalData = $xeTable;
3795
+ const {
3796
+ treeConfig
3797
+ } = props;
3798
+ const {
3799
+ fullAllDataRowIdData,
3800
+ afterFullData
3801
+ } = internalData;
3802
+ const {
3803
+ dragToChild,
3804
+ dragPos,
3805
+ isCrossDrag
3806
+ } = Object.assign({}, options);
3807
+ const treeOpts = $xeTable.computeTreeOpts;
3808
+ const dragRow = (0, _util.handleRowidOrRow)($xeTable, rowidOrRow);
3809
+ let prevDragRow = null;
3810
+ let defPos = 'top';
3811
+ const rowRest = dragRow ? fullAllDataRowIdData[(0, _util.getRowid)($xeTable, dragRow)] : null;
3812
+ if (_xeUtils.default.isNumber(targetRowidOrRow)) {
3813
+ if (rowRest && targetRowidOrRow) {
3814
+ let currList = afterFullData;
3815
+ let offsetIndex = rowRest._index + targetRowidOrRow;
3816
+ if (treeConfig) {
3817
+ currList = rowRest.items;
3818
+ if (treeOpts.transform) {
3819
+ offsetIndex = rowRest.treeIndex + targetRowidOrRow;
3820
+ if (isCrossDrag) {
3821
+ currList = afterFullData;
3822
+ offsetIndex = rowRest._index + targetRowidOrRow;
3823
+ }
3824
+ }
3825
+ }
3826
+ if (offsetIndex >= 0 && offsetIndex <= currList.length - 1) {
3827
+ prevDragRow = currList[offsetIndex];
3828
+ }
3829
+ if (targetRowidOrRow > 0) {
3830
+ defPos = 'bottom';
3831
+ }
3832
+ }
3833
+ } else {
3834
+ prevDragRow = (0, _util.handleRowidOrRow)($xeTable, targetRowidOrRow);
3835
+ const targetRowRest = prevDragRow ? fullAllDataRowIdData[(0, _util.getRowid)($xeTable, prevDragRow)] : null;
3836
+ if (rowRest && targetRowRest) {
3837
+ if (targetRowRest._index > rowRest._index) {
3838
+ defPos = 'bottom';
3839
+ }
3840
+ }
3841
+ }
3842
+ return $xeTable.handleRowDragSwapEvent(null, true, dragRow, prevDragRow, dragPos || defPos, dragToChild === true);
3843
+ },
3713
3844
  /**
3714
3845
  * 获取表格的全量列
3715
3846
  */
@@ -3732,16 +3863,26 @@ const Methods = {
3732
3863
  * 用于多选行,获取已选中的数据
3733
3864
  */
3734
3865
  getCheckboxRecords(isFull) {
3866
+ const $xeTable = this;
3867
+ const props = $xeTable;
3868
+ const reactData = $xeTable;
3869
+ const internalData = $xeTable;
3870
+ const {
3871
+ treeConfig
3872
+ } = props;
3873
+ const {
3874
+ selectCheckboxMaps
3875
+ } = reactData;
3735
3876
  const {
3736
3877
  tableFullData,
3737
3878
  afterFullData,
3738
- treeConfig,
3739
- treeOpts,
3740
- checkboxOpts,
3741
- tableFullTreeData,
3742
3879
  afterTreeFullData,
3880
+ tableFullTreeData,
3881
+ fullDataRowIdData,
3743
3882
  afterFullRowMaps
3744
- } = this;
3883
+ } = internalData;
3884
+ const treeOpts = $xeTable.computeTreeOpts;
3885
+ const checkboxOpts = $xeTable.computeCheckboxOpts;
3745
3886
  const {
3746
3887
  transform,
3747
3888
  mapChildrenField
@@ -3750,21 +3891,18 @@ const Methods = {
3750
3891
  checkField
3751
3892
  } = checkboxOpts;
3752
3893
  const childrenField = treeOpts.children || treeOpts.childrenField;
3753
- const currTableData = isFull ? transform ? tableFullTreeData : tableFullData : transform ? afterTreeFullData : afterFullData;
3754
3894
  let rowList = [];
3755
3895
  if (checkField) {
3756
3896
  if (treeConfig) {
3897
+ const currTableData = isFull ? transform ? tableFullTreeData : tableFullData : transform ? afterTreeFullData : afterFullData;
3757
3898
  rowList = _xeUtils.default.filterTree(currTableData, row => _xeUtils.default.get(row, checkField), {
3758
3899
  children: transform ? mapChildrenField : childrenField
3759
3900
  });
3760
3901
  } else {
3902
+ const currTableData = isFull ? tableFullData : afterFullData;
3761
3903
  rowList = currTableData.filter(row => _xeUtils.default.get(row, checkField));
3762
3904
  }
3763
3905
  } else {
3764
- const {
3765
- selectCheckboxMaps,
3766
- fullDataRowIdData
3767
- } = this;
3768
3906
  _xeUtils.default.each(selectCheckboxMaps, (row, rowid) => {
3769
3907
  if (isFull) {
3770
3908
  if (fullDataRowIdData[rowid]) {
@@ -7529,6 +7667,9 @@ const Methods = {
7529
7667
  } = internalData;
7530
7668
  const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
7531
7669
  const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
7670
+ const errRest = {
7671
+ status: false
7672
+ };
7532
7673
  if (prevDragRow && dragRow) {
7533
7674
  // 判断是否有拖动
7534
7675
  if (prevDragRow !== dragRow) {
@@ -7543,7 +7684,7 @@ const Methods = {
7543
7684
  const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
7544
7685
  return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then(status => {
7545
7686
  if (!status) {
7546
- return;
7687
+ return errRest;
7547
7688
  }
7548
7689
  let oafIndex = -1;
7549
7690
  let nafIndex = -1;
@@ -7574,11 +7715,11 @@ const Methods = {
7574
7715
  if (isPeerDrag && !isCrossDrag) {
7575
7716
  if (oldRest.row[parentField] !== newRest.row[parentField]) {
7576
7717
  // 非同级
7577
- return;
7718
+ return errRest;
7578
7719
  }
7579
7720
  } else {
7580
7721
  if (!isCrossDrag) {
7581
- return;
7722
+ return errRest;
7582
7723
  }
7583
7724
  if (oldAllMaps[newRowid]) {
7584
7725
  isSelfToChildStatus = true;
@@ -7589,19 +7730,19 @@ const Methods = {
7589
7730
  content: getI18n('vxe.error.treeDragChild')
7590
7731
  });
7591
7732
  }
7592
- return;
7733
+ return errRest;
7593
7734
  }
7594
7735
  }
7595
7736
  }
7596
7737
  } else if (oldLevel) {
7597
7738
  // 子到根
7598
7739
  if (!isCrossDrag) {
7599
- return;
7740
+ return errRest;
7600
7741
  }
7601
7742
  } else if (newLevel) {
7602
7743
  // 根到子
7603
7744
  if (!isCrossDrag) {
7604
- return;
7745
+ return errRest;
7605
7746
  }
7606
7747
  if (oldAllMaps[newRowid]) {
7607
7748
  isSelfToChildStatus = true;
@@ -7612,7 +7753,7 @@ const Methods = {
7612
7753
  content: getI18n('vxe.error.treeDragChild')
7613
7754
  });
7614
7755
  }
7615
- return;
7756
+ return errRest;
7616
7757
  }
7617
7758
  }
7618
7759
  } else {
@@ -7670,26 +7811,34 @@ const Methods = {
7670
7811
  if (reactData.scrollYLoad) {
7671
7812
  $xeTable.updateScrollYSpace();
7672
7813
  }
7673
- $xeTable.$nextTick().then(() => {
7814
+ if (evnt) {
7815
+ $xeTable.dispatchEvent('row-dragend', {
7816
+ oldRow: dragRow,
7817
+ newRow: prevDragRow,
7818
+ dragRow,
7819
+ dragPos: prevDragPos,
7820
+ dragToChild: isDragToChildFlag,
7821
+ offsetIndex: dragOffsetIndex,
7822
+ _index: {
7823
+ newIndex: nafIndex,
7824
+ oldIndex: oafIndex
7825
+ }
7826
+ }, evnt);
7827
+ }
7828
+ return $xeTable.$nextTick().then(() => {
7674
7829
  $xeTable.updateCellAreas();
7675
7830
  $xeTable.recalculate();
7831
+ }).then(() => {
7832
+ return {
7833
+ status: true
7834
+ };
7676
7835
  });
7677
- $xeTable.dispatchEvent('row-dragend', {
7678
- oldRow: dragRow,
7679
- newRow: prevDragRow,
7680
- dragRow,
7681
- dragPos: prevDragPos,
7682
- dragToChild: isDragToChildFlag,
7683
- offsetIndex: dragOffsetIndex,
7684
- _index: {
7685
- newIndex: nafIndex,
7686
- oldIndex: oafIndex
7687
- }
7688
- }, evnt);
7689
- }).catch(() => {});
7836
+ }).catch(() => {
7837
+ return errRest;
7838
+ });
7690
7839
  }
7691
7840
  }
7692
- return Promise.resolve();
7841
+ return Promise.resolve(errRest);
7693
7842
  },
7694
7843
  handleRowDragDragendEvent(evnt) {
7695
7844
  const $xeTable = this;
@@ -7876,6 +8025,9 @@ const Methods = {
7876
8025
  collectColumn
7877
8026
  } = internalData;
7878
8027
  const dragOffsetIndex = prevDragPos === 'right' ? 1 : 0;
8028
+ const errRest = {
8029
+ status: false
8030
+ };
7879
8031
  if (prevDragCol && dragCol) {
7880
8032
  // 判断是否有拖动
7881
8033
  if (prevDragCol !== dragCol) {
@@ -7892,7 +8044,7 @@ const Methods = {
7892
8044
  const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
7893
8045
  return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then(status => {
7894
8046
  if (!status) {
7895
- return;
8047
+ return errRest;
7896
8048
  }
7897
8049
  let oafIndex = -1;
7898
8050
  let nafIndex = -1;
@@ -7906,11 +8058,11 @@ const Methods = {
7906
8058
  if (isPeerDrag && !isCrossDrag) {
7907
8059
  if (dragColumn.parentId !== newColumn.parentId) {
7908
8060
  // 非同级
7909
- return;
8061
+ return errRest;
7910
8062
  }
7911
8063
  } else {
7912
8064
  if (!isCrossDrag) {
7913
- return;
8065
+ return errRest;
7914
8066
  }
7915
8067
  if (oldAllMaps[newColumn.id]) {
7916
8068
  isSelfToChildStatus = true;
@@ -7921,19 +8073,19 @@ const Methods = {
7921
8073
  content: getI18n('vxe.error.treeDragChild')
7922
8074
  });
7923
8075
  }
7924
- return;
8076
+ return errRest;
7925
8077
  }
7926
8078
  }
7927
8079
  }
7928
8080
  } else if (dragColumn.parentId) {
7929
8081
  // 子到根
7930
8082
  if (!isCrossDrag) {
7931
- return;
8083
+ return errRest;
7932
8084
  }
7933
8085
  } else if (newColumn.parentId) {
7934
8086
  // 根到子
7935
8087
  if (!isCrossDrag) {
7936
- return;
8088
+ return errRest;
7937
8089
  }
7938
8090
  if (oldAllMaps[newColumn.id]) {
7939
8091
  isSelfToChildStatus = true;
@@ -7944,7 +8096,7 @@ const Methods = {
7944
8096
  content: getI18n('vxe.error.treeDragChild')
7945
8097
  });
7946
8098
  }
7947
- return;
8099
+ return errRest;
7948
8100
  }
7949
8101
  }
7950
8102
  } else {
@@ -8013,25 +8165,32 @@ const Methods = {
8013
8165
  $xeTable.clearCopyCellArea();
8014
8166
  }
8015
8167
  }
8016
- $xeTable.dispatchEvent('column-dragend', {
8017
- oldColumn: dragColumn,
8018
- newColumn,
8019
- dragColumn,
8020
- dragPos: prevDragPos,
8021
- dragToChild: isDragToChildFlag,
8022
- offsetIndex: dragOffsetIndex,
8023
- _index: {
8024
- newIndex: nafIndex,
8025
- oldIndex: oafIndex
8026
- }
8027
- }, evnt);
8168
+ if (evnt) {
8169
+ $xeTable.dispatchEvent('column-dragend', {
8170
+ oldColumn: dragColumn,
8171
+ newColumn,
8172
+ dragColumn,
8173
+ dragPos: prevDragPos,
8174
+ dragToChild: isDragToChildFlag,
8175
+ offsetIndex: dragOffsetIndex,
8176
+ _index: {
8177
+ newIndex: nafIndex,
8178
+ oldIndex: oafIndex
8179
+ }
8180
+ }, evnt);
8181
+ }
8028
8182
  if (isSyncColumn) {
8029
8183
  $xeTable.handleColDragSwapColumn();
8030
8184
  }
8031
- }).catch(() => {});
8185
+ return {
8186
+ status: true
8187
+ };
8188
+ }).catch(() => {
8189
+ return errRest;
8190
+ });
8032
8191
  }
8033
8192
  }
8034
- return Promise.resolve();
8193
+ return Promise.resolve(errRest);
8035
8194
  },
8036
8195
  handleHeaderCellDragDragendEvent(evnt) {
8037
8196
  const $xeTable = this;