From afbe83a8a5df872f099c1d38cf1e46e411346951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E7=8E=B2?= <8702040+cai-ling@user.noreply.gitee.com> Date: Mon, 11 Nov 2024 13:25:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/index.vue | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/pages/index.vue b/src/pages/index.vue index 510b8ea..87422df 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -142,6 +142,7 @@ export default { }, data () { return { + timer: null, options1: [], sCode: '', nCode: '', @@ -176,9 +177,15 @@ export default { mounted () { this._queryAllPoints() this._queryMaterials() - this._queryAreas() + // this._queryAreas() + this.refresh() this._queryTaskIds() }, + beforeDestroy () { + if (this.timer !== null) { + clearInterval(this.timer) + } + }, methods: { back () { let flag = !!(document.fullscreenElement || document.mozFullscreenElement || document.webkitFullscreenElement || document.msFullscreenElement) @@ -195,6 +202,12 @@ export default { } this.$router.push('/setup') }, + refresh () { + this._queryAreas() + this.timer = setInterval(() => { + this._queryAreas() + }, 3000) + }, async _queryAllPoints () { let res = await queryAllPoints() this.options1 = [...res]