fix(场景自动化): 修复JSONSchema integer取值问题;优化步骤删除时抖动问题。

This commit is contained in:
fit2-zhao 2021-05-11 16:23:07 +08:00 committed by fit2-zhao
parent b6edbd9dfe
commit 75f46c6c66
2 changed files with 7 additions and 4 deletions

View File

@ -150,8 +150,13 @@ public class JSONSchemaGenerator {
concept.put(propertyName, object.get("default")); concept.put(propertyName, object.get("default"));
} }
if (object.has("mock") && object.get("mock").getAsJsonObject() != null && StringUtils.isNotEmpty(object.get("mock").getAsJsonObject().get("mock").getAsString())) { if (object.has("mock") && object.get("mock").getAsJsonObject() != null && StringUtils.isNotEmpty(object.get("mock").getAsJsonObject().get("mock").getAsString())) {
String value = ScriptEngineUtils.calculate(object.get("mock").getAsJsonObject().get("mock").toString()); try {
concept.put(propertyName, value); int value = object.get("mock").getAsJsonObject().get("mock").getAsInt();
concept.put(propertyName, value);
} catch (Exception e) {
String value = ScriptEngineUtils.calculate(object.get("mock").getAsJsonObject().get("mock").getAsString());
concept.put(propertyName, value);
}
} }
if (object.has("multipleOf")) { if (object.has("multipleOf")) {

View File

@ -621,7 +621,6 @@
recursiveSorting(arr, scenarioProjectId) { recursiveSorting(arr, scenarioProjectId) {
for (let i in arr) { for (let i in arr) {
arr[i].index = Number(i) + 1; arr[i].index = Number(i) + 1;
arr[i].active = this.expandedStatus;
if (arr[i].type === ELEMENT_TYPE.LoopController && arr[i].loopType === "LOOP_COUNT" && arr[i].hashTree && arr[i].hashTree.length > 1) { if (arr[i].type === ELEMENT_TYPE.LoopController && arr[i].loopType === "LOOP_COUNT" && arr[i].hashTree && arr[i].hashTree.length > 1) {
arr[i].countController.proceed = true; arr[i].countController.proceed = true;
} }
@ -648,7 +647,6 @@
for (let i in this.scenarioDefinition) { for (let i in this.scenarioDefinition) {
// //
this.scenarioDefinition[i].index = Number(i) + 1; this.scenarioDefinition[i].index = Number(i) + 1;
this.scenarioDefinition[i].active = this.expandedStatus;
// //
if (this.scenarioDefinition[i].type === ELEMENT_TYPE.LoopController && this.scenarioDefinition[i].hashTree if (this.scenarioDefinition[i].type === ELEMENT_TYPE.LoopController && this.scenarioDefinition[i].hashTree
&& this.scenarioDefinition[i].hashTree.length > 1) { && this.scenarioDefinition[i].hashTree.length > 1) {