code: function toArrayTree (array, options) {
    var opts = baseExports.assign({}, setupDefaults.treeOptions, options)
    var optStrict = opts.strict
    var optKey = opts.key
    var optParentKey = opts.parentKey
    var optChildren = opts.children
    var optSortKey = opts.sortKey
    var optReverse = opts.reverse
    var optData = opts.data
    var result = []
    var treeMap = {}
    var idList, id, treeData, parentId
  
    if (optSortKey) {
      array = arraySort(baseExports.clone(array), optSortKey)
      if (optReverse) {
        array = array.reverse()
      }
    }
  
    idList = arrayMap(array, function (item) {
      return item[optKey]
    })
  
    baseExports.each(array, function (item) {
      id = item[optKey]
  
      if (optData) {
        treeData = {}
        treeData[optData] = item
      } else {
        treeData = item
      }
  
      parentId = item[optParentKey]
      treeMap[id] = treeMap[id] || []
      treeMap[parentId] = treeMap[parentId] || []
      treeMap[parentId].push(treeData)
      treeData[optKey] = id
      treeData[optParentKey] = parentId
      treeData[optChildren] = treeMap[id]
  
      if (!optStrict || (optStrict && !parentId)) {
        if (!baseExports.includes(idList, parentId)) {
          result.push(treeData)
        }
      }
    })
  
    if (optStrict) {
      strictTree(array, optChildren)
    }
  
    return result
  }
docs: 将一个带层级的数据列表转成树结构
  
  @param {Array} array 数组
  @param {Object} options {strict: false, parentKey: 'parentId', key: 'id', children: 'children', data: 'data'}
  @return {Array}