feat: 解决预警等级数量问题
This commit is contained in:
@ -46,10 +46,10 @@ const initCharts = (data) => {
|
||||
];
|
||||
data.forEach(item => {
|
||||
item.count = isNaN(Number(item?.count) || 0) ? 0 : item.count;
|
||||
if (item.yj_jb == '10') countData[0].value = item.count;
|
||||
if (item.yj_jb == '20') countData[1].value = item.count;
|
||||
if (item.yj_jb == '30') countData[2].value = item.count;
|
||||
if (item.yj_jb == '40') countData[3].value = item.count;
|
||||
if (item.yj_jb == '10' || item.yj_jb == '01') countData[0].value = item.count;
|
||||
if (item.yj_jb == '20' || item.yj_jb == '02') countData[1].value = item.count;
|
||||
if (item.yj_jb == '30' || item.yj_jb == '03') countData[2].value = item.count;
|
||||
if (item.yj_jb == '40' || item.yj_jb == '04') countData[3].value = item.count;
|
||||
});
|
||||
vehicleChart.setOption(createChartOption(countData, colors))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user