Selaa lähdekoodia

Merge branch 'hideNoContent' into test

zhangxc 5 vuotta sitten
vanhempi
commit
8c0d00244b
3 muutettua tiedostoa jossa 30 lisäystä ja 43 poistoa
  1. 10 9
      src/js/index.js
  2. 19 32
      src/js/indexHorizontal.js
  3. 1 2
      src/js/indexHorizontalDom.js

+ 10 - 9
src/js/index.js

@@ -89,7 +89,7 @@ function getPageInfo() {
     const {confArr, showLabsNum, showPacsNum, labsAndPacMode} = transConf(configArr)
     pushResult = pushInfo.data || {};
     treatResult = treatInfo.data || {}
-    tipsResult = tipsInfo.data || {}
+    tipsResult = tipsInfo.data || []
 
     const diagPossible =  pushResult.dis&&pushResult.dis['可能诊断'] || []//可能
     const diagDoubt = pushResult.dis&&pushResult.dis['拟诊'] || [] // 疑似
@@ -121,28 +121,29 @@ function getPageInfo() {
 
       switch(confArr[i].code) {
         case "inquiry_show":  //问诊症状
-          renderRecommendInfo(confArr[i].showNum,'symptomRecommend', '问诊症状', symptomRecommend, false)
+        symptomRecommend.length > 0 && renderRecommendInfo(confArr[i].showNum,'symptomRecommend', '问诊症状', symptomRecommend, false)
           break; 
         case "health_show": //体格检查
-          renderRecommendInfo(confArr[i].showNum,'physiExamRecommend', '体格检查', physiExamRecommend, false)
+        physiExamRecommend.length > 0&&  renderRecommendInfo(confArr[i].showNum,'physiExamRecommend', '体格检查', physiExamRecommend, false)
           break;
         case "illness_show": //病情提示
-          renderRecommendConditTips('conditTips','病情提示', medicalIndications || [])
+        medicalIndications.length > 0&& renderRecommendConditTips('conditTips','病情提示', medicalIndications || [])
           break;
         case "vigilant_show": //警惕诊断
-          renderRecommendInfo(confArr[i].showNum,'warning', '警惕诊断', diagWaring, true,7,2)
+          
+        diagWaring.length > 0&& renderRecommendInfo(confArr[i].showNum,'warning', '警惕诊断', diagWaring, true,7,2)
           break;
         case "lispacs_show": //检验检查
-          renderMultRecommendInfo('labAndPacsRecommend', '检验检查', labAndPacsRecommend, false)
+          (labRecommend.length > 0 || pacsRecommend.length >0) && renderMultRecommendInfo('labAndPacsRecommend', '检验检查', labAndPacsRecommend, false)
           break;
         case "cure_show": //治疗方案
-          renderTreat('treatRecommend','治疗方案',treatResult)
+          JSON.stringify(treatResult)!='{}'&&treatResult.commonTreatment&&treatResult.treatment.length > 0&&renderTreat('treatRecommend','治疗方案',treatResult)
           break;
         case "diagnose_show": //推荐诊断
-          renderRecommendInfo(confArr[i].showNum,'diagRecommend', '推荐诊断', diagRecommend, true,7,2)
+        diagRecommend.length > 0 && renderRecommendInfo(confArr[i].showNum,'diagRecommend', '推荐诊断', diagRecommend, true,7,2)
           break;
         case "tip_show": //提示信息
-          renderTipsInfo('tipsInfo','提示信息',tipsResult)
+          tipsResult.length > 0 && renderTipsInfo('tipsInfo','提示信息',tipsResult)
           moreInfo()
           break;
         case "knowledge_show": //医学知识

+ 19 - 32
src/js/indexHorizontal.js

@@ -57,23 +57,6 @@ if(mrId) {
   getPageInfo();
 }
 
-
-// var msg = {
-//     age: getUrlArgObject('age'),
-//     sex: getUrlArgObject('sex') == '男'?1:(getUrlArgObject('sex') == '女'?2:(getUrlArgObject('sex') == '通用'?3:getUrlArgObject('sex'))),
-//     symptom: getUrlArgObject('symptomJson'),
-//     vital: getUrlArgObject('vitalJson'),
-//     lis: getUrlArgObject('lisJson')? JSON.parse(getUrlArgObject('lisJson')) : [],
-//     pacs: getUrlArgObject('pacsJson'),
-//     diag: getUrlArgObject('diagJson'),
-//     diseaseName: getUrlArgObject('diagJson'),
-//     other: getUrlArgObject('otherJson') + getUrlArgObject('pastJson'),
-//     hosCode:getUrlArgObject('hospitalCode') || '',
-//     plan:getUrlArgObject('plan') || '0',
-// }//推送相关信息
-// //   http://localhost:8082/indexVert.html?age=28&diseaseId=280&lisJson=&diagJson=%E6%80%A5%E6%80%A7%E8%83%B0%E8%85%BA%E7%82%8E&pastJson=%E6%97%A0%E5%BF%83%E8%84%8F%E7%97%85&otherJson=%E6%97%A0%E9%AB%98%E8%A1%80%E5%8E%8B&pacsJson=%E8%85%B9%E9%83%A8B%E8%B6%85:%E6%97%A0%E5%BC%82%E5%B8%B8,%20%E6%8A%A5%E5%91%8A%E6%97%A5%E6%9C%9F:2019-05-07&sex=%E7%94%B7&symptomJson=%E6%81%B6%E5%BF%83%E5%91%95%E5%90%90%E8%85%B0%E7%97%9B&vitalJson=%E8%A1%80%E5%8E%8B%E5%B7%A6%E4%B8%8A%E8%82%A213/12mmHg
-// window.msg = msg
-// window.pushMessage = {}
 function getConf() {
   return post(config.getSysSetInfoDatas,{hospitalCode: msg.hosCode,plan:msg.plan})
 }
@@ -98,11 +81,11 @@ function getPageInfo() {
     const configArr = res1&&res1.data&&res1.data.data || []
     const pushInfo = res2.data || {}
     const treatInfo = res3.data || {}
-    const tipsInfo = res4.data || {}
+    const tipsInfo = res4.data || []
     const {confArr, showLabsNum, showPacsNum, labsAndPacMode} = transConf(configArr)
-    const pushResult = pushInfo.data || {};
-    const treatResult = treatInfo.data || {}
-    const tipsResult = tipsInfo.data&&tipsInfo.data || []
+    pushResult = pushInfo.data || {};
+    treatResult = treatInfo.data || {}
+    tipsResult = tipsInfo.data || []
     const diagPossible =  pushResult.dis&&pushResult.dis['可能诊断'] || []//可能
     const diagDoubt = pushResult.dis&&pushResult.dis['拟诊'] || [] // 疑似
     const diagDeter = pushResult.dis&&pushResult.dis['确诊'] || []//确诊
@@ -132,31 +115,35 @@ function getPageInfo() {
     for(let i = 0; i < confArr.length; i++) {
       switch(confArr[i].code) {
         case "inquiry_show":  //问诊症状
-          renderRecommendInfo(confArr[i].showNum, symptomImg, 'symptomRecommend', '问诊症状', symptomRecommend, false)
+          symptomRecommend.length > 0 && renderRecommendInfo(confArr[i].showNum, symptomImg, 'symptomRecommend', '问诊症状', symptomRecommend, false)
           break; 
         case "health_show": //体格检查
-          renderRecommendInfo(confArr[i].showNum, physiExamImg, 'physiExamRecommend', '体格检查', physiExamRecommend, false)
+          physiExamRecommend.length > 0 && renderRecommendInfo(confArr[i].showNum, physiExamImg, 'physiExamRecommend', '体格检查', physiExamRecommend, false)
           break;
         case "illness_show": //病情提示
-          renderRecommendConditTips(conditTipsImg, 'conditTips','病情提示', medicalIndications || [])
+          medicalIndications.length > 0 && renderRecommendConditTips(conditTipsImg, 'conditTips','病情提示', medicalIndications || [])
           break;
         case "vigilant_show": //警惕诊断
-          renderRecommendInfo(confArr[i].showNum, warningImg, 'warning', '警惕诊断', diagWaring, true,7,2)
+          diagWaring.length > 0 && renderRecommendInfo(confArr[i].showNum, warningImg, 'warning', '警惕诊断', diagWaring, true,7,2)
           break;
         case "lispacs_show": //检验检查
-          renderMultRecommendInfo(labsAndPacMode,labAndPacsImg, 'labAndPacsRecommend', '检验检查', labAndPacsRecommend, false)
+          (labRecommend.length > 0 || pacsRecommend.length >0) && renderMultRecommendInfo(labsAndPacMode,labAndPacsImg, 'labAndPacsRecommend', '检验检查', labAndPacsRecommend, false)
           break;
         case "cure_show": //治疗方案
-          tipsNum++;
-          renderTreat(treatImg, 'treatRecommend','治疗方案',treatResult)
+          if(JSON.stringify(treatResult)!='{}'&&treatResult.commonTreatment&&treatResult.treatment.length > 0) {
+            tipsNum++;
+            renderTreat(treatImg, 'treatRecommend','治疗方案',treatResult)
+          }
           break;
         case "diagnose_show": //推荐诊断
-          renderRecommendInfo(confArr[i].showNum, diagImg, 'diagRecommend', '推荐诊断', diagRecommend, true,7,2)
+          diagRecommend.length > 0 && renderRecommendInfo(confArr[i].showNum, diagImg, 'diagRecommend', '推荐诊断', diagRecommend, true,7,2)
           break;
         case "tip_show": //提示信息
-          tipsNum++;
-          renderTipsInfo('', 'tipsInfo','提示信息',tipsResult)
-          moreInfo()
+          if(tipsResult.length > 0 ) {
+            tipsNum++;
+            renderTipsInfo('', 'tipsInfo','提示信息',tipsResult)
+            moreInfo()
+          }
           break;
         case "knowledge_show": //医学知识
           tipsNum++;

+ 1 - 2
src/js/indexHorizontalDom.js

@@ -84,13 +84,12 @@ function renderRecommendInfo(showNum, icon, className,title,data, hasInfo, type,
 
 //化验和辅检等多种类型
 function renderMultRecommendInfo(labsAndPacMode,icon, className,title,data, hasInfo, type, position) {
-    console.log(labsAndPacMode)
     const str = `<div class="recommendInfoWrapper ${className} clearfix">
                     <h4 class ="${+labsAndPacMode === 1 ? 'showTopTitle':'showRightTitle'}"><img src=${icon} title="${title}" class="icon">${title}:</h4>
                     <div class="recommendInfoBox ${className + 'box'} ${+labsAndPacMode === 1 ? 'showTopInfo':'showRightInfo'}"></div>
                 </div>`
     $('.push').append(str)
-    
+    let hanContentNum = 0
     for(let i = 0; i < data.length; i++) {
         const showNum = data[i].showNum || 5
         const dataLen = data[i].data.length