const getList = (data) => {
let res = [];
const toList = ({serve, name, children}, index, prefix = '') => {
const id = prefix ? prefix + '.' + (index + 1) : (index + 1);
res.push({id: id, serve: serve, name: name});
children && children.length > 0 && children.forEach((v, k) => toList(v, k, id));
}
data.forEach((item, key) => {toList(item, key)});
return res;
}