From fe1e2aff7ecd92094d3d24392937b5eaf73a5e63 Mon Sep 17 00:00:00 2001 From: "luoJunYong.123" Date: Thu, 2 Dec 2021 18:05:49 +0800 Subject: [PATCH] 12.2 --- src/pages/match/manage/index.vue | 33 ++++++++++-------------- src/pages/match/manage/matchProgress.vue | 27 +++++++++++-------- src/store/modules/match.js | 6 ++++- 3 files changed, 35 insertions(+), 31 deletions(-) diff --git a/src/pages/match/manage/index.vue b/src/pages/match/manage/index.vue index 8a1f7ff..88e41d4 100644 --- a/src/pages/match/manage/index.vue +++ b/src/pages/match/manage/index.vue @@ -25,6 +25,7 @@ import MatchDetail from "./matchDetail"; import MatchProgress from "./matchProgress"; import MatchSignup from "./matchSignup"; +import EventBus from "@/libs/bus.js"; export default { name: "matchManage", @@ -44,35 +45,29 @@ export default { MatchSignup }, created() { - + EventBus.$on("tabChangeWait", (waitIndex) => { + this.tabChange(waitIndex) + }); + }, + beforeDestroy() { + // EventBus.$off() }, methods: { goBack() { this.$router.back(); }, tabChange(index) { - console.log('changewait?') - console.log(this.wait) - // this.active = index; - if(!this.wait) { + this.$store.commit("match/setWaitIndex", index); + if(!(this.wait !== 999)) { this.active = index; }else { - sessionStorage.setItem('tabIndex', index) + EventBus.$emit("tabClickWait", this.wait); + this.$store.commit("match/setWait", 999); } }, - tabChangeWait() { - tabChange(sessionStorage.setItem('tabIndex', index)) - }, - beforeLeave(newTab, oldTab) { - console.log(newTab) - console.log(oldTab) - // if(sessionStorage.getItem('wait')) { - // this.$confirm('暂未保存,是否保存本次编辑?', '提示', { - // confirmButtonText: '确定', - // cancelButtonText: '取消', - // type: 'warning' - // }) - // } + tabChangeWait(index) { + this.tabChange(index) + // tabChange(sessionStorage.setItem('tabIndex', fromIndex)) } }, computed: { diff --git a/src/pages/match/manage/matchProgress.vue b/src/pages/match/manage/matchProgress.vue index 65a9aad..56e44ac 100644 --- a/src/pages/match/manage/matchProgress.vue +++ b/src/pages/match/manage/matchProgress.vue @@ -9,18 +9,18 @@ @@ -40,6 +40,7 @@