final_report_list.html 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <!DOCTYPE html>
  2. <html lang="zh-CN" xmlns:th="http://www.thymeleaf.org"
  3. xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
  4. layout:decorator="main">
  5. <head>
  6. <link rel="stylesheet" type="text/css" href="/static/css/main.css"/>
  7. <link rel="stylesheet" type="text/css" href="/static/css/app_info.css"/>
  8. <!-- dataTables -->
  9. <link rel="stylesheet" type="text/css"
  10. href="/static/AdminLTE/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css"/>
  11. <!-- Select2 -->
  12. <link rel="stylesheet" type="text/css" href="/static/AdminLTE/bower_components/select2/dist/css/select2.min.css"/>
  13. </head>
  14. <body>
  15. <th:block layout:fragment="sidebar">
  16. <li class="treeview">
  17. <a href="#">
  18. <i class="fa fa-list"></i>
  19. <span>审核报告</span>
  20. <span class="pull-right-container">
  21. <i class="fa fa-angle-left pull-right"></i>
  22. </span>
  23. </a>
  24. <ul class="treeview-menu" style="display: block;">
  25. <li>
  26. <a th:href="'/task_detail?examId='+${examId}+'&amp;caseId='+${caseId}">
  27. <i class="fa fa-sticky-note text-success"></i>
  28. <span>默认视图</span>
  29. </a>
  30. </li>
  31. <li>
  32. <a th:href="'/agg_report_list?examId='+${examId}+'&amp;caseId='+${caseId}">
  33. <i class="fa fa-sitemap text-warning"></i>
  34. <span>聚合视图</span>
  35. </a>
  36. </li>
  37. <li>
  38. <!--<a th:href="'/history/getTrees?case_take_id='+${caseId}-${examId}+'&amp;start='+0+'&amp;count='+10+'&amp;page=null&amp;identity='+0+'&amp;report_id='+5cbc1a9f825a8960cdc7bd4f+'&amp;worker_id='+22383+'">-->
  39. <a th:href="'/history/getTrees?case_take_id=1281-2724&amp;start=0&amp;count=10&amp;page=null&amp;identity=0&amp;report_id=5cbc1a9f825a8960cdc7bd4f&amp;worker_id=22383'">
  40. <!--<a th:href="'/history/getTrees2?examId='+${caseId}+'">-->
  41. <i class="fa fa-sitemap text-warning"></i>
  42. <span>新增视图</span>
  43. </a>
  44. </li>
  45. </ul>
  46. </li>
  47. </th:block>
  48. <th:block layout:fragment="maincontent">
  49. <section class="content-header">
  50. <h1>预交付报告
  51. <small th:text="${task.name}"></small>
  52. </h1>
  53. <ol class="breadcrumb">
  54. <li>
  55. <a href="/home">
  56. <i class="fa fa-dashboard"></i>
  57. 全部任务
  58. </a>
  59. </li>
  60. <li class="active" th:text="|${task.name} 预交付报告|">
  61. </li>
  62. </ol>
  63. </section>
  64. <section class="content container-fluid">
  65. <!-- Report List Table -->
  66. <div class="assign-div pull-right">
  67. <button id="export-btn" class="btn btn-sm btn-assign pull-right">
  68. <i class="fa fa-coffee" style="margin-right: 3px;"></i>
  69. <span>导出报告</span>
  70. </button>
  71. </div>
  72. <table id="report-list" class="table table-striped table-bordered" cellpadding="0" width="100%">
  73. <thead>
  74. <tr>
  75. <th>类别</th>
  76. <th>严重程度</th>
  77. <th>可复现程度</th>
  78. <th>描述</th>
  79. <th>来源</th>
  80. <th>创建人</th>
  81. <th>操作</th>
  82. </tr>
  83. </thead>
  84. <tbody>
  85. <th:block th:each="report : ${finalReports}">
  86. <tr th:class="|row-${report.id}|">
  87. <td>
  88. <!--<i class="fa fa-square" style="color: {{ report.print_bug_category_color }};"></i>-->
  89. <span th:text="${category2String.get(report.category)}"></span>
  90. </td>
  91. <td>
  92. <img th:alt="|${severity2String.get(report.severity)} Image|" height="14"
  93. th:src="'/static/images/icons/priorities/' + ${report.severity} + '.png'"/>
  94. <span th:text="${severity2String.get(report.severity)}"></span>
  95. </td>
  96. <td>
  97. <span th:text="${recurrent2String.get(report.recurrent)}"></span>
  98. </td>
  99. <td style="width: 300px;">
  100. <div th:id="'ab-content-' + ${report.id}" data-toggle="collapse" th:attr="data-target='#full-content-' + ${report.id}" class="trunc collapse in" th:text="${report.description}">
  101. </div>
  102. <div th:id="'full-content-' + ${report.id}" data-toggle="collapse" th:attr="data-target='#ab-content-' + ${report.id}" class="full-content collapse">
  103. <span th:text="${report.description}"></span>
  104. <br/>
  105. <img class="my-img-thumbnail pointer" th:src="${imgUrl}"
  106. th:each="imgUrl,iterStat : ${report.getImgUrls()}"
  107. onclick="showimage(event);"/>
  108. </div>
  109. </td>
  110. <td class="report-aggregator">
  111. <a th:if="${report.sourceId}" th:href="'report?masterId='+${report.sourceId}+'&amp;examId='+${examId}+'&amp;caseId='+${caseId}"
  112. th:text="|ML-AG-${report.sourceId.substring(10)}|"></a>
  113. </td>
  114. <td class="report-assignee">
  115. 管理员
  116. </td>
  117. <td>
  118. <a th:if="${report.sourceId}" th:href="'report?masterId='+${report.sourceId}+'&amp;examId='+${examId}+'&amp;caseId='+${caseId}+'&amp;finalReportId='+${report.id}">编辑</a>
  119. <a href="#" th:onclick="'deleteReport('+ ${report.id} +')'">删除</a>
  120. </td>
  121. </tr>
  122. </th:block>
  123. </tbody>
  124. </table>
  125. </section>
  126. </th:block>
  127. </body>
  128. </html>
  129. <div class="modal fade bs-example-modal-lg text-center" id="imgModal" tabindex="-1" role="dialog"
  130. aria-labelledby="myLargeModalLabel">
  131. <div class="modal-dialog modal-lg" style="display: inline-block; width: 300px;">
  132. <div class="modal-content">
  133. <img id="imgInModalID"
  134. class="carousel-inner img-responsive img-rounded"
  135. onclick="closeImageViewer()"
  136. onmouseover="this.style.cursor='pointer';this.style.cursor='hand'"
  137. onmouseout="this.style.cursor='default'"
  138. />
  139. </div>
  140. </div>
  141. </div>
  142. <script src="/static/AdminLTE/bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
  143. <script src="/static/AdminLTE/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
  144. <script src="/static/AdminLTE/bower_components/select2/dist/js/select2.min.js"></script>
  145. <script src="/static/js/app_info.js"></script>
  146. <script type="text/javascript">
  147. function deleteReport(finalReportId) {
  148. $.ajax({
  149. url: '/final_report/' + finalReportId,
  150. type: 'DELETE',
  151. success: function (result) {
  152. // Do something with the result
  153. alert("删除成功");
  154. location.reload();
  155. }
  156. });
  157. }
  158. //显示大图
  159. function showimage(e) {
  160. $("#imgModal").find("#imgInModalID").attr("src", e.target.src);
  161. $("#imgModal").modal();
  162. e.stopPropagation()
  163. }
  164. //关闭
  165. function closeImageViewer() {
  166. $("#imgModal").modal('hide');
  167. }
  168. $(function () {
  169. $('#export-btn').click(function () {
  170. // 修改assign-btn的文字以及让其处于不可用状态
  171. $(this).attr('disabled', true);
  172. $(this).find('span').text('报告生成中...');
  173. var urlParams = new URLSearchParams(window.location.search);
  174. var examId = urlParams.get('examId');
  175. var caseId = urlParams.get('caseId');
  176. $.get('/final_report/export', {examId: examId, caseId: caseId}, function (result) {
  177. var url = JSON.parse(result).downloadUrl;
  178. window.open(url, '_blank');
  179. location.reload()
  180. });
  181. });
  182. });
  183. </script>