diff --git a/backend/src/main/java/io/metersphere/excel/listener/TestCaseNoModelDataListener.java b/backend/src/main/java/io/metersphere/excel/listener/TestCaseNoModelDataListener.java index 2e21e64502..71cd6feab3 100644 --- a/backend/src/main/java/io/metersphere/excel/listener/TestCaseNoModelDataListener.java +++ b/backend/src/main/java/io/metersphere/excel/listener/TestCaseNoModelDataListener.java @@ -521,11 +521,11 @@ public class TestCaseNoModelDataListener extends AnalysisEventListener rowNums = new HashSet<>(); if (data.getStepDesc() != null) { - String[] stepDesc = data.getStepDesc().split("\r\n"); + String[] stepDesc = data.getStepDesc().split("\r|\n|\r\n"); int rowIndex = 1; for (String row : stepDesc) { - TestCaseNoModelDataListener.RowInfo rowInfo = this.parseIndexInRow(row); + TestCaseNoModelDataListener.RowInfo rowInfo = this.parseIndexInRow(row,rowIndex); stepDescList.add(rowInfo.rowInfo); rowNums.add(rowIndex++); } @@ -534,21 +534,13 @@ public class TestCaseNoModelDataListener extends AnalysisEventListener -1 && rowNums.contains(rowIndex)) { - listUtils.set(stepResList, lastStepIndex - 1, rowMessage, ""); - lastStepIndex = rowIndex; - } else { - listUtils.set(stepResList, lastStepIndex - 1, rowMessage, ""); - lastStepIndex++; - } + stepResList.add(rowMessage); + lastStepIndex++; } } else { stepResList.add(""); @@ -578,7 +570,7 @@ public class TestCaseNoModelDataListener extends AnalysisEventListener 0) { String indexString = rowSplit[0]; - if (StringUtils.isNumeric(indexString)) { + if (StringUtils.isNumeric(indexString)&&indexString.equals(String.valueOf(rowIndex))) { try { index = Integer.parseInt(indexString); rowMessage = StringUtils.substring(parseString, indexString.length() + splitChar.length());