表格里的数据
const a = [
{
address: '',
contactDeptName: '杨幂',
id: '456'
}
{
address: '',
contactDeptName: '赵丽颖',
id: '123'
}
]
月后端返回的数据
const b={
'456':'12',
'123':'123444444444'
}
总合返回的数据
const c={
'456':'99',
'123':'88'
}
变成
const a2 = [
{
address: '',
contactDeptName: '杨幂',
id: '456',
yue:'12',//月的
zonghe:'99'
}
{
address: '',
contactDeptName: '赵丽颖',
id: '123',
yue:'123444444444',//月的
zonghe:'88'
}
]
a.map((item)=>{
return {
...item,
yue:b[item.id],
zonghe:c[item.id],
}
})