forked from github/dataease
Merge pull request #6086 from dataease/pr@dev@fix_mark_map_template
fix: 使用echarts地图符号功能模版报错#5918
This commit is contained in:
commit
e2a80af0cf
@ -604,12 +604,21 @@ public class ChartViewService {
|
|||||||
List<ChartViewFieldDTO> viewFields = gson.fromJson(view.getViewFields(), tokenType);
|
List<ChartViewFieldDTO> viewFields = gson.fromJson(view.getViewFields(), tokenType);
|
||||||
final Map<String, List<ChartViewFieldDTO>> extFieldsMap = new LinkedHashMap<>();
|
final Map<String, List<ChartViewFieldDTO>> extFieldsMap = new LinkedHashMap<>();
|
||||||
if (CollectionUtils.isNotEmpty(viewFields)) {
|
if (CollectionUtils.isNotEmpty(viewFields)) {
|
||||||
viewFields.forEach(field -> {
|
String[] busiFlagArray = new String[] {"daxis", "locationXaxis", "locationYaxis"};
|
||||||
|
Map<String, Boolean> flagMap = new HashMap<>();
|
||||||
|
for (String s : busiFlagArray) {
|
||||||
|
flagMap.put(s, false);
|
||||||
|
}
|
||||||
|
for (ChartViewFieldDTO field : viewFields) {
|
||||||
|
flagMap.put(field.getBusiType(), true);
|
||||||
String busiType = field.getBusiType();
|
String busiType = field.getBusiType();
|
||||||
List<ChartViewFieldDTO> list = extFieldsMap.containsKey(busiType) ? extFieldsMap.get(busiType) : new ArrayList<>();
|
List<ChartViewFieldDTO> list = extFieldsMap.containsKey(busiType) ? extFieldsMap.get(busiType) : new ArrayList<>();
|
||||||
list.add(field);
|
list.add(field);
|
||||||
extFieldsMap.put(field.getBusiType(), list);
|
extFieldsMap.put(field.getBusiType(), list);
|
||||||
});
|
}
|
||||||
|
if (flagMap.get("daxis") && (!flagMap.get("locationXaxis") || !flagMap.get("locationYaxis"))) {
|
||||||
|
viewFields = viewFields.stream().filter(field -> !StringUtils.equals("daxis", field.getBusiType())).collect(Collectors.toList());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ChartViewFieldDTO> xAxisBase = gson.fromJson(view.getXAxis(), tokenType);
|
List<ChartViewFieldDTO> xAxisBase = gson.fromJson(view.getXAxis(), tokenType);
|
||||||
|
Loading…
Reference in New Issue
Block a user