From 9e26edb62c5f89eadc47037e15bb8a88da29a5a4 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Thu, 26 Mar 2020 17:52:49 +0800 Subject: [PATCH] route --- .../components/performance/plan/EditPerformanceTestPlan.vue | 4 ++++ .../performance/plan/components/PerformanceAdvancedConfig.vue | 4 ++-- .../performance/plan/components/PerformancePressureConfig.vue | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/src/business/components/performance/plan/EditPerformanceTestPlan.vue b/frontend/src/business/components/performance/plan/EditPerformanceTestPlan.vue index a76ec27387..84d55c223a 100644 --- a/frontend/src/business/components/performance/plan/EditPerformanceTestPlan.vue +++ b/frontend/src/business/components/performance/plan/EditPerformanceTestPlan.vue @@ -82,6 +82,10 @@ return; } + if (to.name !== 'editPerTest') { + return; + } + let testId = to.path.split('/')[4]; // find testId if (testId) { this.result = this.$get('/testplan/get/' + testId, response => { diff --git a/frontend/src/business/components/performance/plan/components/PerformanceAdvancedConfig.vue b/frontend/src/business/components/performance/plan/components/PerformanceAdvancedConfig.vue index 716b23fea9..fd0d714d1a 100644 --- a/frontend/src/business/components/performance/plan/components/PerformanceAdvancedConfig.vue +++ b/frontend/src/business/components/performance/plan/components/PerformanceAdvancedConfig.vue @@ -218,8 +218,8 @@ } }, watch: { - '$route'(to, from) { - if (from.name !== 'createPerTest' && from.name !== 'editPerTest') { + '$route'(to) { + if (to.name !== 'createPerTest' && to.name !== 'editPerTest') { return; } let testId = to.path.split('/')[4]; diff --git a/frontend/src/business/components/performance/plan/components/PerformancePressureConfig.vue b/frontend/src/business/components/performance/plan/components/PerformancePressureConfig.vue index 07b08f2d8f..be8ffb0314 100644 --- a/frontend/src/business/components/performance/plan/components/PerformancePressureConfig.vue +++ b/frontend/src/business/components/performance/plan/components/PerformancePressureConfig.vue @@ -131,8 +131,8 @@ this.getResourcePools(); }, watch: { - '$route'(to, from) { - if (from.name !== 'createPerTest' && from.name !== 'editPerTest') { + '$route'(to) { + if (to.name !== 'createPerTest' && to.name !== 'editPerTest') { return; } let testId = to.path.split('/')[4];