diff --git a/api-test/frontend/src/business/automation/scenario/common/ApiBaseComponent.vue b/api-test/frontend/src/business/automation/scenario/common/ApiBaseComponent.vue index a12f0c2634..1803a07e29 100644 --- a/api-test/frontend/src/business/automation/scenario/common/ApiBaseComponent.vue +++ b/api-test/frontend/src/business/automation/scenario/common/ApiBaseComponent.vue @@ -517,4 +517,8 @@ fieldset { .is-text { margin-right: 5px; } + +:deep(.el-tabs__nav-wrap) { + width: calc(100% - 50px); +} diff --git a/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue b/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue index 9447421bf1..462241e24e 100644 --- a/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue +++ b/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue @@ -742,8 +742,4 @@ export default { font-size: 15px; color: #de9d1c; } - -:deep(.el-tabs__nav-wrap) { - width: calc(100% - 50px); -} diff --git a/api-test/frontend/src/business/automation/scenario/component/ApiScenarioComponent.vue b/api-test/frontend/src/business/automation/scenario/component/ApiScenarioComponent.vue index 3b3d0785ad..70e1c538a4 100644 --- a/api-test/frontend/src/business/automation/scenario/component/ApiScenarioComponent.vue +++ b/api-test/frontend/src/business/automation/scenario/component/ApiScenarioComponent.vue @@ -213,19 +213,20 @@ export default { // 合并自身依赖场景变量 if (runScenario && runScenario.variableEnable && runScenario.variables) { if (variables) { - // 同名合并 - runScenario.variables.forEach((data) => { - variables.forEach((item) => { - if (data.type === item.type && data.name === item.name) { - Object.assign(data, item); - } - }); - }); + runScenario.variables = [...runScenario.variables, ...variables].reduce((acc, cur) => { + const index = acc.findIndex(item => item.name === cur.name && item.type === cur.type); + if (index !== -1) { + acc[index] = cur; + } else { + acc.push(cur); + } + return acc; + }, []); } } else { runScenario.variables = variables; } - + runScenario.id = this.currentScenario.id; runScenario.hashTree = [this.scenario]; runScenario.stepScenario = true; this.$emit('runScenario', runScenario);