fix(接口测试): 修复批量禁用场景步骤失败的缺陷

--bug=1027696 --user=王孝刚
【接口测试】github#25507,批量禁用部分步骤,会导致同一场景下其他未禁用步骤的后置脚本被禁用
https://www.tapd.cn/55049933/s/1391818
This commit is contained in:
wxg0103 2023-07-11 19:26:34 +08:00 committed by fit2-zhao
parent f68e7f1090
commit 0433a12596
1 changed files with 14 additions and 4 deletions

View File

@ -2404,16 +2404,26 @@ export default {
} }
}, },
getAllResourceIds() { getAllResourceIds() {
let selectNodes = [];
let selectIds = [];
if (this.$refs.stepTree) {
selectNodes = this.$refs.stepTree.getCheckedNodes();
selectNodes.forEach(item => {
selectIds.push(item.resourceId)
});
}
let resourceIds = []; let resourceIds = [];
this.filterAllStep(this.scenarioDefinition, resourceIds); this.filterAllStep(this.scenarioDefinition, resourceIds, selectIds);
return resourceIds; return resourceIds;
}, },
filterAllStep(stepArray, resourceIds) { filterAllStep(stepArray, resourceIds,selectIds) {
if (stepArray) { if (stepArray) {
stepArray.forEach(item =>{ stepArray.forEach(item =>{
resourceIds.push(item.resourceId); if (selectIds && selectIds.includes(item.resourceId)) {
resourceIds.push(item.resourceId);
}
if(item.referenced !== 'REF' && item.hashTree){ if(item.referenced !== 'REF' && item.hashTree){
this.filterAllStep(item.hashTree,resourceIds); this.filterAllStep(item.hashTree,resourceIds, selectIds);
} }
}) })
} }