/** * 将对象中属性值为undefined的替换为'',源对象不会被修改 * @param {Object} source 源对象 * @return {Object} 新对象 */ static undefinedToStr = function(source) { let newObj = ObjectUtil.deepCopy(source); for (let key in newObj) { if (newObj.hasOwnProperty(key) && newObj[key] === undefined) { newObj[key] = ''; } } return newObj; };