From 6fc1763bc30308ca6bcc83025c0e2448dab55847 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Mon, 17 Apr 2023 15:04:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E5=85=B3=E8=81=94UI=E5=8F=8A=E5=9C=BA=E6=99=AF=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E5=BC=B9=E7=AA=97=E5=B7=A6=E4=BE=A7=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E6=A0=91=E7=AD=9B=E9=80=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1025458 --user=宋昌昌 【测试跟踪】-测试用例-编辑用例-关联UI/场景用例-筛选用例-模块树数量显示不变 https://www.tapd.cn/55049933/s/1363349 --- .../api/remote/api/api-automation-module.js | 4 ++ .../src/api/remote/ui/ui-scenario-module.js | 4 ++ .../case/relate/ApiScenarioModule.vue | 10 ++--- .../case/relate/CaseRelateScenarioList.vue | 2 + .../case/relate/CaseRelateUiScenarioList.vue | 8 ++-- .../case/relate/CaseScenarioRelate.vue | 6 +++ .../case/relate/CaseUiScenarioRelate.vue | 6 +++ .../case/relate/UiScenarioModule.vue | 44 +++++++++---------- 8 files changed, 53 insertions(+), 31 deletions(-) diff --git a/test-track/frontend/src/api/remote/api/api-automation-module.js b/test-track/frontend/src/api/remote/api/api-automation-module.js index 2d3f5fb38e..94ad95d4d7 100644 --- a/test-track/frontend/src/api/remote/api/api-automation-module.js +++ b/test-track/frontend/src/api/remote/api/api-automation-module.js @@ -6,3 +6,7 @@ export function apiAutomationModuleProjectList(projectId) { return get(BASE_URL + `list/${projectId}`); } +export function getAutomationModuleListByParam(projectId, params) { + return post(BASE_URL + `list/${projectId}`, params); +} + diff --git a/test-track/frontend/src/api/remote/ui/ui-scenario-module.js b/test-track/frontend/src/api/remote/ui/ui-scenario-module.js index 1cdedd1743..59762198be 100644 --- a/test-track/frontend/src/api/remote/ui/ui-scenario-module.js +++ b/test-track/frontend/src/api/remote/ui/ui-scenario-module.js @@ -5,3 +5,7 @@ const BASE_URL = '/ui/scenario/module/'; export function uiScenarioModuleProjectList(projectId) { return get(BASE_URL + `list/${projectId}`); } + +export function getUiScenarioModuleListByCondition(projectId, type, params) { + return post(BASE_URL + `list/${projectId}/${type}`, params); +} diff --git a/test-track/frontend/src/business/case/components/case/relate/ApiScenarioModule.vue b/test-track/frontend/src/business/case/components/case/relate/ApiScenarioModule.vue index 73271e1f6e..5ecb081374 100644 --- a/test-track/frontend/src/business/case/components/case/relate/ApiScenarioModule.vue +++ b/test-track/frontend/src/business/case/components/case/relate/ApiScenarioModule.vue @@ -41,7 +41,7 @@ import MsNodeTree from "metersphere-frontend/src/components/new-ui/MsNodeTree"; import { buildTree } from "metersphere-frontend/src/model/NodeTree"; import MsSearchBar from "metersphere-frontend/src/components/search/MsSearchBar"; import { getCurrentProjectID } from "@/business/utils/sdk-utils"; -import { apiAutomationModuleProjectList } from "@/api/remote/api/api-automation-module"; +import { getAutomationModuleListByParam } from "@/api/remote/api/api-automation-module"; import { apiAutomationModulePlanList } from "@/api/remote/plan/test-plan-scenario"; export default { @@ -75,6 +75,7 @@ export default { return getCurrentProjectID(); }, }, + caseCondition: Object }, computed: { isPlanModel() { @@ -132,13 +133,12 @@ export default { this.getData(response); }); } else if (this.isRelevanceModel) { - apiAutomationModuleProjectList(this.relevanceProjectId).then( - (response) => { + getAutomationModuleListByParam(this.relevanceProjectId, this.caseCondition).then((response) => { this.getData(response); } ); } else { - apiAutomationModuleProjectList(projectId).then((response) => { + getAutomationModuleListByParam(projectId, this.caseCondition).then((response) => { this.getData(response); }); } @@ -176,7 +176,7 @@ export default { this.getNohupReloadData(response, selectNodeId); }); } else if (this.isRelevanceModel) { - apiAutomationModuleProjectList(this.relevanceProjectId).then( + getAutomationModuleListByParam(this.relevanceProjectId, this.caseCondition).then( (response) => { this.getNohupReloadData(response, selectNodeId); } diff --git a/test-track/frontend/src/business/case/components/case/relate/CaseRelateScenarioList.vue b/test-track/frontend/src/business/case/components/case/relate/CaseRelateScenarioList.vue index d3256e4b3d..a81796084c 100644 --- a/test-track/frontend/src/business/case/components/case/relate/CaseRelateScenarioList.vue +++ b/test-track/frontend/src/business/case/components/case/relate/CaseRelateScenarioList.vue @@ -179,6 +179,7 @@ export default { testCaseId: String, }, created: function () { + this.$emit('setCondition', this.condition); this.getVersionOptions(); this.initTable(); }, @@ -216,6 +217,7 @@ export default { } this.condition.notInIds = this.notInIds; this.condition.testCaseId = this.testCaseId; + this.$emit('setCondition', this.condition); getTestCaseRelevanceScenarioList( this.currentPage, this.pageSize, diff --git a/test-track/frontend/src/business/case/components/case/relate/CaseRelateUiScenarioList.vue b/test-track/frontend/src/business/case/components/case/relate/CaseRelateUiScenarioList.vue index 67f3063253..0a8d262092 100644 --- a/test-track/frontend/src/business/case/components/case/relate/CaseRelateUiScenarioList.vue +++ b/test-track/frontend/src/business/case/components/case/relate/CaseRelateUiScenarioList.vue @@ -123,10 +123,8 @@ import MsSingleTag from "metersphere-frontend/src/components/new-ui/MsSingleTag" import { TEST_CASE_RELEVANCE_API_CASE_CONFIGS } from "metersphere-frontend/src/components/search/search-components"; import { getVersionFilters } from "@/business/utils/sdk-utils"; import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect"; -import { - getTestCaseRelevanceScenarioList, - getTestCaseRelevanceUiScenarioList, -} from "@/api/testCase"; +import { getTestCaseRelevanceUiScenarioList } from "@/api/testCase"; +import {getCurrentProjectID} from "metersphere-frontend/src/utils/token"; import {getTagToolTips, parseColumnTag} from "@/business/case/test-case"; export default { @@ -177,6 +175,7 @@ export default { testCaseId: String, }, created: function () { + this.$emit('setCondition', this.condition); this.getVersionOptions(); this.initTable(); }, @@ -216,6 +215,7 @@ export default { this.condition.notInIds = this.notInIds; this.condition.testCaseId = this.testCaseId; + this.$emit('setCondition', this.condition); getTestCaseRelevanceUiScenarioList( this.currentPage, this.pageSize, diff --git a/test-track/frontend/src/business/case/components/case/relate/CaseScenarioRelate.vue b/test-track/frontend/src/business/case/components/case/relate/CaseScenarioRelate.vue index 386e28757b..f3a9595983 100644 --- a/test-track/frontend/src/business/case/components/case/relate/CaseScenarioRelate.vue +++ b/test-track/frontend/src/business/case/components/case/relate/CaseScenarioRelate.vue @@ -14,6 +14,7 @@ @setModuleOptions="setModuleOptions" @enableTrash="false" :is-read-only="true" + :case-condition="condition" ref="nodeTree" /> @@ -25,6 +26,7 @@ :versionEnable="versionEnable" :test-case-id="caseId" @selectCountChange="setSelectCounts" + @setCondition="setCondition" ref="apiCaseList" /> @@ -110,6 +112,10 @@ export default { setSelectCounts(data) { this.$refs.baseRelevance.selectCounts = data; }, + setCondition(data) { + this.condition = data; + this.$refs.nodeTree.list(this.projectId); + } }, }; diff --git a/test-track/frontend/src/business/case/components/case/relate/CaseUiScenarioRelate.vue b/test-track/frontend/src/business/case/components/case/relate/CaseUiScenarioRelate.vue index b6e4aac159..cc4fb8ff7e 100644 --- a/test-track/frontend/src/business/case/components/case/relate/CaseUiScenarioRelate.vue +++ b/test-track/frontend/src/business/case/components/case/relate/CaseUiScenarioRelate.vue @@ -14,6 +14,7 @@ @setModuleOptions="setModuleOptions" @enableTrash="false" :is-read-only="true" + :case-condition="condition" ref="nodeTree" /> @@ -25,6 +26,7 @@ :versionEnable="versionEnable" :test-case-id="caseId" @selectCountChange="setSelectCounts" + @setCondition="setCondition" ref="apiCaseList" /> @@ -112,6 +114,10 @@ export default { setSelectCounts(data) { this.$refs.baseRelevance.selectCounts = data; }, + setCondition(data) { + this.condition = data; + this.$refs.nodeTree.list(this.projectId); + } }, }; diff --git a/test-track/frontend/src/business/case/components/case/relate/UiScenarioModule.vue b/test-track/frontend/src/business/case/components/case/relate/UiScenarioModule.vue index 1e73c96ce6..9b1ccb4b93 100644 --- a/test-track/frontend/src/business/case/components/case/relate/UiScenarioModule.vue +++ b/test-track/frontend/src/business/case/components/case/relate/UiScenarioModule.vue @@ -1,7 +1,7 @@ - + - + - \ No newline at end of file