Преглед на файлове

修复single——report视图

insomniaLee преди 5 години
родител
ревизия
be1cc44b0f
променени са 2 файла, в които са добавени 19 реда и са изтрити 4 реда
  1. 17 2
      src/main/java/com/mooctest/controller/ReportController.java
  2. 2 2
      src/main/resources/templates/single_report.html

+ 17 - 2
src/main/java/com/mooctest/controller/ReportController.java

@@ -189,14 +189,14 @@ public class ReportController {
         List<FinalReportDTO> finalReports =new ArrayList<>();
         Map<String,String> sing2root = historyService.getSingle2Root(caseId, examId);
         String treeReportId = sing2root.get(id);
+        finalReports.addAll(finalReportService.getBySourceId(id));
         if(masterReportSource == null){
             // 如果不存在聚合报告;
             model.addAttribute("hasMaster",false);
         }else{
             model.addAttribute("hasMaster",true);
             String masterId = masterReportSource.getMasterId();
-            finalReports.addAll(finalReportService.getBySourceId(masterId)); // 和这份报告suoshu julei baogao de fincal bgoa
-
+            addDistinctFinalReport(finalReports,finalReportService.getBySourceId(masterId));
             model.addAttribute("masterName","ML-AG-"+masterId.substring(10));
             model.addAttribute("masterUrl","/report?masterId="+masterId+"&examId="+examId+"&caseId="+caseId);
         }
@@ -258,6 +258,21 @@ public class ReportController {
         return "agg_report_new::ul_reports";
     }
 
+    //报告列表
+    @GetMapping("created_reports_single")
+    public String getCreatedReportsSingle(@RequestParam("masterId") String masterId,
+                                    @RequestParam("examId") long examId,
+                                    @RequestParam("caseId") long caseId,Model model){
+        List<FinalReportDTO> finalReports = finalReportService.getBySourceId(masterId);
+        model.addAttribute("examId", examId);
+        model.addAttribute("caseId", caseId);
+        model.addAttribute("finalReports", finalReports);
+        model.addAttribute("category2String", ReportUtil.category2String);
+        model.addAttribute("recurrent2String", ReportUtil.recurrent2String);
+        model.addAttribute("severity2String", ReportUtil.severity2String);
+        return "single_report::ul_reports";
+    }
+
     //创建报告界面
     @GetMapping("created_reports_form")
     public String getCreatedReportssd(Model model){

+ 2 - 2
src/main/resources/templates/single_report.html

@@ -279,7 +279,7 @@
                                         <div style="overflow: auto;">
                                             <span th:text="${finalReport.id}"></span>
                                             <span class="pull-right">
-                                            <a href="#" th:onclick="'editReport('+${finalReport.id}+')'" >编辑</a>
+<!--                                            <a href="#" th:onclick="'editReport('+${finalReport.id}+')'" >编辑</a>-->
                                             <a href="#" th:onclick="'deleteReport('+ ${finalReport.id} +')'">删除</a>
                                         </span>
                                         </div>
@@ -446,7 +446,7 @@
     function loadPartReports() {
         console.log("局部刷新")
         /*<![CDATA[*/
-        $('#new-created-reports-panel').load("/created_reports?masterId="+ reportId +"&caseId="+ caseId +"&examId="+ examId );
+        $('#new-created-reports-panel').load("/created_reports_single?masterId="+ reportId +"&caseId="+ caseId +"&examId="+ examId );
         //$('#new-report-create-block').load("/created_reports_form");
         finalReportId = null
         /*]]>*/