export function treeTranslation(tree, oldkeys = [], newkeys = ["id", "label", "children"]) {
    let newTree = [];
    tree.forEach((item) => {
        let newItem = {};
        newItem[newkeys[0]] = item[oldkeys[0]];
        newItem[newkeys[1]] = item[oldkeys[1]];
        newItem[newkeys[2]] = item[oldkeys[2]];
        newItem.level = item.level;
        if (item.children && item.children.length) {
            const children = treeTranslation(item.children, [
                "code",
                "name",
                "children",
            ]);
            newItem.children = children;
        } else {
            newItem.children = [];
        }
        newTree.push(newItem);
    });
    return newTree;
}