From 521f20aaa4495947bc22e46a343afa6a73ff2684 Mon Sep 17 00:00:00 2001 From: wenyann Date: Wed, 26 May 2021 19:18:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=87=AA=E5=8A=A8=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=A0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/service/ApiDefinitionService.java | 4 +- .../api/automation/ApiAutomation.vue | 42 ++++++++++--------- .../automation/scenario/ApiScenarioList.vue | 2 + .../api/definition/ApiDefinition.vue | 5 +++ .../definition/components/list/ApiList.vue | 6 +-- .../components/track/case/TestCase.vue | 1 + .../track/case/components/TestCaseList.vue | 2 + .../components/track/common/NodeTree.vue | 2 +- 8 files changed, 38 insertions(+), 26 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 6446f5d240..99a4544b0e 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -114,7 +114,7 @@ public class ApiDefinitionService { List resList = extApiDefinitionMapper.list(request); calculateResult(resList, request.getProjectId()); ApiDefinitionRequest finalRequest = request; - List resListFilters = new ArrayList<>(); + /* List resListFilters = new ArrayList<>(); if (finalRequest.getFilters().size() > 1) { if (null != finalRequest.getFilters().get("case_status")) { resListFilters = resList.stream() @@ -123,7 +123,7 @@ public class ApiDefinitionService { return resListFilters; } - } + }*/ return resList; diff --git a/frontend/src/business/components/api/automation/ApiAutomation.vue b/frontend/src/business/components/api/automation/ApiAutomation.vue index 86df7af423..a3a99ce88e 100644 --- a/frontend/src/business/components/api/automation/ApiAutomation.vue +++ b/frontend/src/business/components/api/automation/ApiAutomation.vue @@ -20,6 +20,7 @@ { this.genProtocalFilter(this.condition.protocol); - this.total = response.data.listObject.length; + this.total = response.data.itemCount; this.tableData = response.data.listObject; this.tableData.forEach(item => { if (item.tags && item.tags.length > 0) { @@ -514,6 +511,7 @@ export default { }); } getLabel(this, API_LIST); + this.$emit("refreshTree"); }, genProtocalFilter(protocalType) { if (protocalType === "HTTP") { diff --git a/frontend/src/business/components/track/case/TestCase.vue b/frontend/src/business/components/track/case/TestCase.vue index 1da4eda44b..75f8cd752f 100644 --- a/frontend/src/business/components/track/case/TestCase.vue +++ b/frontend/src/business/components/track/case/TestCase.vue @@ -31,6 +31,7 @@ :checkRedirectID="checkRedirectID" :isRedirectEdit="isRedirectEdit" :tree-nodes="treeNodes" + @refreshTable="refresh" @testCaseEdit="editTestCase" @testCaseCopy="copyTestCase" @testCaseDetail="showTestCaseDetail" diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index dd1660d24d..4ff2f4c2b7 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -501,6 +501,7 @@ export default { confirmButtonText: this.$t('commons.confirm'), callback: (action) => { if (action === 'confirm') { + this.$emit('refreshTable'); this._handleDelete(testCase); } } @@ -528,6 +529,7 @@ export default { this.$post('/test/case/delete/' + testCaseId, {}, () => { this.initTableData(); this.$success(this.$t('commons.delete_success')); + }); }, refresh() { diff --git a/frontend/src/business/components/track/common/NodeTree.vue b/frontend/src/business/components/track/common/NodeTree.vue index 4a1aea8a5d..16feecb5c5 100644 --- a/frontend/src/business/components/track/common/NodeTree.vue +++ b/frontend/src/business/components/track/common/NodeTree.vue @@ -148,7 +148,7 @@ export default { "name": this.allLabel, "level": 0, "children": this.treeNodes, - "caseNum": num + "caseNum": num > 0 ? num : "" }); if (this.expandedNode.length === 0) { this.expandedNode.push("root");