"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.transToTreeNode = void 0;

var _index = require("../../../components/menu-tree/tree-node/index");

var transToTreeNode = function transToTreeNode(data) {
  var res = [];
  data.forEach(function (user) {
    var node = {
      id: user.userId,
      title: user.name,
      key: "".concat(user.userId),
      nodeType: _index.USER_NODE,
      data: user,
      isLeaf: !user.hasSubordinates,
      isFlip: false,
      pid: user.managerId
    };
    res.push(node);
  });
  return res;
};

exports.transToTreeNode = transToTreeNode;