|
@@ -0,0 +1,989 @@
|
|
|
+<!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" href="css/style.css">
|
|
|
+ <link href="http://cdn.bootcss.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet">
|
|
|
+ <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
|
|
|
+ <link rel="stylesheet" type="text/css" href="css/default.css">
|
|
|
+ <link href="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/toastr.min.js"></script>
|
|
|
+ <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/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>
|
|
|
+
|
|
|
+ <style>
|
|
|
+ html {
|
|
|
+ font-family: sans-serif;
|
|
|
+ line-height: 1.15;
|
|
|
+ -ms-text-size-adjust: 100%;
|
|
|
+ -webk_idit-text-size-adjust: 100%;
|
|
|
+ background-color: #ffffff;
|
|
|
+ }
|
|
|
+ td {
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
+ #in_button:hover{
|
|
|
+ background: #000000;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ body {
|
|
|
+ font-family :-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
|
|
|
+ }
|
|
|
+ </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>APP</span><i class="fa fa-home"></i>
|
|
|
+
|
|
|
+ <input type="radio" class="tab-5" name="tab" onclick="location.href='avss_index.html'">
|
|
|
+ <span>AVSS</span><i class="fa fa-language"></i>
|
|
|
+
|
|
|
+ <input type="radio" class="tab-6" name="tab" onclick="location.href='zosi_link_index.html'">
|
|
|
+ <span>Zosi Link</span><i class="fa fa-language"></i>
|
|
|
+
|
|
|
+ <input type="radio" class="tab-7" name="tab" checked="checked" onclick="location.href='new_searchTool.html'">
|
|
|
+ <span> New Search Tool</span><i class="fa fa-language"></i>
|
|
|
+
|
|
|
+ <input type="radio" class="tab-8" name="tab" checked="checked" >
|
|
|
+ <span>Old Search Tool</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>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <!-- tab-content -->
|
|
|
+ <div class="tab-content" style="overflow: auto">
|
|
|
+ <section class="tab-item-1" style="height: 100%;width: 100%;display: block">
|
|
|
+ <ul id="myTab" class="nav nav-tabs">
|
|
|
+ <li class="active">
|
|
|
+ <a href="#mokuai" data-toggle="tab">模块</a>
|
|
|
+ </li>
|
|
|
+ <li><a href="#message" data-toggle="tab">消息</a></li>
|
|
|
+ </ul>
|
|
|
+
|
|
|
+ <div class="tab-pane fade in active" id="mokuai">
|
|
|
+ <div class="container-fluid">
|
|
|
+ <div class="row">
|
|
|
+ <div id="mokuaisearchCheckBox" class="col-md-8"></div>
|
|
|
+ <div class="col-md-4">
|
|
|
+ <input type="text" class="form-group form-control" id="mokuaisearchInput"
|
|
|
+ style="width: 300px;display: inline"/>
|
|
|
+ <button class="btn btn-danger form-inline" style="margin-bottom: 5px"
|
|
|
+ onclick="searchMoKuaiAction()">搜索
|
|
|
+ </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="mokuaiHead"></thead>
|
|
|
+ <tbody id="mokuaiBody"></tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div id="mokuaipagination"></div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="tab-pane fade" id="message">
|
|
|
+ <div class="container-fluid">
|
|
|
+ <div class="row">
|
|
|
+ <div id="messagesearchCheckBox" class="col-md-8"></div>
|
|
|
+ <div class="col-md-4">
|
|
|
+ <input type="text" class="form-group form-control" id="messagesearchInput"
|
|
|
+ style="width: 300px;display: inline"/>
|
|
|
+ <button class="btn btn-danger form-inline" style="margin-bottom: 5px"
|
|
|
+ onclick="searchMessageAction()">搜索
|
|
|
+ </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="messageHead"></thead>
|
|
|
+ <tbody id="messageBody"></tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div id="messagepagination"></div>
|
|
|
+ </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>
|
|
|
+
|
|
|
+
|
|
|
+ <div class="container-fluid">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-md-12">
|
|
|
+ <div class="modal fade" id="message_Modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
|
|
+ <div class="modal-dialog" role="document">
|
|
|
+ <div class="modal-content">
|
|
|
+ <div class="modal-header">
|
|
|
+ <h5 class="modal-title" id="roleTitle">消息内容增加/修改</h5>
|
|
|
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
|
+ <span aria-hidden="true">×</span>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <div class="form-group">
|
|
|
+ <label for="name">模块名</label>
|
|
|
+ <select id ="queryDevice" class="selectpicker" style="width: 70%"></select>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+
|
|
|
+ <label for="name">位置</label>
|
|
|
+ <input type="text" class="form-control" id="location" name ="location"/>
|
|
|
+ <label for="remark">行数</label>
|
|
|
+ <input type="text" class="form-control" id="line" name = "line" />
|
|
|
+ <label for="remark">来源</label>
|
|
|
+ <input type="text" class="form-control" id="source" name ="source" />
|
|
|
+ <label for="remark">翻译</label>
|
|
|
+ <input type="text" class="form-control" id="translation" name ="translation"/>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="modal-footer" id = "footerbutton">
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </section>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+
|
|
|
+<script type="text/javascript">
|
|
|
+ var orderByupdate = 0
|
|
|
+ var page = 1
|
|
|
+ var line = 10
|
|
|
+ var initData
|
|
|
+ var IndexFlat = 0
|
|
|
+
|
|
|
+ var queryUrl ;
|
|
|
+ var tagTableHead = $('#mokuaiHead');
|
|
|
+ var tagTableBody = $('#mokuaiBody');
|
|
|
+ let searchKey ;
|
|
|
+ let searchVal ;
|
|
|
+ var optionsRadios ;
|
|
|
+ var searchCheckBox ;
|
|
|
+ var bodykey ;
|
|
|
+ var tagpagination;
|
|
|
+ var searchtype = "1" ;
|
|
|
+ $(function(){
|
|
|
+ initQueryUrl();
|
|
|
+ initTagTable();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $("#myTab a").click(function(e){
|
|
|
+ e.preventDefault();
|
|
|
+ $(this).tab("show");
|
|
|
+ initQueryUrl();
|
|
|
+ initTagTable();
|
|
|
+
|
|
|
+ let post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'page': 1,
|
|
|
+ 'line': line,
|
|
|
+ 'orderByupdate': orderByupdate,
|
|
|
+ 'type': searchtype
|
|
|
+ };
|
|
|
+ InitIndex(post_data=post_data,is_search = 1);
|
|
|
+
|
|
|
+ //IndexTable();
|
|
|
+ });
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ function initQueryUrl(){
|
|
|
+ var tabtext = getCurrentTabText();
|
|
|
+ if (!tabtext) {
|
|
|
+ queryUrl = "searchtool/query";
|
|
|
+ }
|
|
|
+ if(tabtext == "模块"){
|
|
|
+ queryUrl = "searchtool/query";
|
|
|
+ }
|
|
|
+ if(tabtext == "消息"){
|
|
|
+ queryUrl = "searchtool/query_message";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function initTagTable(){
|
|
|
+ var tabtext = getCurrentTabText();
|
|
|
+ $('#mokuai').hide();
|
|
|
+ $('#message').hide();
|
|
|
+ IndexFlat = 0;
|
|
|
+ if (!tabtext) {
|
|
|
+ tagTableHead = $('#mokuaiHead');
|
|
|
+ tagTableBody = $('#mokuaiBody');
|
|
|
+
|
|
|
+ optionsRadios= "mokuaioptionsRadios";
|
|
|
+
|
|
|
+ searchKey = $('input[name="'+optionsRadios+'"]:checked')[0];
|
|
|
+ searchVal = $('#mokuaisearchInput').val(null);
|
|
|
+
|
|
|
+ bodykey = "mokuaikey";
|
|
|
+
|
|
|
+ searchCheckBox = $('#mokuaisearchCheckBox');
|
|
|
+
|
|
|
+ tagpagination = $('#mokuaipagination');
|
|
|
+
|
|
|
+
|
|
|
+ $('#mokuai').show();
|
|
|
+ $('#message').show();
|
|
|
+ }
|
|
|
+ if(tabtext == "模块"){
|
|
|
+ tagTableHead = $('#mokuaiHead');
|
|
|
+ tagTableBody = $('#mokuaiBody');
|
|
|
+
|
|
|
+ optionsRadios= "mokuaioptionsRadios";
|
|
|
+
|
|
|
+ searchKey = $('input[name="'+optionsRadios+'"]:checked')[0];
|
|
|
+ searchVal = $('#mokuaisearchInput').val(null);
|
|
|
+
|
|
|
+ bodykey = "mokuaikey";
|
|
|
+
|
|
|
+ tagpagination = $('#mokuaipagination');
|
|
|
+
|
|
|
+ searchCheckBox = $('#mokuaisearchCheckBox');
|
|
|
+
|
|
|
+
|
|
|
+ $('#mokuai').show();
|
|
|
+ }
|
|
|
+ if(tabtext == "消息"){
|
|
|
+ tagTableHead = $('#messageHead');
|
|
|
+ tagTableBody = $('#messageBody');
|
|
|
+
|
|
|
+ optionsRadios= "messageoptionsRadios";
|
|
|
+
|
|
|
+ searchKey = $('input[name="'+optionsRadios+'"]:checked')[0];
|
|
|
+ searchVal = $('#messagesearchInput').val(null);
|
|
|
+
|
|
|
+ bodykey = "messagekey";
|
|
|
+
|
|
|
+ tagpagination = $('#messagepagination');
|
|
|
+
|
|
|
+ searchCheckBox = $('#messagesearchCheckBox');
|
|
|
+
|
|
|
+
|
|
|
+ $('#message').show();
|
|
|
+ }
|
|
|
+
|
|
|
+ //getsearch();
|
|
|
+ }
|
|
|
+ function getsearch(){
|
|
|
+ var tabtext = getCurrentTabText();
|
|
|
+ if (!tabtext) {
|
|
|
+ searchKey = $('input[name="'+optionsRadios+'"]:checked').val();
|
|
|
+ searchVal = $('#mokuaisearchInput').val();
|
|
|
+ }
|
|
|
+ if(tabtext == "模块"){
|
|
|
+ searchKey = $('input[name="'+optionsRadios+'"]:checked').val();
|
|
|
+ searchVal = $('#mokuaisearchInput').val();
|
|
|
+ }
|
|
|
+ if(tabtext == "消息"){
|
|
|
+ searchKey = $('input[name="'+optionsRadios+'"]:checked').val();
|
|
|
+ searchVal = $('#messagesearchInput').val();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /*function initPostData(page,line,orderByupdate,type){
|
|
|
+ let post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'page': page,
|
|
|
+ 'line': line,
|
|
|
+ 'orderByupdate': orderByupdate,
|
|
|
+ 'type': type
|
|
|
+ };
|
|
|
+ }*/
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $(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,
|
|
|
+ 'type': searchtype
|
|
|
+ };
|
|
|
+ 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,
|
|
|
+ 'type': searchtype
|
|
|
+ };
|
|
|
+ InitIndex(post_data)
|
|
|
+ }
|
|
|
+
|
|
|
+ function InitIndex(post_data, is_search = 0) {
|
|
|
+
|
|
|
+ $.postJSON(
|
|
|
+ http_ip_prot + queryUrl, 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)
|
|
|
+ var current_page = GetUrlParam('page');
|
|
|
+ if(is_search === 1){
|
|
|
+ current_page = 1;
|
|
|
+ }
|
|
|
+ tagpagination.pagination({
|
|
|
+ pages: count_page, //总页数
|
|
|
+ // pages: 10000, //总页数
|
|
|
+ edges: 2,
|
|
|
+ cssStyle: 'pagination', //按纽大小pagination-lg或写入自定义css
|
|
|
+ displayedPages: 5, //显示几个
|
|
|
+ currentPage: current_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'])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ let la_list
|
|
|
+ let lw_data
|
|
|
+
|
|
|
+ function queryData(page) {
|
|
|
+ var post_data = {}
|
|
|
+ getsearch();
|
|
|
+ if (searchVal) {
|
|
|
+ post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'page': page,
|
|
|
+ 'line': 10,
|
|
|
+ 'orderByupdate': orderByupdate,
|
|
|
+ 'searchKey': searchKey,
|
|
|
+ 'searchVal': searchVal,
|
|
|
+ 'type': searchtype
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'page': page,
|
|
|
+ 'line': 10,
|
|
|
+ 'orderByupdate': orderByupdate,
|
|
|
+ 'type': searchtype
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ $.postJSON(
|
|
|
+ http_ip_prot + queryUrl, 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) {
|
|
|
+
|
|
|
+ // body部详细语言
|
|
|
+ let body_data = data['la_list'];
|
|
|
+ lw_data = body_data
|
|
|
+
|
|
|
+ let search_tab = '' ;
|
|
|
+ let head_html ;
|
|
|
+ //头部标签添加
|
|
|
+ var tabtext = getCurrentTabText();
|
|
|
+ var headkey = ["位置","行数","来源","翻译"];
|
|
|
+ var headval = ["location","line","source","translation"];
|
|
|
+ if(tabtext == "模块"){
|
|
|
+ head_html = '<tr><th width="180px"><a href="javascript:void(0);" onclick="addRow()">add</a></th>';
|
|
|
+ head_html += ('<th>模块名</th>')
|
|
|
+ search_tab += ' <label><input type="radio" name='+optionsRadios+' value="name" checked>模块名</label></th>'
|
|
|
+
|
|
|
+ }
|
|
|
+ if(tabtext == "消息"){
|
|
|
+ head_html = '<tr><td width="180px"><button class="btn btn-primary btn-sm" data-toggle="modal" onclick="saveOrEditMessage()"> add</button></td>'
|
|
|
+ head_html += ('<th>模块名</th>')
|
|
|
+ search_tab += ' <label><input type="radio" name='+optionsRadios+' value="bk_name" checked>模块名</label>'
|
|
|
+
|
|
|
+
|
|
|
+ for(var i=0;i<4;i++){
|
|
|
+ head_html += ('<th>' + headkey[i] + '</th>')
|
|
|
+ search_tab += ' <label><input type="radio" name='+optionsRadios+' value="' + headval[i] + '">' + headkey[i] + '</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) {
|
|
|
+
|
|
|
+ if(tabtext == "模块"){
|
|
|
+ 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>';
|
|
|
+ body_html += '<tr><td>' + edit_btn + ' ' + del_btn + '</td>';
|
|
|
+ body_html += ('<td >' + obj['name'] + '</td>');
|
|
|
+ body_html += ('<td style="display:none" >' + obj['id'] + '</td>');
|
|
|
+ }
|
|
|
+ if(tabtext == "消息"){
|
|
|
+ let edit_btn = '<a href="javascript:void(0);" title="Edit" onclick="saveOrEditMessage('+idx+')"><i class="fa fa-edit"></i></a>';
|
|
|
+ let del_btn = '<a href="javascript:void(0);" title="Delete" onclick="deleteMessage('+idx+')"><i class="fa fa-ban"></i></a>';
|
|
|
+ body_html += '<tr><td>' + edit_btn + ' ' + del_btn + '</td>';
|
|
|
+ body_html += ('<td >' + obj['name'] + '</td>');
|
|
|
+ for(var i=0;i<4;i++){
|
|
|
+ body_html += ('<td >' + obj[headval[i]] + '</td>');
|
|
|
+
|
|
|
+ }
|
|
|
+ body_html += ('<td style="display:none" >' + obj['id'] + '</td>');
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ let updTime = $.DateChange.UnixToDate(obj['updTime'], true, 8);
|
|
|
+ body_html += ('<td>' + updTime + '<span class="arrow dsc"></td></tr>');
|
|
|
+ });
|
|
|
+ tagTableHead.empty().html(head_html);
|
|
|
+ tagTableBody.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" id="newRow_name"></td>'
|
|
|
+
|
|
|
+ newRow += '<td></td></tr>'
|
|
|
+ tagTableBody.prepend(newRow)
|
|
|
+ addDelFunc()
|
|
|
+ addSaveFunc()
|
|
|
+ }
|
|
|
+
|
|
|
+ function saveOrEditMessage(messageid = null) {
|
|
|
+ let post_data = {
|
|
|
+ 'token': $.cookie('access_token')
|
|
|
+ }
|
|
|
+ post_data['messageid'] = messageid
|
|
|
+ post_data['type'] = searchtype
|
|
|
+ $.postJSON(
|
|
|
+ http_ip_prot + 'searchtool/query_saveOrEditMessage', JSON.stringify(post_data),
|
|
|
+ function (data) {
|
|
|
+ if (data['code'] == 0) {
|
|
|
+ var message_list = data['res']['la_list'];
|
|
|
+ var mokuai_list = data['res']['lw_dict'];
|
|
|
+ if (message_list) {
|
|
|
+ $.each(message_list, function (idx, obj) {
|
|
|
+ var deviceStr="" ;
|
|
|
+ for(var i=0; i<mokuai_list.length; i++){
|
|
|
+ if (obj.bk_id == mokuai_list[i].id ){
|
|
|
+ deviceStr+='<option value="'+mokuai_list[i].id+'" selected>'+mokuai_list[i].name+'</option>';
|
|
|
+ }else {
|
|
|
+ deviceStr+='<option value="'+mokuai_list[i].id+'" >'+mokuai_list[i].name+'</option>';
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ $("#queryDevice").html("");
|
|
|
+ $('#queryDevice').append(deviceStr);
|
|
|
+ $('#message_Modal').modal('show')
|
|
|
+ $('#location').val(obj.location);
|
|
|
+ $('#line').val(obj.line);
|
|
|
+ $('#source').val(obj.source);
|
|
|
+ $('#translation').val(obj.translation);
|
|
|
+
|
|
|
+ var buttonstr = '<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button> <button type="button" class="btn btn-primary" onclick="saveOrExitMsg('+idx+');">保存</button>';
|
|
|
+ $("#footerbutton").html("");
|
|
|
+ $('#footerbutton').append(buttonstr);
|
|
|
+
|
|
|
+
|
|
|
+ $('#message_Modal').modal('show')
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ var deviceStr="" ;
|
|
|
+ for(var i=0; i<mokuai_list.length; i++){
|
|
|
+ deviceStr+='<option value="'+mokuai_list[i].id+'" >'+mokuai_list[i].name+'</option>';
|
|
|
+ }
|
|
|
+ var buttonstr = '<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button> <button type="button" class="btn btn-primary" onclick="saveOrExitMsg();">保存</button>';
|
|
|
+ $("#footerbutton").html("");
|
|
|
+ $('#footerbutton').append(buttonstr);
|
|
|
+ $("#queryDevice").html("");
|
|
|
+ $('#queryDevice').append(deviceStr);
|
|
|
+ $('#message_Modal').modal('show')
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ alert(data['msg'])
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+ 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')
|
|
|
+ }
|
|
|
+ trRow = $(this)
|
|
|
+ post_data['name'] = $('#newRow_name').val()
|
|
|
+ post_data['type'] = searchtype
|
|
|
+ console.log(post_data)
|
|
|
+ $.postJSON(
|
|
|
+ http_ip_prot + 'searchtool/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 saveOrExitMsg(messageid = null) {
|
|
|
+ var selectedvar = $('#queryDevice').find('option:selected').val();
|
|
|
+ var id =messageid;
|
|
|
+ let post_data = {
|
|
|
+ 'token': $.cookie('access_token')
|
|
|
+ }
|
|
|
+ post_data['bk_id'] = selectedvar
|
|
|
+ post_data['location'] = $('#location').val()
|
|
|
+ post_data['line'] = $('#line').val()
|
|
|
+ post_data['source'] = $('#source').val()
|
|
|
+ post_data['translation'] = $('#translation').val()
|
|
|
+ post_data['type'] = searchtype
|
|
|
+ post_data['id'] = id
|
|
|
+ console.log(post_data)
|
|
|
+ $.postJSON(
|
|
|
+ http_ip_prot + 'searchtool/saveOrExitMsg', JSON.stringify(post_data),
|
|
|
+ function (data) {
|
|
|
+ if (data['code'] == 0) {
|
|
|
+ // console.log(data['res'])
|
|
|
+ let post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'page': 1,
|
|
|
+ 'line': line,
|
|
|
+ 'orderByupdate': orderByupdate,
|
|
|
+ 'type': searchtype
|
|
|
+ };
|
|
|
+ if (id) {
|
|
|
+ $('#message_Modal').modal('hide')
|
|
|
+ }
|
|
|
+ alert(data['msg']);
|
|
|
+ InitIndex(post_data=post_data,is_search = 1);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ alert(data['msg'])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // 编辑模态框
|
|
|
+ function editFunc($this) {
|
|
|
+
|
|
|
+ var mokuainame = $($this).parent().parent().children().eq(1).text()
|
|
|
+ var mokuaiid = $($this).parent().parent().children().eq(2).text()
|
|
|
+ $('#modal-container-593541').modal('show')
|
|
|
+ let html_per = '<label for="lang_key_edit">模块名</label><div id="mokuaiid" style="display:none">'+mokuaiid+'</div><input class="form-control" type="text" id="mokuainame_edit" oldkey="' + mokuainame + '" value="' + mokuainame + '"> '
|
|
|
+ $('#edit_model_form').html(html_per)
|
|
|
+ }
|
|
|
+
|
|
|
+ function deleteFunc($this) {
|
|
|
+ var mokuaiid = $($this).parent().parent().children().eq(2).text()
|
|
|
+
|
|
|
+ var r = confirm("Press a button")
|
|
|
+ if (r) {
|
|
|
+ let post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'id': mokuaiid
|
|
|
+ }
|
|
|
+ console.log(post_data)
|
|
|
+ $.postJSON(
|
|
|
+ http_ip_prot + 'searchtool/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'])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ function deleteMessage(messageid = null) {
|
|
|
+
|
|
|
+ var r = confirm("Press a button")
|
|
|
+ if (r) {
|
|
|
+ let post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'id': messageid
|
|
|
+ }
|
|
|
+ console.log(post_data)
|
|
|
+ $.postJSON(
|
|
|
+ http_ip_prot + 'searchtool/deletemessage', JSON.stringify(post_data),
|
|
|
+ function (data) {
|
|
|
+ if (data['code'] == 0) {
|
|
|
+ // console.log(data['res'])
|
|
|
+ console.log(data);
|
|
|
+ alert(data['msg']);
|
|
|
+ // console.log(data['res'])
|
|
|
+ let post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'page': 1,
|
|
|
+ 'line': line,
|
|
|
+ 'orderByupdate': orderByupdate,
|
|
|
+ 'type': searchtype
|
|
|
+ };
|
|
|
+ InitIndex(post_data=post_data,is_search = 1);
|
|
|
+ } else {
|
|
|
+ alert(data['msg'])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function editRow($this) {
|
|
|
+ let post_data = {
|
|
|
+ 'token': $.cookie('access_token')
|
|
|
+ }
|
|
|
+ post_data['name'] = $('#mokuainame_edit').val()
|
|
|
+ post_data['type'] = searchtype
|
|
|
+ post_data['id'] = $('#mokuaiid').text();
|
|
|
+
|
|
|
+ $.postJSON(
|
|
|
+ http_ip_prot + 'searchtool/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,
|
|
|
+ 'type': searchtype
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ $.postJSON(
|
|
|
+ http_ip_prot + queryUrl, 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 searchMoKuaiAction() {
|
|
|
+ /*var page = GetUrlParam('page')
|
|
|
+ if (!page) {
|
|
|
+ page = 1
|
|
|
+ }*/
|
|
|
+ getsearch();
|
|
|
+ let page = 1
|
|
|
+ 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,
|
|
|
+ 'type': searchtype
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'page': page,
|
|
|
+ 'line': 10,
|
|
|
+ 'type': searchtype
|
|
|
+ };
|
|
|
+ }
|
|
|
+ InitIndex(post_data, 1)
|
|
|
+ }
|
|
|
+
|
|
|
+ function searchMessageAction() {
|
|
|
+ /*var page = GetUrlParam('page')
|
|
|
+ if (!page) {
|
|
|
+ page = 1
|
|
|
+ }*/
|
|
|
+ getsearch();
|
|
|
+ let page = 1
|
|
|
+ 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,
|
|
|
+ 'type': searchtype
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ post_data = {
|
|
|
+ 'token': $.cookie('access_token'),
|
|
|
+ 'page': page,
|
|
|
+ 'line': 10,
|
|
|
+ 'type': searchtype
|
|
|
+ };
|
|
|
+ }
|
|
|
+ InitIndex(post_data, 1)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ function onReset() {
|
|
|
+ let role = $.cookie('role');
|
|
|
+ if(role == 1){
|
|
|
+ if(!confirm("如果你重置了语言状态,别的翻译者将无法查看到语言的相应状态!")){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let post_data = {}
|
|
|
+ var word_key = '';
|
|
|
+ let table = tagTableBody.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 + 'searchtool/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'])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function getCurrentTabText(){
|
|
|
+ var $tabs = $('#myTab').children( 'li' );
|
|
|
+ var text;
|
|
|
+ $tabs.each( function() {
|
|
|
+ var $tab = $( this );
|
|
|
+ if($tab.hasClass('active')){
|
|
|
+ text = $tab[0].innerText;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } );
|
|
|
+ return text;
|
|
|
+ }
|
|
|
+ function messageclose(){
|
|
|
+ $('#location').val(null);
|
|
|
+ $('#line').val(null);
|
|
|
+ $('#source').val(null);
|
|
|
+ $('#translation').val(null);
|
|
|
+
|
|
|
+ $("#queryDevice").html("");
|
|
|
+ $('#message_Modal').modal('hide')
|
|
|
+ }
|
|
|
+
|
|
|
+ $('#message_Modal').on('hide.bs.modal', function () {
|
|
|
+ $('#location').val(null);
|
|
|
+ $('#line').val(null);
|
|
|
+ $('#source').val(null);
|
|
|
+ $('#translation').val(null);
|
|
|
+
|
|
|
+ $("#queryDevice").html("");
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+</script>
|
|
|
+</body>
|
|
|
+</html>
|