瀏覽代碼

8718/8721/8722/8842空状态

zhouna 3 年之前
父節點
當前提交
c0692ff813
共有 5 個文件被更改,包括 108 次插入68 次删除
  1. 22 14
      src/css/cdssHorizontal.less
  2. 1 1
      src/html/cdss.html
  3. 9 1
      src/html/cdssHorizontal.html
  4. 29 43
      src/js/cdss.js
  5. 47 9
      src/js/cdssHorizontal.js

+ 22 - 14
src/css/cdssHorizontal.less

@@ -1,33 +1,35 @@
 @import "./common.less";
 .bodyWrap {
-  padding: 0 0 0 43px;
+  /*padding: 0 0 0 43px;*/
   position: relative;
-  min-height: 244px;
+  /*min-height: 244px;*/
+  height: 244px;
   border-bottom: 1px solid #ebebeb;
-  min-width: 1127px;
+  /*min-width: 1127px;*/
   box-shadow: 1px 1px 5px 2px #ebebeb;
 }
 .versionWrapper {
-  display: inline-block;
+  /*display: inline-block;
+  position: absolute;
+  left: 0px;*/
+  float: left;
   width: 43px;
   height: 100%;
-  position: absolute;
   background: @bgcBlue;
   color: #fff;
   font-size: 12px;
-  left: 0px;
 }
 .versionTop {
-  position: absolute;
-  width: 100%;
+  /*position: absolute;
+  width: 100%;*/
   height: 160px;
   cursor: pointer;
 }
 .versionBottom {
   position: absolute;
-  width: 100%;
-  height: 70px;
+  /*width: 100%;*/
   bottom: 0;
+  height: 70px;
   font-size: 12px;
   cursor: pointer;
 }
@@ -92,14 +94,15 @@
   background: #4f9ff3;
 }
 .contentBox {
-  position: absolute;
+  /*position: absolute;
+  left: 43px;*/
+  margin-left: 43px;
   height: 100%;
-  left: 43px;
   // overflow-y: auto;
 }
 .moduleWrapper {
-  position: absolute;
-  width: 100%;
+  /*position: absolute;
+  width: 100%;*/
   height: 202px;
 }
 .leftWrapper,
@@ -719,3 +722,8 @@
   box-sizing: border-box;
   overflow: auto;
 }
+.empty-box{
+  text-align: center;
+  margin-top: 60px;
+  display: none;
+}

+ 1 - 1
src/html/cdss.html

@@ -40,7 +40,7 @@
               </div>
               <div class="empty-box empty-null">
                   <img class="emptyImg" src="../images/empty.png" alt="空">
-                  <p class="emptyTxt">暂无数据</p>
+                  <p class="emptyTxt">暂无推送内容</p>
               </div>
               <div class="empty-box loading">
                 <div class="loadingMask"></div>

+ 9 - 1
src/html/cdssHorizontal.html

@@ -14,7 +14,7 @@
 </head>
 
 <body>
-  <div class="bodyWrap">
+  <div class="bodyWrap clearfix">
       <div class="versionWrapper">
         <span class="versionTop">
           <span class="pushDisclaimer">智能推送仅供参考 </span>
@@ -32,6 +32,14 @@
 
         </div>
         <div class="recommendWrap moduleWrapper clearfix">
+          <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="leftWrapper">
             <div class="leftBox"></div>
           </div>

+ 29 - 43
src/js/cdss.js

@@ -68,7 +68,7 @@ let treatDisName;
 function getMRInfo() {
    return post(config.getMr2,{mrId:mrId})
 }
-//$('.empty').css("display","none")
+
 if(mrId){
   Promise.all([getConf(),getMRInfo()]).then(([res1,res2])=>{
     const data = res1.data.data&&res1.data.data[0]
@@ -223,6 +223,7 @@ function renderPage(pageSet){
   const hasMedical = hasTab("医学知识",setInfo)
   const hasFollowUp = hasTab("随访计划",setInfo)
   const hasTcm = hasTab("中医辅助", setInfo);
+  //所有模块都未开启配置,显示功能未开启(无tab)
   if(hasAuxiliary.status===0&&hasMedical.status===0&&hasFollowUp.status===0&&hasTcm.status===0){
     const nullTxt = `<div class="empty-box" style="left: -20px;display: block;">
                   <img class="emptyImg" src="../images/icon_admin.png" alt="空">
@@ -238,12 +239,20 @@ function renderPage(pageSet){
     return
   }
   const planDetail = hasAuxiliary.planDetails;
+  const configs = planDetail.find((it)=>it.status!==0);
+  if(!configs){         //没有开启辅助信息各项配置
+      $('.empty-box').hide();
+      $('.recommendBox .empty-right').show();
+      return;
+  }
   if(hasAuxiliary){
+    $('.empty-box').hide();
+    $(".loading").show();
     renderModuleWrapper(planDetail)
     let needPush = isNeedPush(planDetail)
     let needPushWarning = isNeedPushWarning(planDetail)
     let needWriteStandardPush = isNeedwriteStandardPush(planDetail);
-    if(needPush || needPushWarning){
+    if(needPush){
       renderPushData()
       allInterface++
     }
@@ -263,6 +272,7 @@ function renderPage(pageSet){
 
 function renderPushData(){
   return getPushInfo().then(res =>{
+    $(".loading").hide();
     hasCompleteTnterface++
     if(res.data.code == "0"){
       const result = res.data.data
@@ -301,15 +311,10 @@ function renderPushData(){
       renderOperationPush(operationsPush,operationsNum)
       rendergeneraTreatPush(generaTreatPush)
       renderNurse(nursePush, nurseNum)
-      //if(hasCompleteTnterface === allInterface){
-        //$('.loading').css("display","none")
-        //if(moduleNum === 0){
-          empty()
-        //}
-      //}
       bindOpenInfo()
       moreInfo()
       bindSlide()
+      empty();  //判断是否显示空状态
     }
   })
 }
@@ -320,7 +325,7 @@ function adjustHei(){
 }
 function isNeedPush(list){
   let pass = false;
-  let pushCode = ["diag","lis","pacs","symptom","vital","treat","medicines"]
+  let pushCode = ['critical',"diag","lis","pacs","symptom","vital","treat","medicines",'evaluation','general','medicine','operation','nurse']
   for(let i = 0; i < list.length; i++){
     if(pushCode.indexOf(list[i].code)>-1){
       if(list[i].status == "1"){
@@ -357,6 +362,7 @@ function isNeedPushWarning(list){
 //let popNum = 0;//气泡显示数字
 function renderPushWarning(){
   return getPusgWarning().then(res =>{
+      $(".loading").hide();
     hasCompleteTnterface++
     if(res.data.code == '0'){
       const result = res.data.data
@@ -376,33 +382,20 @@ function renderPushWarning(){
       $(".moduleItem.tips").wrapAll("<div class='tips-cont'></div>");
         updatePopNum();
       $(titleStr('warning')).insertBefore('.tips-cont .moduleItem:first-child')
-      //popNum = billMsgList.length+highRiskList.length+criticalValList.length+otherList.length;
-      // renderBillingPush(dubugStr,'注意调试信息')
-     
+      empty();
     }
-    //if(hasCompleteTnterface === allInterface){
-      //$('.loading').css("display","none")
-      //if(moduleNum === 0){
-        empty()
-      //}
-    //}
-    
   })
 }
 function renderWriteStandard(){
   return getWriteStandardPush().then(res =>{
+      $(".loading").hide();
     hasCompleteTnterface++
     if(res.data.code == '0'){
       const list = res.data.data || {}
       let casewritingNum = $(".moduleItem.casewriting").attr("data-num") || 5
       renderwriteStandardPage(list,casewritingNum)
+      empty();
     }
-    //if(hasCompleteTnterface === allInterface){
-      //$('.loading').css("display","none")
-      //if(moduleNum === 0){
-        empty()
-      //}
-    //}
   })
 }
 function  renderwriteStandardPage(list,casewritingNum){
@@ -613,14 +606,12 @@ function renderOperationPush(list,showNum){
 function renderItemWrapper(list, showNum) {
   let showNum1 = showNum || 5
   let shortStr = '', longStr = ''
-  $('.empty').css("display","none")
   for(let i = 0; i < list.length; i++){
     if(i <= showNum1-1){
       shortStr += renderPushItem(list[i])
     }
     longStr += renderPushItem(list[i])
   }
-
   if(showNum1 >= list.length){
     return {
       shortStr:`<div class="shortBox">${shortStr}</div>`,
@@ -679,10 +670,9 @@ function renderModuleWrapper(moduleList){
     }
    
   }
-  // console.log(moduleList,moduleStr)
+  //console.log(moduleList,moduleStr)
 
   $(".recommendWrap").append(moduleStr)
-  empty();    //如没有配置数据,显示无配置
 }
 
 function hasTab(tabName,tabList){
@@ -774,20 +764,16 @@ function bindGeneralSlide(){
 
 //显示空状态
 function empty(){
-  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();
+    setTimeout(function(){
+        const emptyShownBox = $('.recommendWrap .empty-box:visible').length;
+        const configShownBox = $('.recommendWrap .moduleItem:visible').length;
+        if(configShownBox===0&&emptyShownBox===0){       //有配置但没数据
+            $('.empty-box').hide();
+            $('.recommendBox .empty-null').show();
+            return;
+        }
+        $(".empty-box").hide();
+    },200);
 }
 
 $(function(){

+ 47 - 9
src/js/cdssHorizontal.js

@@ -29,7 +29,6 @@ let generalTreatInfo
 const { renderFollowUp } = require('./followUp.js');
 const { getTcmMr } = require('./tcmiss.js');
 
-setWidth()
 let moduleConfig = {
   auxiliary: "recommendWrap",
   qc: "qcWrap",
@@ -106,9 +105,28 @@ function renderPage(pageSet) {
   const hasFollowUp = hasTab("随访计划", pageSet.sysSetInfo)
   const hasTcm = hasTab("中医辅助", pageSet.sysSetInfo)
 
+  //所有模块都未开启配置,显示功能未开启(无tab)
+  if(hasAuxiliary.status===0&&hasMedical.status===0&&hasFollowUp.status===0&&hasTcm.status===0){
+      const nullTxt = `<div class="empty-box" style="left: -20px;display: block;">
+                <img class="emptyImg" src="../images/icon_admin.png" alt="空">
+                <p class="emptyTxt">功能未开启</p>
+            </div>`
+      $(".recommendWrap").html(nullTxt);
+      return;
+  }
   if (hasTcm) {
     getTcmMr(mrId, hasTcm);
   }
+
+  const planDetail = hasAuxiliary.planDetails;
+  const configs = planDetail.find((it)=>it.status!==0);
+  if(!configs){         //没有开启辅助信息各项配置
+      $('.empty-box').hide();
+      $('.recommendWrap .empty-right').show();
+      return;
+  }
+  //有数据再设置宽度
+  //setWidth()
   if (hasAuxiliary) {
     renderModuleWrapper(hasAuxiliary.planDetails)
     let needPush = isNeedPush(hasAuxiliary.planDetails)
@@ -152,7 +170,7 @@ function renderTab(tabList) {
   let showModuleName = $(".tabList .tab").eq(0).attr("data-name")
   getModuleShow(moduleConfig[showModuleName])
   bindTabClick()
-  setTabNameTop()
+  //setTabNameTop()
 }
 function hasTab(tabName, tabList) {
   for (let i = 0; i < tabList.length; i++) {
@@ -183,9 +201,12 @@ function renderModuleWrapper(moduleList) {
   }
   $(".recommendWrap .leftBox").append(moduleStr)
   $(".recommendWrap .rightBox").append(treatStr)
+  if($(".leftBox .moduleItem:visible,.rightBox .moduleItem:visible").length===0){
+      $(".empty-null").show();
+  }
 }
 function isNeedPush(list) {
-  let pushCode = ["diag", "lis", "pacs", "symptom", "vital"]
+  let pushCode = ['critical',"diag", "lis", "pacs", "symptom", "vital","treat","medicines",'evaluation','general','medicine','operation','nurse']
   for (let i = 0; i < list.length; i++) {
     if (pushCode.indexOf(list[i].code) > -1) {
       if (list[i].status == "1") {
@@ -231,10 +252,11 @@ function getModuleShow(moduleClassName) {
   if ($(`.${moduleClassName}`).css("display") == "none") {
     $(".moduleWrapper").css("display", "none")
     $(`.${moduleClassName}`).css("display", "block")
+    $(".empty-box").hide();
   }
 }
 function setTabNameTop() {
-  tabNameList = $(".tabList .tab .tabName")
+  const tabNameList = $(".tabList .tab .tabName")
   for (let i = 0; i < tabNameList.length; i++) {
     let tabNameHei = $(".tabList .tab .tabName").eq(i).height()
     // $(".tabList .tab .tabName").eq(i).css("marginTop", -tabNameHei / 2 + "px")
@@ -258,6 +280,7 @@ function renderCaseWrite() {
       }
     }
   })
+  empty()
 }
 function renderPushData() {
   return getPushInfo().then(res => {
@@ -300,9 +323,14 @@ function renderPushData() {
         let str = `<img class="treatIcon" src = ${titleConfigH["treat"].icon} /><span>${titleConfigH["treat"].name}</span>`
         $(".rightBoxTitle").append(str)
         renderDisName()
-        $(".rightWrapper").css("display", "inline-block")
-        // $(".leftWrapper").css("borderRight", "1px solid #E6E6E6")
+        $(".empty-box").hide();
+        $(".rightWrapper").css("display", "block")
+        if($(".leftBox .moduleItem:visible").length===0){   //左侧没有数据,右侧有数据时,右侧往左移
+          $(".leftWrapper").css({"width":'0','padding':'0'});
+          $(".rightWrapper").css("width",'100%');
+        }
       } else {
+        $(".empty-box").hide();
         $(".leftWrapper").css({
           borderRight: "0px",
           width: "100%"
@@ -310,6 +338,7 @@ function renderPushData() {
       }
       if ((!$(".moduleItem.medicine") && !$(".moduleItem.operation") && !(".moduleItem.general")) || ($(".moduleItem.general").length === 0 && $(".moduleItem.medicine").length === 0 && $(".moduleItem.operation").length === 0 && $(".moduleItem.nurse").length === 0)) {
         $(".rightWrapper").css("display", "none")
+        $(".empty-box").hide();
         $(".leftWrapper").css({
           borderRight: "0px",
           width: "100%"
@@ -323,10 +352,18 @@ function renderPushData() {
       bindOpenInfo()
       bindSlide()
       moreInfo()
+      empty()
     }
   })
 }
-
+function empty(){   //显示空状态
+  setTimeout(function(){
+      if($(".moduleItem:visible").length===0){
+          $(".empty-box").hide();
+          $(".empty-null").show();
+      }
+  },200);
+}
 function renderLis(list, showNum) {
   if (list.length > 0 && $(".moduleItem.lis").length > 0) {
     moduleNum++
@@ -529,6 +566,7 @@ function renderPushWarning() {
     }
 
   })
+  empty()
 }
 function renderBillingPush(list, name, code) {
   if (list.length === 0) {
@@ -637,10 +675,10 @@ function bindGeneralSlide() {
     openNewWin(`generalTreat.html?disName=${treatDisName}&name=${treatUniqueName}`)
   })
 }
-function setWidth() {
+/*function setWidth() {
   let winWidth = $(".bodyWrap").css("width")
   $(".contentBox").css("width", winWidth)
-}
+}*/
 
 //医学知识搜索
 searchMedical()