fix: 切换项目测试计划和评审详情页面不更新
This commit is contained in:
parent
5f2ef8198f
commit
7dc83a4591
|
@ -97,6 +97,8 @@ export default {
|
|||
this.$post("/user/update/current", {id: this.userId, lastProjectId: projectId}, (response) => {
|
||||
saveLocalStorage(response);
|
||||
this.currentProjectId = projectId;
|
||||
|
||||
this.$EventBus.$emit('projectChange');
|
||||
// 刷新路由
|
||||
this.reload();
|
||||
|
||||
|
|
|
@ -86,6 +86,13 @@ export default {
|
|||
this.getTestPlans();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$EventBus.$on('projectChange', () => {
|
||||
if (this.$route.name === 'planView') {
|
||||
this.$router.push('/track/plan/all');
|
||||
}
|
||||
});
|
||||
},
|
||||
mounted() {
|
||||
this.getTestPlans();
|
||||
},
|
||||
|
|
|
@ -83,6 +83,13 @@ export default {
|
|||
return `var(--primary_color)`
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$EventBus.$on('projectChange', () => {
|
||||
if (this.$route.name === 'testCaseReviewView') {
|
||||
this.$router.push('/track/review/all');
|
||||
}
|
||||
});
|
||||
},
|
||||
mounted() {
|
||||
this.initData();
|
||||
this.openTestCaseEdit(this.$route.path);
|
||||
|
|
|
@ -76,7 +76,10 @@ Vue.directive('preventReClick', {
|
|||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// 添加全局事件总线
|
||||
Vue.prototype.$EventBus = new Vue();
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
|
|
Loading…
Reference in New Issue