fix(图表): 日期下钻显示路径错误

This commit is contained in:
wisonic-s 2024-07-02 18:24:37 +08:00
parent 74e54c7b93
commit ebef25efb5
2 changed files with 7 additions and 0 deletions

View File

@ -137,6 +137,12 @@ public class DefaultChartHandler extends AbstractChartPlugin {
Map<String, Object> mapTableNormal = ChartDataBuild.transTableNormal(xAxis, yAxis, view, calcResult.getOriginData(), extStack, desensitizationList);
var drillFilters = filterResult.getFilterList().stream().filter(f -> f.getFilterType() == 1).collect(Collectors.toList());
// 日期下钻替换回去
drillFilters.forEach(f -> {
if (CollectionUtils.isNotEmpty(f.getOriginValue())) {
f.setValue(f.getOriginValue());
}
});
var isDrill = CollectionUtils.isNotEmpty(drillFilters);
// 构建结果
Map<String, Object> dataMap = new HashMap<>();

View File

@ -281,6 +281,7 @@ public class ChartDataManage {
drillFilter.setFilterType(1);
if (datasetTableField.getDeType() == 1) {
drillFilter.setOperator("between");
drillFilter.setOriginValue(Collections.singletonList(dim.getValue()));
// 把value类似过滤组件处理获得start time和end time
Map<String, Long> stringLongMap = Utils.parseDateTimeValue(dim.getValue());
drillFilter.setValue(Arrays.asList(String.valueOf(stringLongMap.get("startTime")), String.valueOf(stringLongMap.get("endTime"))));