' + 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 renderContentscale(list, contentWrapClassName, name) {
var pushInfo=[]
anchors = '
' + name + '';
str = '
' + name + '
'
$(`.${contentWrapClassName} .infos .infos-box`).append(str);
$(`.${contentWrapClassName} .anchors ul`).append(anchors);
for (var i = 0; i < list[0].detailList.length; i++) {
var item = list[0].detailList[i];
if (item.textType == 11) {
item.content = item.content && item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
str = '
'
str += item.content
str += '
'
str = `
${str}
`
$(`.${contentWrapClassName} .infos .infos-box`).append(str);
for (var j = 0; j < item.subList.length; j++) {
var items = item.subList[j];
for (var k = 0; k < items.detailList.length; k++) {
var it = items.detailList[k];
it.content = it.content && it.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
str = '
';
str += '
' + it.content + '
'
str += '
'
str += '
'
$(".scale .infos .infos-box .infoWrapper .infoBox[data-id=" + it.parentId + "]").append(str);
for (var l = 0; l < it.subList[0].detailList.length; l++) {
var its = it.subList[0].detailList[l];
console.log(its.parentId)
its.content = its.content && its.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
str = '
';
str += '
'
str += `${item.match ? `

` : `` }
`
$(".scale .infos .infos-box .infoWrapper .infoBox[data-id=" + it.parentId + "] .contentList .item-content[data-id=" + its.parentId + "]").append(str);
}
}
}
}
if (item.textType == 13){
for (var m = 0; m < item.subList[0].detailList[0].subList[0].detailList.length; m++ ){
var itl = item.subList[0].detailList[0].subList[0].detailList[m]
let arr = {
content: JSON.parse(itl.content),
result: itl.result,
pushInfo: itl.pushInfo
}
pushInfo.push(arr)
}
}
}
str = '
'
str += '
'
str += ``
$(`.${contentWrapClassName} .infos .infos-box`).append(str);
// str = ``
// $(`.${contentWrapClassName} .infos`).after(str);
function addScrollEvent() {
var scrollTop = $(`.${contentWrapClassName} .infos .infos-box`).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 .infos-box`).scroll(throttle(addScrollEvent, 200));
addLinkClickEvent(contentWrapClassName);
adjustHeight();
adjustWidth()
getcheck()
getResult(pushInfo)
copy()
getprinting()
}
function getprinting() {
$('.printing').click(function () {
$('.foot').hide()
$('.hel').hide()
$('#Print').css({
'height': 'auto', //高度自动
}).jqprint();
$('.foot').show()
$('.hel').show()
})
}
function getcheck() {
$('input:radio').click(function () {
var domName = $(this).attr('name');
var $radio = $(this);
if ($radio.data('waschecked') == true) {
$radio.prop('checked', false);
$("input:radio[name='" + domName + "']").data('waschecked', false);
} else {
$radio.prop('checked', true);
$("input:radio[name='" + domName + "']").data('waschecked', false);
$radio.data('waschecked', true);
}
console.log("选中状态:", $(this).prop("checked"));
console.log($("input:radio[name='" + domName + "']:checked").val());
});
}
function copy() {
$(".copy").click(function () {
var texts = document.getElementById("result_title").innerText;
var inputs = document.getElementById("inputs");
inputs.value = texts; // 修改文本框的内容(赋值内容)
inputs.select(); // 选中文本
document.execCommand("copy"); // 执行浏览器复制命令
Toast('复制成功', 500)
setTimeout(()=>{
window.close()
},500)
})
}
function getResult(pushInfo) {
$(".but").click(function () {
let arr = [];
let num = 0
$(".contentList").each(function (i) {
if (Number(parseFloat($(this).find('input[type="radio"]:checked').val()))) {
num += parseFloat($(this).find('input[type="radio"]:checked').val())
}
})
for (var i = 0; i < pushInfo.length; i++) {
console.log(pushInfo[i])
if (pushInfo[i].content.max >= num >= pushInfo[i].content.min) {
$(".result_title").attr({
"title": pushInfo[i].result
});
$(".hel").attr({
"title": pushInfo[i].pushInfo
});
$(".result_title").html(pushInfo[i].result);
}
}
$(".score").html('总分:' + num + '分');
$(".score").css('display', 'block')
$(".result").css('display', 'block')
$(".foot").css('display', 'block')
})
$(".printing").hover(
function () {
$(".slideImg").attr("src", printing2);
}, function () {
$(".slideImg").attr("src", printing);
});
}
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, scale) {
if (detailList['静态知识']) {
$(".tabList").append(`
静态知识`)
}
if (detailList['临床路径']) {
$(".tabList").append(`
临床路径`)
//$(".tabBox .title").html(clinicalPathwayName);
}
if (detailList['注意事项']) {
$(".tabList").append(`
注意事项`)
//$(".tabBox .title").html(noticeName);
}
if (scale) {
$(".tabList").append(`
评估内容`)
//$(".tabBox .title").html(noticeName);
}
let defaultModuleName
if (getUrlArgObject('page') && getUrlArgObject('page') == 1 && scale){
$(".tabList .tab").eq(1).addClass("activeTab")
defaultModuleName = $(".tabList .tab").eq(1).attr("data-module")
}else{
$(".tabList .tab").eq(0).addClass("activeTab")
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")
$(".tabBox .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 name = getUrlArgObject('name');
const position = getUrlArgObject('position');
openNewWin("staticInfo.html?name=" + encodeURIComponent(name) + "&position=" + encodeURIComponent(position) + "&type=" + encodeURIComponent(type));
})
}
function adjustHeight() {
var ht = window.innerHeight || document.documentElement.clientHeight;
$(".content,.content .infos").height(ht - 162 + "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 - 240 + 'px')
}
$(window).on('resize', function () {
adjustHeight()
adjustWidth()
})
//如果是子窗口,隐藏网页查看按钮
if (window.opener) {
$("#openWin").hide();
}