fix(测试用例): 导入时标签解析问题#1006699
--bug=1006699 --user=lyh 【github#6097】测试用例使用excel模板导入,标签只要是使用纯数字,会显示成序列,而不是单个标签 https://www.tapd.cn/55049933/s/1048783
This commit is contained in:
parent
9d09795352
commit
f5d1f0614d
|
@ -23,6 +23,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
|
@ -487,6 +488,12 @@ public class TestCaseNoModelDataListener extends AnalysisEventListener<Map<Integ
|
|||
try {
|
||||
if (StringUtils.isNotBlank(tags)) {
|
||||
JSONArray.parse(tags);
|
||||
// 数字
|
||||
String pattern = "[0-9]*";
|
||||
boolean isMatch = Pattern.matches(pattern, tags);
|
||||
if (isMatch) {
|
||||
return "[" + "\""+ tags + "\"" + "]";
|
||||
}
|
||||
return tags;
|
||||
}
|
||||
return "[]";
|
||||
|
|
|
@ -591,7 +591,12 @@ export default {
|
|||
}
|
||||
});
|
||||
this.page.data.forEach((item) => {
|
||||
try {
|
||||
item.tags = JSON.parse(item.tags);
|
||||
} catch (e) {
|
||||
item.tags = [];
|
||||
}
|
||||
|
||||
});
|
||||
checkTableRowIsSelected(this, this.$refs.table);
|
||||
|
||||
|
|
Loading…
Reference in New Issue