parent
7df2186a95
commit
2f1fc4133e
|
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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') {
|
||||
//循环到是0的位置就删除该元素0并且在arr末尾push进这个元素0,由于splice删除了该位置元素,所以i不用+1,下次循环仍然检查i位置的元素
|
||||
customFields.push(customFields.splice(i, 1)[0]);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue