Browse Source

Merge branch 'master' of http://116.63.33.55/git/nazw

elis 2 years ago
parent
commit
b339517846
1 changed files with 20 additions and 14 deletions
  1. 20 14
      nngkxxdp/src/main/resources/static/school/school.html

+ 20 - 14
nngkxxdp/src/main/resources/static/school/school.html

@@ -160,34 +160,24 @@
     $('.department li').click(function () {
         $(this).addClass('click').siblings().removeClass('click');
         department = $(this)[0].outerText
+        queryData()
     })
     // 监听学校类型
     $('.schoolType li').click(function () {
         $(this).addClass('click').siblings().removeClass('click');
         schoolType = $(this)[0].getAttribute('type')
+        queryData()
     })
     // 监听所属组
     $('.group li').click(function () {
         $(this).addClass('click').siblings().removeClass('click');
         group = $(this)[0].outerText
+        queryData()
     })
     // 点击搜索
     $('#searchBtn').click(function () {
-        if (schoolLocation == '不限') {
-            schoolLocation = ''
-        }
-        if (department == '不限') {
-            department = ''
-        }
-        if (group == '不限') {
-            group = ''
-        }
-        if (schoolType == -1) {
-            schoolType = ''
-        }
         schoolName = $('#schoolName')[0].value;
-        page = 1
-        getData();
+        queryData()
     })
     $(".content").keydown(function (e){
         // 当 keyCode 是13时,是回车操作
@@ -209,6 +199,22 @@
             getData();
         }
     })
+    function queryData() {
+        if (schoolLocation == '不限') {
+            schoolLocation = ''
+        }
+        if (department == '不限') {
+            department = ''
+        }
+        if (group == '不限') {
+            group = ''
+        }
+        if (schoolType == -1) {
+            schoolType = ''
+        }
+        page = 1
+        getData();
+    }
     function gotoInfo(id) {
         window.location.href = PATH + "/school/schoolDetail.html?id=" + schoolData[id].id
     }