From a4662753702c0a8702257f13a5e350ab68e51ec7 Mon Sep 17 00:00:00 2001 From: caill <815519168@qq.com> Date: Tue, 20 Sep 2022 14:45:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B7=E6=96=B0=E5=88=86=E6=8B=A3=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/proj/SortingManage.vue | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) 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) }