remark_list.html 4.9 KB

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