|
@@ -7,17 +7,24 @@ if (!Promise) {
|
|
|
})
|
|
|
}
|
|
|
require('../css/staticInfo.less')
|
|
|
+
|
|
|
const {
|
|
|
post,
|
|
|
throttle,
|
|
|
imageUrlPrefix,
|
|
|
config,
|
|
|
getUrlArgObject,
|
|
|
- openNewWin
|
|
|
+ openNewWin,
|
|
|
+ Toast
|
|
|
} = require('./promise.js');
|
|
|
const $ = require("jquery");
|
|
|
-let showName, noticeName, clinicalPathwayName
|
|
|
+require("./jquery-migrate");
|
|
|
+const jqprint = require("../js/jquery.PrintArea")
|
|
|
+let printing = require('./../images/printing.png');
|
|
|
+let printing2 = require('./../images/printing2.png');
|
|
|
+let recommend = require('./../images/recommend.png');
|
|
|
|
|
|
+let showName, noticeName, clinicalPathwayName
|
|
|
function getInfomation() {
|
|
|
var param = {
|
|
|
"type": getUrlArgObject('type'),
|
|
@@ -30,6 +37,7 @@ function getInfomation() {
|
|
|
|
|
|
post(config.information, param).then((res) => {
|
|
|
const data = res.data.data
|
|
|
+ // const data = dataaaa.data
|
|
|
document.title = showName
|
|
|
var str = '';
|
|
|
var anchors = '';
|
|
@@ -44,17 +52,15 @@ function getInfomation() {
|
|
|
var staticKnowList = detailList['静态知识']
|
|
|
var noticeInfo = detailList['注意事项']
|
|
|
var clinicalPathwayInfo = detailList['临床路径']
|
|
|
- var scaleInfo = scale ? scale.scaleDetails : ''
|
|
|
+ var scaleInfo = data.scale ? data.scale.scaleDetails : ''
|
|
|
var name = data.name
|
|
|
noticeName = data.noticeName || "注意事项"
|
|
|
clinicalPathwayName = data.clinicalPathwayName || "临床路径"
|
|
|
- console.log(clinicalPathwayName)
|
|
|
renderTab(detailList, scale)
|
|
|
staticKnowList && renderContent(staticKnowList, 'staticKnowledge')
|
|
|
noticeInfo && renderContent(noticeInfo, 'notice')
|
|
|
clinicalPathwayInfo && renderContent(clinicalPathwayInfo, 'clinicalPathway')
|
|
|
scaleInfo && renderContentscale(scaleInfo, 'scale', name)
|
|
|
-
|
|
|
$('.content img').bind('contextmenu', function () {
|
|
|
return false
|
|
|
})
|
|
@@ -105,6 +111,7 @@ function renderContent(list, contentWrapClassName) {
|
|
|
}
|
|
|
|
|
|
function renderContentscale(list, contentWrapClassName, name) {
|
|
|
+ var pushInfo=[]
|
|
|
anchors = '<li><i></i><a href="#' + contentWrapClassName +
|
|
|
'">' + name + '</a></li><li class="anchor-line"></li>';
|
|
|
str = '<p class="scaletitle">' + name + '</p>'
|
|
@@ -112,39 +119,59 @@ function renderContentscale(list, contentWrapClassName, name) {
|
|
|
$(`.${contentWrapClassName} .anchors ul`).append(anchors);
|
|
|
for (var i = 0; i < list[0].detailList.length; i++) {
|
|
|
var item = list[0].detailList[i];
|
|
|
- item.content = item.content && item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
|
|
|
- str = '<div class="infoBox scaleBox"><div class="title"> <h2 class="titleH2" id="' + contentWrapClassName + i +
|
|
|
- '">'
|
|
|
- str += item.content
|
|
|
- str += '</h2></div>'
|
|
|
- str = `<div class="infoWrapper">${str}</div>`
|
|
|
- $(`.${contentWrapClassName} .infos`).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"><div class="item-list">';
|
|
|
- str += '<p class="item-title">' + it.content + '</p>'
|
|
|
- str += '<div class="item-content" data-id="' + it.id + '">'
|
|
|
- str += '</div></div></div>'
|
|
|
- $(`.${contentWrapClassName} .infos .infoWrapper .infoBox`).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">';
|
|
|
- str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="radio" value="" />'
|
|
|
- str += its.content
|
|
|
- str += '<span class="num">' + '(' + its.score + ')' + '</span>'
|
|
|
- str += '</label>'
|
|
|
- str += '</div>'
|
|
|
- $(".scale .infos .infoWrapper .infoBox .contentList .item-content[data-id=" + its.parentId + "]").append(str);
|
|
|
+ if (item.textType == 11) {
|
|
|
+ item.content = item.content && item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix);
|
|
|
+ str = '<div class="infoBox scaleBox"><div class="title"> <h2 class="titleH2" id="' + contentWrapClassName + i +
|
|
|
+ '">'
|
|
|
+ str += item.content
|
|
|
+ str += '</h2></div>'
|
|
|
+ str = `<div class="infoWrapper">${str}</div>`
|
|
|
+ $(`.${contentWrapClassName} .infos`).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"><div class="item-list">';
|
|
|
+ str += '<p class="item-title">' + it.content + '</p>'
|
|
|
+ str += '<div class="item-content" data-id="' + it.id + '">'
|
|
|
+ str += '</div></div></div>'
|
|
|
+ $(`.${contentWrapClassName} .infos .infoWrapper .infoBox`).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 + '">';
|
|
|
+ str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="radio" value="' + its.score + '" />'
|
|
|
+ str += its.content
|
|
|
+ str += '<span class="num">' + '(' + its.score + ')' + '</span>'
|
|
|
+ str += '</label>'
|
|
|
+ str += `${item.match ? `<img class="recommend" src=${recommend} />` : `` }</div>`
|
|
|
+ $(".scale .infos .infoWrapper .infoBox .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 = '<div class="scalebot">'
|
|
|
+ str += '<p class="score"></p>'
|
|
|
+ str += '<button class="but">结果</button></div>'
|
|
|
+ str += '<div class="result"><div class="result_box"><p class="hel">?</p><span>结果:</span><p id="result_title" class="result_title"></p><textarea id="inputs"></textarea></div></div>'
|
|
|
+ str += `<div class="foot"><div class="foot_box"><div class="printing"><img src=${printing} class="slideImg"/>打印</div><div class="copy">确认并复制结果</div></div></div>`
|
|
|
+ $(`.${contentWrapClassName} .infos `).append(str);
|
|
|
+ // str = `<div class="foot"><div class="foot_box"><div class="printing"><img src=${printing} class="slideImg"/>打印</div><div class="copy">确认并复制结果</div></div></div>`
|
|
|
+ // $(`.${contentWrapClassName} .infos`).after(str);
|
|
|
function addScrollEvent() {
|
|
|
var scrollTop = $(`.${contentWrapClassName} .infos`).scrollTop()
|
|
|
|
|
@@ -162,8 +189,95 @@ function renderContentscale(list, contentWrapClassName, name) {
|
|
|
addLinkClickEvent(contentWrapClassName);
|
|
|
adjustHeight();
|
|
|
adjustWidth()
|
|
|
+ getcheck()
|
|
|
+ getResult(pushInfo)
|
|
|
+ copy()
|
|
|
+ getprinting()
|
|
|
+}
|
|
|
+
|
|
|
+function getprinting() {
|
|
|
+ $('.printing').click(function () {
|
|
|
+ $('.foot').hide()
|
|
|
+ $('#Print').css({
|
|
|
+ 'height': 'auto', //高度自动
|
|
|
+ }).jqprint();
|
|
|
+ $('.foot').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");
|
|
@@ -194,8 +308,15 @@ function renderTab(detailList, scale) {
|
|
|
$(".tabList").append(`<span class="tab" data-module="scale" data-title="` + showName + `">评估内容</span>`)
|
|
|
//$(".tabBox .title").html(noticeName);
|
|
|
}
|
|
|
- $(".tabList .tab").eq(0).addClass("activeTab")
|
|
|
- let defaultModuleName = $(".tabList .tab").eq(0).attr("data-module")
|
|
|
+ let defaultModuleName
|
|
|
+ if (getUrlArgObject('page') && getUrlArgObject('page') == 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")
|
|
|
+ }
|
|
|
+
|
|
|
$(`.${defaultModuleName}`).css("display", "block")
|
|
|
bindTabClick()
|
|
|
}
|