fix(测试跟踪): 自定义字段显示问题

story 1004114
This commit is contained in:
shiziyuan9527 2022-05-18 18:23:29 +08:00 committed by f2c-ci-robot[bot]
parent 7df2186a95
commit 2f1fc4133e
3 changed files with 11 additions and 2 deletions

View File

@ -72,7 +72,9 @@ public class CustomFieldResourceService {
if (CollectionUtils.isNotEmpty(addFields)) {
this.checkInit();
addFields.forEach(field -> {
createOrUpdateFields(tableName, resourceId, field);
if (StringUtils.isNotBlank(field.getValue()) && StringUtils.isNotBlank(field.getTextValue())) {
createOrUpdateFields(tableName, resourceId, field);
}
});
}
}

View File

@ -57,6 +57,13 @@ 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) {
try {
customFields[i].defaultValue = JSON.parse(customFields[i].defaultValue);
} catch (e) {
// nothing
}
}
if (customFields[i].type === 'richText') {
//00arrpush0splicei+1i
customFields.push(customFields.splice(i, 1)[0]);

View File

@ -96,7 +96,7 @@ export function buildCustomFields(data, param, template) {
template.customFields.forEach(item => {
let customField = {
fieldId: item.id,
value: JSON.stringify(item.defaultValue),
value: item.defaultValue ? JSON.stringify(item.defaultValue): "",
};
if (item.isEdit) {
editFields.push(customField);