@tongfun/tf-widget 0.1.155 → 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.
- package/lib/tf-widget.common.js +14 -14
- package/lib/tf-widget.umd.js +14 -14
- package/lib/tf-widget.umd.min.js +1 -1
- package/package.json +1 -1
package/lib/tf-widget.common.js
CHANGED
|
@@ -141068,25 +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
|
-
|
|
141076
|
-
collectColumn,
|
|
141077
|
-
tableColumn
|
|
141078
|
-
} = tableInstance.getTableColumn(); // 转换真实索引
|
|
141079
|
-
|
|
141080
|
-
const oldColumnIndex = tableInstance.getColumnIndex(tableColumn[oldIndex]);
|
|
141081
|
-
const newColumnIndex = tableInstance.getColumnIndex(tableColumn[newIndex]);
|
|
141082
|
-
|
|
141083
|
-
if (newColumnIndex === oldColumnIndex) {
|
|
141075
|
+
if (newIndex === oldIndex) {
|
|
141084
141076
|
return;
|
|
141085
|
-
}
|
|
141086
|
-
|
|
141077
|
+
}
|
|
141087
141078
|
|
|
141088
|
-
const
|
|
141089
|
-
|
|
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);
|
|
141090
141090
|
tableInstance.loadColumn(collectColumn); // 配置更新
|
|
141091
141091
|
|
|
141092
141092
|
columnChange(el, binding, vNode);
|
package/lib/tf-widget.umd.js
CHANGED
|
@@ -141078,25 +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
|
-
|
|
141086
|
-
collectColumn,
|
|
141087
|
-
tableColumn
|
|
141088
|
-
} = tableInstance.getTableColumn(); // 转换真实索引
|
|
141089
|
-
|
|
141090
|
-
const oldColumnIndex = tableInstance.getColumnIndex(tableColumn[oldIndex]);
|
|
141091
|
-
const newColumnIndex = tableInstance.getColumnIndex(tableColumn[newIndex]);
|
|
141092
|
-
|
|
141093
|
-
if (newColumnIndex === oldColumnIndex) {
|
|
141085
|
+
if (newIndex === oldIndex) {
|
|
141094
141086
|
return;
|
|
141095
|
-
}
|
|
141096
|
-
|
|
141087
|
+
}
|
|
141097
141088
|
|
|
141098
|
-
const
|
|
141099
|
-
|
|
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);
|
|
141100
141100
|
tableInstance.loadColumn(collectColumn); // 配置更新
|
|
141101
141101
|
|
|
141102
141102
|
columnChange(el, binding, vNode);
|