remark_list.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. "searching": true,
  56. "ordering": false,
  57. "info": true,
  58. "autoWidth": false,
  59. "serverSide": true,
  60. "ajax": {
  61. "url": "/front/user/remark/list",
  62. "type": "post",
  63. "data": {"tid": tid, "s_sourceinfo": sourceinfo}
  64. },
  65. "language": {
  66. "url": "/dist/js/dataTables.chinese.lang"
  67. },
  68. "fnDrawCallback": function () {
  69. $("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>");
  70. $('#dataTable-btn').click(function (e) {
  71. var redirectpage = 0
  72. if ($("#changePage").val() && $("#changePage").val() > 0) {
  73. var redirectpage = $("#changePage").val() - 1;
  74. }
  75. ttable.page(redirectpage).draw(false);
  76. });
  77. this.api().column(0).nodes().each(function (cell, i) {
  78. cell.innerHTML = i + 1;
  79. });
  80. },
  81. "columns": [
  82. {"data": null, width: "2%"},
  83. {"data": "b_istag", width: "5%", render: function (val) {
  84. let tmp;
  85. if (val) {
  86. tmp = '<span style="display: inline-block;font-size:14px;color: green">已标注</span>'
  87. } else {
  88. tmp = '<span style="display: inline-block;font-size:14px;color: #428bca">未标注</span>'
  89. }
  90. return tmp
  91. }},
  92. {"data": "v_baseinfo.title", render: function (val, index, row) {
  93. let tmp;
  94. if (row["b_istag"]) {
  95. tmp = '<a style="display: inline-block;cursor:pointer;font-size:16px;color: green" target="_blank" href="/front/user/remark/detail/?pid='+pid+'&did=' + row._id + '&s_sourceinfo='+sourceinfo+'">' + val + '</a>'
  96. } else {
  97. 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>'
  98. }
  99. return tmp
  100. }}
  101. ],
  102. "initComplete": function () {
  103. $("#dataTable_filter").append($('#status-div'))
  104. },
  105. "fnServerParams": function (e) {
  106. e.i_ckdata = $("#statusSelect option:selected").val()
  107. }
  108. });
  109. $('#statusSelect').on('changed.bs.select', function () {
  110. ttable.api().ajax.reload();
  111. })
  112. });
  113. </script>