fix(视图): 符号地图添加数字类型提示报错

This commit is contained in:
fit2cloud-chenyw 2022-09-29 17:18:44 +08:00
parent c79e6916cc
commit 4814dc53d1

View File

@ -942,10 +942,30 @@ public class ChartDataBuild {
public static Map<String, Object> transTableNormal(Map<String, List<ChartViewFieldDTO>> fieldMap, ChartViewWithBLOBs view, List<String[]> data, List<String> desensitizationList) { public static Map<String, Object> transTableNormal(Map<String, List<ChartViewFieldDTO>> fieldMap, ChartViewWithBLOBs view, List<String[]> data, List<String> desensitizationList) {
List<ChartViewFieldDTO> fields = new ArrayList<>(); List<ChartViewFieldDTO> fields = new ArrayList<>();
List<ChartViewFieldDTO> yfields = new ArrayList<>();
if (CollectionUtils.isNotEmpty(fieldMap.get("xAxis"))) fields.addAll(fieldMap.get("xAxis")); if (CollectionUtils.isNotEmpty(fieldMap.get("xAxis"))) fields.addAll(fieldMap.get("xAxis"));
if (CollectionUtils.isNotEmpty(fieldMap.get("tooltipAxis"))) fields.addAll(fieldMap.get("tooltipAxis")); if (CollectionUtils.isNotEmpty(fieldMap.get("tooltipAxis"))) {
if (CollectionUtils.isNotEmpty(fieldMap.get("labelAxis"))) fields.addAll(fieldMap.get("labelAxis")); fieldMap.get("tooltipAxis").forEach(field -> {
Integer deType = field.getDeType();
if(deType == 2 || deType == 3) {
yfields.add(field);
} else {
fields.add(field);
}
});
}
if (CollectionUtils.isNotEmpty(fieldMap.get("labelAxis"))) {
fieldMap.get("labelAxis").forEach(field -> {
Integer deType = field.getDeType();
if(deType == 2 || deType == 3) {
yfields.add(field);
} else {
fields.add(field);
}
});
}
if (CollectionUtils.isNotEmpty(fieldMap.get("yAxis"))) fields.addAll(fieldMap.get("yAxis")); if (CollectionUtils.isNotEmpty(fieldMap.get("yAxis"))) fields.addAll(fieldMap.get("yAxis"));
if (CollectionUtils.isNotEmpty(yfields)) fields.addAll(yfields);
return transTableNormal(fields, view, data, desensitizationList); return transTableNormal(fields, view, data, desensitizationList);
} }