遍历成自己想要的数组
getSeriesData (arr = []) {
let serArr = []
let [...arrDayArrs] = this.defaultData()
let arrData = []
// console.log(arrDayArrs)
arr.forEach((element, index) => {
let serObj = {}
serObj.name = element.channelName
arrData[index] = JSON.parse(JSON.stringify(arrDayArrs))
if (element.data) {
arrData[index].forEach(item => {
element.data.forEach(subEle => {
if (subEle.time === item.time) {
item.time = subEle.time
item.grandCount = subEle.grandCount
}
})
serObj.data = arrData[index]
})
}
serArr.push(serObj)
})
console.log(serArr)
return serArr
},