diff --git a/framework/sdk-parent/frontend/src/utils/tableUtils.js b/framework/sdk-parent/frontend/src/utils/tableUtils.js index 163938046a..4ea24f6109 100644 --- a/framework/sdk-parent/frontend/src/utils/tableUtils.js +++ b/framework/sdk-parent/frontend/src/utils/tableUtils.js @@ -544,11 +544,13 @@ export function getCustomFieldValue(row, field, members) { return val; } else if (field.type === 'multipleInput') { let val = ''; - if (item.value instanceof Array) { - item.value.forEach(i => { - val += i + ' '; - }); + if (!item.value || item.value === '') { + return val; } + let mulArr = parseMultipleInputToArray(item.value) + mulArr.forEach(i => { + val += i + ' '; + }); return val; } else if (field.type === 'datetime' || field.type === 'date') { return datetimeFormat(item.value); @@ -561,6 +563,29 @@ export function getCustomFieldValue(row, field, members) { } } +/** + * 多值输入值解析, 按照导入规则括号中字符可解析[, ; ,;|] + * @param mulInputStr + * @returns {*[]|*} + */ +export function parseMultipleInputToArray(mulInputStr) { + if (mulInputStr.indexOf(",")) { + return mulInputStr.split(",") + } else if (mulInputStr.indexOf(";")) { + return mulInputStr.split(";") + } else if (mulInputStr.indexOf(",")) { + return mulInputStr.split(",") + } else if (mulInputStr.indexOf(";")) { + return mulInputStr.split(";") + } else if (mulInputStr.indexOf("|")) { + return mulInputStr.split("|") + } else { + let mulArr = []; + mulArr.push(mulInputStr) + return mulArr; + } +} + /** * 获取批量编辑的自定义字段选项 * @param customFields