diff --git a/frontend/src/business/components/api/automation/report/ApiReportDetail.vue b/frontend/src/business/components/api/automation/report/ApiReportDetail.vue index b5d5d9a2be..9ce9d81ae8 100644 --- a/frontend/src/business/components/api/automation/report/ApiReportDetail.vue +++ b/frontend/src/business/components/api/automation/report/ApiReportDetail.vue @@ -540,13 +540,19 @@ export default { }, exportReportReset() { this.$router.go(0); - } + }, + handleProjectChange() { + this.$router.push('/api/automation/report'); + }, }, created() { this.getReport(); + this.$EventBus.$on('projectChange', this.handleProjectChange); + }, + destroyed () { + this.$EventBus.$off('projectChange', this.handleProjectChange); }, - computed: { path() { return "/api/test/edit?id=" + this.report.testId; diff --git a/frontend/src/business/components/performance/report/PerformanceReportView.vue b/frontend/src/business/components/performance/report/PerformanceReportView.vue index bf153a60da..9f6f9afadb 100644 --- a/frontend/src/business/components/performance/report/PerformanceReportView.vue +++ b/frontend/src/business/components/performance/report/PerformanceReportView.vue @@ -491,7 +491,12 @@ export default { } } localStorage.setItem("reportRefreshTime", this.refreshTime); - } + }, + handleProjectChange() { + if (this.$route.name === 'perReportView') { + this.$router.push('/performance/report/all'); + } + }, }, created() { this.isReadOnly = !hasPermission('PROJECT_PERFORMANCE_REPORT:READ+DELETE'); @@ -500,6 +505,10 @@ export default { this.reportId = this.perReportId; } this.getReport(this.reportId); + this.$EventBus.$on('projectChange', this.handleProjectChange); + }, + destroyed () { + this.$EventBus.$off('projectChange', this.handleProjectChange); }, watch: { '$route'(to) { diff --git a/frontend/src/business/components/performance/test/EditPerformanceTest.vue b/frontend/src/business/components/performance/test/EditPerformanceTest.vue index 540f613735..8b4f4f282a 100644 --- a/frontend/src/business/components/performance/test/EditPerformanceTest.vue +++ b/frontend/src/business/components/performance/test/EditPerformanceTest.vue @@ -184,6 +184,10 @@ export default { if (hasLicense()) { this.getVersionHistory(); } + this.$EventBus.$on('projectChange', this.handleProjectChange); + }, + destroyed () { + this.$EventBus.$off('projectChange', this.handleProjectChange); }, mounted() { this.importAPITest(); @@ -619,7 +623,12 @@ export default { } } }); - } + }, + handleProjectChange() { + if (this.$route.name === 'editPerTest') { + this.$router.push('/performance/test/all'); + } + }, } };