es6 递归 tree
function loop(data) {
let office = data.map(item => {
if(item.type == '1' ||item.type == '2') {
item = {...item,disabled:true,children:loop(item.children)}
return item
}else {
return item
}
})
return office
}
let officeDataTree = loop(officeData)