@tongfun/tf-widget 0.1.154 → 0.1.156

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.
@@ -141068,21 +141068,25 @@ async function initColumnDrag(el, binding, vNode) {
141068
141068
  handle: '.elx-header--column:not(.col--fixed)',
141069
141069
  ghostClass: 'dragColbg',
141070
141070
  chosenClass: 'dragColbg',
141071
- onEnd: ({
141071
+ onEnd: async ({
141072
141072
  newIndex,
141073
141073
  oldIndex
141074
141074
  }) => {
141075
- const {
141076
- collectColumn
141077
- } = tableInstance.getTableColumn();
141078
-
141079
141075
  if (newIndex === oldIndex) {
141080
141076
  return;
141081
- } // 移动到目标列
141082
-
141077
+ }
141083
141078
 
141084
- const currRow = collectColumn.splice(oldIndex, 1)[0];
141085
- collectColumn.splice(newIndex, 0, currRow);
141079
+ const {
141080
+ collectColumn
141081
+ } = tableInstance.getTableColumn();
141082
+ const newColumns = collectColumn.filter(item => item.visible);
141083
+ const oldProperty = newColumns[oldIndex].property;
141084
+ const newProperty = newColumns[newIndex].property;
141085
+ const oldMoveIndex = collectColumn.findIndex(d => d.property === oldProperty);
141086
+ const newMoveIndex = collectColumn.findIndex(d => d.property === newProperty); // 移动到目标列
141087
+
141088
+ const currRow = collectColumn.splice(oldMoveIndex, 1)[0];
141089
+ collectColumn.splice(newMoveIndex, 0, currRow);
141086
141090
  tableInstance.loadColumn(collectColumn); // 配置更新
141087
141091
 
141088
141092
  columnChange(el, binding, vNode);
@@ -141078,21 +141078,25 @@ async function initColumnDrag(el, binding, vNode) {
141078
141078
  handle: '.elx-header--column:not(.col--fixed)',
141079
141079
  ghostClass: 'dragColbg',
141080
141080
  chosenClass: 'dragColbg',
141081
- onEnd: ({
141081
+ onEnd: async ({
141082
141082
  newIndex,
141083
141083
  oldIndex
141084
141084
  }) => {
141085
- const {
141086
- collectColumn
141087
- } = tableInstance.getTableColumn();
141088
-
141089
141085
  if (newIndex === oldIndex) {
141090
141086
  return;
141091
- } // 移动到目标列
141092
-
141087
+ }
141093
141088
 
141094
- const currRow = collectColumn.splice(oldIndex, 1)[0];
141095
- collectColumn.splice(newIndex, 0, currRow);
141089
+ const {
141090
+ collectColumn
141091
+ } = tableInstance.getTableColumn();
141092
+ const newColumns = collectColumn.filter(item => item.visible);
141093
+ const oldProperty = newColumns[oldIndex].property;
141094
+ const newProperty = newColumns[newIndex].property;
141095
+ const oldMoveIndex = collectColumn.findIndex(d => d.property === oldProperty);
141096
+ const newMoveIndex = collectColumn.findIndex(d => d.property === newProperty); // 移动到目标列
141097
+
141098
+ const currRow = collectColumn.splice(oldMoveIndex, 1)[0];
141099
+ collectColumn.splice(newMoveIndex, 0, currRow);
141096
141100
  tableInstance.loadColumn(collectColumn); // 配置更新
141097
141101
 
141098
141102
  columnChange(el, binding, vNode);