From f511b38e910a3210c770d57d8e3ede919d9c5181 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Wed, 10 Mar 2021 11:25:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9C=BA=E6=99=AF=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96):=20=E4=BF=AE=E5=A4=8D=E5=BE=AA=E7=8E=AF=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=99=A8=E4=B8=8D=E8=83=BD=E6=B7=BB=E5=8A=A0=E5=BC=95?= =?UTF-8?q?=E7=94=A8=E5=9C=BA=E6=99=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/automation/scenario/EditApiScenario.vue | 9 +++++---- .../components/api/automation/scenario/Setting.js | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index af479b9619..da76e117af 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -224,6 +224,7 @@ import MsComponentConfig from "./component/ComponentConfig"; import {handleCtrlSEvent} from "../../../../../common/js/utils"; import EnvPopover from "@/business/components/api/automation/scenario/EnvPopover"; + let jsonPath = require('jsonpath'); export default { name: "EditApiScenario", @@ -400,7 +401,7 @@ }, { title: this.$t('api_test.automation.scenario_import'), - show:this.showButton("scenario"), + show: this.showButton("scenario"), titleColor: "#606266", titleBgColor: "#F4F4F5", icon: "movie", @@ -557,7 +558,7 @@ this.scenarioDefinition[i].countController.proceed = true; } if (!this.scenarioDefinition[i].projectId) { - this.scenarioDefinition.projectId = getCurrentProjectID(); + this.scenarioDefinition[i].projectId = getCurrentProjectID(); } if (this.scenarioDefinition[i].hashTree != undefined && this.scenarioDefinition[i].hashTree.length > 0) { this.recursiveSorting(this.scenarioDefinition[i].hashTree); @@ -677,7 +678,7 @@ } const index = hashTree.findIndex(d => d.resourceId === row.resourceId); if (index != -1) { - hashTree.splice(index+1, 0, obj); + hashTree.splice(index + 1, 0, obj); } else { hashTree.push(obj); } @@ -1019,7 +1020,7 @@ // 加载环境配置 this.$nextTick(() => { this.projectIds.clear(); - this.scenarioDefinition.forEach(data=>{ + this.scenarioDefinition.forEach(data => { let arr = jsonPath.query(data, "$..projectId"); arr.forEach(a => this.projectIds.add(a)); }) diff --git a/frontend/src/business/components/api/automation/scenario/Setting.js b/frontend/src/business/components/api/automation/scenario/Setting.js index 9636cf8e03..9ddffe168a 100644 --- a/frontend/src/business/components/api/automation/scenario/Setting.js +++ b/frontend/src/business/components/api/automation/scenario/Setting.js @@ -6,8 +6,8 @@ export const ELEMENTS = new Map([ ['JDBCSampler', ["ConstantTimer", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]], ['TCPSampler', ["ConstantTimer", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]], ['OT_IMPORT', ["ConstantTimer", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]], - ['IfController', ["IfController","scenario", "HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler", "OT_IMPORT", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract", "CustomizeReq"]], - ['LoopController', ["IfController", "HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler", "OT_IMPORT", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract", "CustomizeReq"]], + ['IfController', ["IfController", "scenario", "HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler", "OT_IMPORT", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract", "CustomizeReq"]], + ['LoopController', ["IfController", "scenario", "HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler", "OT_IMPORT", "ConstantTimer", "JSR223Processor", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract", "CustomizeReq"]], ['ConstantTimer', []], ['JSR223Processor', ["ConstantTimer", "JSR223PreProcessor", "JSR223PostProcessor", "Assertions", "Extract"]], ['JSR223PreProcessor', []],