remark_list.html 4.8 KB

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