找出数组中相同名称的对象并合并
list.forEach((item) => {
const repeat = newArray.find((res) => res.name === item.name);
if (!repeat) {
newArray.push({
name: item.name,
...item
});
} else {
newArray.forEach(ele =>{
if(item.name == ele.name){
Object.assign(ele, item)
}
})
}
});