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}`);
}
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) {
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 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);
}

View File

@ -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,

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 { 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,

View File

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

View File

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

View File

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