' + item.content + '
';
str = `
${str}
`
$(`.${contentWrapClassName} .infos`).append(str);
$(`.${contentWrapClassName} .anchors ul`).append(anchors);
}
function addScrollEvent() {
var scrollTop = $(`.${contentWrapClassName} .infos`).scrollTop()
var divHeight = 0;
for (var i = 0; i < list.length; i++) {
divHeight = divHeight + parseInt($('#'+contentWrapClassName+i).css('height')) + parseInt($('#'+contentWrapClassName+i).parent().next().css('height')) + 20
if (divHeight > scrollTop) {
var anchor = 2 * i;
$(`.${contentWrapClassName} .anchors ul`).children().eq(anchor).addClass('active').siblings().removeClass('active');
return;
}
}
}
$(`.${contentWrapClassName} .infos`).scroll(throttle(addScrollEvent, 200));
addLinkClickEvent(contentWrapClassName);
adjustHeight();
adjustWidth()
}
function addLinkClickEvent(contentWrapClassName) {
$(`.${contentWrapClassName} .anchors li:first`).addClass("active");
$(`.${contentWrapClassName} .anchors li>a`).on("click", function () {
const that = this
setTimeout(function(){
$(`.${contentWrapClassName} .anchors .active`).removeClass('active');
$(that).parent().addClass("active");
},20)
});
}
function renderTab(detailList){
$(".tabList").html('')
if(detailList['静态知识']){
$(".tabList").append(`
静态知识`)
//$(".titleCont .title").html(showName);
}
if(detailList['临床路径']){
$(".tabList").append(`
临床路径`)
//$(".titleCont .title").html(clinicalPathwayName);
}
if(detailList['注意事项']){
$(".tabList").append(`
注意事项`)
//$(".titleCont .title").html(noticeName);
}
$(".tabList .tab").eq(0).addClass("activeTab")
let defaultModuleName = $(".tabList .tab").eq(0).attr("data-module")
$(`.${defaultModuleName}`).css("display","block")
bindTabClick()
}
function bindTabClick(){
$(".tabList .tab").on("click", function(){
const moduleName = $(this).attr("data-module")
const display = $(`.${moduleName}`).css("display")
$(".titleCont .title").html($(this).attr('data-title'));
//if(display == "none"){
$(".activeTab").removeClass("activeTab")
$(this).addClass("activeTab")
$(".container").css("display","none")
$(`.${moduleName}`).css("display","block")
$(`.${moduleName} .infos`).scrollTop(0)
//}
})
$("#openWin").on("click",function(){
const type= getUrlArgObject('type');
const hospitalId= getUrlArgObject('hospitalId');
const hisName= getUrlArgObject('hisName');
const hisDetailName= getUrlArgObject('hisDetailName');
openNewWin("staticInfoOut.html?hospitalId="+encodeURIComponent(hospitalId)+"&hisName="+encodeURIComponent(hisName)+"&hisDetailName="+encodeURIComponent(hisDetailName||'')+"&type="+encodeURIComponent(type));
})
}
function adjustHeight() {
var ht = window.innerHeight || document.documentElement.clientHeight;
$(".content,.content .infos").height(ht - 228 + "px");
}
function adjustWidth() {
var wt = window.innerWidth || document.documentElement.clientWidth;
$(".titleH2").width(wt- 0.2*wt -33 - 200 - 17 - 40 -15 + 'px')
$("pre").width(wt- 0.2*wt - 200 + 'px')
}
$(window).on('resize', function(){
adjustHeight()
adjustWidth()
})
//如果是子窗口,隐藏网页查看按钮
if(window.opener){
$("#openWin").hide();
}