Skip to content

Commit

Permalink
Merge pull request #9716 from dataease/pr@dev@fix_report_panel_name
Browse files Browse the repository at this point in the history
fix(X-Pack): 定时报告选择名称带/的仪表板报错
  • Loading branch information
fit2cloud-chenyw committed May 18, 2024
2 parents b21e3fe + 0530205 commit 8941757
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,15 @@ public List<File> export(String panelId, List<String> viewIds, PermissionProxy p
Map<String, ChartExtRequest> stringChartExtRequestMap = buildViewRequest(panelDto, justView);
List<File> results = new ArrayList<>();
List<ExcelSheetModel> sheets = viewIds.stream().map(viewId -> viewFiles(viewId, stringChartExtRequestMap.get(viewId))).collect(Collectors.toList());
File excelFile = ExcelUtils.exportExcel(sheets, panelDto.getName(), panelDto.getId() + "_" + taskId);
File excelFile = ExcelUtils.exportExcel(sheets, getSafeFileName(panelDto.getName()), panelDto.getId() + "_" + taskId);
results.add(excelFile);
return results;
}

private String getSafeFileName(String fileName) {
return fileName.replace("/", "_");
}


private Map<String, ChartExtRequest> buildViewRequest(PanelGroupDTO panelDto, Boolean justView) {
String componentsJson = panelDto.getPanelData();
Expand Down

0 comments on commit 8941757

Please sign in to comment.