From 012c8ec8417b057a0e92b44fe1586b143716ead7 Mon Sep 17 00:00:00 2001 From: "song.tianyang" Date: Sat, 20 Feb 2021 13:59:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E4=BC=9A=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解决点击文档会报错的问题 --- .../base/mapper/ext/ExtApiDocumentMapper.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDocumentMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDocumentMapper.xml index d0e9515f31..655c980f30 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDocumentMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDocumentMapper.xml @@ -5,13 +5,13 @@ SELECT api.id,api.name FROM Api_definition api - api.project_Id = #{request.projectId} + AND api.project_Id = #{request.projectId} - - api.project_Id like CONCAT('%', #{request.name},'%') + + AND api.name like CONCAT('%', #{request.name},'%') - - api.method = #{request.type} + + AND api.method = #{request.type} From 8fd91be7b10eb2ab6be1e7854da2d94da0cd03dc Mon Sep 17 00:00:00 2001 From: "song.tianyang" Date: Sat, 20 Feb 2021 14:06:09 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E5=88=97=E8=A1=A8=E6=8E=92=E5=BA=8F=E5=8F=98?= =?UTF-8?q?=E5=8A=A8=E6=97=B6=E4=BA=A7=E7=94=9F=E7=9A=84=E9=94=99=E5=BA=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解决文档右侧列表排序变动时产生的错序问题 --- .../api/definition/components/document/ApiDocumentItem.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/business/components/api/definition/components/document/ApiDocumentItem.vue b/frontend/src/business/components/api/definition/components/document/ApiDocumentItem.vue index 6b2c0e1925..4a4488eb60 100644 --- a/frontend/src/business/components/api/definition/components/document/ApiDocumentItem.vue +++ b/frontend/src/business/components/api/definition/components/document/ApiDocumentItem.vue @@ -384,6 +384,7 @@ export default { } let simpleInfoUrl = "/api/document/selectApiSimpleInfo"; + this.apiSimpleInfoArray = []; this.$post(simpleInfoUrl, simpleRequest, response => { this.apiSimpleInfoArray = response.data; this.apiStepIndex = 0; From 3e623dd0ad9c534ba253d4930223d2b1c88e9a6a Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Sat, 20 Feb 2021 14:10:06 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E5=9C=BA=E6=99=AF=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ApiAutomationController.java | 7 ------- .../api/service/ApiAutomationService.java | 10 ---------- .../api/automation/ApiAutomation.vue | 20 +------------------ .../automation/scenario/ApiScenarioList.vue | 2 +- 4 files changed, 2 insertions(+), 37 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java b/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java index f37aaf53e4..52c7ac385e 100644 --- a/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java +++ b/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java @@ -44,13 +44,6 @@ public class ApiAutomationController { return PageUtils.setPageInfo(page, apiAutomationService.list(request)); } - @PostMapping("/list/all") - @RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER, RoleConstants.TEST_VIEWER}, logical = Logical.OR) - public List list(@RequestBody ApiScenarioRequest request) { - request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId()); - return apiAutomationService.get(request); - } - @PostMapping(value = "/create") public ApiScenario create(@RequestPart("request") SaveApiScenarioRequest request, @RequestPart(value = "files") List bodyFiles) { return apiAutomationService.create(request, bodyFiles); diff --git a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java index 0436a9c0d6..027fe93ec5 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java @@ -720,16 +720,6 @@ public class ApiAutomationService { } } - public List get(ApiScenarioRequest request) { - ApiScenarioExample example = new ApiScenarioExample(); - if (CollectionUtils.isNotEmpty(request.getIds())) { - example.createCriteria().andIdIn(request.getIds()); - } else { - example.createCriteria().andProjectIdEqualTo(request.getProjectId()); - } - return apiScenarioMapper.selectByExampleWithBLOBs(example); - } - public List getWithBLOBs(ApiScenarioWithBLOBs request) { ApiScenarioExample example = new ApiScenarioExample(); example.createCriteria().andNameEqualTo(request.getName()).andProjectIdEqualTo(request.getProjectId()).andStatusNotEqualTo("Trash").andIdNotEqualTo(request.getId()); diff --git a/frontend/src/business/components/api/automation/ApiAutomation.vue b/frontend/src/business/components/api/automation/ApiAutomation.vue index 58b6240c65..44ee0dafdc 100644 --- a/frontend/src/business/components/api/automation/ApiAutomation.vue +++ b/frontend/src/business/components/api/automation/ApiAutomation.vue @@ -131,25 +131,7 @@ }, methods: { exportAPI() { - let obj = {projectName: localStorage.getItem(PROJECT_NAME)} - let condition = {projectId: getCurrentProjectID(), ids: this.$refs.apiScenarioList.selection}; - let url = "/api/automation/list/all"; - this.loading = true; - this.$post(url, condition, response => { - obj.data = response.data; - this.buildApiPath(obj.data); - this.loading = false; - downloadFile("Metersphere_Scenario_" + localStorage.getItem(PROJECT_NAME) + ".json", JSON.stringify(obj)); - }); - }, - buildApiPath(apis) { - apis.forEach((api) => { - this.moduleOptions.forEach(item => { - if (api.moduleId === item.id) { - api.modulePath = item.path; - } - }); - }); + this.$refs.apiScenarioList.exportApi(); }, checkRedirectEditPage(redirectParam) { if (redirectParam != null) { diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue index d9fbdd4b8d..317795503a 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue @@ -187,7 +187,7 @@ import {PROJECT_NAME} from "../../../../../common/js/constants"; import EnvironmentSelect from "../../definition/components/environment/EnvironmentSelect"; import BatchMove from "../../../track/case/components/BatchMove"; import {_sort} from "@/common/js/tableUtils"; -import {Api_Scenario_List, Track_Test_Case} from "@/business/components/common/model/JsonData"; +import {Api_Scenario_List} from "@/business/components/common/model/JsonData"; import HeaderCustom from "@/business/components/common/head/HeaderCustom"; import { _filter,