在vue2中,使用计算属性,将下面数据
"task_dimension_score": {
"prompt": null,
"dimensions": [
{
"desc": "",
"name": "维度1",
"weight": 80,
"elements": [
{
"score_value": 1,
"evaluate_name": "等级1"
},
{
"score_value": 2,
"evaluate_name": "等级2"
},
{
"score_value": 3,
"evaluate_name": "等级3"
},
{
"score_value": 4,
"evaluate_name": "等级4"
},
{
"score_value": 4,
"evaluate_name": "等级6"
},
{
"score_value": 5,
"evaluate_name": "等级5"
}
]
},
{
"desc": "mock dimension",
"name": "流畅度",
"weight": 20,
"elements": [
{
"score_value": 0,
"evaluate_name": "满意"
},
{
"score_value": 0,
"evaluate_name": "一般"
},
{
"score_value": 0,
"evaluate_name": "不满意"
}
]
}
]
}
改成如下形式,如果score_value属性的值一样,只留存一个
"task_dimension_score": {
"prompt": null,
"dimensions": [
{
"desc": "",
"name": "维度1",
"weight": 80,
"elements": [
{
"score_value": 1,
"evaluate_name": "等级1"
},
{
"score_value": 2,
"evaluate_name": "等级2"
},
{
"score_value": 3,
"evaluate_name": "等级3"
},
{
"score_value": 4,
"evaluate_name": "等级4"
},
{
"score_value": 5,
"evaluate_name": "等级5"
}
]
},
{
"desc": "mock dimension",
"name": "流畅度",
"weight": 20,
"elements": [
{
"score_value": 0,
"evaluate_name": "满意"
},
]
}
]
}