|
@@ -18,15 +18,19 @@ function renderPage(data){
|
|
|
const operaItemName = operaItem.item || {}
|
|
|
const operaItemDetail = operaItem.pushPlanDetails || []
|
|
|
renderName(operaItemName)
|
|
|
-
|
|
|
+ let dom1 = document.getElementById('operaNameWrap')
|
|
|
+ let dom2 = document.getElementById('btnBox')
|
|
|
+ console.log("dom1",dom1,"dom2",dom2)
|
|
|
renderBtn(operaItemDetail)
|
|
|
- renderDetail(operaItemDetail)
|
|
|
+ let arr = [].push(dom1,dom2)
|
|
|
+ // checkDom(arr, renderDetail(operaItemDetail))
|
|
|
+
|
|
|
|
|
|
}
|
|
|
function renderName(data){
|
|
|
const operationTime = data.dateValue&&getTime(data.dateValue)
|
|
|
const operationName = data.name || ""
|
|
|
- const str = `<div class="operaNameWrap"><div class="operaNameBox">患者于<span class="operaNameBold">${operationTime}</span>进行<span class="operaNameBold">${operationName}</span>。根据临床路径要求,特制订检验检查计划如下。</div></div>`
|
|
|
+ const str = `<div class="operaNameWrap" id="operaNameWrap"><div class="operaNameBox">患者于<span class="operaNameBold">${operationTime}</span>进行<span class="operaNameBold">${operationName}</span>。根据临床路径要求,特制订检验检查计划如下。</div></div>`
|
|
|
$(".followUpWrap").append(str)
|
|
|
}
|
|
|
function renderDetail(data){
|
|
@@ -50,17 +54,16 @@ function renderDetail(data){
|
|
|
<div class="pacsBox">${pacsStr}</div>
|
|
|
</div>`
|
|
|
}
|
|
|
- $(".followUpWrap").append(`<div class="infoWrap">${str}</div>`)
|
|
|
- setTimeout(function(){
|
|
|
- adjustHeight()
|
|
|
- },4000)
|
|
|
+
|
|
|
+ adjustHeight()
|
|
|
+
|
|
|
}
|
|
|
function renderBtn(data){
|
|
|
const hasBtn = data[0]&&data[0].history&&data[0].history === 0
|
|
|
if(!hasBtn){
|
|
|
return
|
|
|
}
|
|
|
- const str = `<div class="btnBox"><span class="btnName">显示历史计划</span></div>`
|
|
|
+ const str = `<div class="btnBox" id="btnBox"><span class="btnName">显示历史计划</span></div>`
|
|
|
$(".followUpWrap").append(str)
|
|
|
|
|
|
}
|
|
@@ -80,6 +83,31 @@ function getTime(date){
|
|
|
const day = new Date(date).getDate()
|
|
|
return `${year}年${month}月${day}日`
|
|
|
}
|
|
|
+
|
|
|
+// 声明定时器
|
|
|
+var cheakDomTimer = null
|
|
|
+// 检查dom是否执行完成
|
|
|
+function checkDom(domList,callBack) {
|
|
|
+ console.log("domListdomList",domList)
|
|
|
+ let hasExit = true
|
|
|
+ for(let i = 0; i < domList.length; i++){
|
|
|
+ if(!domList[i]){
|
|
|
+ hasExit = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(hasExit) {
|
|
|
+ // 执行dom加载完成后的操作
|
|
|
+ callBack();
|
|
|
+ // 清除定时器
|
|
|
+ if(!cheakDomTimer) {
|
|
|
+ clearTimeout(cheakDomTimer)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 自我调用
|
|
|
+ cheakDomTimer = setTimeout(checkDom, 0)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
$(window).on('resize', function(){
|
|
|
adjustHeight()
|
|
|
})
|