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: {