Skip to content

Commit

Permalink
bug of sort items
Browse files Browse the repository at this point in the history
  • Loading branch information
star7th committed Apr 18, 2021
1 parent 6baf516 commit 49940d3
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions web_src/src/components/item/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -499,25 +499,10 @@ export default {
}
})
},
exchangeArray(data, oldIndex, newIndex) {
let tmp = data[oldIndex]
data.splice(oldIndex, 1)
data.splice(newIndex, 0, tmp)
return data
},
endMove(evt) {
let data = {}
let list = this.exchangeArray(
this.itemList,
evt['oldIndex'],
evt['newIndex']
)
this.itemList = []
this.$nextTick(() => {
this.itemList = list
})
for (var i = 0; i < list.length; i++) {
let key = list[i]['item_id']
for (var i = 0; i < this.itemList.length; i++) {
let key = this.itemList[i]['item_id']
data[key] = i + 1
}
this.sort_item(data)
Expand Down

0 comments on commit 49940d3

Please sign in to comment.