|
@@ -87,14 +87,16 @@
|
|
|
<section class="tab-item-1">
|
|
|
<div class="container-fluid">
|
|
|
<div class="row">
|
|
|
+ <div id="searchCheckBox"></div>
|
|
|
<div class="col-md-12">
|
|
|
- <div class="input-group">
|
|
|
- <div class="input-group-prepend">
|
|
|
- <div class="input-group-text">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <input type="text" class="form-control" id="searchInput"/>
|
|
|
+ <button class="btn btn-danger form-inline" onclick="searchKeyAction()">搜索</button>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <hr>
|
|
|
+ <div class="container-fluid">
|
|
|
+ <div class="row">
|
|
|
<!--add-->
|
|
|
<div class="col-md-12">
|
|
|
<table class="table table-bordered table-hover">
|
|
@@ -106,6 +108,7 @@
|
|
|
<div id="pagination"></div>
|
|
|
</div>
|
|
|
|
|
|
+ <hr>
|
|
|
|
|
|
<!---->
|
|
|
<div class="container-fluid">
|
|
@@ -168,8 +171,27 @@
|
|
|
let post_data = {
|
|
|
'token': $.cookie('access_token'),
|
|
|
'page': 1,
|
|
|
- 'line': 10
|
|
|
+ 'line': 10,
|
|
|
};
|
|
|
+ InitIndex(post_data)
|
|
|
+ // $('#pagination').pagination({
|
|
|
+ // pages: 50, //总页数
|
|
|
+ // edges: 2,
|
|
|
+ // cssStyle: 'pagination-sm', //按纽大小pagination-lg或写入自定义css
|
|
|
+ // displayedPages: 5, //显示几个
|
|
|
+ // onPageClick: function(pageNumber, event) {
|
|
|
+ // //点击时调用
|
|
|
+ // // alert(pageNumber);
|
|
|
+ // },
|
|
|
+ // onInit: function(getid) {
|
|
|
+ // //刷新时或初始化调用
|
|
|
+ // // alert(getid);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ });
|
|
|
+
|
|
|
+ function InitIndex(post_data) {
|
|
|
+
|
|
|
$.postJSON(
|
|
|
http_ip_prot + 'langWord/query', JSON.stringify(post_data),
|
|
|
function (data) {
|
|
@@ -199,23 +221,9 @@
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
- // $('#pagination').pagination({
|
|
|
- // pages: 50, //总页数
|
|
|
- // edges: 2,
|
|
|
- // cssStyle: 'pagination-sm', //按纽大小pagination-lg或写入自定义css
|
|
|
- // displayedPages: 5, //显示几个
|
|
|
- // onPageClick: function(pageNumber, event) {
|
|
|
- // //点击时调用
|
|
|
- // // alert(pageNumber);
|
|
|
- // },
|
|
|
- // onInit: function(getid) {
|
|
|
- // //刷新时或初始化调用
|
|
|
- // // alert(getid);
|
|
|
- // }
|
|
|
- // });
|
|
|
- });
|
|
|
+ }
|
|
|
+
|
|
|
let la_list
|
|
|
- let checkboxInput = '<input type="checkbox" aria-label="Checkbox for following text input">'
|
|
|
let lw_data
|
|
|
|
|
|
function queryData(page) {
|
|
@@ -246,13 +254,18 @@
|
|
|
let body_data = data['lw_dict'];
|
|
|
lw_data = body_data
|
|
|
let head_html = '<tr><th>key</th>';
|
|
|
+ let search_tab = '<label><input type="radio" name="optionsRadios" value="key" checked>key</label>'
|
|
|
+
|
|
|
//头部标签添加
|
|
|
+
|
|
|
$.each(head_data, function (idx, obj) {
|
|
|
// console.log(idx)
|
|
|
head_html += ('<th>' + obj['lang'] + '</th>')
|
|
|
+ search_tab += ' <label><input type="radio" name="optionsRadios" value="' + obj['lang'] + '">' + obj['lang'] + '</label>'
|
|
|
});
|
|
|
head_html += '<th width="180px"><a href="#" onclick="addRow()">add</a></th></tr>';
|
|
|
-
|
|
|
+ // search_tab += '<td width="180px"><button class="btn-primary btn">搜索</button></td></tr>';
|
|
|
+ $('#searchCheckBox').html(search_tab)
|
|
|
let body_html = '';
|
|
|
|
|
|
|
|
@@ -423,6 +436,31 @@
|
|
|
// })
|
|
|
}
|
|
|
|
|
|
+ function searchKeyAction() {
|
|
|
+ let searchKey = $('input[name="optionsRadios"]:checked').val();
|
|
|
+ let searchVal = $('#searchInput').val()
|
|
|
+ console.log('-------------------------------')
|
|
|
+ console.log(searchKey)
|
|
|
+ console.log(searchVal)
|
|
|
+ console.log('-------------------------------')
|
|
|
+ let post_data = {}
|
|
|
+ if (searchVal && searchKey) {
|
|
|
+ post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'page': 1,
|
|
|
+ 'line': 10,
|
|
|
+ 'searchKey': searchKey,
|
|
|
+ 'searchVal': searchVal
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'page': 1,
|
|
|
+ 'line': 10,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ InitIndex(post_data)
|
|
|
+ }
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|