/** 判断值是否存在 */
isNotExists (value) {
return value === undefined || value === null || value === '' || value === 'undefined'
},
// 对象复制 name为空时obj1复制到obj2 不为空则在obj2中的名字为 name + 原对象名字首字母大写命名
copyObject (obj1, obj2, name) {
for (var p in obj1) {
if (this.isNotExists(name)) {
// name为空时obj1复制到obj2
if (obj1.hasOwnProperty(p) && !obj2.hasOwnProperty(p)) {
obj2[p] = obj1[p]
}
} else {
// obj2 不为空则在obj2中的名字为 name + 原对象名字首字母大写命名
let _p = p.toLowerCase()
_p = _p.replace(/\b\w+\b/g, function (word) {
return word.substring(0, 1).toUpperCase() + word.substring(1)
})
if (obj1.hasOwnProperty(p) && !obj2.hasOwnProperty(p)) {
obj2[name + _p] = obj1[p]
}
}
}
return obj2
}