Merge remote-tracking branch 'origin/v1.3' into v1.3

This commit is contained in:
shiziyuan9527 2020-10-09 18:40:02 +08:00
commit 42a9074074
9 changed files with 23 additions and 18 deletions

View File

@ -275,7 +275,7 @@ public class TestCaseService {
.map(TestCase::getName)
.collect(Collectors.toSet());
List<ExcelErrData<TestCaseExcelData>> errList = null;
if(multipartFile == null )
if (multipartFile == null)
MSException.throwException(Translator.get("upload_fail"));
if (multipartFile.getOriginalFilename().endsWith(".xmind")) {
@ -288,6 +288,11 @@ public class TestCaseService {
ExcelErrData excelErrData = new ExcelErrData(null, 1, Translator.get("upload_fail") + "" + processLog);
errList.add(excelErrData);
excelResponse.setErrList(errList);
} else if (xmindParser.getNodePaths().isEmpty() && xmindParser.getTestCase().isEmpty()) {
excelResponse.setSuccess(false);
ExcelErrData excelErrData = new ExcelErrData(null, 1, Translator.get("upload_fail") + "" + Translator.get("upload_content_is_null"));
errList.add(excelErrData);
excelResponse.setErrList(errList);
} else {
if (!xmindParser.getNodePaths().isEmpty()) {
testCaseNodeService.createNodes(xmindParser.getNodePaths(), projectId);
@ -299,7 +304,8 @@ public class TestCaseService {
excelResponse.setSuccess(true);
}
} catch (Exception e) {
e.printStackTrace();
LogUtil.error(e.getMessage(), e);
MSException.throwException(e.getMessage());
}
} else {

View File

@ -90,7 +90,7 @@ public class XmindCaseParser {
}
// 递归处理案例数据
private void recursion(StringBuffer processBuffer, Attached parent, int level, List<Attached> attacheds) {
private void recursion(Attached parent, int level, List<Attached> attacheds) {
for (Attached item : attacheds) {
if (isAvailable(item.getTitle(), "(?:tc|tc:|tc)")) { // 用例
item.setParent(parent);
@ -100,7 +100,7 @@ public class XmindCaseParser {
item.setPath(nodePath);
item.setParent(parent);
if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) {
recursion(processBuffer, item, level + 1, item.getChildren().getAttached());
recursion(item, level + 1, item.getChildren().getAttached());
} else {
if (!nodePath.startsWith("/")) {
nodePath = "/" + nodePath;
@ -267,7 +267,6 @@ public class XmindCaseParser {
// 导入思维导图处理
public String parse(MultipartFile multipartFile) {
StringBuffer processBuffer = new StringBuffer();
try {
// 获取思维导图内容
List<JsonRootBean> roots = XmindParser.parseObject(multipartFile);
@ -281,7 +280,7 @@ public class XmindCaseParser {
String nodePath = item.getTitle();
item.setPath(nodePath);
if (item.getChildren() != null && !item.getChildren().getAttached().isEmpty()) {
recursion(processBuffer, item, 1, item.getChildren().getAttached());
recursion(item, 1, item.getChildren().getAttached());
} else {
if (!nodePath.startsWith("/")) {
nodePath = "/" + nodePath;
@ -295,7 +294,8 @@ public class XmindCaseParser {
}
}
}
this.validate();
this.validate(); //检查目录合规性
} catch (Exception ex) {
return ex.getMessage();
}

View File

@ -161,3 +161,4 @@ test_track.length_less_than=The title is too long, the length must be less than
# check owner
check_owner_project=The current user does not have permission to operate this project
check_owner_test=The current user does not have permission to operate this test
upload_content_is_null=Imported content is empty

View File

@ -161,3 +161,4 @@ test_track.length_less_than=标题过长,字数必须小于
# check owner
check_owner_project=当前用户没有操作此项目的权限
check_owner_test=当前用户没有操作此测试的权限
upload_content_is_null=导入内容为空

View File

@ -162,3 +162,4 @@ test_track.length_less_than=標題過長,字數必須小於
# check owner
check_owner_project=當前用戶沒有操作此項目的權限
check_owner_test=當前用戶沒有操作此測試的權限
upload_content_is_null=導入內容為空

View File

@ -39,8 +39,7 @@
:disabled="!row.edit || readOnly"
size="mini"
v-model="row.enable"
active-color="#13ce66"
inactive-color="#ff4949">
inactive-color="#DCDFE6">
</el-switch>
</template>
</el-table-column>

View File

@ -37,8 +37,7 @@
<el-table-column prop="status" :label="$t('commons.status')">
<template v-slot:default="scope">
<el-switch v-model="scope.row.status"
active-color="#13ce66"
inactive-color="#ff4949"
inactive-color="#DCDFE6"
active-value="ACTIVE"
inactive-value="DISABLED"
@change="changeSwitch(scope.row)"

View File

@ -16,8 +16,7 @@
<el-table-column prop="status" :label="$t('test_resource_pool.enable_disable')">
<template v-slot:default="scope">
<el-switch v-model="scope.row.status"
active-color="#13ce66"
inactive-color="#ff4949"
inactive-color="#DCDFE6"
active-value="VALID"
inactive-value="INVALID"
@change="changeSwitch(scope.row)"

View File

@ -19,8 +19,7 @@
<el-table-column prop="status" :label="$t('commons.status')" width="120">
<template v-slot:default="scope">
<el-switch v-model="scope.row.status"
active-color="#13ce66"
inactive-color="#ff4949"
inactive-color="#DCDFE6"
active-value="1"
inactive-value="0"
@change="changeSwitch(scope.row)"