AlexandrDr,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
<body>
<div id="app">
<ul>
<li v-for="el of array_out">
{{el}}
</li>
</ul>
</div>
<script>
const webstore = new Vue({
el: '#app',
data() {
return {
array_in: [{
"ASSIGNEE": "Иванова Татьяна",
"SUBCATEGORY": "Обратная связь",
"AVERAGE_TTL": 279
},
{
"ASSIGNEE": "Иванова Татьяна",
"SUBCATEGORY": "Обратная связь от КК",
"AVERAGE_TTL": 4
},
{
"ASSIGNEE": "Петрова Валентина",
"SUBCATEGORY": "Обратная связь",
"AVERAGE_TTL": 4
},
{
"ASSIGNEE": "Петрова Валентина",
"SUBCATEGORY": "Обратная связь от КК",
"AVERAGE_TTL": 114
},
],
array_out: []
}
},
created() {
this.array_out = this.getArray(this.array_in);
},
methods: {
getArray(arr) {
let obj_name = {};
let arr_calculated = [];
arr.forEach(({
ASSIGNEE,
SUBCATEGORY,
AVERAGE_TTL
}) => {
if (obj_name[ASSIGNEE]) {
obj_name[ASSIGNEE][SUBCATEGORY] = AVERAGE_TTL
} else {
obj_name[ASSIGNEE] = {
ASSIGNEE,
[SUBCATEGORY]: AVERAGE_TTL
}
arr_calculated.push(obj_name[ASSIGNEE])
}
})
return arr_calculated;
}
},
});
</script>
</body>
</html>