You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.5 KiB
55 lines
1.5 KiB
<html>
|
|
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<script>
|
|
const input = {
|
|
"code": 200,
|
|
"data": [
|
|
{
|
|
"wx_openid": "ozFDj00JgajMrVjirC8xZj_ClS3k",
|
|
"wx_cancel_count": 0,
|
|
"person_name": "张三",
|
|
"wx_running_count": 6,
|
|
"wx_allcount": 13,
|
|
"wx_finish_count": 7,
|
|
"person_id": "643E5C08-AB12-417E-94D0-3B5E3AE5D32F"
|
|
},
|
|
{
|
|
"wx_openid": "-1",
|
|
"wx_cancel_count": 0,
|
|
"person_name": "李四",
|
|
"wx_running_count": 10,
|
|
"wx_allcount": 14,
|
|
"wx_finish_count": 4,
|
|
"person_id": "E2B9D118-AC7F-42D8-869E-B65DE8118853"
|
|
}
|
|
]
|
|
};
|
|
|
|
const output = {
|
|
categories: input.data.map(item => item.person_name),
|
|
series: [
|
|
{
|
|
name: "维修中",
|
|
data: input.data.map(item => item.wx_running_count)
|
|
},
|
|
{
|
|
name: "已维修",
|
|
data: input.data.map(item => item.wx_finish_count)
|
|
}
|
|
]
|
|
};
|
|
|
|
console.log(output);
|
|
|
|
|
|
</script>
|
|
</body>
|
|
|
|
</html> |