|
|
@@ -194,22 +194,27 @@ export default {
|
|
|
};
|
|
|
if (node.previousSibling) {
|
|
|
this.loading = true;
|
|
|
+ let sort0 = node.previousSibling.data.sort,
|
|
|
+ sort1 = node.data.sort;
|
|
|
Promise.all([
|
|
|
this.$http.post("/menu/save", {
|
|
|
...node.data,
|
|
|
children: null,
|
|
|
- sort: node.previousSibling.data.sort
|
|
|
+ sort: sort0
|
|
|
}),
|
|
|
this.$http.post("/menu/save", {
|
|
|
...node.previousSibling.data,
|
|
|
children: null,
|
|
|
- sort: node.data.sort
|
|
|
+ sort: sort1
|
|
|
})
|
|
|
])
|
|
|
.then(_ => {
|
|
|
this.loading = false;
|
|
|
- let tmp = { ...node.previousSibling.data };
|
|
|
- node.previousSibling.data = { ...node.data };
|
|
|
+ let tmp = { ...node.previousSibling.data, sort: sort1 };
|
|
|
+ node.previousSibling.data = {
|
|
|
+ ...node.data,
|
|
|
+ sort: sort0
|
|
|
+ };
|
|
|
node.data = tmp;
|
|
|
})
|
|
|
.catch(e => {
|
|
|
@@ -231,22 +236,24 @@ export default {
|
|
|
};
|
|
|
if (node.nextSibling) {
|
|
|
this.loading = true;
|
|
|
+ let sort0 = node.data.sort,
|
|
|
+ sort1 = node.nextSibling.data.sort;
|
|
|
Promise.all([
|
|
|
this.$http.post("/menu/save", {
|
|
|
...node.data,
|
|
|
children: null,
|
|
|
- sort: node.nextSibling.data.sort
|
|
|
+ sort: sort1
|
|
|
}),
|
|
|
this.$http.post("/menu/save", {
|
|
|
...node.nextSibling.data,
|
|
|
children: null,
|
|
|
- sort: node.data.sort
|
|
|
+ sort: sort0
|
|
|
})
|
|
|
])
|
|
|
.then(_ => {
|
|
|
this.loading = false;
|
|
|
- let tmp = { ...node.nextSibling.data };
|
|
|
- node.nextSibling.data = { ...node.data };
|
|
|
+ let tmp = { ...node.nextSibling.data, sort: sort1 };
|
|
|
+ node.nextSibling.data = { ...node.data, sort: sort0 };
|
|
|
node.data = tmp;
|
|
|
})
|
|
|
.catch(e => {
|