From 04372f484888b8013a025b15ffd49084e2b1e562 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Wed, 8 Mar 2023 17:46:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=AC=E5=85=B1=E7=94=A8=E4=BE=8B=E5=BA=93?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E9=A1=B5=E7=A0=81=E6=95=B0=E6=8D=AE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=94=99=E8=AF=AF=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1024046 --user=王孝刚 【测试跟踪】公共用例库,选择模块,模块内切换页码,显示数据错误 https://www.tapd.cn/55049933/s/1347113 --- .../business/case/components/case/CaseChangeHistory.vue | 2 +- .../case/components/public/PublicTestCaseList.vue | 8 +++++++- .../src/business/module/TestCasePublicNodeTree.vue | 3 +++ test-track/frontend/src/store/state.js | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/test-track/frontend/src/business/case/components/case/CaseChangeHistory.vue b/test-track/frontend/src/business/case/components/case/CaseChangeHistory.vue index 25e7acea9e..f2d5ec39d5 100644 --- a/test-track/frontend/src/business/case/components/case/CaseChangeHistory.vue +++ b/test-track/frontend/src/business/case/components/case/CaseChangeHistory.vue @@ -267,7 +267,7 @@ export default { text-overflow: ellipsis; vertical-align: middle; white-space: nowrap; - width: 120px; + width: 150px !important; } .wrap { padding: 24px 0 0 0; diff --git a/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue b/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue index da1c2a684a..78b5954d79 100644 --- a/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue +++ b/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue @@ -369,7 +369,7 @@ export default { return getCurrentProjectID(); }, ...mapState(useStore, { - selectNodeIds: 'testCaseSelectNodeIds', + selectNodeIds: 'testCasePublicSelectNodeIds', selectNode: 'testCaseSelectNode', moduleOptions: 'testCaseModuleOptions', customNum: 'currentProjectIsCustomNum' @@ -417,6 +417,12 @@ export default { this.condition.nodeIds = []; initCondition(this.condition, this.condition.selectAll); this.condition.orders = getLastTableSortField(this.tableHeaderKey); + if (this.selectNodeIds && this.selectNodeIds.length > 0) { + if (!this.selectNode || this.selectNode.data.id !== 'root') { + // 优化:如果当前选中节点是root节点,则不添加过滤条件 + this.condition.nodeIds = this.selectNodeIds; + } + } this.condition.versionId = this.currentVersion || null; this.condition.filters.reviewStatus = ["Prepare", "Pass", "UnPass"]; if (nodeIds && Array.isArray(nodeIds) && nodeIds.length > 0) { diff --git a/test-track/frontend/src/business/module/TestCasePublicNodeTree.vue b/test-track/frontend/src/business/module/TestCasePublicNodeTree.vue index be11f1dd44..39589a9563 100644 --- a/test-track/frontend/src/business/module/TestCasePublicNodeTree.vue +++ b/test-track/frontend/src/business/module/TestCasePublicNodeTree.vue @@ -19,6 +19,7 @@ import MsSearchBar from "metersphere-frontend/src/components/new-ui/MsSearchBar"; import MsNodeTree from "metersphere-frontend/src/components/new-ui/MsNodeTree"; import {getTestCasePublicNodes} from "@/api/testCase"; +import {useStore} from "@/store"; export default { name: "TestCasePublicNodeTree", @@ -46,6 +47,8 @@ export default { this.$refs.publicNodeTree.filter(this.condition.filterText); }, publicNodeChange(node, nodeIds, pNodes) { + let store = useStore(); + store.testCasePublicSelectNodeIds = nodeIds; this.$emit("nodeSelectEvent", node, node.data.id === 'root' ? [] : nodeIds, pNodes); }, list() { diff --git a/test-track/frontend/src/store/state.js b/test-track/frontend/src/store/state.js index aef62c015a..fc48a6ebb4 100644 --- a/test-track/frontend/src/store/state.js +++ b/test-track/frontend/src/store/state.js @@ -4,6 +4,7 @@ export default { theme: undefined, testCaseSelectNode: {}, testCaseSelectNodeIds: [], + testCasePublicSelectNodeIds: [], testCaseModuleOptions: [], testReviewSelectNode: {}, testReviewSelectNodeIds: [],