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; }