|
@@ -18,6 +18,7 @@
|
|
|
<script src="js/jqhttpsdk.js"></script>
|
|
|
<script src="js/jkcor.js"></script>
|
|
|
<script src="js/pages.js"></script>
|
|
|
+ <script src="js/datachange.js"></script>
|
|
|
<style>
|
|
|
td {
|
|
|
white-space: nowrap;
|
|
@@ -101,8 +102,10 @@
|
|
|
<div class="row">
|
|
|
<div id="searchCheckBox" class="col-md-12"></div>
|
|
|
<div class="col-md-12">
|
|
|
- <input type="text" class="form-group form-control" id="searchInput" style="width: 300px;display: inline"/>
|
|
|
- <button class="btn btn-danger form-inline" style="margin-bottom: 5px" onclick="searchKeyAction()">搜索</button>
|
|
|
+ <input type="text" class="form-group form-control" id="searchInput"
|
|
|
+ style="width: 300px;display: inline"/>
|
|
|
+ <button class="btn btn-danger form-inline" style="margin-bottom: 5px"
|
|
|
+ onclick="searchKeyAction()">搜索</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -179,11 +182,13 @@
|
|
|
</div>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
+ var orderByupdate = 0
|
|
|
$(function () {
|
|
|
let post_data = {
|
|
|
'token': $.cookie('access_token'),
|
|
|
'page': 1,
|
|
|
'line': 5,
|
|
|
+ 'orderByupdate': orderByupdate
|
|
|
};
|
|
|
InitIndex(post_data)
|
|
|
// $('#pagination').pagination({
|
|
@@ -202,6 +207,21 @@
|
|
|
// });
|
|
|
});
|
|
|
|
|
|
+ function orderByUpdateTimeFunc(status) {
|
|
|
+ if (status === 1) {
|
|
|
+ orderByupdate = 0
|
|
|
+ } else {
|
|
|
+ orderByupdate = 1
|
|
|
+ }
|
|
|
+ let post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'page': 1,
|
|
|
+ 'line': 5,
|
|
|
+ 'orderByupdate': orderByupdate
|
|
|
+ };
|
|
|
+ InitIndex(post_data)
|
|
|
+ }
|
|
|
+
|
|
|
function InitIndex(post_data) {
|
|
|
|
|
|
$.postJSON(
|
|
@@ -275,20 +295,22 @@
|
|
|
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>';
|
|
|
+ // head_html += '<th>udpateTime <i class="fa fa-arrow-down" aria-hidden="true"></i></td><th width="180px"><a href="#" onclick="addRow()">add</a></th></tr>';
|
|
|
+ head_html += ('<th><a href="#" onclick="orderByUpdateTimeFunc(' + orderByupdate + ')">udpateTime <i class="fa ' + (orderByupdate == 1 ? 'fa-arrow-up' : 'fa-arrow-down') + '" aria-hidden="true"></i></a></td><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 = '';
|
|
|
|
|
|
-
|
|
|
+ console.log('--------');
|
|
|
$.each(body_data, function (idx, obj) {
|
|
|
// console.log(idx)
|
|
|
- // console.log(obj)
|
|
|
+ console.log(obj)
|
|
|
let edit_btn = '<a href="#" title="Edit" onclick="editFunc(\'' + idx + '\')"><i class="fa fa-edit"></i></a>';
|
|
|
- let del_btn = '<a href="#" title="Delete" onclick="deleteFunc(\'' + idx + '\')"><i class="fa fa-ban"></i></a>';
|
|
|
+ // let del_btn = '<a href="#" title="Delete" onclick="deleteFunc(\'' + idx + '\')"><i class="fa fa-ban"></i></a>';
|
|
|
+ let del_btn = '';
|
|
|
body_html += '<tr>';
|
|
|
body_html += ('<td>' + idx + '</td>');
|
|
|
- console.log('--------');
|
|
|
+
|
|
|
$.each(la_list, function (x, y) {
|
|
|
if (obj[y['lang']]) {
|
|
|
body_html += ('<td>' + obj[y['lang']] + '</td>')
|
|
@@ -296,7 +318,8 @@
|
|
|
body_html += ('<td></td>')
|
|
|
}
|
|
|
});
|
|
|
- body_html += '<td>' + edit_btn + ' ' + del_btn + '</td></tr>';
|
|
|
+ let updTime = $.DateChange.UnixToDate(obj['updTime'], true, 8);
|
|
|
+ body_html += ('<td>' + updTime + '<span class="arrow dsc"></td><td>' + edit_btn + ' ' + del_btn + '</td></tr>');
|
|
|
});
|
|
|
|
|
|
$('#langTableHead').html(head_html);
|