keywords.hbs 2.41 KB
<div class="pageheader">
    <div class="media">
        <div class="pageicon pull-left">
            <i class="fa fa-th-list"></i>
        </div>
        <div class="media-body">
            <ul class="breadcrumb">
                <li><a href="/"><i class="glyphicon glyphicon-home"></i></a></li>
                <li><a href="/keywords">关键词管理</a></li>
            </ul>
            <h4>关键词管理</h4>
        </div>
    </div>
    <!-- media -->
</div>

<div class="contentpanel project-index-page" style="padding-bottom:0;">
    <div class="panel panel-default">
        <div class="panel-body">
            <label style="margin-right:20px;"><input type="checkbox" style="margin-right:5px;">全选</label>
            <button class="btn btn-default" type="submit" style="margin-right:10px;">增加</button>
            <button class="btn btn-default" type="submit">删除</button>
        </div>
    </div>
</div>

<div class="contentpanel project-index-page" style="padding-top:0;">
    <div class="panel panel-default">
        <div class="panel-body">
            <table id="table-oper-log" class="table table-striped table-bordered building-table">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>关键词</th>
                    <th>操作</th>
                </tr>
                </thead>
            </table>
        </div>
    </div>
</div>

<script>

    $(document).on('ready pjax:success', function() {
        /**$("#table-oper-log").DataTable({
            pageLength: 25,
            retrieve: true,
            responsive: true,
            processing: true,
            serverSide: true,
            ajax: {
                url: '/keywords/getKeywords',
                type: "GET"
            },
            columns: [
                {data: "datas"},
                {data: "datas"},
                {data: "datas"}
            ],
            order: [[1, 'desc']]
        });**/
        $.get('/keywords/getKeywords', function(data){console.log(data);
            var html='';
            let datas=data.data;
            datas.forEach(function(item, index){
                html+='<tr><td>'+index+'</td><td>'+item+'</td><td><button class="btn btn-default" type="submit">编辑</button><button class="btn btn-default" type="submit">删除</button></td></tr>';
            });
            $('#table-oper-log').html($('#table-oper-log').html()+html);
        });
    });
</script>