res.data.two5.pData.map(row=>{
if(row.name==='一般')
row.itemStyle = {
"color": "#5B9BD5"
}
if(row.name==='严重')
row.itemStyle = {
"color": "#FFC000"
}
if(row.name==='非常严重')
row.itemStyle = {
"color": "#FF0000"
}
return row;
});

过滤器

filters : {
createColors(data){
var colors = [];
if(data.rows==undefined){
return colors;
}
data.rows.forEach(row=>{
colors.push(row.itemStyle.color)
});
return colors;
},
}

转载于:https://www.cnblogs.com/wcss/p/11026955.html

Logo

前往低代码交流专区

更多推荐