diff --git a/src/pages/proj/SortingManage.vue b/src/pages/proj/SortingManage.vue index ccd60b7..cbfe3f3 100644 --- a/src/pages/proj/SortingManage.vue +++ b/src/pages/proj/SortingManage.vue @@ -111,6 +111,8 @@ export default { }, data () { return { + interTime: this.$store.getters.setTime, + timer: null, dataList: [], newList: [], pkId: '', @@ -127,9 +129,19 @@ export default { } }, created () { - this.sortingOrder() + this.refresh() + }, + beforeDestroy () { + clearInterval(this.timer) + this.timer = null }, methods: { + refresh () { + this.sortingOrder() + this.timer = setInterval(() => { + this.sortingOrder() + }, this.interTime) + }, showSec (e, i) { e.childShow = !e.childShow if (e.childShow) { @@ -168,6 +180,9 @@ export default { let res = await sendMessage(type, uuid, ouuid) if (res.code === '1') { this.toast(res.desc) + clearInterval(this.timer) + this.timer = null + this.refresh() } else { this.Dialog(res.desc) } @@ -201,6 +216,9 @@ export default { let res = await deviceOperation(type) if (res.code === '1') { this.toast(res.desc) + clearInterval(this.timer) + this.timer = null + this.refresh() } else { this.Dialog(res.desc) } @@ -238,6 +256,9 @@ export default { let res = await orderOperation(type, uuid, ouuid) if (res.code === '1') { this.toast(res.desc) + clearInterval(this.timer) + this.timer = null + this.refresh() } else { this.Dialog(res.desc) }