remark_list.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. {{include "com/inc.html"}}
  2. <!-- Main Header -->
  3. {{include "com/header.html"}}
  4. <!-- Left side column. 权限菜单 -->
  5. {{include "com/menu.html"}}
  6. <div class="content-wrapper">
  7. <section class="content-header">
  8. <h1>
  9. <small></small>
  10. </h1>
  11. <ol class="breadcrumb">
  12. <li><a href="/front/user/task/list"><i class="fa fa-dashboard"></i> 任务列表</a></li>
  13. <li><a href="#"><i class="fa fa-dashboard"></i> 标注列表</a></li>
  14. </ol>
  15. </section>
  16. <!-- Main content -->
  17. <section class="content">
  18. <div class="row">
  19. <div class="col-xs-12">
  20. <div class="box">
  21. <div class="box-body">
  22. <div id="status-div" class="col-xs-1" style="width: auto;float:right;">
  23. <label for="statusSelect">状态:
  24. <select class="form-control selectpicker" id="statusSelect">
  25. <option value=-1>全部</option>
  26. <option value=0>未标注</option>
  27. <option value=1>已标注</option>
  28. </select></label>
  29. </div>
  30. <table id="dataTable" class="table table-bordered table-hover">
  31. <thead>
  32. <tr>
  33. <th></th>
  34. <th>状态</th>
  35. <th>标题</th>
  36. </tr>
  37. </thead>
  38. </table>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. </section>
  44. </div>
  45. {{include "com/footer.html"}}
  46. <script>
  47. menuActive("/front/user/task/list");
  48. let tid = {{ .T.tid }}
  49. let pid = {{ .T.pid }}
  50. let sourceinfo = {{ .T.s_sourceinfo }}
  51. $(function () {
  52. ttable = $('#dataTable').dataTable({
  53. "paging": true,
  54. "lengthChange": false,
  55. "processing": true,
  56. "pageLength": 20,
  57. "searching": true,
  58. "ordering": false,
  59. "info": true,
  60. "autoWidth": false,
  61. "serverSide": true,
  62. "ajax": {
  63. "url": "/front/user/remark/list",
  64. "type": "post",
  65. "data": {"tid": tid, "s_sourceinfo": sourceinfo}
  66. },
  67. "language": {
  68. "url": "/dist/js/dataTables.chinese.lang"
  69. },
  70. "fnDrawCallback": function () {
  71. $("ul.pagination").prepend("&nbsp;&nbsp;&nbsp;转到第 <input type='text' id='changePage' style='width:20px;'> 页 <a type='text' href='javascript:void(0);' id='dataTable-btn' style='text-align:center'>GO</a>");
  72. $('#dataTable-btn').click(function (e) {
  73. var redirectpage = 0
  74. if ($("#changePage").val() && $("#changePage").val() > 0) {
  75. var redirectpage = $("#changePage").val() - 1;
  76. }
  77. ttable.api().page(redirectpage).draw(false);
  78. });
  79. this.api().column(0).nodes().each(function (cell, i) {
  80. cell.innerHTML = i + 1;
  81. });
  82. },
  83. "columns": [
  84. {"data": null, width: "2%"},
  85. {"data": "b_istag", width: "6%", render: function (val) {
  86. let tmp;
  87. if (val) {
  88. tmp = '<span style="display: inline-block;font-size:14px;color: green">已标注</span>'
  89. } else {
  90. tmp = '<span style="display: inline-block;font-size:14px;color: #428bca">未标注</span>'
  91. }
  92. return tmp
  93. }},
  94. {"data": "v_baseinfo.title", render: function (val, index, row) {
  95. let tmp;
  96. if (row["b_istag"]) {
  97. tmp = '<a style="display: inline-block;cursor:pointer;font-size:16px;color: green" target="_blank" href="/front/user/remark/detail/?pid='+pid+'&tid=' + tid +'&did=' + row._id + '&s_sourceinfo='+sourceinfo+'">' + val + '</a>'
  98. } else {
  99. tmp = '<a style="display: inline-block;cursor:pointer;font-size:16px;color: #428bca" target="_blank" href="/front/user/remark/detail/?pid='+pid+'&tid=' + tid +'&did=' + row._id + '&s_sourceinfo='+sourceinfo+'">' + val + '</a>'
  100. }
  101. return tmp
  102. }}
  103. ],
  104. "initComplete": function () {
  105. $("#dataTable_filter").append($('#status-div'))
  106. },
  107. "fnServerParams": function (e) {
  108. e.i_ckdata = $("#statusSelect option:selected").val()
  109. }
  110. });
  111. $('#statusSelect').on('changed.bs.select', function () {
  112. ttable.api().ajax.reload();
  113. })
  114. });
  115. </script>