Pārlūkot izejas kodu

解决【搜索】功能异常

tanghongbin 5 gadi atpakaļ
vecāks
revīzija
ff374d7fc2
3 mainītis faili ar 39 papildinājumiem un 18 dzēšanām
  1. 13 6
      web/avss_index.html
  2. 13 6
      web/index.html
  3. 13 6
      web/zosi_link_index.html

+ 13 - 6
web/avss_index.html

@@ -251,7 +251,7 @@
         InitIndex(post_data)
     }
 
-    function InitIndex(post_data) {
+    function InitIndex(post_data, is_search = 0) {
         $.postJSON(
             http_ip_prot + 'langWord/query', JSON.stringify(post_data),
             function (data) {
@@ -260,13 +260,17 @@
                     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;
+                    }
                     $('#pagination').pagination({
                         pages: count_page, //总页数
                         // pages: 10000, //总页数
                         edges: 2,
                         cssStyle: 'pagination', //按纽大小pagination-lg或写入自定义css
                         displayedPages: 5, //显示几个
-                        currentPage: GetUrlParam('page'),
+                        currentPage: current_page,
                         onPageClick: function (pageNumber, event) {
                             //点击时调用
                             // alert(pageNumber);
@@ -593,10 +597,11 @@
     }
 
     function searchKeyAction() {
-        var page = GetUrlParam('page')
+        /*var page = GetUrlParam('page')
         if (!page) {
             page = 1
-        }
+        }*/
+        let page = 1
         let searchKey = $('input[name="optionsRadios"]:checked').val();
         let searchVal = $('#searchInput').val()
         console.log('-------------------------------')
@@ -610,16 +615,18 @@
                 'page': page,
                 'line': 10,
                 'searchKey': searchKey,
-                'searchVal': searchVal
+                'searchVal': searchVal,
+                'langType': 1
             };
         } else {
             post_data = {
                 'token': $.cookie('access_token'),
                 'page': page,
                 'line': 10,
+                'langType': 1
             };
         }
-        InitIndex(post_data)
+        InitIndex(post_data, 1)
     }
 
     function onReset() {

+ 13 - 6
web/index.html

@@ -251,7 +251,7 @@
         InitIndex(post_data)
     }
 
-    function InitIndex(post_data) {
+    function InitIndex(post_data, is_search = 0) {
         $.postJSON(
             http_ip_prot + 'langWord/query', JSON.stringify(post_data),
             function (data) {
@@ -260,13 +260,17 @@
                     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;
+                    }
                     $('#pagination').pagination({
                         pages: count_page, //总页数
                         // pages: 10000, //总页数
                         edges: 2,
                         cssStyle: 'pagination', //按纽大小pagination-lg或写入自定义css
                         displayedPages: 5, //显示几个
-                        currentPage: GetUrlParam('page'),
+                        currentPage: current_page,
                         onPageClick: function (pageNumber, event) {
                             //点击时调用
                             // alert(pageNumber);
@@ -594,10 +598,11 @@
     }
 
     function searchKeyAction() {
-        var page = GetUrlParam('page')
+        /*var page = GetUrlParam('page')
         if (!page) {
             page = 1
-        }
+        }*/
+        let page = 1;
         let searchKey = $('input[name="optionsRadios"]:checked').val();
         let searchVal = $('#searchInput').val()
         console.log('-------------------------------')
@@ -611,16 +616,18 @@
                 'page': page,
                 'line': 10,
                 'searchKey': searchKey,
-                'searchVal': searchVal
+                'searchVal': searchVal,
+                'langType': 0
             };
         } else {
             post_data = {
                 'token': $.cookie('access_token'),
                 'page': page,
                 'line': 10,
+                'langType': 0
             };
         }
-        InitIndex(post_data)
+        InitIndex(post_data, 1)
     }
 
     function onReset() {

+ 13 - 6
web/zosi_link_index.html

@@ -251,7 +251,7 @@
         InitIndex(post_data)
     }
 
-    function InitIndex(post_data) {
+    function InitIndex(post_data, is_search = 0) {
         $.postJSON(
             http_ip_prot + 'langWord/query', JSON.stringify(post_data),
             function (data) {
@@ -260,13 +260,17 @@
                     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;
+                    }
                     $('#pagination').pagination({
                         pages: count_page, //总页数
                         // pages: 10000, //总页数
                         edges: 2,
                         cssStyle: 'pagination', //按纽大小pagination-lg或写入自定义css
                         displayedPages: 5, //显示几个
-                        currentPage: GetUrlParam('page'),
+                        currentPage: current_page,
                         onPageClick: function (pageNumber, event) {
                             //点击时调用
                             // alert(pageNumber);
@@ -594,10 +598,11 @@
     }
 
     function searchKeyAction() {
-        var page = GetUrlParam('page')
+        /*var page = GetUrlParam('page')
         if (!page) {
             page = 1
-        }
+        }*/
+        let page = 1
         let searchKey = $('input[name="optionsRadios"]:checked').val();
         let searchVal = $('#searchInput').val()
         console.log('-------------------------------')
@@ -611,16 +616,18 @@
                 'page': page,
                 'line': 10,
                 'searchKey': searchKey,
-                'searchVal': searchVal
+                'searchVal': searchVal,
+                'langType': 2
             };
         } else {
             post_data = {
                 'token': $.cookie('access_token'),
                 'page': page,
                 'line': 10,
+                'langType': 2
             };
         }
-        InitIndex(post_data)
+        InitIndex(post_data, 1)
     }
 
     function onReset() {