From 113de8da6cccdaa2d5e4619fcbb2777465866453 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 22 Oct 2021 15:56:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=B3=E8=81=94=E5=89=8D=E5=90=8E?= =?UTF-8?q?=E7=BD=AE=E7=94=A8=E4=BE=8B=E5=88=97=E8=A1=A8=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ApiDefinitionController.java | 3 +- .../api/service/ApiDefinitionService.java | 8 +- .../base/mapper/ext/ExtTestCaseMapper.xml | 2 +- .../track/controller/TestCaseController.java | 3 +- .../track/service/TestCaseService.java | 6 +- .../scenario/api/RelevanceApiList.vue | 20 ++-- .../complete/ApiRelationshipRelevance.vue | 30 +++--- .../components/complete/ApiTableList.vue | 8 +- .../complete/RelationshipRelevanceList.vue | 100 ------------------ frontend/src/common/js/utils.js | 6 +- 10 files changed, 44 insertions(+), 142 deletions(-) delete mode 100644 frontend/src/business/components/api/definition/components/complete/RelationshipRelevanceList.vue diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java b/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java index f9c31b51c8..ca22e11ad8 100644 --- a/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java +++ b/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java @@ -322,7 +322,6 @@ public class ApiDefinitionController { @PostMapping("/relationship/relate/{goPage}/{pageSize}") public Pager< List> getRelationshipRelateList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody ApiDefinitionRequest request) { - Page page = PageHelper.startPage(goPage, pageSize, true); - return PageUtils.setPageInfo(page, apiDefinitionService.getRelationshipRelateList(request)); + return apiDefinitionService.getRelationshipRelateList(request, goPage, pageSize); } } 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 419efa5a16..d9ab2a73d4 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -2,6 +2,8 @@ package io.metersphere.api.service; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; import io.metersphere.api.dto.APIReportResult; import io.metersphere.api.dto.ApiTestImportRequest; import io.metersphere.api.dto.automation.ApiScenarioRequest; @@ -58,6 +60,7 @@ import org.apache.ibatis.session.SqlSessionFactory; import org.apache.jorphan.collections.HashTree; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.multipart.MultipartFile; import sun.security.util.Cache; @@ -1663,11 +1666,12 @@ public class ApiDefinitionService { } } - public List getRelationshipRelateList(ApiDefinitionRequest request) { + public Pager> getRelationshipRelateList(ApiDefinitionRequest request, int goPage, @PathVariable int pageSize) { request = this.initRequest(request, true, true); List relationshipIds = relationshipEdgeService.getRelationshipIds(request.getId()); request.setNotInIds(relationshipIds); request.setId(null); // 去掉id的查询条件 - return extApiDefinitionMapper.list(request); + Page page = PageHelper.startPage(goPage, pageSize, true); + return PageUtils.setPageInfo(page, extApiDefinitionMapper.list(request)); } } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml index fdcd9e5b09..035792949b 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml @@ -559,7 +559,7 @@