123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636 |
- if (!Promise) {
- var Promise = require("bluebird");
- // Configure
- Promise.config({
- longStackTraces: true,
- warnings: true // note, run node with --trace-warnings to see full stack traces for warnings
- })
- }
- require('../css/informationOut.less')
- require('../css/informationOut.css')
- const {
- post,
- throttle,
- imageUrlPrefix,
- config,
- getUrlArgObject,
- openNewWin,
- Toast
- } = require('./promise.js');
- const $ = require("jquery");
- const print = require("../js/jQuery.print")
- let printing = require('./../images/printing.png');
- let printing2 = require('./../images/printing2.png');
- let hel = require('./../images/icon-hel.png');
- let showName, noticeName, clinicalPathwayName, showLis = [], selectedDrop = 0, selectedTab = 0, isclick, num, top = 0
- //如果是子窗口,隐藏网页查看按钮
- function myBrowser() {
- var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
- var isOpera = userAgent.indexOf("Opera") > -1;
- if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
- return "IE";
- }; //判断是否IE浏览器
- }
- if (window.opener) {
- selectedDrop = getUrlArgObject("d") || 0;
- selectedTab = getUrlArgObject("t") || 0;
- $("#openWin,.footer").hide();
- }
- let icond = require('./../images/d.png').replace(/^undefined/g, '')
- function getInfomation() {
- // var param = {
- // "type": getUrlArgObject('type'),
- // "name": getUrlArgObject('name'),
- // "position": getUrlArgObject('position'),
- // "contentTypes":[1,2,3]
- // };
- var param = {
- "type": getUrlArgObject('type'),
- "hospitalId": getUrlArgObject('hospitalId'),
- "hisName": getUrlArgObject('hisName'),
- "hisDetailName": getUrlArgObject('hisDetailName'),
- "contentTypes": [1, 2, 3]
- };
- //showName = param.hisName;
- // if (param.type == 5 || param.type == 51) {
- // param.type = 12;
- // param.name = uname;
- // }
- post(config.getStaticKnowledgeForHIS, param).then((res) => {
- if (res.data.code === '0') {
- const data = res.data.data
- var str = '';
- var anchors = '';
- let sName = '';
- if (!data || data.length === 0) {
- showEmpty();
- return;
- }
- showLis = data
- for (let i = 0; i < showLis.length; i++) {
- let tmp = showLis[i]
- str += `<li data-idx="${i}" title="${tmp.name}(${tmp.hisName})">${tmp.name}(${tmp.hisName})</li>`
- }
- $(".showWhich ul").html(str);
- sName = showLis[selectedDrop].name + "(" + showLis[selectedDrop].hisName + ")";
- $(".showWhichSelect").html(sName).attr("title", sName)
- showName = data[selectedDrop].name + "(" + data[selectedDrop].hisName + ")";
- showInfoSelect()
- showInfo(data[selectedDrop], 1)
- renderTitleShow();
- $('.content img').bind('contextmenu', function () {
- return false
- })
- } else {
- showEmpty();
- }
- })
- }
- getInfomation();
- function showEmpty() {
- const str = `<div class="empty"><img src="../images/empty3.png" alt=""><p>暂无静态知识</p></div>`;
- $(".tabBox").html(str).css("border-bottom", "none");
- $("body").css('background', '#fff');
- }
- function showInfo(data, type) {
- var detailList = data.details
- var scale = data.scale
- var staticKnowList = detailList['静态知识']
- var noticeInfo = detailList['注意事项']
- var clinicalPathwayInfo = detailList['临床路径']
- var name = data.name
- noticeName = data.noticeName || "注意事项"
- clinicalPathwayName = data.clinicalPathwayName || "临床路径"
- var scaleInfo = data.scale ? data.scale.scaleDetails : ''
- // $("h1").css({
- // "color": "#267FD7",
- // "borderBottom": "4px solid #E9E9E9",
- // "padding": "0px 60px 50px 0px"
- // });
- renderTab(detailList, scale)
- staticKnowList && renderContent(staticKnowList, 'staticKnowledge')
- noticeInfo && renderContent(noticeInfo, 'notice')
- clinicalPathwayInfo && renderContent(clinicalPathwayInfo, 'clinicalPathway')
- scaleInfo && renderContentscale(scaleInfo, 'scale', name)
- }
- function showInfoSelect() {
- $('.showWhich li').click(function () {
- let idx = $(this).attr('data-idx')
- let name = $(this).html(), str = ''
- selectedDrop = idx;
- selectedTab = 0;
- showName = showLis[idx].name + "(" + showLis[idx].hisName + ")";
- num = $(".activeTab").attr('data-num')
-
- showInfo(showLis[idx], 2)
- $('.content .infos').scrollTop(0)
- $(".showWhich ul").css("display", "none")
- $(".showWhichSelect").html(name).attr("title", name)
- renderTitleShow();
- })
- $(".showWhichSelect").click(function (e) {
- e.stopPropagation()
- $(".showWhich ul").slideToggle()
- })
- $(document).click(function () {
- $(".showWhich ul").css("display", "none")
- })
- }
- function renderTitleShow() {
- document.title = showName;
- // $(".titleCont .title").html($(".tabList .tab:eq(" + selectedTab + ")").attr("data-title"));
- $(".titleCont .title").html($(".showWhich .showWhichSelect").attr("title"));
-
- }
- function renderContent(list, contentWrapClassName) {
- $(`.${contentWrapClassName} .infos`).html('');
- $(`.${contentWrapClassName} .anchors ul`).html('');
- for (var i = 0; i < list.length; i++) {
- var item = list[i];
- item.content = item.content && item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
- anchors = '<li><i></i><a href="#' + contentWrapClassName + i +
- '">' + item.title + '</a></li><li class="anchor-line"></li>';
- str = '<div class="infoBox"><div class="title"> <h2 class="titleH2" id="' + contentWrapClassName + i +
- '">'
- if (getUrlArgObject('type') == 8) {
- str += '【' + item.title + '】'
- } else {
- str += item.title
- }
- str += '</h2></div>' +
- '<div class="contentWrapper"><pre>' + item.content + '</pre><div></div>';
- str = `<div class="infoWrapper">${str}</div>`
- $(`.${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) {
- $(`.${contentWrapClassName} .infos .infos-box`).html('');
- $(`.${contentWrapClassName} .anchors ul`).html('');
- var pushInfo = []
- var textType = []
- var constant = 0
- $('.scaletitle').html(name);
- for (var i = 0; i < list[0].detailList.length; i++) {
- var item = list[0].detailList[i];
- textType.push(item.textType)
- if (item.resultType == 1) {
- constant += parseFloat(item.constant)
- }
- if (item.textType == 11) {
- item.content = item.content && item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
- str = '<div class="infoBox scaleBox" data-id="' + item.id + '"><div class="title"> <h2 class="titleH2" id="' + contentWrapClassName + i +
- '">'
- str += item.content
- str += '</h2></div>'
- str = `<div class="infoWrapper">${str}</div>`
- $(`.${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 = '<div class="contentList" data-id="' + it.parentId + '-' + it.groupNum + '"><div class="item-list">';
- if (it.selectType == 21) {
- str += '<p class="item-title">' + it.content + '</p>'
- } else if (it.selectType == 22) {
- str += '<p class="item-titles">' + it.content + '</p>'
- }
- str += '<div class="item-content" data-id="' + it.id + '">'
- str += '</div></div></div>'
- $(".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];
- its.content = its.content && its.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
- str = '<div class="radio" name="scale' + its.parentId + '" value="' + its.score + '">';
- if (it.selectType == 21 && item.resultType == 1) {
- str += '<label><input class="radio_type" type="radio" name="scale' + its.parentId + '" value="' + parseFloat(((its.score * it.factor + it.constant) * item.factor + item.constant)) + '" resultType="' + item.resultType + '"/>'
- } else if (it.selectType == 22 && item.resultType == 1) {
- str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="checkbox" value="' + parseFloat(((its.score * it.factor + it.constant) * item.factor + item.constant)) + '" resultType="' + item.resultType + '"/>'
- } else if (it.selectType == 21 && item.resultType == 2) {
- str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="radio" value="' + its.result + '" data_obj="' + it.content + '' + its.result + '" proposal="' + its.pushInfo + '" resultType="' + item.resultType + '"/>'
- } else if (it.selectType == 22 && item.resultType == 2) {
- str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="checkbox" value="' + its.result + '" data_obj="' + it.content + '' + its.result + '" proposal="' + its.pushInfo + '" resultType="' + item.resultType + '"/>'
- }
- str += '<span class="inp">' + its.content + '</span>'
- if (item.resultType == 1) {
- str += '<span class="num">(' + its.score + ')</span>'
- }
- str += '</label>'
- str += `${its.match == 1 ? `<img class="recommend" src="./../images/recommend.png" />` : ``}</div>`
- $(".scale .infos .infos-box .infoWrapper .infoBox[data-id=" + it.parentId + "] .contentList .item-content[data-id=" + its.parentId + "]").append(str);
- }
- }
- }
- }
- if (item.textType == 12) {
- item.content = item.content && item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
- str = '<div class="infoBox scaleBox" data-id="' + item.id + '"><div class="title"> <h2 class="titleH2" id="' + contentWrapClassName + i +
- '">'
- str += item.content
- str += '</h2></div>'
- str = `<div class="infoWrapper">${str}</div>`
- $(`.${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 = '<div class="contentList" data-id="' + it.parentId + '-' + it.groupNum + '"><div class="item-list">';
- str += it.content
- str += '<div class="item-content" data-id="' + it.id + '">'
- str += '</div></div></div>'
- $(".scale .infos .infos-box .infoWrapper .infoBox[data-id=" + it.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 = '<div class="scalebot">'
- str += '<button class="but">结果</button><p class="score"></p>'
- str += '</div>'
- str += `<div class="result"><div class="result_box"><div class="result_left"><img src="./../images/icon-hel.png" class="hel"/><p id="result_title" class="result_title"></p></div><textarea id="inputs"></textarea><p id="result_title_tip" class="result_title_tip">该量表需要入院当天评估一次,出院当天评估一次,每七天要评估一次</p></div></div>`
- str += `<div class="foot"><div class="foot_box"><div class="printing"><img src="./../images/printing.png" class="slideImg"/>打印</div><div class="copy">确认并复制结果</div></div></div>`
- $(`.${contentWrapClassName} .infos .infos-box`).append(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, textType, constant)
- copy(name)
- getprinting()
- }
- function getprinting() {
- $('.printing').click(function () {
- $('.foot').hide()
- $('.scalebot').hide()
- $('.result_title_tip').hide()
-
- $('#Print').css({
- 'height': 'auto', //高度自动
- }).print();
- $('.foot').show()
- $('.scalebot').show()
- $('.result_title_tip').show()
- $('#Print').css({
- 'height': '100%', //高度自动
- });
- })
- }
- function getcheck() {
- $('input:radio').click(function () {
- const domName = $(this).attr('name');
- const $radio = $(this);
- const id = $(this).parents('.contentList').data("id");
- if ($radio.data('waschecked') == true) {
- $radio.prop('checked', false);
- $("input:radio[name='" + domName + "']").data('waschecked', false);
- $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('label').css("color", "#666666");
- $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.item-titles').css("color", "#333333");
- if (isclick) {
- getchecks()
- $(".score").html('');
- $(".result_title").html('');
- $(".result").css('display', 'none')
- $(".foot").css('display', 'none')
- }
- } else {
- $radio.prop('checked', true);
- $("input:radio[name='" + domName + "']").data('waschecked', false);
- $radio.data('waschecked', true);
- $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.radio_type').attr("disabled", true);
- $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('label').css("color", "#C7C7C7");
- $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.item-titles').css("color", "#C7C7C7");
- if (isclick) {
- getchecks()
- $(".score").html('');
- $(".result_title").html('');
- $(".result").css('display', 'none')
- $(".foot").css('display', 'none')
- }
- }
- });
- $('input:checkbox').click(function () {
- const domName = $(this).attr('name');
- const $radio = $(this);
- const id = $(this).parents('.contentList').data("id");
- $radio.parents('.contentList').each(function (i) {
- if ($(this).find('input[type="checkbox"]:checked').val() == undefined) {
- $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.radio_type').attr("disabled", false);
- $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('label').css("color", "#666666");
- $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.item-titles').css("color", "#333333");
- if (isclick) {
- getchecks()
- $(".score").html('');
- $(".result_title").html('');
- $(".result").css('display', 'none')
- $(".foot").css('display', 'none')
- }
- } else {
- $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.radio_type').attr("disabled", true);
- $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('label').css("color", "#C7C7C7");
- $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.item-titles').css("color", "#C7C7C7");
- if (isclick) {
- getchecks()
- $(".score").html('');
- $(".result_title").html('');
- $(".result").css('display', 'none')
- $(".foot").css('display', 'none')
- }
- }
- })
- });
- }
- function copy(name) {
- $(".copy").click(function () {
- var texts = document.getElementById("result_title").innerText;
- if (texts == '') {
- Toast('温馨提示:结果为空,无法复制', 500, 'warn')
- return
- }
- var inputs = document.getElementById("inputs");
- inputs.value = name + '结果为:' + texts.substring(3); // 修改文本框的内容(赋值内容)
- inputs.select(); // 选中文本
- document.execCommand("copy"); // 执行浏览器复制命令
- Toast('复制成功', 500, 'success')
- })
- }
- function getchecks() {
- $(".contentList").each(function (i) {
- if ($(this).find('input[type="radio"]:checked').val() == undefined && $(this).find('.radio_type').attr('disabled') == undefined) {
- $(this).find(".item-title").addClass('chColor');
- } else {
- $(this).find(".item-title").removeClass('chColor');
- }
- if ($(this).find('input[type="checkbox"]:checked').val() == undefined && $(this).find('.radio_type').attr('disabled') == undefined) {
- $(this).find(".item-titles").addClass('chColor');
- } else {
- $(this).find(".item-titles").removeClass('chColor');
- }
- });
- }
- $('#Print').on('scroll', function () {
- top = $('#Print').scrollTop()
- })
- function getResult(pushInfo, textType, constant) {
- $(".but").click(function () {
- let arr = [];
- let multarr = []
- let multname
- let num = 0
- let result
- let key = false
- let proposal = ''
- let proposals = []
- let scrollTop = []
- let v
- let numType = false
- isclick = true
- for (var i = 0; i < textType.length; i++) {
- if (textType[i] == 13) {
- numType = true
- }
- }
- $(".contentList").each(function (i) {
- if ($(this).find('input[type="radio"]:checked').val() == undefined && $(this).find('.radio_type').attr('disabled') == undefined) {
- $(this).find(".item-title").addClass('chColor');
- } else {
- $(this).find(".item-title").removeClass('chColor');
- }
- if ($(this).find('input[type="checkbox"]:checked').val() == undefined && $(this).find('.radio_type').attr('disabled') == undefined) {
- $(this).find(".item-titles").addClass('chColor');
- } else {
- $(this).find(".item-titles").removeClass('chColor');
- }
- scrollTop.push($(this).eq(0).find(".chColor").offset())
- });
- for (var i = 0; i < scrollTop.length; i++) {
- if (scrollTop[i] != undefined) {
- v = scrollTop[i]
- break
- }
- }
- if (v) {
- $(`.scale .infos`).scrollTop(v.top + top - 160)
- }
- if (!$(".contentList").find(".item-title").hasClass('chColor') && !$(".contentList").find(".item-titles").hasClass('chColor')) {
- $('input[type="radio"]:checked').each(function () {
- if ($(this).attr("resultType") == 1) {
- num += parseFloat($(this).val())
- } else {
- arr.push($(this).attr("data_obj"))
- proposals.push($(this).attr("proposal"))
- }
- });
- $('input[type="checkbox"]:checkbox:checked').each(function () {
- if ($(this).attr("resultType") == 1) {
- num += parseFloat($(this).val())
- } else {
- arr.push($(this).attr("data_obj"))
- proposals.push($(this).attr("proposal"))
- }
- });
- num = num + constant
- num = parseFloat(num)
- tmp = arr.join(";");
- if (pushInfo.length > 0) {
- for (var i = 0; i < pushInfo.length; i++) {
- if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && !tmp) {
- result = pushInfo[i].result + '(' + num.toFixed(2) + '分' + ')'
- if (proposals.join(";")) {
- proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
- } else {
- proposal = pushInfo[i].pushInfo
- }
- break
- } else if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && tmp) {
- result = pushInfo[i].result + '(' + num.toFixed(2) + '分' + ')' + ';' + tmp
- if (proposals.join(";")) {
- proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
- } else {
- proposal = pushInfo[i].pushInfo
- }
- break
- } else {
- result = tmp
- proposal = proposals.join(";");
- }
- }
- } else {
- result = tmp
- proposal = proposals.join(";");
- }
- if (result) {
- $(".hel").attr({
- "title": proposal
- });
- $(".result_title").html('结果:' + result);
- if (num >= 0 && numType) {
- $(".score").html('总分:' + num.toFixed(2) + '分');
- }
- $(".result").css('display', 'block')
- $(".score").css('display', 'block')
- $(".copy").css('display', 'block')
- $(".foot").css('display', 'block')
- } else {
- if (num >= 0 && numType) {
- $(".score").html('总分:' + num.toFixed(2) + '分');
- }
- $(".score").css('display', 'block')
- $(".copy").css('display', 'none')
- $(".foot").css('display', 'block')
- }
- } else {
- Toast('温馨提示:必填选项不能为空~', 500, 'warn')
- }
- })
- $(".printing").hover(
- function () {
- $(".slideImg").attr("src", "./../images/printing2.png");
- }, function () {
- $(".slideImg").attr("src", "./../images/printing.png");
- });
- }
- 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) {
- $(".tabList").html('')
- $(".container").css("display", "none")
- if (detailList['静态知识']) {
- $(".tabList").append(`<span class="tab" data-num="1" data-module="staticKnowledge" data-title="` + showName + `">静态知识</span>`)
- }
- if (detailList['临床路径']) {
- $(".tabList").append(`<span class="tab" data-num="2" data-module="clinicalPathway" data-title="` + clinicalPathwayName + `">临床路径</span>`)
- //$(".tabBox .title").html(clinicalPathwayName);
- }
- if (detailList['注意事项']) {
- $(".tabList").append(`<span class="tab" data-num="2" data-module="notice" data-title="` + noticeName + `">注意事项</span>`)
- //$(".tabBox .title").html(noticeName);
- }
- if (!!scale && getUrlArgObject('type') == 8) {
- $(".tabList").append(`<span class="tab" data-num="2" data-module="scale" data-title="` + showName + `">评估内容</span>`)
- //$(".tabBox .title").html(noticeName);
- }
- let defaultModuleName
- if ((getUrlArgObject('page') && getUrlArgObject('page') == 1 && scale && detailList['静态知识']) || (getUrlArgObject('scale') && getUrlArgObject('scale') != 'staticKnowledge' && detailList['静态知识']) || num == 2) {
- console.log(1)
- $(".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")
- }
- if ($('.tabList').children('.tab').length == 1) {
- $(".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 () {
- if ($('.tabList').children('.tab').length == 1) {
- return
- }
- const moduleName = $(this).attr("data-module")
- const display = $(`.${moduleName}`).css("display")
- selectedTab = $('.tabList .tab').index(this);
- // $(".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');
- const scale = $('.activeTab').attr('data-module')
- console.log(scale)
- openNewWin("informationOut.html?hospitalId=" + encodeURIComponent(hospitalId) + "&hisName=" + encodeURIComponent(hisName) + "&hisDetailName=" + encodeURIComponent(hisDetailName || '') + "&type=" + encodeURIComponent(type) + "&d=" + selectedDrop + "&t=" + selectedTab + "&scale=" + scale);
- })
- }
- function adjustHeight() {
- const extHt = window.opener?60:0; //网页查看时隐藏页脚
- var ht = window.innerHeight || document.documentElement.clientHeight;
- $(".content").height(ht - 160 + "px");
- $(".content .infos").height(ht - 170 + "px");
- $(".content .anchors").height(ht - 217 + "px");
- }
- function adjustWidth() {
- var wt = window.innerWidth || document.documentElement.clientWidth;
- // $(".titleH2").width(wt - 0.2 * wt - 33 - 200 - 17 - 40 - 15 + 'px')
- $(".content .infos").width(wt - 155 - 33 - 17 - 40 - 15 + 'px');
- }
- $(window).on('resize', function () {
- adjustHeight()
- adjustWidth()
- })
|