|
@@ -0,0 +1,557 @@
|
|
|
+<!doctype html>
|
|
|
+<html lang="zh">
|
|
|
+<head>
|
|
|
+ <meta charset="UTF-8">
|
|
|
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
+ <title>afaa</title>
|
|
|
+ <link rel="stylesheet" type="text/css" href="css/normalize.css"/>
|
|
|
+ <link rel="stylesheet" type="text/css" href="css/default.css">
|
|
|
+ <link rel="stylesheet" href="css/style.css">
|
|
|
+ <link href="http://cdn.bootcss.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet">
|
|
|
+ <link href="css/bootstrap.min.css" rel="stylesheet">
|
|
|
+ <link href="http://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css" rel="stylesheet">
|
|
|
+ <script src="https://npmcdn.com/tether@1.2.4/dist/js/tether.min.js"></script>
|
|
|
+ <script src="js/jquery.min.js"></script>
|
|
|
+ <script src="js/bootstrap.min.js"></script>
|
|
|
+ <script src="js/jquery_cookie_min.js"></script>
|
|
|
+ <script src="js/scripts.js"></script>
|
|
|
+ <script src="js/jqhttpsdk.js"></script>
|
|
|
+ <script src="js/jkcor.js"></script>
|
|
|
+ <script src="js/pages.js"></script>
|
|
|
+ <script src="js/datachange.js"></script>
|
|
|
+ <script src="http://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js" type="text/javascript"></script>
|
|
|
+ <style>
|
|
|
+ td {
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+<div class="clear-backend">
|
|
|
+ <div class="avatar">
|
|
|
+ <div>
|
|
|
+ <a href="javascript:void(0);" target="_blank">
|
|
|
+ <img src="img/admin.png" alt="">
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- tab-menu -->
|
|
|
+ <input type="radio" class="tab-1" name="tab" checked="checked">
|
|
|
+ <span>Home</span><i class="fa fa-home"></i>
|
|
|
+
|
|
|
+ <input type="radio" class="tab-2" name="tab" onclick="location.href='langTab.html'">
|
|
|
+ <span>Lang</span><i class="fa fa-medium"></i>
|
|
|
+
|
|
|
+ <input type="radio" class="tab-3" name="tab" onclick="location.href='userTab.html'">
|
|
|
+ <span>Users</span><i class="fa fa-user"></i>
|
|
|
+
|
|
|
+ <span></span>
|
|
|
+ <!--
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <input type="radio" class="tab-5" name="tab">
|
|
|
+ <span>Upload</span><i class="fa fa-cloud-upload"></i>
|
|
|
+
|
|
|
+ <input type="radio" class="tab-6" name="tab">
|
|
|
+ <span>Favorite</span><i class="fa fa-star"></i>
|
|
|
+
|
|
|
+ <input type="radio" class="tab-7" name="tab">
|
|
|
+ <span>Photos</span><i class="fa fa-photo"></i>
|
|
|
+
|
|
|
+ <input type="radio" class="tab-8" name="tab">
|
|
|
+ <span>Analysis</span><i class="fa fa-line-chart"></i>
|
|
|
+
|
|
|
+ <input type="radio" class="tab-9" name="tab">
|
|
|
+ <span>Links</span><i class="fa fa-link"></i>
|
|
|
+
|
|
|
+ <input type="radio" class="tab-10" name="tab">
|
|
|
+ <span>Settings</span><i class="fa fa-cog"></i>-->
|
|
|
+
|
|
|
+ <!-- tab-top-bar -->
|
|
|
+ <div class="top-bar">
|
|
|
+ <ul>
|
|
|
+ <li>
|
|
|
+ <a href="login.html" title="Log Out">
|
|
|
+ <i class="fa fa-sign-out"></i>
|
|
|
+ </a>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <a href="" title="Messages">
|
|
|
+ <i class="fa fa-envelope"></i>
|
|
|
+ </a>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <a href="" title="Edit">
|
|
|
+ <i class="fa fa-edit"></i>
|
|
|
+ </a>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- tab-content -->
|
|
|
+ <div class="tab-content" style="overflow: auto">
|
|
|
+ <section class="tab-item-1" style="height: 100%;width: 100%">
|
|
|
+ <div class="container-fluid">
|
|
|
+ <div class="row">
|
|
|
+ <div id="searchCheckBox" class="col-md-8"></div>
|
|
|
+ <div class="col-md-4">
|
|
|
+ <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>
|
|
|
+ <div class="container-fluid">
|
|
|
+ <div class="row">
|
|
|
+ <!--add-->
|
|
|
+ <div class="col-md-12">
|
|
|
+ <table class="table table-bordered table-hover">
|
|
|
+ <thead id="langTableHead"></thead>
|
|
|
+ <tbody id="langTableBody"></tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div id="pagination"></div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <!---->
|
|
|
+ <div class="container-fluid">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-md-12">
|
|
|
+ <div class="modal fade" id="modal-container-593541" role="dialog" aria-labelledby="myModalLabel"
|
|
|
+ aria-hidden="true">
|
|
|
+ <div class="modal-dialog" role="document">
|
|
|
+ <div class="modal-content">
|
|
|
+ <div class="modal-header">
|
|
|
+ <h5 class="modal-title" id="myModalLabel">
|
|
|
+ EDIT
|
|
|
+ </h5>
|
|
|
+ <button type="button" class="close" data-dismiss="modal">
|
|
|
+ <span aria-hidden="true">×</span>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <div class="form-group" id="edit_model_form">
|
|
|
+ <!--<label for="InputLangArea">-->
|
|
|
+ <!--langArea-->
|
|
|
+ <!--</label>-->
|
|
|
+ <!--<input type="text" class="form-control" id="InputLangArea"/>-->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="modal-footer">
|
|
|
+
|
|
|
+ <button type="button" class="btn btn-primary editRowSaveBtn"
|
|
|
+ onclick="editRow(this);return false;">
|
|
|
+ Save changes
|
|
|
+ </button>
|
|
|
+ <button type="button" class="btn btn-secondary" data-dismiss="modal">
|
|
|
+ Close
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!---->
|
|
|
+ </section>
|
|
|
+ <section class="tab-item-2">
|
|
|
+ <div class="container-fluid">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-md-12">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </section>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+
|
|
|
+<script type="text/javascript">
|
|
|
+ var orderByupdate = 0
|
|
|
+ var page = 1
|
|
|
+ var line = 10
|
|
|
+
|
|
|
+ $(function () {
|
|
|
+ toastr.options = {
|
|
|
+ "closeButton": true,
|
|
|
+ "debug": false,
|
|
|
+ "newestOnTop": false,
|
|
|
+ "progressBar": true,
|
|
|
+ "positionClass": "toast-top-right",
|
|
|
+ "preventDuplicates": false,
|
|
|
+ "onclick": null,
|
|
|
+ "showDuration": "300",
|
|
|
+ "hideDuration": "500",
|
|
|
+ "timeOut": "5000",
|
|
|
+ "extendedTimeOut": "1000",
|
|
|
+ "showEasing": "swing",
|
|
|
+ "hideEasing": "linear",
|
|
|
+ "showMethod": "fadeIn",
|
|
|
+ "hideMethod": "fadeOut"
|
|
|
+ }
|
|
|
+ var page = GetUrlParam('page')
|
|
|
+ if (!page) {
|
|
|
+ page = 1
|
|
|
+ }
|
|
|
+ let post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'page': page,
|
|
|
+ 'line': line,
|
|
|
+ 'orderByupdate': orderByupdate
|
|
|
+ };
|
|
|
+ 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 orderByUpdateTimeFunc(status) {
|
|
|
+ if (status === 1) {
|
|
|
+ orderByupdate = 0
|
|
|
+ } else {
|
|
|
+ orderByupdate = 1
|
|
|
+ }
|
|
|
+ var page = GetUrlParam('page')
|
|
|
+ if(!page){
|
|
|
+ page = 1
|
|
|
+ }
|
|
|
+ let post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'page': page,
|
|
|
+ 'line': 10,
|
|
|
+ 'orderByupdate': orderByupdate
|
|
|
+ };
|
|
|
+ InitIndex(post_data)
|
|
|
+ }
|
|
|
+
|
|
|
+ function InitIndex(post_data) {
|
|
|
+
|
|
|
+ $.postJSON(
|
|
|
+ http_ip_prot + 'langWord/query', JSON.stringify(post_data),
|
|
|
+ function (data) {
|
|
|
+ if (data['code'] == 0) {
|
|
|
+ // console.log(data['res'])
|
|
|
+ console.log(data)
|
|
|
+ addTable(data['res'])
|
|
|
+ let count_page = Math.ceil(data['res']['count'] / line)
|
|
|
+ $('#pagination').pagination({
|
|
|
+ pages: count_page, //总页数
|
|
|
+ // pages: 10000, //总页数
|
|
|
+ edges: 2,
|
|
|
+ cssStyle: 'pagination', //按纽大小pagination-lg或写入自定义css
|
|
|
+ displayedPages: 5, //显示几个
|
|
|
+ onPageClick: function (pageNumber, event) {
|
|
|
+ //点击时调用
|
|
|
+ // alert(pageNumber);
|
|
|
+ queryData(pageNumber)
|
|
|
+ },
|
|
|
+ onInit: function (getid) {
|
|
|
+ //刷新时或初始化调用
|
|
|
+ // alert(getid);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ alert(data['msg'])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ let la_list
|
|
|
+ let lw_data
|
|
|
+
|
|
|
+ function queryData(page) {
|
|
|
+ let post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'page': page,
|
|
|
+ 'line': 10,
|
|
|
+ 'orderByupdate': orderByupdate
|
|
|
+ };
|
|
|
+ $.postJSON(
|
|
|
+ http_ip_prot + 'langWord/query', JSON.stringify(post_data),
|
|
|
+ function (data) {
|
|
|
+ if (data['code'] == 0) {
|
|
|
+ // console.log(data['res'])
|
|
|
+ console.log(data)
|
|
|
+ addTable(data['res'])
|
|
|
+ } else {
|
|
|
+ alert(data['msg'])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ function addTable(data) {
|
|
|
+ //头部多区域语言
|
|
|
+ let head_data = data['la_list'];
|
|
|
+ la_list = head_data
|
|
|
+ // body部详细语言
|
|
|
+ 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.reverse(), 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>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="javascript:void(0);" 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="javascript:void(0);" 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)
|
|
|
+ //let edit_btn = '<a href="javascript:void(0);" title="Edit" onclick="editFunc(\'' + idx + '\')"><i class="fa fa-edit"></i></a>';
|
|
|
+ //let del_btn = '<a href="javascript:void(0);" title="Delete" onclick="deleteFunc(\'' + idx + '\')"><i class="fa fa-ban"></i></a>';
|
|
|
+ let edit_btn = '<a href="javascript:void(0);" title="Edit" onclick="editFunc(this)"><i class="fa fa-edit"></i></a>';
|
|
|
+ let del_btn = '<a href="javascript:void(0);" title="Delete" onclick="deleteFunc(this)"><i class="fa fa-ban"></i></a>';
|
|
|
+ // let del_btn = '';
|
|
|
+ body_html += '<tr>';
|
|
|
+ body_html += ('<td>' + idx + '</td>');
|
|
|
+
|
|
|
+ $.each(la_list, function (x, y) {
|
|
|
+ if (obj[y['lang']]) {
|
|
|
+ body_html += ('<td>' + obj[y['lang']] + '</td>')
|
|
|
+ } else {
|
|
|
+ body_html += ('<td></td>')
|
|
|
+ }
|
|
|
+ });
|
|
|
+ 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').empty().html(head_html);
|
|
|
+ $('#langTableBody').empty().html(body_html);
|
|
|
+ addDelFunc()
|
|
|
+ }
|
|
|
+
|
|
|
+ function addRow() {
|
|
|
+
|
|
|
+ let newRow = '<tr><td><input class="form-control" type="text" langID="key" id="newRow_key"></td>'
|
|
|
+ $.each(la_list, function (idx, obj) {
|
|
|
+ // console.log(idx)
|
|
|
+ // newRow += ('<td>' + obj['id'] + '</td>')
|
|
|
+ newRow += ('<td>' +
|
|
|
+ '<input class="form-control" type="text" langID="' + obj['id'] + '" id="newRow_lang_' + obj['id'] + '">' +
|
|
|
+ '</td>')
|
|
|
+ })
|
|
|
+ let save_btn = '<a href="javascript:void(0);" title="Save" class="save_row"><i class="fa fa-check-circle-o"></i></a>';
|
|
|
+ let del_btn = '<a href="javascript:void(0);" title="Delete" class="del_row"><i class="fa fa-ban"></i></a>';
|
|
|
+
|
|
|
+ newRow += '<td></td><td>' + save_btn + ' ' + del_btn + '</td></tr>'
|
|
|
+ $('#langTableBody').prepend(newRow)
|
|
|
+ addDelFunc()
|
|
|
+ addSaveFunc()
|
|
|
+ }
|
|
|
+
|
|
|
+ function addDelFunc() {
|
|
|
+ $(".del_row").bind("click", function () {
|
|
|
+ let trRow = $(this).parent().parent()
|
|
|
+ trRow.remove()
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function addSaveFunc() {
|
|
|
+ $(".save_row").bind("click", function () {
|
|
|
+ let post_data = {
|
|
|
+ 'token': $.cookie('access_token')
|
|
|
+ }
|
|
|
+ let post_list = []
|
|
|
+ let trRow = $(this).parent().parent()
|
|
|
+ trRow.find('input').each(function () {
|
|
|
+ // console.log($(this).attr('id'))
|
|
|
+ // console.log($(this).attr('langID'))
|
|
|
+ let inputVal = $(this).val()
|
|
|
+ let langID = $(this).attr('langID')
|
|
|
+ if (langID === 'key') {
|
|
|
+ post_data['word_key'] = inputVal
|
|
|
+ } else {
|
|
|
+ post_list.push({'la_id': langID, 'val': inputVal})
|
|
|
+ }
|
|
|
+ })
|
|
|
+ post_data['word_arr'] = post_list
|
|
|
+ console.log(post_data)
|
|
|
+ $.postJSON(
|
|
|
+ http_ip_prot + 'langWord/add', JSON.stringify(post_data),
|
|
|
+ function (data) {
|
|
|
+ if (data['code'] == 0) {
|
|
|
+ // console.log(data['res'])
|
|
|
+ window.location.reload();
|
|
|
+ console.log(data)
|
|
|
+ } else {
|
|
|
+ alert(data['msg'])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // 编辑模态框
|
|
|
+ function editFunc($this) {
|
|
|
+
|
|
|
+ let langKey = $($this).parent().parent().children().eq(0).text()
|
|
|
+ $('#modal-container-593541').modal('show')
|
|
|
+ // let post_data = {'token': $.cookie('access_token')};
|
|
|
+ let html_per = '<label for="lang_key_edit">KEY</label><input class="form-control" type="text" id="lang_key_edit" oldkey="' + langKey + '" value="' + langKey + '"> '
|
|
|
+ $.each(la_list, function (idx, obj) {
|
|
|
+ console.log(obj);
|
|
|
+ html_per += ('<label for="InputLangArea">' + obj['lang'] + ':</label>' +
|
|
|
+ '<input type="text" class="form-control" lang="' + obj['lang'] + '" value="' + (lw_data[langKey][obj['lang']] ? lw_data[langKey][obj['lang']] : '') + '"/>')
|
|
|
+ });
|
|
|
+ // console.log(html_per)
|
|
|
+ $('#edit_model_form').html(html_per)
|
|
|
+ }
|
|
|
+
|
|
|
+ function deleteFunc($this) {
|
|
|
+ let langKey = $($this).parent().parent().children().eq(0).text()
|
|
|
+
|
|
|
+ var r = confirm("Press a button")
|
|
|
+ if (r) {
|
|
|
+ let post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'word_key': langKey
|
|
|
+ }
|
|
|
+ console.log(post_data)
|
|
|
+ $.postJSON(
|
|
|
+ http_ip_prot + 'langWord/delete', JSON.stringify(post_data),
|
|
|
+ function (data) {
|
|
|
+ if (data['code'] == 0) {
|
|
|
+ // console.log(data['res'])
|
|
|
+ console.log(data);
|
|
|
+ alert(data['msg']);
|
|
|
+ window.location.reload();
|
|
|
+ } else {
|
|
|
+ alert(data['msg'])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /*post_data = {
|
|
|
+ word_key_id:1,
|
|
|
+ word_key:xxx,
|
|
|
+ word_arr:[
|
|
|
+ {'lang':'','val':''},
|
|
|
+ {'lang':'','val':''},
|
|
|
+ {'lang':'','val':''}
|
|
|
+ ]
|
|
|
+ }*/
|
|
|
+ function editRow() {
|
|
|
+ let post_data = {}
|
|
|
+ post_data['token'] = $.cookie('access_token')
|
|
|
+ post_data['word_key'] = $('#lang_key_edit').val()
|
|
|
+ post_data['old_word_key'] = $('#lang_key_edit').attr('oldkey')
|
|
|
+ post_data['word_arr'] = {}
|
|
|
+ $('#edit_model_form').find('input').each(function () {
|
|
|
+ let langArea = $(this).attr('lang')
|
|
|
+ if (langArea) {
|
|
|
+ post_data['word_arr'][langArea] = $(this).val()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(post_data)
|
|
|
+ $.postJSON(
|
|
|
+ http_ip_prot + 'langWord/update', JSON.stringify(post_data),
|
|
|
+ function (data) {
|
|
|
+ if (data['code'] == 0) {
|
|
|
+ // console.log(data['res'])
|
|
|
+ console.log(data)
|
|
|
+ toastr["success"](data['msg'])
|
|
|
+ $('#modal-container-593541').modal('hide')
|
|
|
+ IndexTable()
|
|
|
+ //window.location.reload();
|
|
|
+ } else {
|
|
|
+ alert(data['msg'])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+ // $('.editRowSaveBtn').bind('click', function () {
|
|
|
+ // console.log('adjslkfjsdalkfj')
|
|
|
+ // })
|
|
|
+ }
|
|
|
+
|
|
|
+ function IndexTable() {
|
|
|
+ var page = GetUrlParam('page')
|
|
|
+ if (!page) {
|
|
|
+ page = 1
|
|
|
+ }
|
|
|
+ let post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'page': page,
|
|
|
+ 'line': line,
|
|
|
+ 'orderByupdate': orderByupdate
|
|
|
+ };
|
|
|
+ $.postJSON(
|
|
|
+ http_ip_prot + 'langWord/query', JSON.stringify(post_data),
|
|
|
+ function (data) {
|
|
|
+ if (data['code'] == 0) {
|
|
|
+ // console.log(data['res'])
|
|
|
+ console.log(data)
|
|
|
+ addTable(data['res'])
|
|
|
+ let count_page = Math.ceil(data['res']['count'] / line)
|
|
|
+ queryData(page)
|
|
|
+ } else {
|
|
|
+ alert(data['msg'])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ 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>
|