Browse Source

空状态、遮挡

zhouna 3 years ago
parent
commit
73f21d2b5e
3 changed files with 46 additions and 24 deletions
  1. 11 4
      src/css/cdss.less
  2. 12 4
      src/html/cdss.html
  3. 23 16
      src/js/cdss.js

+ 11 - 4
src/css/cdss.less

@@ -105,16 +105,23 @@ body{
     background: #D1D1D1;
 }
 
-
-.empty{
+.empty-box{
     position: relative;
     top: 100px;
+    display: none;
+}
+.empty{
+  display: block;
 }
 .emptyImg{
-    width: 90px;
+    width: 185px;
     position: relative;
     left: 50%;
-    margin-left: -45px;
+    margin-left: -93px;
+    &.small{
+      width: 90px;
+      margin-left: -45px;
+    }
 }
 .emptyImgSearch{
     width: 145px;

+ 12 - 4
src/html/cdss.html

@@ -30,13 +30,21 @@
         <div class="contentWrapper">
           <div class="recommendWrap moduleWrapper">
             <div class="recommendBox">
-              <div class="empty">
-                <img class="emptyImg" src="./images/empty2.png" alt="空">
+              <div class="empty-box empty">
+                <img class="emptyImg small" src="../images/empty2.png" alt="空">
                 <p class="emptyTxt">等待内容输入中…</p>
               </div>
-              <div class="loading">
+              <div class="empty-box empty-right">
+                  <img class="emptyImg" src="../images/icon_admin.png" alt="空">
+                  <p class="emptyTxt">功能未开启</p>
+              </div>
+              <div class="empty-box empty-null">
+                  <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">
+                <img class="loadingImg" src="../images/loading.gif" alt="loading">
                 <!-- <p class="loadingTxt">loading~</p> -->
               </div>
               <p class="responsibility"></p>

+ 23 - 16
src/js/cdss.js

@@ -13,6 +13,7 @@ require('./../css/followUpV.less');
 require('../css/staticSearch.less')
 require('./../js/staticSearch.js');//静态知识搜索
 require('./../images/empty.png').replace(/^undefined/g, '')
+require('./../images/icon_admin.png').replace(/^undefined/g, '')
 require('./../images/empty2.png').replace(/^undefined/g, '')
 require('./../images/empty3.png').replace(/^undefined/g, '')
 require('./../images/icon_no.png').replace(/^undefined/g, '')
@@ -227,7 +228,6 @@ function renderPage(pageSet){
       getTcmMr(mrId, hasTcm);
   }
   if(!mrId){
-    empty()
     return
   }
   const planDetail = hasAuxiliary.planDetails;
@@ -296,9 +296,9 @@ function renderPushData(){
       renderNurse(nursePush, nurseNum)
       if(hasCompleteTnterface === allInterface){
         $('.loading').css("display","none")
-        if(moduleNum === 0){
+        //if(moduleNum === 0){
           empty()
-        }
+        //}
       }
       bindOpenInfo()
       moreInfo()
@@ -375,9 +375,9 @@ function renderPushWarning(){
     }
     if(hasCompleteTnterface === allInterface){
       $('.loading').css("display","none")
-      if(moduleNum === 0){
+      //if(moduleNum === 0){
         empty()
-      }
+      //}
     }
     
   })
@@ -392,9 +392,9 @@ function renderWriteStandard(){
     }
     if(hasCompleteTnterface === allInterface){
       $('.loading').css("display","none")
-      if(moduleNum === 0){
+      //if(moduleNum === 0){
         empty()
-      }
+      //}
     }
   })
 }
@@ -675,6 +675,7 @@ function renderModuleWrapper(moduleList){
   // console.log(moduleList,moduleStr)
 
   $(".recommendWrap").append(moduleStr)
+  empty();    //如没有配置数据,显示无配置
 }
 
 function hasTab(tabName,tabList){
@@ -764,18 +765,24 @@ function bindGeneralSlide(){
  
  }
 
+//显示空状态
 function empty(){
-  // $(".responsibility").css("display","none")
-  $('.recommendWrap .empty').css("display","block")
+  const emptyShownBox = $('.recommendWrap .empty-box:visible').length;
+  const configShownBox = $('.recommendWrap .moduleItem:visible').length;
+  const configBox = $('.recommendWrap .moduleItem').length;
+  if(configBox===0){
+      $('.empty-box').hide();
+      $('.recommendBox .empty-right').show();
+      return;
+  }
+  if(configBox>0&&configShownBox===0&&emptyShownBox===0){
+      $('.empty-box').hide();
+      $('.recommendBox .empty-null').show();
+      return;
+  }
+  $(".empty-box").hide();
 }
 
-
-
-
-
-
-
-
 $(function(){
   //隐藏logo
   if(getUrlArgObject("hideLg")){