소스 검색

提示信息横板

zhangxc 5 년 전
부모
커밋
5cb4a68f5b
5개의 변경된 파일175개의 추가작업 그리고 25개의 파일을 삭제
  1. 46 9
      src/css/indexHorizontal.less
  2. 3 1
      src/html/indexHorizontal.html
  3. 56 7
      src/js/indexHorizontal.js
  4. 69 7
      src/js/indexHorizontalDom.js
  5. 1 1
      webpack.config.js

+ 46 - 9
src/css/indexHorizontal.less

@@ -32,7 +32,7 @@
     border-right: 1px solid #f0efef;
     box-sizing: border-box;
 }
-.treat {
+.infomationBox {
     margin-top: 10px;
     width: 38%;
     float: left;
@@ -68,6 +68,9 @@
         color: #1AB3A9;
     }
 }
+.treatRecommend  {
+    position: absolute;
+}
 .icon{
     display: block;
     width: 20px;
@@ -191,20 +194,23 @@
 .diagName {
     color: #040428;
 }
-.treatItemTitle {
-    font-weight: bold;
-    font-size: 13px;
-    color: #7C828E;
+.treatItemTitle, .tipsTitle {
+    // font-weight: bold;
+    font-size: 14px;
+    color: #000000;
     float: left;
     width: 60px;
     height: 30px;
     line-height: 30px;
     float: left;
 }
-.treat .recommendInfoBox {
+.tipsTitle {
+    margin-top: 10px;
+}
+.infomationBox .recommendInfoBox {
     margin-left: 0px;
 }
-.treat .treatTextBox {
+.infomationBox .treatTextBox {
     margin-left: 80px;
     line-height: 30px;
     height: 90px;
@@ -214,17 +220,26 @@
     // -webkit-box-orient: vertical;
     // -webkit-line-clamp: 3;
 }
-.treat .treatDrugBox {
+.infomationBox .treatDrugBox {
     margin-left: 80px;
     line-height: 30px;
     height: 90px;
     overflow: hidden;
 }
+.tipsInfoBox {
+    margin: 10px 0 0 80px;
+    line-height: 30px;
+    height: 180px;
+    overflow-y: auto;
+    img {
+        display: none;
+    }
+}
 .drugTreatmentInfoItemBox {
     .ellipse;
     height: 30px;
 }
-.treat .treatRecommend {
+.infomationBox .treatRecommend {
     margin-top: 10px;
 }
 .labAndPacsRecommend  .labAndPacsTitle {
@@ -270,3 +285,25 @@
 .disclaimer, .illnessTable {
     cursor: pointer;
 }
+.tipsInfoWrapper  {
+    position: absolute;
+    top: 30px;
+}
+.infoTab {
+    margin-right: 15px;
+}
+.activeTab {
+    color: #267FD7;
+    border-bottom: 2px solid #267FD7;
+}
+.moreInfo {
+    display: inline-block;
+    width:42px;
+    height:20px;
+    border-radius:4px;
+    border:1px solid #267FD7;
+    line-height:20px;
+    color: #267FD7;
+    text-align: center;
+    margin-left: 20px;
+}

+ 3 - 1
src/html/indexHorizontal.html

@@ -21,7 +21,9 @@
             <span class="logo">智<br/>能<br/>推<br/>送<br/>仅<br/>供<br/>参<br/>考<br/>&copy; <br/>朗<br/>通<br/>医<br/>疗</span>
           </div>
             <div class="push"></div>
-            <div class="treat"></div>
+            <div class="infomationBox clearfix">
+              <div class="infoTabBox"></div>
+            </div> 
         </div>
         <!-- <p class="responsibility">以上推送为常见诊断及问诊内容,实际以医生临床判断为准</p> -->
       </div>

+ 56 - 7
src/js/indexHorizontal.js

@@ -16,7 +16,7 @@ let treatImg = require('./../images/zhiliao.png')
 const $ = require("jquery");
 const { post,config,getUrlArgObject,openNewWin, isIe8 } = require('./promise.js');
 const { transConf } = require('./util.js');
-const { renderRecommendInfo, renderMultRecommendInfo, renderTreat, renderRecommendConditTips } = require('./indexHorizontalDom.js');
+const { renderRecommendInfo, renderMultRecommendInfo, renderTreat, renderRecommendConditTips, renderTipsInfo } = require('./indexHorizontalDom.js');
 const is8Ie = isIe8() //判断是否为IE8
 if(is8Ie) {
   let reg = /undefined/g
@@ -30,6 +30,7 @@ if(is8Ie) {
 }
 
 let mrId = getUrlArgObject('mrId') 
+let showTab = getUrlArgObject('showTab') || '0';
 let msg;
 if(mrId) {
  post(config.getMr,{mrId:mrId}).then((res) => {
@@ -60,6 +61,7 @@ if(mrId) {
   getPageInfo();
 }
 
+
 // var msg = {
 //     age: getUrlArgObject('age'),
 //     sex: getUrlArgObject('sex') == '男'?1:(getUrlArgObject('sex') == '女'?2:(getUrlArgObject('sex') == '通用'?3:getUrlArgObject('sex'))),
@@ -179,14 +181,17 @@ function getTreatment() {
     // }
   })
 }
-// getConf();
-// pushInfo();
-// getTreatment();
 
-function getPageInfo() {
 
+function getTipsInfo() {
+  post(config.information,{name:getUrlArgObject('tipsName'),type:getUrlArgObject('tipsType'), position: 1}).then((res)=>{
+    var data = res.data
+    window.tipsInfo = data
+  })
+}
 
-  Promise.all([getConf(),getPushInfo(),getTreatment()]).then(([res1, res2, res3]) =>{
+function getPageInfo() {
+  Promise.all([getConf(),getPushInfo(),getTreatment(),getTipsInfo()]).then(([res1, res2, res3,res4]) =>{
     if(pushInfo.code == 0) {
       pushResult = pushInfo.data;
     } else {
@@ -197,6 +202,11 @@ function getPageInfo() {
     } else {
       treatResult = {}
     }
+    if(tipsInfo.code == 0) {
+      tipsResult = tipsInfo.data
+    } else {
+      tipsResult = {}
+    }
     const diagPossible =  pushResult.dis&&pushResult.dis['可能诊断'] || []//可能
     const diagDoubt = pushResult.dis&&pushResult.dis['疑似诊断'] || [] // 疑似
     const diagDeter = pushResult.dis&&pushResult.dis['确诊'] || []//确诊
@@ -220,6 +230,7 @@ function getPageInfo() {
       }
     ]
     window.pushMessage = medicalIndications;//计算的需要的相关数据
+    let tipsNum = 0;
     for(let i = 0; i < confArr.length; i++) {
   
       switch(confArr[i].code) {
@@ -239,18 +250,56 @@ function getPageInfo() {
           renderMultRecommendInfo(labAndPacsImg, 'labAndPacsRecommend', '检验检查', labAndPacsRecommend, false)
           break;
         case "cure_show": //治疗方案
+        console.log(22222)
+          tipsNum++;
           renderTreat(treatImg, 'treatRecommend','治疗方案',treatResult)
           break;
         case "diagnose_show": //推荐诊断
           renderRecommendInfo(diagImg, 'diagRecommend', '推荐诊断', diagRecommend, true,7,2)
           break;
+        case "tip_show": //提示信息
+        console.log(11111111)
+          tipsNum++;
+          renderTipsInfo('', 'tipsInfo','提示信息',tipsResult)
+          moreInfo()
+          break;
         default:
            return
       } 
     }
+    
+    function bindTab() {
+      if(showTab == '1') {
+          $('.infoTabBox .tipsTab').addClass('activeTab')
+          $('.infomationBox .treatRecommend').css("display","none")
+      } else {
+        $('.infoTabBox .treatTab').addClass('activeTab')
+        $('.infomationBox .tipsInfo').css("display","none")
+      }
+
+      $('.infomationBox .infoTab').click(function() {
+        $(this).addClass('activeTab').siblings().removeClass('activeTab')
+        $('.informationBox').css("display","none")
+        const boxNode = $(this).attr('data-box')
+        $('.'+boxNode).css("display","block")
+      })
+    
+    }
+    // bindTab();
+    if(tipsNum === 2) {
+      bindTab();
+    }
+    function moreInfo() {
+      $('.moreInfo').click(function(){
+        const name = $(this).attr('data-name')
+        const type = getUrlArgObject('tipsType')
+        openNewWin(`information.html?type=${type}&position=0&name=${name}`)
+      })
+    }
+    
     const pushHei = $('.push').height()
     if(pushHei == 0) {
-      $('.treat').css({"width":"90%"})
+      $('.infomationBox').css({"width":"90%"})
     }
     // renderRecommendInfo(warningImg, 'warning', '警惕诊断', diagWaring, true,7,2)
     // renderRecommendInfo(diagImg, 'diagRecommend', '推荐诊断', diagRecommend, true,7,2)

+ 69 - 7
src/js/indexHorizontalDom.js

@@ -1,9 +1,10 @@
 const $ = require("jquery");
-const { openNewWin, isIe8 } = require('./promise.js');
+const { openNewWin, imageUrlPrefix, isIe8 } = require('./promise.js');
 const { bindTipsEvent } = require('./popupEdit.js');
 let showImg = require('./../images/show.png')
 let collapseImg = require('./../images/collapse.png')
 
+
 const is8Ie = isIe8() //判断是否为IE8
 if(is8Ie) {
   let reg = /undefined/g
@@ -99,11 +100,12 @@ function renderMultRecommendInfo(icon, className,title,data, hasInfo, type, posi
 }
 
 function renderTreat(icon, className,title, data) {
-    const str = `<div class="recommendInfoWrapper ${className} clearfix">
-                    <h4><img src=${icon} title="${title}" class="icon">${title}:<span class="diagName">${msg.diag}</span></h4>
+    $('.infoTabBox').append(`<span class="infoTab treatTab"  data-box="${className}">${title}</span>`)
+    const str = `<div class="informationBox recommendInfoWrapper ${className} clearfix">
+                    <span class="diagName">${msg.diag}</span>
                     <div class="recommendInfoBox clearfix ${className + 'box'}"></div>
                 </div>`
-    $('.treat').append(str)
+    $('.infomationBox').append(str)
     const commonTreatmentInfo = data.commonTreatment&&data.commonTreatment.content || ""
     const treatmentList = data.treatment || []
     renderTreatText('commonTreatment', '一般治疗', commonTreatmentInfo, className+'box')
@@ -128,7 +130,7 @@ function renderTreatText(className,title,data, parentNode) {
     if(commonTreatHeight > 75){
         $(".treatTextBox").append('<span class="more">更多</span>')
     }
-    $(".treat .treatTextBox").on('click',".more",function(){
+    $(".infomationBox .treatTextBox").on('click',".more",function(){
         openNewWin(`treatplan.html?age=${msg.age}&sex=${msg.sex}&symptomJson=${msg.symptom}&vitalJson=${msg.vital}&lisJson=${msg.lis}&pacsJson=${msg.pacs}&diagJson=${msg.diag}&otherJson=${msg.other}&hospitalCode=${msg.hosCode}`)
       })
     
@@ -178,7 +180,7 @@ function renderTreatDrug(className,title,data, parentNode) {
     } else if(drugTreatmentHeight > 30) {
         $(".drugTreatmentInfo").append('<span class="more">更多</span>')
     }
-    $(".treat .drugTreatmentbox").on('click',".more",function(){
+    $(".infomationBox .drugTreatmentbox").on('click',".more",function(){
         openNewWin(`treatplan.html?age=${msg.age}&sex=${msg.sex}&symptomJson=${msg.symptom}&vitalJson=${msg.vital}&lisJson=${msg.lis}&pacsJson=${msg.pacs}&diagJson=${msg.diag}&otherJson=${msg.other}&hospitalCode=${msg.hosCode}`)
       })
     var treatList = $(".drugTreatmentInfo").find(".drugTreatmentInfoItemBox")
@@ -197,6 +199,65 @@ function renderTreatDrug(className,title,data, parentNode) {
     // }
 }
 
+function renderTipsInfo(icon, className,title,data) {
+  
+    $('.infoTabBox').append(`<span class="infoTab tipsTab" data-box="${className}">${title}</span>`)
+    let str
+    if(!data.name) {
+        str = `<div class="informationBox tipsInfoWrapper ${className} clearfix">
+            <p class="diagName">暂无数据</p>
+            <div class="tipsInfoBox clearfix ${className + 'box'}"></div>
+        </div>`
+    } else {
+        str = `<div class="informationBox tipsInfoWrapper ${className} clearfix">
+                    <p class="diagName">${data.name} <span class="moreInfo" data-name="${data.name}">详情</span></p>
+                    <p class="tipsTitle">诊断依据:</p>
+                    <div class="tipsInfoBox clearfix ${className + 'box'}"></div>
+                </div>`
+    }
+    
+    $('.infomationBox').append(str)
+    if(data.name) {
+        renderTipsInfoText('','诊断依据',data.details,className + 'box')
+    }
+}
+
+
+function renderTipsInfoText(className,title,data, parentNode) {
+    let childrenNodeBoxStr = ``
+    if(data.length === 0) {
+        childrenNodeBoxStr += `<p>暂无数据</p>
+                                
+                            `
+    }
+    for(let i = 0; i < data.length; i++) {
+        childrenNodeBoxStr += `<p>${data[i].title}</p>
+                                ${data[i].content.replace(/{imageUrlPrefix}/g, imageUrlPrefix)}
+                            `
+    }
+    // const childrenNodeBoxStr = `
+    //     <div class = "treatItemBox ${className + 'box'}">
+    //         <p class="treatItemTitle">${title}:</p>
+    //         <div class="treatTextBox">
+    //             <p class="${className + 'Info'} clearfix"></p>
+    //         </div>
+    //     </div>
+    // `
+    $('.' + parentNode).append(childrenNodeBoxStr)
+    // if(!data) {
+    //     data = '<span class="recommendNull">暂无推荐</span>'
+    // }
+    // $('.' + className+'Info').html(data)
+    // var commonTreatHeight = $(".commonTreatmentInfo").height()
+    // if(commonTreatHeight > 75){
+    //     $(".treatTextBox").append('<span class="more">更多</span>')
+    // }
+    // $(".treat .treatTextBox").on('click',".more",function(){
+    //     openNewWin(`treatplan.html?age=${msg.age}&sex=${msg.sex}&symptomJson=${msg.symptom}&vitalJson=${msg.vital}&lisJson=${msg.lis}&pacsJson=${msg.pacs}&diagJson=${msg.diag}&otherJson=${msg.other}&hospitalCode=${msg.hosCode}`)
+    //   })
+    
+}
+
 function renderRecommendConditTips(icon, className,title,data) {
     const str = `<div class="recommendInfoWrapper ${className} clearfix">
                     <h4><img src=${icon} title="${title}" class="icon">${title}:</h4>
@@ -262,5 +323,6 @@ module.exports = {
     renderRecommendInfo,
     renderMultRecommendInfo,
     renderTreat,
-    renderRecommendConditTips
+    renderRecommendConditTips,
+    renderTipsInfo
 }

+ 1 - 1
webpack.config.js

@@ -245,6 +245,6 @@ module.exports = {
       '/api': proxyHost
     },
     hot: true,
-    openPage:'index.html?age=28&diseaseId=280&lisJson=&diagJson=急性胰腺炎&pastJson=无心脏病&otherJson=无高血压&pacsJson=腹部B超:无异常,%20报告日期:2019-05-07&sex=男&symptomJson=恶心呕吐腰痛&vitalJson=血压左上肢13/12mmHg&hospitalCode=A001'
+    openPage:'index.html?age=28&plan=2&showTab=1&diseaseId=280&tipsName=血常规&tipsType=12&lisJson=&diagJson=急性胰腺炎&pastJson=无心脏病&otherJson=无高血压&pacsJson=腹部B超:无异常,%20报告日期:2019-05-07&sex=男&symptomJson=恶心呕吐腰痛&vitalJson=血压左上肢13/12mmHg&hospitalCode=A001'
   }
 }