diff --git a/test-track/frontend/src/business/case/components/TestCaseList.vue b/test-track/frontend/src/business/case/components/TestCaseList.vue index 6fe996fcdb..bdf92b1c35 100644 --- a/test-track/frontend/src/business/case/components/TestCaseList.vue +++ b/test-track/frontend/src/business/case/components/TestCaseList.vue @@ -832,9 +832,27 @@ export default { item.nodePath = nodePath.replaceAll("/未规划用例", "/" + this.$t('api_test.unplanned_case')); } }); + this.updateTestCaseNodeCount(); }); this.$emit("getTrashList"); - this.$emit("getPublicList"); + this.$emit("getPublicList") + } + }, + // 如果在其他tab页创建用例,会导致模块数量显示和列表不一致,这里重新更新下模块的用例数 + updateTestCaseNodeCount() { + if (this.selectNode && this.treeNodes && this.selectNode.data + && this.selectNode.data.caseNum !== this.page.total) { + + let updateCount = this.page.total - this.selectNode.data.caseNum; + let node = this.selectNode; + this.selectNode.data.caseNum = this.page.total; + while (node) { + node = node.parent; + if (node && node.data) { + node.data.caseNum += updateCount; + } + } + } }, search() {