fix(测试跟踪): 英文语境下,用例导入用例等级失败

This commit is contained in:
chenjianxing 2023-02-03 19:47:58 +08:00 committed by jianxing
parent 6c3bf896d7
commit 7901950a0d
2 changed files with 11 additions and 4 deletions

View File

@ -402,6 +402,12 @@ public class TestCaseNoModelDataListener extends AnalysisEventListener<Map<Integ
if (TestCaseImportFiled.MAINTAINER.getFiledLangMap().containsValue(fieldName.replace("(ID)", StringUtils.EMPTY))) {
fieldName = TestCaseImportFiled.MAINTAINER.getFiledLangMap().get(Locale.SIMPLIFIED_CHINESE); // 兼容旧模板的 责任人(ID)
}
if (TestCaseImportFiled.PRIORITY.getFiledLangMap().containsValue(fieldName)) {
fieldName = TestCaseImportFiled.PRIORITY.getFiledLangMap().get(Locale.SIMPLIFIED_CHINESE);
}
if (TestCaseImportFiled.STATUS.getFiledLangMap().containsValue(fieldName)) {
fieldName = TestCaseImportFiled.STATUS.getFiledLangMap().get(Locale.SIMPLIFIED_CHINESE);
}
CustomFieldDao customField = customFieldsMap.get(fieldName);
if (customField == null) {
continue;
@ -420,9 +426,9 @@ public class TestCaseNoModelDataListener extends AnalysisEventListener<Map<Integ
stringBuilder.append(e.getMessage().concat(ERROR_MSG_SEPARATOR));
}
if (StringUtils.equals(fieldName, TestCaseImportFiled.STATUS.getFiledLangMap().get(Locale.SIMPLIFIED_CHINESE))) {
data.setStatus(customData.get(fieldName).toString());
data.setStatus(customData.get(originFieldName).toString());
} else if (StringUtils.equals(fieldName, TestCaseImportFiled.PRIORITY.getFiledLangMap().get(Locale.SIMPLIFIED_CHINESE))) {
data.setPriority(customData.get(fieldName).toString());
data.setPriority(customData.get(originFieldName).toString());
} else if (StringUtils.equals(fieldName, TestCaseImportFiled.MAINTAINER.getFiledLangMap().get(Locale.SIMPLIFIED_CHINESE))) {
data.setMaintainer(customData.get(originFieldName).toString());
}

View File

@ -314,7 +314,7 @@ import TestPlanCaseIssueItem from "@/business/plan/view/comonents/functional/Tes
import {
getProjectMemberOption,
getProjectVersions,
getAdvSearchCustomField
getAdvSearchCustomField, parseTag
} from "@/business/utils/sdk-utils";
import {
testPlanTestCaseBatchDelete,
@ -628,13 +628,14 @@ export default {
this.total = r.data.itemCount;
this.pageCount = Math.ceil(this.total / this.pageSize);
this.tableData = r.data.listObject;
parseTag(this.tableData);
parseCustomFilesForList(this.tableData);
for (let i = 0; i < this.tableData.length; i++) {
if (this.tableData[i]) {
if (this.tableData[i].customFields) {
this.tableData[i].customFields = JSON.parse(this.tableData[i].customFields);
}
this.$set(this.tableData[i], "showTags", JSON.parse(this.tableData[i].tags));
this.$set(this.tableData[i], "showTags", this.tableData[i].tags);
this.$set(this.tableData[i], "issuesSize", this.tableData[i].issuesCount);
this.$set(this.tableData[i], "hasLoadIssue", false);
this.$set(this.tableData[i], "issuesContent", []);