@tongfun/tf-widget 0.1.154 → 0.1.155
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
CHANGED
|
@@ -141073,16 +141073,20 @@ async function initColumnDrag(el, binding, vNode) {
|
|
|
141073
141073
|
oldIndex
|
|
141074
141074
|
}) => {
|
|
141075
141075
|
const {
|
|
141076
|
-
collectColumn
|
|
141077
|
-
|
|
141076
|
+
collectColumn,
|
|
141077
|
+
tableColumn
|
|
141078
|
+
} = tableInstance.getTableColumn(); // 转换真实索引
|
|
141078
141079
|
|
|
141079
|
-
|
|
141080
|
+
const oldColumnIndex = tableInstance.getColumnIndex(tableColumn[oldIndex]);
|
|
141081
|
+
const newColumnIndex = tableInstance.getColumnIndex(tableColumn[newIndex]);
|
|
141082
|
+
|
|
141083
|
+
if (newColumnIndex === oldColumnIndex) {
|
|
141080
141084
|
return;
|
|
141081
141085
|
} // 移动到目标列
|
|
141082
141086
|
|
|
141083
141087
|
|
|
141084
|
-
const currRow = collectColumn.splice(
|
|
141085
|
-
collectColumn.splice(
|
|
141088
|
+
const currRow = collectColumn.splice(oldColumnIndex, 1)[0];
|
|
141089
|
+
collectColumn.splice(newColumnIndex, 0, currRow);
|
|
141086
141090
|
tableInstance.loadColumn(collectColumn); // 配置更新
|
|
141087
141091
|
|
|
141088
141092
|
columnChange(el, binding, vNode);
|
package/lib/tf-widget.umd.js
CHANGED
|
@@ -141083,16 +141083,20 @@ async function initColumnDrag(el, binding, vNode) {
|
|
|
141083
141083
|
oldIndex
|
|
141084
141084
|
}) => {
|
|
141085
141085
|
const {
|
|
141086
|
-
collectColumn
|
|
141087
|
-
|
|
141086
|
+
collectColumn,
|
|
141087
|
+
tableColumn
|
|
141088
|
+
} = tableInstance.getTableColumn(); // 转换真实索引
|
|
141088
141089
|
|
|
141089
|
-
|
|
141090
|
+
const oldColumnIndex = tableInstance.getColumnIndex(tableColumn[oldIndex]);
|
|
141091
|
+
const newColumnIndex = tableInstance.getColumnIndex(tableColumn[newIndex]);
|
|
141092
|
+
|
|
141093
|
+
if (newColumnIndex === oldColumnIndex) {
|
|
141090
141094
|
return;
|
|
141091
141095
|
} // 移动到目标列
|
|
141092
141096
|
|
|
141093
141097
|
|
|
141094
|
-
const currRow = collectColumn.splice(
|
|
141095
|
-
collectColumn.splice(
|
|
141098
|
+
const currRow = collectColumn.splice(oldColumnIndex, 1)[0];
|
|
141099
|
+
collectColumn.splice(newColumnIndex, 0, currRow);
|
|
141096
141100
|
tableInstance.loadColumn(collectColumn); // 配置更新
|
|
141097
141101
|
|
|
141098
141102
|
columnChange(el, binding, vNode);
|