zhouna 3 년 전
부모
커밋
404afcf40f
3개의 변경된 파일48개의 추가작업 그리고 11개의 파일을 삭제
  1. 24 0
      src/css/cdssHorizontal.less
  2. 5 0
      src/html/cdssHorizontal.html
  3. 19 11
      src/js/cdssHorizontal.js

+ 24 - 0
src/css/cdssHorizontal.less

@@ -727,4 +727,28 @@
   text-align: center;
   margin-top: 60px;
   display: none;
+}
+.loading{
+   position: fixed;
+   width: 100%;
+   left: 0;
+   top: 82px;
+   z-index: 100;
+   display: none;
+ }
+.loadingMask{
+  position: absolute;
+  width: 100%;
+  height: 100%;
+  background-color: #fff;
+  opacity: 0.5;
+  filter:alpha(opacity=50);
+  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=50);";
+}
+.loadingImg{
+  width: 40px;
+  position: absolute;
+  left: 50%;
+  top: 50%;
+  margin: -20px 0 0 -20px;
 }

+ 5 - 0
src/html/cdssHorizontal.html

@@ -40,6 +40,11 @@
             <img class="emptyImg" src="../images/empty.png" alt="空">
             <p class="emptyTxt">暂无推送内容</p>
           </div>
+          <div class="empty-box loading">
+          <div class="loadingMask"></div>
+          <img class="loadingImg" src="../images/loading.gif" alt="loading">
+          <!-- <p class="loadingTxt">loading~</p> -->
+        </div>
           <div class="leftWrapper">
             <div class="leftBox"></div>
           </div>

+ 19 - 11
src/js/cdssHorizontal.js

@@ -201,9 +201,10 @@ function renderModuleWrapper(moduleList) {
   }
   $(".recommendWrap .leftBox").append(moduleStr)
   $(".recommendWrap .rightBox").append(treatStr)
-  if($(".leftBox .moduleItem:visible,.rightBox .moduleItem:visible").length===0){
+  /*if($(".moduleItem:visible").length===0){
       $(".empty-null").show();
-  }
+  }*/
+
 }
 function isNeedPush(list) {
   let pushCode = ['critical',"diag", "lis", "pacs", "symptom", "vital","treat","medicines",'evaluation','general','medicine','operation','nurse']
@@ -219,7 +220,7 @@ function isNeedPush(list) {
 function isNeedPushWarning(list) {
   let pushCode = ["crivalue", "rationali", "highrisk", "otherremind"]
   for (let i = 0; i < list.length; i++) {
-    if (pushCode.indexOf(list[i].code) > -1) {
+    if (pushCode.indexOf(list[i].code.trim()) > -1) {
       if (list[i].status == "1") {
         return true
       }
@@ -252,7 +253,7 @@ function getModuleShow(moduleClassName) {
   if ($(`.${moduleClassName}`).css("display") == "none") {
     $(".moduleWrapper").css("display", "none")
     $(`.${moduleClassName}`).css("display", "block")
-    empty();
+    //empty();
   }
 }
 function setTabNameTop() {
@@ -279,10 +280,12 @@ function renderCaseWrite() {
         }
       }
     }
+  }).catch(()=>{
+      $(".loading").hide()
   })
-  empty()
 }
 function renderPushData() {
+  $(".loading").show()
   return getPushInfo().then(res => {
     hasCompleteTnterface++
     if (res.data.code == "0") {
@@ -354,15 +357,17 @@ function renderPushData() {
       moreInfo()
       empty()
     }
+  }).catch(()=>{
+      $(".loading").hide()
   })
 }
 function empty(){   //显示空状态
   setTimeout(function(){
-      if($(".empty-right:visible").length===0&&$(".moduleItem:visible").length===0){
+      if($(".tabList .tab:first-child").is(".activeTab")&&$(".empty-right:visible").length===0&&$(".moduleItem:visible").length===0){
           $(".empty-box").hide();
           $(".empty-null").show();
       }
-  },200);
+  },300);
 }
 function renderLis(list, showNum) {
   if (list.length > 0 && $(".moduleItem.lis").length > 0) {
@@ -524,6 +529,7 @@ function renderwriteStandardPage(list) {
     $(".moduleItem.casewriting").append(str)
     $('.moduleItem.casewriting').css("display", "block")
   }
+  empty()
 }
 function renderPushWarning() {
   return getPusgWarning().then(res => {
@@ -560,13 +566,15 @@ function renderPushWarning() {
     }
     if (hasCompleteTnterface === allInterface) {
       $('.loading').css("display", "none")
-      if (moduleNum === 0) {//console.log(999)
-        // empty()
-      }
+      /*if (moduleNum === 0) {//console.log(999)
+         empty()
+      }*/
     }
+    empty()
 
+  }).catch(()=>{
+      $(".loading").hide()
   })
-  empty()
 }
 function renderBillingPush(list, name, code) {
   if (list.length === 0) {