From 115823f739cefeb60965ea1265d523a80f205cf9 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Wed, 25 Mar 2020 10:51:41 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=B5=84=E6=BA=90=E6=B1=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/request/testplan/TestPlanRequest.java | 9 +++++++++ .../java/io/metersphere/service/LoadTestService.java | 2 ++ .../plan/components/PerformancePressureConfig.vue | 8 ++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/controller/request/testplan/TestPlanRequest.java b/backend/src/main/java/io/metersphere/controller/request/testplan/TestPlanRequest.java index db45afdcfd..7ac76b577a 100644 --- a/backend/src/main/java/io/metersphere/controller/request/testplan/TestPlanRequest.java +++ b/backend/src/main/java/io/metersphere/controller/request/testplan/TestPlanRequest.java @@ -24,6 +24,8 @@ public class TestPlanRequest { private String schedule; + private String testResourcePoolId; + private static final long serialVersionUID = 1L; @@ -115,4 +117,11 @@ public class TestPlanRequest { this.schedule = schedule == null ? null : schedule.trim(); } + public String getTestResourcePoolId() { + return testResourcePoolId; + } + + public void setTestResourcePoolId(String testResourcePoolId) { + this.testResourcePoolId = testResourcePoolId; + } } diff --git a/backend/src/main/java/io/metersphere/service/LoadTestService.java b/backend/src/main/java/io/metersphere/service/LoadTestService.java index 16e8859f91..0a6e7369b9 100644 --- a/backend/src/main/java/io/metersphere/service/LoadTestService.java +++ b/backend/src/main/java/io/metersphere/service/LoadTestService.java @@ -87,6 +87,7 @@ public class LoadTestService { loadTest.setUpdateTime(System.currentTimeMillis()); loadTest.setScenarioDefinition("todo"); loadTest.setDescription("todo"); + loadTest.setTestResourcePoolId(request.getTestResourcePoolId()); loadTest.setLoadConfiguration(request.getLoadConfiguration()); loadTest.setAdvancedConfiguration(request.getAdvancedConfiguration()); loadTestMapper.insert(loadTest); @@ -153,6 +154,7 @@ public class LoadTestService { loadTest.setDescription("todo"); loadTest.setLoadConfiguration(request.getLoadConfiguration()); loadTest.setAdvancedConfiguration(request.getAdvancedConfiguration()); + loadTest.setTestResourcePoolId(request.getTestResourcePoolId()); loadTestMapper.updateByPrimaryKeySelective(loadTest); } diff --git a/frontend/src/business/components/performance/plan/components/PerformancePressureConfig.vue b/frontend/src/business/components/performance/plan/components/PerformancePressureConfig.vue index 260faa70ae..b12cc3d6ce 100644 --- a/frontend/src/business/components/performance/plan/components/PerformancePressureConfig.vue +++ b/frontend/src/business/components/performance/plan/components/PerformancePressureConfig.vue @@ -107,9 +107,9 @@ export default { name: "PerformancePressureConfig", + props: ['testPlan'], data() { return { - testPlan: {}, threadNumber: 10, duration: 10, rampUpTime: 10, @@ -127,7 +127,7 @@ } else { this.calculateChart(); } - + this.resourcePool = this.testPlan.testResourcePoolId; this.getResourcePools(); }, watch: { @@ -141,6 +141,10 @@ } else { this.calculateChart(); } + }, + testPlan(n) { + this.resourcePool = n.testResourcePoolId; + window.console.log(this.resourcePool); } }, methods: {