From 532007f25d23f04532e0ee9b3f854c72199ba6a3 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Fri, 26 Feb 2021 18:24:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96):=20=E5=9C=BA=E6=99=AF=E6=AD=A5=E9=AA=A4=E8=B7=A8?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=B7=BB=E5=8A=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/service/ApiDefinitionService.java | 8 +- .../automation/scenario/ApiScenarioModule.vue | 4 +- .../automation/scenario/api/ApiRelevance.vue | 149 ++++++++++-------- .../scenario/api/RelevanceApiList.vue | 9 +- .../scenario/api/RelevanceCaseList.vue | 9 +- .../scenario/api/ScenarioRelevance.vue | 6 +- .../scenario/component/ApiComponent.vue | 5 +- .../api/definition/components/Run.vue | 2 +- .../components/module/ApiModule.vue | 4 +- .../comonents/base/TestCaseRelevanceBase.vue | 8 +- 10 files changed, 116 insertions(+), 88 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index 7ee46aa7a1..cc58b14e73 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -437,11 +437,9 @@ public class ApiDefinitionService { Map envConfig = new HashMap<>(); Map map = request.getEnvironmentMap(); if (map != null && map.size() > 0) { - map.keySet().forEach(id -> { - ApiTestEnvironmentWithBLOBs environment = environmentService.get(map.get(id)); - EnvironmentConfig env = JSONObject.parseObject(environment.getConfig(), EnvironmentConfig.class); - envConfig.put(id, env); - }); + ApiTestEnvironmentWithBLOBs environment = environmentService.get(map.get(request.getProjectId())); + EnvironmentConfig env = JSONObject.parseObject(environment.getConfig(), EnvironmentConfig.class); + envConfig.put(request.getProjectId(), env); config.setConfig(envConfig); } diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue index 3e53c9b4a5..de524efdf7 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue @@ -150,14 +150,14 @@ break; } }, - list() { + list(projectId) { let url = undefined; if (this.isPlanModel) { url = '/api/automation/module/list/plan/' + this.planId; } else if (this.isRelevanceModel) { url = "/api/automation/module/list/" + this.relevanceProjectId; } else { - url = "/api/automation/module/list/" + this.projectId; + url = "/api/automation/module/list/" + (projectId ? projectId : this.projectId); if (!this.projectId) { return; } diff --git a/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue b/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue index f93ba6fda0..d6dbdccc9d 100644 --- a/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue +++ b/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue @@ -1,8 +1,11 @@