parent
c1330135f3
commit
0140f07bad
|
@ -218,7 +218,9 @@ public class TestCaseService {
|
|||
|
||||
testCaseMapper.insert(request);
|
||||
saveFollows(request.getId(), request.getFollows());
|
||||
customFieldTestCaseService.addFields(request.getId(), request.getAddFields());
|
||||
List<CustomFieldResource> addFields = request.getAddFields();
|
||||
addFields.addAll(request.getEditFields());
|
||||
customFieldTestCaseService.addFields(request.getId(), addFields);
|
||||
return request;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ export default {
|
|||
let total = 0;//定义total用于控制循环结束
|
||||
let customFields = this.issueTemplate.customFields;
|
||||
for (let i = 0; total < customFields.length; total++) {
|
||||
if (customFields[i].type === 'input' && typeof (customFields[i].defaultValue) === 'string' || customFields[i].defaultValue instanceof String) {
|
||||
if (typeof (customFields[i].defaultValue) === 'string' || customFields[i].defaultValue instanceof String) {
|
||||
try {
|
||||
customFields[i].defaultValue = JSON.parse(customFields[i].defaultValue);
|
||||
} catch (e) {
|
||||
|
|
|
@ -28,7 +28,13 @@ export function parseCustomField(data, template, rules, oldFields) {
|
|||
template.customFields.forEach(item => {
|
||||
|
||||
if (item.defaultValue && !item.hasParse) {
|
||||
setDefaultValue(item, JSON.parse(item.defaultValue));
|
||||
let val = item.defaultValue;
|
||||
try {
|
||||
val = JSON.parse(item.defaultValue);
|
||||
} catch (e) {
|
||||
//
|
||||
}
|
||||
setDefaultValue(item, val);
|
||||
}
|
||||
|
||||
// 添加自定义字段必填校验
|
||||
|
|
Loading…
Reference in New Issue