Commit 4506e6e3 authored by 仇晓婷's avatar 仇晓婷

设置工艺拖拽

parent 57d0a002
......@@ -25,6 +25,8 @@
ref="selection"
:columns="columns"
:data="data1"
:draggable="true"
@on-drag-drop="onDragDrop"
@on-selection-change="selectInfo"
></Table>
</Content>
......@@ -190,6 +192,27 @@ export default {
this.getData();
},
methods: {
onDragDrop(first, end) {
//转成int型,方便后续使用
first = parseInt(first);
end = parseInt(end);
let tmp = this.data1[first];
if (first < end) {
for (var i = first + 1; i <= end; i++) {
this.data1.splice(i - 1, 1, this.data1[i]);
}
this.data1.splice(end, 1, tmp);
}
if (first > end) {
for (var i = first; i > end; i--) {
this.data1.splice(i, 1, this.data1[i - 1]);
}
this.data1.splice(end, 1, tmp);
}
},
getData() {
let conditions = [
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment