paper_list.html 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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="base">
  5. <head>
  6. <link rel="stylesheet" href="/static/css/applications.css" type="text/css"/>
  7. <!-- dataTables -->
  8. <link rel="stylesheet" type="text/css"
  9. href="/static/AdminLTE/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css"/>
  10. <!-- Select2 -->
  11. <link rel="stylesheet" type="text/css" href="/static/AdminLTE/bower_components/select2/dist/css/select2.min.css"/>
  12. </head>
  13. <body>
  14. <div layout:fragment="mainbody">
  15. <aside class="main-sidebar">
  16. <section class="sidebar">
  17. <div class="user-panel">
  18. <div class="pull-left image">
  19. <img src="/static/images/avatar/avatar-admin.jpg" class="img-circle" alt="User Image" />
  20. </div>
  21. <div class="pull-left info">
  22. <p>Admin</p>
  23. <a href="#">
  24. <i class="fa fa-circle text-success"></i>
  25. Online
  26. </a>
  27. </div>
  28. </div>
  29. <!-- Search form -->
  30. <form action="#" method="get" class="sidebar-form">
  31. <div class="input-group">
  32. <input type="text" name="q" class="form-control" placeholder="Search..." />
  33. <span class="input-group-btn">
  34. <button type="submit" name="search" id="search-btn" class="btn btn-flat">
  35. <i class="fa fa-search"></i>
  36. </button>
  37. </span>
  38. </div>
  39. </form>
  40. <!-- Sidebar Menu -->
  41. <ul class="sidebar-menu tree" data-widget="tree">
  42. <!-- {% for task in app_list %}-->
  43. <!-- <li th:each="task:${tasks}" >-->
  44. <!-- <a th:href="'/task_detail?examId='+${task.examId}+'&amp;caseId='+${task.caseId}" th:text="${task.name}">-->
  45. <!-- <i class="fa fa-link"></i>-->
  46. <!-- </a>-->
  47. <!-- </li>-->
  48. <!-- {% endfor %}-->
  49. <li>
  50. <a href="/addPaper">
  51. <i class="glyphicon glyphicon-pencil"></i>
  52. <span>
  53. 新建试卷
  54. </span>
  55. </a>
  56. </li>
  57. <li>
  58. <a href="/papers">
  59. <i class="glyphicon glyphicon-tasks"></i>
  60. <span>
  61. 试卷列表
  62. </span>
  63. </a>
  64. </li>
  65. <li>
  66. <a href="/review/jobs">
  67. <i class="glyphicon glyphicon-tasks"></i>
  68. <span>
  69. JOB列表
  70. </span>
  71. </a>
  72. </li>
  73. <li>
  74. <a href="/addExcel">
  75. <i class="glyphicon glyphicon-pencil"></i>
  76. <span>
  77. 导入Excel项目文件
  78. </span>
  79. </a>
  80. </li>
  81. </ul>
  82. </section>
  83. </aside>
  84. <!-- Main Content -->
  85. <div class="content-wrapper" style="min-height: 691px;">
  86. <section class="content-header">
  87. <h1>全部应用</h1>
  88. <ol class="breadcrumb">
  89. <li class="active">
  90. <a href="/home">
  91. <i class="fa fa-dashboard"></i>
  92. 全部应用
  93. </a>
  94. </li>
  95. </ol>
  96. </section>
  97. <!-- Main Content -->
  98. <section class="content container-fluid">
  99. <!-- <div id="task-list-search" class="input-group col-md-6">
  100. <input type="text" class="form-control" placeholder="Search for application">
  101. <span class="input-group-btn">
  102. <button class="btn btn-default" type="button" id="task-search-btn">Search</button>
  103. </span>
  104. </div> -->
  105. <table id="task-list" class="table table-striped text-center" style="margin-top: 10px">
  106. <thead><tr>
  107. <!--<th></th>-->
  108. <th>试卷名称</th>
  109. <th>试卷类型</th>
  110. <th>创建时间</th>
  111. <!--<th>版本</th>-->
  112. <th>操作</th>
  113. </tr></thead>
  114. <tbody>
  115. <th:block th:each="task : ${tasks}">
  116. <tr>
  117. <td><b><a th:href="'/paperDetail?id='+${task.get('id')}" th:text="${task.get('name')}"></a></b></td>
  118. <!--<td><img th:src="${task.icon}" style="width: 25px; height: 25px;" /></td>-->
  119. <td><span class="label label-info" th:text="${task.get('type')}" ></span></td>
  120. <!-- <td><span class="label label-info" th:text="${task.caseId}">题号</span></td>-->
  121. <td>
  122. <span class=" " th:if="${task.get('create_time')!=null}" th:text="${#dates.format(task.get('create_time'),'yyyy-MM-dd HH:mm:ss')} " ></span>
  123. <!-- <span class=" " th:text="${task.get('create_time')}" ></span>-->
  124. </td>
  125. <td>
  126. <button th:paperId="${task.get('id')}" th:onclick="javascript:showYulan( this.getAttribute('paperId') )" class="btn btn-default">预览</button>
  127. <a type="button" th:paperId="${task.get('id')}" class="btn btn-default" th:href="'/changePaper?id='+${task.get('id')}">修改</a>
  128. <button th:paperId="${task.get('id')}" th:onclick="javascript:delPaper( this, this.getAttribute('paperId')) " class="btn btn-default">删除</button>
  129. </td>
  130. <!--<td th:text="${task.version}"></td>-->
  131. <!-- <td th:if="${task.numOfUndeal > 0}"><span class="label label-info">审核中</span></td>-->
  132. <!-- <td th:if="${task.numOfUndeal == 0}"><span class="label label-success">审核结束</span></td>-->
  133. <!--<td th:text="${task.startTime}">{{ task.print_start_time }}</td>-->
  134. <!--<td th:text="${task.endTime}">{{ task.print_end_time }}</td>-->
  135. <!-- <td><span class="badge"><a th:href="'/task_detail?examId=' + ${task.examId} + '&amp;caseId=' + ${task.caseId}" style="color: #fff;" th:text="${task.numOfUndeal}"></a></span></td>-->
  136. </tr>
  137. </th:block>
  138. </tbody>
  139. </table><!-- table -->
  140. </section>
  141. </div>
  142. </div>
  143. </body>
  144. </html>
  145. <script src="/static/AdminLTE/bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
  146. <script src="/static/AdminLTE/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
  147. <script src="/static/AdminLTE/bower_components/select2/dist/js/select2.min.js"></script>
  148. <script type="text/javascript" xmlns:th="http://www.thymeleaf.org" th:inline="javascript">
  149. /*<![CDATA[*/
  150. var reportHost = [[${reportHost}]]
  151. /*]]>*/
  152. $(document).ready(function(){
  153. $('[data-toggle="tooltip"]').tooltip();
  154. var taskListTable = $('#task-list').DataTable({
  155. searching: true,
  156. pageLength: 25,
  157. "order": []
  158. });
  159. });
  160. showYulan = function ( id ) {
  161. window.open('http://'+reportHost+'/report/review/paper/'+ id);
  162. // 默认使用0号worker做展示页面。
  163. }
  164. delPaper = function ( element , id ) {
  165. $.ajax({
  166. url: '/dpaper?id='+id,
  167. // data:{
  168. // 'id':id
  169. // },
  170. type: 'DELETE',
  171. success: function (result) {
  172. console.log(result);
  173. // var obj = eval('(' + result + ')');
  174. element.parentNode.parentNode.remove();
  175. // success
  176. // var jobId = obj['paperId'];
  177. // if ( type == 1 ){
  178. // var workid = getOneWorker();
  179. // console.log("worke")
  180. // console.log(workid)
  181. // window.open('http://reporthost/report/job/'+jobId+'/'+workid+'/0/1');
  182. // }else{
  183. // $.notify({
  184. // // options
  185. // message: '添加成功,paperid为'+jobId
  186. // },{
  187. // // settings
  188. // delay: 100,
  189. // timer: 3000,
  190. // type: 'success'
  191. // });
  192. // }
  193. }
  194. });
  195. }
  196. </script>