优化以下map方法
_eventGroup: function () {
let buttonList = {};
_.map(this.buttons, (item)=>{
if(item.tag === 'button'){
const btnId = _.uniqueId('advantedBtn_')
item.attrs.btnId = btnId;
buttonList[btnId] = item.attrs;
} else {
_.map(item.children, (i) =>{
if(i.tag === 'button'){
const btnId = _.uniqueId('advantedBtn_')
i.attrs.btnId = btnId;
buttonList[btnId] = i.attrs;
}
})
}
});
return buttonList
},