Browse Source

添加加载状态5588

zhangxc 4 years ago
parent
commit
2a62c0e58d
3 changed files with 27 additions and 1 deletions
  1. 17 0
      src/css/medicalTermMap.less
  2. 3 0
      src/html/medicalTermMap.html
  3. 7 1
      src/js/medicalTermMap.js

+ 17 - 0
src/css/medicalTermMap.less

@@ -164,6 +164,23 @@
             top: 155px;
         }
     }
+    .emptyBox2{
+        position: absolute;
+        display: none;
+        width: 100%;
+        height: 100%;
+        background: #fff;
+        left: 0;
+        top: 0;
+        text-align: center;
+        z-index: 2;
+        p{
+            position: relative;
+            color:#AAA;
+            text-indent: 10px;
+            top: 155px;
+        }
+    }
     .footer {
         position: absolute;
         width: 100%;

+ 3 - 0
src/html/medicalTermMap.html

@@ -52,6 +52,9 @@
 						<img src ='./images/empty2.png'>   
 						<p>暂无结果~</p>
 					</div>
+					<div class="emptyBox2">
+						<p>正在加载中~</p>
+					</div>
 					<div id="main" class="mapWrapper" style="width: 796px;height:600px;cursor: pointer;"></div>
 
 				</div>

+ 7 - 1
src/js/medicalTermMap.js

@@ -28,6 +28,9 @@ $(".submit").on("click",function(){
         word: val,
         number: 10
     }
+    $('#submit').addClass('disabled')
+    $(".mapResult").html('正在加载中~')
+    $(".emptyBox2").css("display","block")
     return post(api.getTerm,param).then(res =>{
         if(res.data.code == 0){
             const data = res.data.data 
@@ -46,6 +49,7 @@ $(".submit").on("click",function(){
             
         }else{
             // getGraph(medicalTermDefaultMap[select_type],select_type)
+            $('#submit').removeClass('disabled')
         }
     })
 })
@@ -63,7 +67,6 @@ setDefaultVal(medicalTermDefaultMap[select_type])
 // })
 
 function setDefaultVal(val){
-    console.log('aaaaaaaaaa')
     $("#infoTxt").val(val)
     $(".submit").click()
 }
@@ -96,11 +99,14 @@ function getGraph(val, type){
     }).then(res=>{
         if(res.data.code == 0) {
             // select_type = select_type_noSearch
+           
             drawGraph(res.data.data)
             $(".emptyBox").css("display","none")
         }else{
            $(".emptyBox").css("display","block")
         }
+        $('#submit').removeClass('disabled')
+        $(".emptyBox2").css("display","none")
     })
 }