From b894bf7cb23e175aedb939f7117cbc396df42529 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Fri, 22 Oct 2021 17:31:01 +0800 Subject: [PATCH] =?UTF-8?q?repr@dev=5Fv1.14@fix=5F=E9=A6=96=E9=A1=B5-?= =?UTF-8?q?=E8=BF=87=E5=8E=BB7=E5=A4=A9=E6=9C=89=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3=EF=BC=8C=E7=82=B9=E5=87=BBID?= =?UTF-8?q?=E5=92=8C=E5=90=8D=E7=A7=B0=E6=B2=A1=E6=9C=89=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=20--bug=3D1007345=20--user=3D=E7=8E=8B=E5=AD=9D=E5=88=9A=20?= =?UTF-8?q?=E3=80=90=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95=E3=80=91=E9=A6=96?= =?UTF-8?q?=E9=A1=B5-=E8=BF=87=E5=8E=BB7=E5=A4=A9=E6=9C=89=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E6=8E=A5=E5=8F=A3=EF=BC=8C=E7=82=B9=E5=87=BB?= =?UTF-8?q?ID=E5=92=8C=E5=90=8D=E7=A7=B0=E6=B2=A1=E6=9C=89=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=20https://www.tapd.cn/55049933/s/1057698?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/definition/ApiDefinitionResult.java | 2 ++ .../api/service/ApiDefinitionService.java | 1 + .../api/definition/components/list/ApiList.vue | 9 +++++++++ .../homepage/components/ApiNewTestCaseList.vue | 18 ++++++++++++++++-- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/ApiDefinitionResult.java b/backend/src/main/java/io/metersphere/api/dto/definition/ApiDefinitionResult.java index 2b37e15000..bd72e8ed55 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/ApiDefinitionResult.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/ApiDefinitionResult.java @@ -27,4 +27,6 @@ public class ApiDefinitionResult extends ApiDefinitionWithBLOBs { private String caseType; private String scenarioType; + + private String apiType; } 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 d9ab2a73d4..6371765e47 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -152,6 +152,7 @@ public class ApiDefinitionService { List resList = extApiDefinitionMapper.weekList(request, startTime.getTime()); calculateResult(resList, request.getProjectId()); calculateResultSce(resList); + resList.stream().forEach(item -> item.setApiType("api")); return resList; } } diff --git a/frontend/src/business/components/api/definition/components/list/ApiList.vue b/frontend/src/business/components/api/definition/components/list/ApiList.vue index 39357e4db4..795f104454 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiList.vue @@ -561,6 +561,7 @@ export default { if (currentProtocol) { this.condition.moduleIds = []; } + if (this.condition.projectId) { this.result = this.$post("/api/definition/list/" + this.currentPage + "/" + this.pageSize, this.condition, response => { getProtocolFilter(this.condition.protocol); @@ -768,6 +769,14 @@ export default { } else { this.selectDataRange = 'all'; } + if (this.selectDataRange != null) { + let selectParamArr = this.selectDataRange.split(":"); + if (selectParamArr.length === 2) { + if (selectParamArr[0] === "apiList") { + this.condition.name = selectParamArr[1]; + } + } + } }, changeSelectDataRangeAll() { this.$emit("changeSelectDataRangeAll", "api"); diff --git a/frontend/src/business/components/api/homepage/components/ApiNewTestCaseList.vue b/frontend/src/business/components/api/homepage/components/ApiNewTestCaseList.vue index 402350b3c6..b2b3844bc4 100644 --- a/frontend/src/business/components/api/homepage/components/ApiNewTestCaseList.vue +++ b/frontend/src/business/components/api/homepage/components/ApiNewTestCaseList.vue @@ -2,8 +2,19 @@
+ show-overflow-tooltip> + + + @@ -184,11 +195,14 @@ export default { }, redirect(pageType, param) { switch (pageType) { + case "api": + this.$emit('redirectPage', 'api', 'api', 'apiList:' + param); + break; case "apiCase": this.$emit('redirectPage', 'api', 'apiTestCase', 'singleList:' + param); break; case "scenario": - if(param) { + if (param) { this.$emit('redirectPage', 'scenario', 'scenario', 'list:' + param); break; }