|
@@ -0,0 +1,656 @@
|
|
|
+<!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;
|
|
|
+ }
|
|
|
+ #in_button:hover{
|
|
|
+ background: black;
|
|
|
+ color: white;
|
|
|
+ }
|
|
|
+ </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" onclick="location.href='index.html'">
|
|
|
+ <span>Home</span><i class="fa fa-home"></i>
|
|
|
+
|
|
|
+ <input type="radio" class="tab-5" name="tab" checked="checked">
|
|
|
+ <span>AVSS</span><i class="fa fa-language"></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>
|
|
|
+
|
|
|
+ <input type="radio" class="tab-4" name="tab" onclick="location.href='imgTab.html'">
|
|
|
+ <span>Azimg</span><i class="fa fa-image"></i>
|
|
|
+
|
|
|
+ <!--
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <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 -->
|
|
|
+ <center class="top-bar">
|
|
|
+ <input id="in_button" type="button" value="reset" style="border: 1px solid #e6cdcd; height: 60px; width: 100px;" onclick="onReset()">
|
|
|
+ <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>
|
|
|
+ </center>
|
|
|
+
|
|
|
+ <!-- tab-content -->
|
|
|
+ <div class="tab-content" style="overflow: auto">
|
|
|
+ <section class="tab-item-1" style="height: 100%;width: 100%;display: block">
|
|
|
+ <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
|
|
|
+ var initData
|
|
|
+ var IndexFlat = 0
|
|
|
+
|
|
|
+ $(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,
|
|
|
+ 'langType': 1
|
|
|
+ };
|
|
|
+ InitIndex(post_data)
|
|
|
+ });
|
|
|
+
|
|
|
+ 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,
|
|
|
+ 'langType': 1,
|
|
|
+ };
|
|
|
+ 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, //显示几个
|
|
|
+ currentPage: GetUrlParam('page'),
|
|
|
+ onPageClick: function (pageNumber, event) {
|
|
|
+ //点击时调用
|
|
|
+ // alert(pageNumber);
|
|
|
+ queryData(pageNumber)
|
|
|
+ },
|
|
|
+ onInit: function (getid) {
|
|
|
+ //刷新时或初始化调用
|
|
|
+ // alert(getid);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ window.location.href = "http://" + domain + ":7724/web/login.html";
|
|
|
+ alert(data['msg'])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
+ $.postJSON(
|
|
|
+ http_ip_prot + 'user/init', JSON.stringify(post_data),
|
|
|
+ function (data) {
|
|
|
+ if (data['code'] == 0) {
|
|
|
+ console.log('initData__start')
|
|
|
+ console.log(data)
|
|
|
+ console.log('initData__end')
|
|
|
+ initData = data['res']
|
|
|
+ } else {
|
|
|
+ window.location.href = "http://" + domain + ":7724/web/login.html";
|
|
|
+ alert(data['msg'])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ let la_list
|
|
|
+ let lw_data
|
|
|
+
|
|
|
+ function queryData(page) {
|
|
|
+ let searchKey = $('input[name="optionsRadios"]:checked').val();
|
|
|
+ let searchVal = $('#searchInput').val()
|
|
|
+ var post_data = {}
|
|
|
+ if (searchVal) {
|
|
|
+ post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'page': page,
|
|
|
+ 'line': 10,
|
|
|
+ 'orderByupdate': orderByupdate,
|
|
|
+ 'searchKey': searchKey,
|
|
|
+ 'searchVal': searchVal,
|
|
|
+ 'langType': 1
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'page': page,
|
|
|
+ 'line': 10,
|
|
|
+ 'orderByupdate': orderByupdate,
|
|
|
+ 'langType': 1,
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ $.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 width="180px"><a href="javascript:void(0);" onclick=""></a></th><th>key</th>';
|
|
|
+ let search_tab = '<label><input type="radio" name="optionsRadios" value="key" checked>key</label>'
|
|
|
+
|
|
|
+ //头部标签添加
|
|
|
+
|
|
|
+ $.each(head_data.reverse(), function (idx, obj) {
|
|
|
+ head_html += ('<th>' + obj['lang'] + '</th>')
|
|
|
+ search_tab += ' <label><input type="radio" name="optionsRadios" value="' + obj['lang'] + '">' + obj['lang'] + '</label>'
|
|
|
+ });
|
|
|
+ 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></tr>');
|
|
|
+ // search_tab += '<td width="180px"><button class="btn-primary btn">搜索</button></td></tr>';
|
|
|
+ if (IndexFlat == 0) {
|
|
|
+ $('#searchCheckBox').html(search_tab)
|
|
|
+ IndexFlat = 1
|
|
|
+ }
|
|
|
+ let body_html = '';
|
|
|
+
|
|
|
+ console.log('--------');
|
|
|
+ $.each(body_data, function (idx, obj) {
|
|
|
+ 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 = '';
|
|
|
+ if(obj['status'] == 1){
|
|
|
+ body_html += '<tr style="background: red; color: white"><td>' + edit_btn + ' ' + del_btn + '</td>';
|
|
|
+ }else if(obj['status'] == 2){
|
|
|
+ body_html += '<tr style="background: blue; color: white"><td>' + edit_btn + ' ' + del_btn + '</td>';
|
|
|
+ }else{
|
|
|
+ body_html += '<tr><td>' + edit_btn + ' ' + del_btn + '</td>';
|
|
|
+ }
|
|
|
+
|
|
|
+ body_html += ('<td id="key">' + 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></tr>');
|
|
|
+ });
|
|
|
+ $('#langTableHead').empty().html(head_html);
|
|
|
+ $('#langTableBody').empty().html(body_html);
|
|
|
+ addDelFunc()
|
|
|
+ }
|
|
|
+
|
|
|
+ function addRow() {
|
|
|
+ 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>';
|
|
|
+
|
|
|
+ let newRow = '<tr><td>' + save_btn + ' ' + del_btn + '</td><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>')
|
|
|
+ })
|
|
|
+
|
|
|
+ newRow += '<td></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(1).text()
|
|
|
+ $('#modal-container-593541').modal('show')
|
|
|
+ let user_perm = initData['user_perm']
|
|
|
+ console.log(initData)
|
|
|
+ // let post_data = {'token': $.cookie('access_token')};
|
|
|
+ let html_per = '<label for="lang_key_edit">KEY</label><input class="form-control" ' + (user_perm == 1 ? '' : 'disabled="disabled"') + ' type="text" id="lang_key_edit" oldkey="' + langKey + '" value="' + langKey + '"> '
|
|
|
+ $.each(la_list, function (idx, obj) {
|
|
|
+ let lang_perm_ls = initData['lang_perm_ls']
|
|
|
+ let check_perm_flag = $.inArray(obj['lang'], lang_perm_ls)
|
|
|
+ if (check_perm_flag >= 0) {
|
|
|
+ var inputAttr = ''
|
|
|
+ } else {
|
|
|
+ var inputAttr = 'disabled="disabled"'
|
|
|
+ }
|
|
|
+ //console.log(obj);
|
|
|
+ html_per += ('<label for="InputLangArea">' + obj['lang'] + ':</label>' +
|
|
|
+ '<textarea type="text" ' + inputAttr + ' class="form-control disabled" lang="' + obj['lang'] + '">' + (lw_data[langKey][obj['lang']] ? lw_data[langKey][obj['lang']] : '') + '</textarea>')
|
|
|
+ //html_per += ('<label for="InputLangArea">' + obj['lang'] + ':</label>' +
|
|
|
+ // '<input type="text" ' + inputAttr + ' class="form-control disabled" 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(1).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 + 'avss/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'] = {}
|
|
|
+ post_data['status'] = 2
|
|
|
+ // $('#edit_model_form').find('input').each(function () {
|
|
|
+ // let langArea = $(this).attr('lang')
|
|
|
+ // if (langArea) {
|
|
|
+ // post_data['word_arr'][langArea] = $(this).val()
|
|
|
+ //}
|
|
|
+ //})
|
|
|
+ $('#edit_model_form').find('textarea').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,
|
|
|
+ 'langType': 1,
|
|
|
+ };
|
|
|
+
|
|
|
+ $.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() {
|
|
|
+ var page = GetUrlParam('page')
|
|
|
+ if (!page) {
|
|
|
+ page = 1
|
|
|
+ }
|
|
|
+ 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': page,
|
|
|
+ 'line': 10,
|
|
|
+ 'searchKey': searchKey,
|
|
|
+ 'searchVal': searchVal
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'page': page,
|
|
|
+ 'line': 10,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ InitIndex(post_data)
|
|
|
+ }
|
|
|
+
|
|
|
+ function onReset() {
|
|
|
+ let role = $.cookie('role');
|
|
|
+ if(role == 1){
|
|
|
+ if(!confirm("如果你重置了语言状态,别的翻译者将无法查看到语言的相应状态!")){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let post_data = {}
|
|
|
+ var word_key = '';
|
|
|
+ let table = $('#langTableBody').find('tr').each(function () {
|
|
|
+ var value = $(this).find('td:eq(1)').text();
|
|
|
+ word_key += value;
|
|
|
+ word_key += ',';
|
|
|
+ })
|
|
|
+ word_key = word_key.substr(0, word_key.length - 1);
|
|
|
+ post_data['word_key'] = word_key;
|
|
|
+ post_data['token'] = $.cookie('access_token');
|
|
|
+ $.postJSON(
|
|
|
+ http_ip_prot + 'langWord/reset', JSON.stringify(post_data),
|
|
|
+ function (data) {
|
|
|
+ if (data['code'] == 0) {
|
|
|
+ // console.log(data['res'])
|
|
|
+ console.log(data)
|
|
|
+ toastr["success"](data['msg'])
|
|
|
+ IndexTable()
|
|
|
+ //window.location.reload();
|
|
|
+ } else {
|
|
|
+ toastr["error"](data['msg'])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+
|
|
|
+ }
|
|
|
+</script>
|
|
|
+</body>
|
|
|
+</html>
|