From 755b29130979fa4253fa9ca4f42dcf8630ea9acf Mon Sep 17 00:00:00 2001 From: "luoJunYong.123" Date: Fri, 3 Dec 2021 17:03:04 +0800 Subject: [PATCH] back_on_before_page --- src/pages/achievement/ass/index.vue | 16 +++++++++++++--- src/pages/achievement/teach/index.vue | 2 +- src/pages/assessment/list/index.vue | 3 ++- src/pages/match/manage/index.vue | 3 ++- src/router/index.js | 3 ++- 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/pages/achievement/ass/index.vue b/src/pages/achievement/ass/index.vue index f708e6d..6164da1 100644 --- a/src/pages/achievement/ass/index.vue +++ b/src/pages/achievement/ass/index.vue @@ -106,18 +106,26 @@ export default { token: util.local.get(Setting.tokenKey), }; }, - mounted() { + created() { + this.getData(); this.classInfo = JSON.parse(this.$route.query.classInfo) for(var i=0;i item.id === activeName2)) { + this.classId = activeName2 + this.activeName = activeName2 + }else { + this.classId = this.classInfo[0].id; + this.activeName = this.classInfo[0].id; + } this.id = this.$route.query.id - this.getData(); }, methods: { handleClick(tab, event) { + sessionStorage.setItem('activeName2', tab.name) this.getData() }, getData() { @@ -146,6 +154,8 @@ export default { } }, show(row) { + // console.log(row) + if (this.systemId == 2) { this.$router.push(`showexperimentOption?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`); } else if (this.systemId == 3) { diff --git a/src/pages/achievement/teach/index.vue b/src/pages/achievement/teach/index.vue index ee8cec7..3627c86 100644 --- a/src/pages/achievement/teach/index.vue +++ b/src/pages/achievement/teach/index.vue @@ -115,7 +115,7 @@ export default { created() { this.classList = JSON.parse(this.$route.query.classList); const activeName = sessionStorage.getItem('activeName') - if(activeName) { + if(activeName && this.classList.some(item => item.id === activeName)) { this.classId = activeName this.activeName = activeName }else { diff --git a/src/pages/assessment/list/index.vue b/src/pages/assessment/list/index.vue index 19c885d..13e2c05 100644 --- a/src/pages/assessment/list/index.vue +++ b/src/pages/assessment/list/index.vue @@ -236,8 +236,9 @@ export default { beginTimer() { this.ticker = setInterval(() => { if(this.sss == 0){ - this.ticker = null; + clearInterval(this.ticker); + this.ticker = null; }else{ for (let i = 0; i < this.listData.length; i++) { const item = this.listData[i]; diff --git a/src/pages/match/manage/index.vue b/src/pages/match/manage/index.vue index 88e41d4..2a18e47 100644 --- a/src/pages/match/manage/index.vue +++ b/src/pages/match/manage/index.vue @@ -50,7 +50,8 @@ export default { }); }, beforeDestroy() { - // EventBus.$off() + // 关闭所以EventBus事件 + EventBus.$off() }, methods: { goBack() { diff --git a/src/router/index.js b/src/router/index.js index 9f78cfe..f0c8967 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -267,7 +267,8 @@ router.beforeEach(function(to, from, next) { } } // 根据路由元信息设置文档标题 - window.document.title = to.meta.title ? to.meta.title : ""; + // window.document.title = to.meta.title ? to.meta.title : ""; + window.document.title = "教师管理端" next(); }); \ No newline at end of file