diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java index 081cb50844..4e1696137c 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java @@ -189,7 +189,7 @@ public class ElementUtil { } } - public static void addCounter(HashTree tree, List variables, boolean isInternal) { + public static void addCounter(HashTree tree, List variables) { if (CollectionUtils.isNotEmpty(variables)) { List list = variables.stream().filter(ScenarioVariable::isCounterValid).filter(ScenarioVariable::isEnable).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(list)) { @@ -199,11 +199,7 @@ public class ElementUtil { counterConfig.setProperty(TestElement.TEST_CLASS, CounterConfig.class.getName()); counterConfig.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("CounterConfigGui")); counterConfig.setName(item.getName()); - if (isInternal) { - counterConfig.setStart((item.getStartNumber() + 1)); - } else { - counterConfig.setStart(item.getStartNumber()); - } + counterConfig.setStart(item.getStartNumber()); counterConfig.setEnd(item.getEndNumber()); counterConfig.setVarName(item.getName()); counterConfig.setIncrement(item.getIncrement()); @@ -814,7 +810,7 @@ public class ElementUtil { config.getConfig().get(projectId).getCommonConfig().getVariables(), config, "shareMode.group"); ElementUtil.addCounter(httpSamplerTree, - config.getConfig().get(projectId).getCommonConfig().getVariables(), false); + config.getConfig().get(projectId).getCommonConfig().getVariables()); ElementUtil.addRandom(httpSamplerTree, config.getConfig().get(projectId).getCommonConfig().getVariables()); } diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java index 2937ff1260..b8433da767 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java @@ -125,7 +125,7 @@ public class MsScenario extends MsTestElement { } if (this.variableEnable == null || this.variableEnable) { ElementUtil.addCsvDataSet(scenarioTree, variables, this.isEnvironmentEnable() ? newConfig : config, "shareMode.group"); - ElementUtil.addCounter(scenarioTree, variables, false); + ElementUtil.addCounter(scenarioTree, variables); ElementUtil.addRandom(scenarioTree, variables); if (CollectionUtils.isNotEmpty(this.headers)) { if (this.isEnvironmentEnable()) { diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java index a8f4f51dd1..807962e1de 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java @@ -53,7 +53,7 @@ public class MsLoopController extends MsTestElement { // 自身场景 if (CollectionUtils.isNotEmpty(config.getVariables())) { ElementUtil.addCsvDataSet(groupTree, config.getVariables(), config, "shareMode.thread"); - ElementUtil.addCounter(groupTree, config.getVariables(), true); + ElementUtil.addCounter(groupTree, config.getVariables()); ElementUtil.addRandom(groupTree, config.getVariables()); } // 当前引用场景 @@ -73,7 +73,7 @@ public class MsLoopController extends MsTestElement { if (CollectionUtils.isNotEmpty(variables)) { ElementUtil.addCsvDataSet(groupTree, variables, config, "shareMode.thread"); - ElementUtil.addCounter(groupTree, variables, true); + ElementUtil.addCounter(groupTree, variables); ElementUtil.addRandom(groupTree, variables); } } diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/variable/ScenarioVariable.java b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/variable/ScenarioVariable.java index 133dc2c1e5..5efdc1e61f 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/variable/ScenarioVariable.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/variable/ScenarioVariable.java @@ -32,9 +32,9 @@ public class ScenarioVariable { /** * counter */ - private int startNumber; - private int endNumber; - private int increment; + private String startNumber; + private String endNumber; + private String increment; /** * random */ diff --git a/api-test/frontend/src/business/automation/scenario/variable/EditCounter.vue b/api-test/frontend/src/business/automation/scenario/variable/EditCounter.vue index 1c7bbd518e..85057d7a4d 100644 --- a/api-test/frontend/src/business/automation/scenario/variable/EditCounter.vue +++ b/api-test/frontend/src/business/automation/scenario/variable/EditCounter.vue @@ -16,34 +16,13 @@ - + - + - + diff --git a/framework/sdk-parent/frontend/src/components/environment/commons/variable/EditCounter.vue b/framework/sdk-parent/frontend/src/components/environment/commons/variable/EditCounter.vue index 1c2669c5bc..3d756979c1 100644 --- a/framework/sdk-parent/frontend/src/components/environment/commons/variable/EditCounter.vue +++ b/framework/sdk-parent/frontend/src/components/environment/commons/variable/EditCounter.vue @@ -1,28 +1,64 @@ @@ -37,20 +73,22 @@ export default { computed: { disabled() { return !(this.editData.name && this.editData.name !== ""); - } + }, }, data() { return { rules: { name: [ - {required: true, message: this.$t('test_track.case.input_name'), trigger: 'blur'}, + { + required: true, + message: this.$t("test_track.case.input_name"), + trigger: "blur", + }, ], }, - } + }; }, -} +}; - + diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/request/variable/ScenarioVariable.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/request/variable/ScenarioVariable.java index d3f3a57500..9e46146df5 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/request/variable/ScenarioVariable.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/request/variable/ScenarioVariable.java @@ -32,9 +32,9 @@ public class ScenarioVariable { /** * counter */ - private int startNumber; - private int endNumber; - private int increment; + private String startNumber; + private String endNumber; + private String increment; /** * random */