fix(测试跟踪): 关联UI及场景用例弹窗左侧模块树筛选问题

--bug=1025458 --user=宋昌昌 【测试跟踪】-测试用例-编辑用例-关联UI/场景用例-筛选用例-模块树数量显示不变 https://www.tapd.cn/55049933/s/1363349
This commit is contained in:
song-cc-rock 2023-04-17 15:04:37 +08:00 committed by fit2-zhao
parent 76f078e12d
commit 6fc1763bc3
8 changed files with 53 additions and 31 deletions

View File

@ -6,3 +6,7 @@ export function apiAutomationModuleProjectList(projectId) {
return get(BASE_URL + `list/${projectId}`); return get(BASE_URL + `list/${projectId}`);
} }
export function getAutomationModuleListByParam(projectId, params) {
return post(BASE_URL + `list/${projectId}`, params);
}

View File

@ -5,3 +5,7 @@ const BASE_URL = '/ui/scenario/module/';
export function uiScenarioModuleProjectList(projectId) { export function uiScenarioModuleProjectList(projectId) {
return get(BASE_URL + `list/${projectId}`); return get(BASE_URL + `list/${projectId}`);
} }
export function getUiScenarioModuleListByCondition(projectId, type, params) {
return post(BASE_URL + `list/${projectId}/${type}`, params);
}

View File

@ -41,7 +41,7 @@ import MsNodeTree from "metersphere-frontend/src/components/new-ui/MsNodeTree";
import { buildTree } from "metersphere-frontend/src/model/NodeTree"; import { buildTree } from "metersphere-frontend/src/model/NodeTree";
import MsSearchBar from "metersphere-frontend/src/components/search/MsSearchBar"; import MsSearchBar from "metersphere-frontend/src/components/search/MsSearchBar";
import { getCurrentProjectID } from "@/business/utils/sdk-utils"; 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"; import { apiAutomationModulePlanList } from "@/api/remote/plan/test-plan-scenario";
export default { export default {
@ -75,6 +75,7 @@ export default {
return getCurrentProjectID(); return getCurrentProjectID();
}, },
}, },
caseCondition: Object
}, },
computed: { computed: {
isPlanModel() { isPlanModel() {
@ -132,13 +133,12 @@ export default {
this.getData(response); this.getData(response);
}); });
} else if (this.isRelevanceModel) { } else if (this.isRelevanceModel) {
apiAutomationModuleProjectList(this.relevanceProjectId).then( getAutomationModuleListByParam(this.relevanceProjectId, this.caseCondition).then((response) => {
(response) => {
this.getData(response); this.getData(response);
} }
); );
} else { } else {
apiAutomationModuleProjectList(projectId).then((response) => { getAutomationModuleListByParam(projectId, this.caseCondition).then((response) => {
this.getData(response); this.getData(response);
}); });
} }
@ -176,7 +176,7 @@ export default {
this.getNohupReloadData(response, selectNodeId); this.getNohupReloadData(response, selectNodeId);
}); });
} else if (this.isRelevanceModel) { } else if (this.isRelevanceModel) {
apiAutomationModuleProjectList(this.relevanceProjectId).then( getAutomationModuleListByParam(this.relevanceProjectId, this.caseCondition).then(
(response) => { (response) => {
this.getNohupReloadData(response, selectNodeId); this.getNohupReloadData(response, selectNodeId);
} }

View File

@ -179,6 +179,7 @@ export default {
testCaseId: String, testCaseId: String,
}, },
created: function () { created: function () {
this.$emit('setCondition', this.condition);
this.getVersionOptions(); this.getVersionOptions();
this.initTable(); this.initTable();
}, },
@ -216,6 +217,7 @@ export default {
} }
this.condition.notInIds = this.notInIds; this.condition.notInIds = this.notInIds;
this.condition.testCaseId = this.testCaseId; this.condition.testCaseId = this.testCaseId;
this.$emit('setCondition', this.condition);
getTestCaseRelevanceScenarioList( getTestCaseRelevanceScenarioList(
this.currentPage, this.currentPage,
this.pageSize, this.pageSize,

View File

@ -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 { TEST_CASE_RELEVANCE_API_CASE_CONFIGS } from "metersphere-frontend/src/components/search/search-components";
import { getVersionFilters } from "@/business/utils/sdk-utils"; import { getVersionFilters } from "@/business/utils/sdk-utils";
import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect"; import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect";
import { import { getTestCaseRelevanceUiScenarioList } from "@/api/testCase";
getTestCaseRelevanceScenarioList, import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
getTestCaseRelevanceUiScenarioList,
} from "@/api/testCase";
import {getTagToolTips, parseColumnTag} from "@/business/case/test-case"; import {getTagToolTips, parseColumnTag} from "@/business/case/test-case";
export default { export default {
@ -177,6 +175,7 @@ export default {
testCaseId: String, testCaseId: String,
}, },
created: function () { created: function () {
this.$emit('setCondition', this.condition);
this.getVersionOptions(); this.getVersionOptions();
this.initTable(); this.initTable();
}, },
@ -216,6 +215,7 @@ export default {
this.condition.notInIds = this.notInIds; this.condition.notInIds = this.notInIds;
this.condition.testCaseId = this.testCaseId; this.condition.testCaseId = this.testCaseId;
this.$emit('setCondition', this.condition);
getTestCaseRelevanceUiScenarioList( getTestCaseRelevanceUiScenarioList(
this.currentPage, this.currentPage,
this.pageSize, this.pageSize,

View File

@ -14,6 +14,7 @@
@setModuleOptions="setModuleOptions" @setModuleOptions="setModuleOptions"
@enableTrash="false" @enableTrash="false"
:is-read-only="true" :is-read-only="true"
:case-condition="condition"
ref="nodeTree" ref="nodeTree"
/> />
</template> </template>
@ -25,6 +26,7 @@
:versionEnable="versionEnable" :versionEnable="versionEnable"
:test-case-id="caseId" :test-case-id="caseId"
@selectCountChange="setSelectCounts" @selectCountChange="setSelectCounts"
@setCondition="setCondition"
ref="apiCaseList" ref="apiCaseList"
/> />
</test-case-relevance-base> </test-case-relevance-base>
@ -110,6 +112,10 @@ export default {
setSelectCounts(data) { setSelectCounts(data) {
this.$refs.baseRelevance.selectCounts = data; this.$refs.baseRelevance.selectCounts = data;
}, },
setCondition(data) {
this.condition = data;
this.$refs.nodeTree.list(this.projectId);
}
}, },
}; };
</script> </script>

View File

@ -14,6 +14,7 @@
@setModuleOptions="setModuleOptions" @setModuleOptions="setModuleOptions"
@enableTrash="false" @enableTrash="false"
:is-read-only="true" :is-read-only="true"
:case-condition="condition"
ref="nodeTree" ref="nodeTree"
/> />
</template> </template>
@ -25,6 +26,7 @@
:versionEnable="versionEnable" :versionEnable="versionEnable"
:test-case-id="caseId" :test-case-id="caseId"
@selectCountChange="setSelectCounts" @selectCountChange="setSelectCounts"
@setCondition="setCondition"
ref="apiCaseList" ref="apiCaseList"
/> />
</test-case-relevance-base> </test-case-relevance-base>
@ -112,6 +114,10 @@ export default {
setSelectCounts(data) { setSelectCounts(data) {
this.$refs.baseRelevance.selectCounts = data; this.$refs.baseRelevance.selectCounts = data;
}, },
setCondition(data) {
this.condition = data;
this.$refs.nodeTree.list(this.projectId);
}
}, },
}; };
</script> </script>

View File

@ -39,7 +39,7 @@
import MsSearchBar from "metersphere-frontend/src/components/search/MsSearchBar"; import MsSearchBar from "metersphere-frontend/src/components/search/MsSearchBar";
import {getCurrentProjectID} from "@/business/utils/sdk-utils"; import {getCurrentProjectID} from "@/business/utils/sdk-utils";
import {uiScenarioModulePlanList} from "@/api/remote/ui/test-plan-ui-scenario-case"; import {uiScenarioModulePlanList} from "@/api/remote/ui/test-plan-ui-scenario-case";
import {uiScenarioModuleProjectList} from "@/api/remote/ui/ui-scenario-module"; import {getUiScenarioModuleListByCondition} from "@/api/remote/ui/ui-scenario-module";
export default { export default {
name: 'UiScenarioModule', name: 'UiScenarioModule',
@ -63,7 +63,8 @@
showCaseNum: { showCaseNum: {
type: Boolean, type: Boolean,
default: true default: true
} },
caseCondition: Object
}, },
computed: { computed: {
isPlanModel() { isPlanModel() {
@ -128,7 +129,7 @@
}); });
} else { } else {
this.loading = true; this.loading = true;
uiScenarioModuleProjectList(projectId ? projectId : this.projectId) getUiScenarioModuleListByCondition(projectId ? projectId : this.projectId, 'scenario', this.caseCondition)
.then(r => { .then(r => {
if (r && r.data) { if (r && r.data) {
this.loading = false; this.loading = false;
@ -218,4 +219,3 @@
} }
</style> </style>