【发布时间】:2019-11-24 12:35:31
【问题描述】:
如何按CustomerID 对我的数据进行分组?
这是行不通的,我正在尝试不同的方式,但我想我不明白这个结构
这是我的代码:
function CustomerGroup() {
this.$http.post(auth.API_URL + 'api/ProblemsSupports/ProblemsList', null, {
headers: {
'Authorization': 'Bearer ' + auth.getAuthHeader()
}
}).then((response) => {
this.problemitems = response.body
const map = this.problemitems.map(e => (map[e.CustomerID] = map[e.CustomerID]))
return map
this.progress = false
}, (response) => {
if (response.status === 0) {
this.text1 = ' !!!'
this.snackbar = true
this.progress = false
} else {
this.text1 = '!!!!!!'
this.snackbar = true
this.progress = false
}
})
}
【问题讨论】:
-
你想达到什么目的?到底发生了什么?
-
我有不同的问题价值。我需要将此问题分组为 customerID ,例如 - X COMPANY - 40 Problems - Y COMPANY - 50 Problems