//处理头部函数
export default function cutHeader(arr) {
    let first = {}
        //一级循环出来一级标签
    arr.map(item => {
            if (!!first[item.FirstTag] && first[item.FirstTag].length) {} else {
                first[item.FirstTag] = []
            }
            first[item.FirstTag].push(item)
        })
        // 循环出第二级标签
    let sound = []
    for (let key in first) {
        let obj = {
            FirstTag: key,
            details: {}
        }
        first[key].map(item => {
            if (!!obj.details[item.SecondTag] && obj.details[item.SecondTag].length) {

            } else {
                obj.details[item.SecondTag] = []
            }
            obj.details[item.SecondTag].push(item)
        })
        sound.push(obj)
    }
    // 循环出制定的数据结构
    let newArr = sound.map(item => {
        let copyarr = Object.assign(item.details, {})
        for (let k in item.details) {
            if (item.details instanceof Array) {} else {
                item.details = []
            }
            item.details.push({
                SecondTag: k,
                details: copyarr[k]
            })
        }
        return item
    })
    return newArr
}