SOURCE

let dataList = [
    { serviceTime: '2020/12/4', name: '大额提现预约' },
    { serviceTime: '2020/12/4', name: '现金取款' },
    { serviceTime: '2020/12/3', name: '大额提现预约' },
    { serviceTime: '2020/12/2', name: '提前预约' },
    { serviceTime: '2020/12/1', name: '大额提现预约' },
]
function dealDate(data) {
    let c = []; let d = {}
    data.forEach(item => {
        if (!d[item.serviceTime]) {
            c.push({
                serviceTime: item.serviceTime,
                allData: [item]
            });
            d[item.serviceTime] = item
        } else {
            c.forEach(ele => {
                if (ele.serviceTime == item.serviceTime) {
                    ele.allData.push(item)
                }
            })
        }
    })
    return c
}
console.log(dealDate(dataList))
console 命令行工具 X clear

                    
>
console