瀏覽代碼

2019-09-16 20:31

xs 5 年之前
父節點
當前提交
994e49e53e
共有 1 個文件被更改,包括 21 次插入19 次删除
  1. 21 19
      src/main/webapp/webpage/modules/sg/free/individualForm.jsp

+ 21 - 19
src/main/webapp/webpage/modules/sg/free/individualForm.jsp

@@ -220,28 +220,30 @@
         $("#mylable2").text(xmmc2);
         $("#readid2").text(fyje2);
 
-        $('#btn-search').click(function () {
-            var keyword = $('#edt-search').val();
-            var searchCount = 0;
-            $('#longtable').next('.treeTable').find('.layui-table-body tbody tr td').each(function () {
-                $(this).css('background-color', 'transparent');
-                var text = $(this).text();
-                if (keyword != '' && text.indexOf(keyword) >= 0) {
-                    $(this).css('background-color', 'rgba(250,230,160,0.5)');
-                    if (searchCount == 0) {
-                        treetable.expandAll('#longtable');
-                        $('html,body').stop(true);
-                        $('html,body').animate({scrollTop: $(this).offset().top - 150}, 500);
-                    }
-                    searchCount++;
+    });
+</script>
+<script>
+    $('#btn-search').click(function () {
+        var keyword = $('#edt-search').val();
+        var searchCount = 0;
+        $('#longtable').next('.treeTable').find('.layui-table-body tbody tr td').each(function () {
+            $(this).css('background-color', 'transparent');
+            var text = $(this).text();
+            if (keyword != '' && text.indexOf(keyword) >= 0) {
+                $(this).css('background-color', 'rgba(250,230,160,0.5)');
+                if (searchCount == 0) {
+                    treetable.expandAll('#longtable');
+                    $('html,body').stop(true);
+                    $('html,body').animate({scrollTop: $(this).offset().top - 150}, 500);
                 }
-            });
-            if (keyword == '') {
-                layer.msg("请输入搜索内容", {icon: 5});
-            } else if (searchCount == 0) {
-                layer.msg("没有匹配结果", {icon: 5});
+                searchCount++;
             }
         });
+        if (keyword == '') {
+            layer.msg("请输入搜索内容", {icon: 5});
+        } else if (searchCount == 0) {
+            layer.msg("没有匹配结果", {icon: 5});
+        }
     });
 </script>
 </html>