|
@@ -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
|
|
|
}
|