const floorList = [];
const roomIdList = [];
needfloorList.forEach(listItem => {
const floorObj = floorList.find(
item => item.floorNumber === listItem.floor
);
if (floorObj) {
roomIdList.push(listItem.id);
return floorObj.roomOptions.push({
roomName:
this.currentBuilding.label +
'-' +
(~listItem.unit.indexOf('单元')
? listItem.unit
: listItem.unit + '单元') +
'-' +
listItem.room,
roomValue: listItem.id
});
}
roomIdList.push(listItem.id);
floorList.push({
floorNumber: listItem.floor,
roomOptions: [
{
roomName:
this.currentBuilding.label +
'-' +
(~listItem.unit.indexOf('单元')
? listItem.unit
: listItem.unit + '单元') +
'-' +
listItem.room,
roomValue: listItem.id
}
]
});
});