123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- {{include "com/inc.html"}}
- <!-- Main Header -->
- {{include "com/header.html"}}
- <!-- Left side column. 权限菜单 -->
- {{include "com/menu.html"}}
- <div class="content-wrapper">
- <section class="content-header">
- <h1>
- <small></small>
- </h1>
- <ol class="breadcrumb">
- <li><a href="/front/user/task/list"><i class="fa fa-dashboard"></i> 任务列表</a></li>
- <li><a href="#"><i class="fa fa-dashboard"></i> 标注列表</a></li>
- </ol>
- </section>
- <!-- Main content -->
- <section class="content">
- <div class="row">
- <div class="col-xs-12">
- <div class="box">
- <div class="box-body">
- <div id="status-div" class="col-xs-1" style="width: auto;float:right;">
- <label for="statusSelect">状态:
- <select class="form-control selectpicker" id="statusSelect">
- <option value=-1>全部</option>
- <option value=0>未标注</option>
- <option value=1>已标注</option>
- </select></label>
- </div>
- <table id="dataTable" class="table table-bordered table-hover">
- <thead>
- <tr>
- <th></th>
- <th>状态</th>
- <th>标题</th>
- </tr>
- </thead>
- </table>
- </div>
- </div>
- </div>
- </div>
- </section>
- </div>
- {{include "com/footer.html"}}
- <script>
- menuActive("/front/user/task/list");
- let tid = {{ .T.tid }}
- let pid = {{ .T.pid }}
- let sourceinfo = {{ .T.s_sourceinfo }}
- $(function () {
- ttable = $('#dataTable').dataTable({
- "paging": true,
- "lengthChange": false,
- "processing": true,
- "pageLength": 20,
- "searching": true,
- "ordering": false,
- "info": true,
- "autoWidth": false,
- "serverSide": true,
- "ajax": {
- "url": "/front/user/remark/list",
- "type": "post",
- "data": {"tid": tid, "s_sourceinfo": sourceinfo}
- },
- "language": {
- "url": "/dist/js/dataTables.chinese.lang"
- },
- "fnDrawCallback": function () {
- $("ul.pagination").prepend(" 转到第 <input type='text' id='changePage' style='width:20px;'> 页 <a type='text' href='javascript:void(0);' id='dataTable-btn' style='text-align:center'>GO</a>");
- $('#dataTable-btn').click(function (e) {
- var redirectpage = 0
- if ($("#changePage").val() && $("#changePage").val() > 0) {
- var redirectpage = $("#changePage").val() - 1;
- }
- ttable.api().page(redirectpage).draw(false);
- });
- this.api().column(0).nodes().each(function (cell, i) {
- cell.innerHTML = i + 1;
- });
- },
- "columns": [
- {"data": null, width: "2%"},
- {"data": "b_istag", width: "6%", render: function (val) {
- let tmp;
- if (val) {
- tmp = '<span style="display: inline-block;font-size:14px;color: green">已标注</span>'
- } else {
- tmp = '<span style="display: inline-block;font-size:14px;color: #428bca">未标注</span>'
- }
- return tmp
- }},
- {"data": "v_baseinfo.title", render: function (val, index, row) {
- let tmp;
- if (row["b_istag"]) {
- 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>'
- } else {
- 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>'
- }
- return tmp
- }}
- ],
- "initComplete": function () {
- $("#dataTable_filter").append($('#status-div'))
- },
- "fnServerParams": function (e) {
- e.i_ckdata = $("#statusSelect option:selected").val()
- }
- });
- $('#statusSelect').on('changed.bs.select', function () {
- ttable.api().ajax.reload();
- })
- });
- </script>
|