dataAll: [ { Count: [1129958, 0, 1, 0], Name: "温度极差报警" }, { Count: [1129959, 0, 0, 0], Name: "最高温度报警" }, { Count: [0, 0, 0, 0], Name: "充电升温速率报警" }, { Count: [1122596, 18, 1136, 35916], Name: "总电压报警" }, { Count: [330996, 215, 2, 11365], Name: "充电总电压上升速率报警" }, { Count: [1089250, 48596, 0, 0], Name: "最大单体电压报警" }, { Count: [19845, 1975, 0, 0], Name: "最低单体电压报警" }, { Count: [0, 0, 0, 0], Name: "电压极差报警" }, { Count: [1151863, 3462, 3122, 1219], Name: "soc报警" } ]
this.dataAll[0].Count.forEach( (item, index)=> { this.dataZong.push( [] ) }) this.dataAll.forEach( (item, index) => { item.Count.forEach( (itemL, indexL)=> { this.dataZong[indexL].push(this.dataAll[index].Count[indexL]) }) })
得到的this.dataZong就是