From 0433a1259617746f9189bbc9c69e0b3ae5d1b1cc Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 11 Jul 2023 19:26:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=B9=E9=87=8F=E7=A6=81=E7=94=A8=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E6=AD=A5=E9=AA=A4=E5=A4=B1=E8=B4=A5=E7=9A=84=E7=BC=BA?= =?UTF-8?q?=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1027696 --user=王孝刚 【接口测试】github#25507,批量禁用部分步骤,会导致同一场景下其他未禁用步骤的后置脚本被禁用 https://www.tapd.cn/55049933/s/1391818 --- .../automation/scenario/EditApiScenario.vue | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue b/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue index 2336f73c89..0bc65d7c09 100644 --- a/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue +++ b/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue @@ -2404,16 +2404,26 @@ export default { } }, getAllResourceIds() { + let selectNodes = []; + let selectIds = []; + if (this.$refs.stepTree) { + selectNodes = this.$refs.stepTree.getCheckedNodes(); + selectNodes.forEach(item => { + selectIds.push(item.resourceId) + }); + } let resourceIds = []; - this.filterAllStep(this.scenarioDefinition, resourceIds); + this.filterAllStep(this.scenarioDefinition, resourceIds, selectIds); return resourceIds; }, - filterAllStep(stepArray, resourceIds) { + filterAllStep(stepArray, resourceIds,selectIds) { if (stepArray) { stepArray.forEach(item =>{ - resourceIds.push(item.resourceId); + if (selectIds && selectIds.includes(item.resourceId)) { + resourceIds.push(item.resourceId); + } if(item.referenced !== 'REF' && item.hashTree){ - this.filterAllStep(item.hashTree,resourceIds); + this.filterAllStep(item.hashTree,resourceIds, selectIds); } }) }