两个数组对象合并操作,键值对合并
for (let m = 0; m < meetingSeatList.length; m++) {
const elementSeat = meetingSeatList[m]
seatData.push({
abscissa: elementSeat.abscissa,
areaId: elementSeat.areaId,
areaName: elementSeat.areaName,
meetingId: elementSeat.meetingId,
ordinate: elementSeat.ordinate,
seatAlias: elementSeat.seatAlias,
seatDisabledSorting: elementSeat.isJoinSort,
seatId: elementSeat.id,
seatName: elementSeat.seatName,
seatSequenceNumber: elementSeat.seatSequenceNumber,
seatSize: elementSeat.seatSize,
realSortValue: elementSeat.realSortValue,
seatWhetherDelete: elementSeat.isDelete,
templateId: elementSeat.templateId,
background: '',
departmentId: '',
id: '',
lock: '',
meetingId: '',
meetingTime: '',
mobile: '',
noticeId: '',
orgName: '',
reUserId: '',
relTheirOrgId: '',
sort: '',
theirOrgId: '',
userId: '',
userName: ''
})
for (let n = 0; n < staffInfoList.length; n++) {
const elementStaff = staffInfoList[n]
if (elementSeat.realSortValue === elementStaff.sort) {
seatData[m].background = elementStaff.background
seatData[m].departmentId = elementStaff.departmentId
seatData[m].id = elementStaff.id
seatData[m].lock = elementStaff.lock
seatData[m].meetingId = elementStaff.meetingId
seatData[m].meetingTime = elementStaff.meetingTime
seatData[m].mobile = elementStaff.mobile
seatData[m].noticeId = elementStaff.noticeId
seatData[m].orgName = elementStaff.orgName
seatData[m].reUserId = elementStaff.reUserId
seatData[m].relTheirOrgId = elementStaff.relTheirOrgId
seatData[m].sort = elementStaff.sort
seatData[m].theirOrgId = elementStaff.theirOrgId
seatData[m].userId = elementStaff.userId
seatData[m].userName = elementStaff.userName
}
}
}