keywords.hbs
2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<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>