From bcca3c5858e0eaad2e34b2e6875be6adbe20b906 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Thu, 9 Apr 2020 09:42:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E9=94=AE=E7=94=9F=E6=88=90=E5=AE=9E?= =?UTF-8?q?=E8=AE=AD=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/lesson/trainingmanage/index.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/views/lesson/trainingmanage/index.vue b/src/views/lesson/trainingmanage/index.vue index 1dd7285af..b42e24814 100644 --- a/src/views/lesson/trainingmanage/index.vue +++ b/src/views/lesson/trainingmanage/index.vue @@ -47,6 +47,7 @@ export default { ControlConvertMenu: [], TrainWindow: [] }, + isLeaving:false, trainingTypeMap: {}, pagerConfig: { pageSize: 'pageSize', @@ -173,6 +174,9 @@ export default { mounted() { this.interCheckGenerateStatus(); }, + beforeDestroy() { + this.isLeaving = true; + }, methods: { async loadInitData(queryData) { this.mapIdList = []; @@ -223,11 +227,15 @@ export default { this.queryList.actions.push({ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:false }); } setTimeout(() => { - this.interCheckGenerateStatus(this.$route.query.mapId, false); + if (!this.isLeaving) { + this.interCheckGenerateStatus(this.$route.query.mapId, false); + } }, 30000); }).catch(()=>{ setTimeout(() => { - this.interCheckGenerateStatus(this.$route.query.mapId, false); + if (!this.isLeaving) { + this.interCheckGenerateStatus(this.$route.query.mapId, false); + } }, 30000); }); },