wyq 3 роки тому
батько
коміт
a6347a13c5

+ 1 - 0
src/css/informationOut.less

@@ -542,6 +542,7 @@ div,li,span,i,p,h1,h2,h3,h4,h5,pre{
   position: absolute;top: 0;left: 0;opacity: 0;z-index: -10;
 }
 #Print{
+  width: 100%!important;
   overflow-x: hidden;
 }
 .scale{

+ 2 - 1
src/css/staticInfo.less

@@ -237,7 +237,7 @@
     border-radius: 0;
     border: none;
     background-color: #F5F6F7;
-    background: url('../images/icon_current.png');
+    background: url('../images/icon_current2.png');
     background-repeat: no-repeat;
     background-position-x: center;
     background-position-y: center;
@@ -506,6 +506,7 @@
   position: absolute;top: 0;left: 0;opacity: 0;z-index: -10;
 }
 #Print{
+  width: 100%!important;
   overflow-x: hidden;
 }
 .scale{

BIN
src/images/icon_current2.png


+ 49 - 38
src/js/informationOut.js

@@ -25,6 +25,13 @@ let hel = require('./../images/icon-hel.png');
 let showName, noticeName, clinicalPathwayName, showLis = [], selectedDrop = 0, selectedTab = 0, isclick
 
 //如果是子窗口,隐藏网页查看按钮
+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;
@@ -182,9 +189,6 @@ function renderContentscale(list, contentWrapClassName, name) {
     console.log(item.resultType)
     textType.push(item.textType)
     if (item.textType == 11) {
-      anchors = '<li><i></i><a href="#' + contentWrapClassName + i +
-        '">' + item.content + '</a></li><li class="anchor-line"></li>';
-
       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 +
         '">'
@@ -192,7 +196,6 @@ function renderContentscale(list, contentWrapClassName, name) {
       str += '</h2></div>'
       str = `<div class="infoWrapper">${str}</div>`
       $(`.${contentWrapClassName} .infos .infos-box`).append(str);
-      $(`.${contentWrapClassName} .anchors ul`).append(anchors);
       for (var j = 0; j < item.subList.length; j++) {
         var items = item.subList[j];
         for (var k = 0; k < items.detailList.length; k++) {
@@ -212,25 +215,24 @@ function renderContentscale(list, contentWrapClassName, name) {
             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="' + its.score + '"/>'
+              str += '<label><input class="radio_type" type="radio" name="scale' + its.parentId + '" value="' + parseFloat(((its.score * it.factor + it.constant) * item.factor + item.constant)) + '"/>'
             } else if (it.selectType == 22 && item.resultType == 1) {
-              str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="checkbox" value="' + its.score + '"/>'
+              str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="checkbox" value="' + parseFloat(((its.score * it.factor + it.constant) * item.factor + item.constant)) + '"/>'
             } 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 + '"/>'
+              str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="radio" value="' + its.result + '" data_obj="' + it.content + '' + its.result + '" proposal="' + its.pushInfo + '"/>'
             } 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="' + its.result + '"/>'
+              str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="checkbox" value="' + its.result + '" data_obj="' + it.content + '' + its.result + '" proposal="' + its.pushInfo + '"/>'
             }
             str += its.content
             if (item.resultType == 1) {
-              str += '<span class="num">' + '(' + its.score + ')' + '</span>'
+              str += '<span class="num">' + its.score + '</span>'
             }
             str += '</label>'
-            str += `${its.match == 1 ? `<img class="recommend" src=${recommend} />` : ``}</div>`
+            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 == 13) {
       for (var m = 0; m < item.subList[0].detailList[0].subList[0].detailList.length; m++) {
@@ -245,10 +247,10 @@ function renderContentscale(list, contentWrapClassName, name) {
     }
   }
   str = '<div class="scalebot">'
-  str += '<p class="score"></p>'
-  str += '<button class="but">结果</button></div>'
-  str += `<div class="result"><div class="result_box"><img src=${hel} class="hel"/><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>`
+  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"/><span>结果:</span></div><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="./../images/printing.png" class="slideImg"/>打印</div><div class="copy">确认并复制结果</div></div></div>`
   $(`.${contentWrapClassName} .infos .infos-box`).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);
@@ -265,6 +267,15 @@ function renderContentscale(list, contentWrapClassName, name) {
     }
   }
   $(`.${contentWrapClassName} .infos .infos-box`).scroll(throttle(addScrollEvent, 200));
+  var mb = myBrowser();
+  if ("IE" == mb) {
+    $('.result_left').css({
+      'position': 'relative', //高度自动
+    })
+    $('.result_title').css({
+      'margin-left': '0', //高度自动
+    })
+  }
   addLinkClickEvent(contentWrapClassName);
   adjustHeight();
   adjustWidth()
@@ -272,6 +283,7 @@ function renderContentscale(list, contentWrapClassName, name) {
   getResult(pushInfo, textType)
   copy(name)
   getprinting()
+
 }
 
 function getprinting() {
@@ -283,6 +295,9 @@ function getprinting() {
     }).jqprint();
     $('.foot').show()
     // $('.hel').show()
+    $('#Print').css({
+      'height': '100%', //高度自动
+    });
   })
 }
 
@@ -352,15 +367,11 @@ function copy(name) {
       return
     }
     var inputs = document.getElementById("inputs");
-    inputs.value = name + '结果为:' + texts; // 修改文本框的内容(赋值内容)
+    inputs.value = name + '结果为' + texts; // 修改文本框的内容(赋值内容)
     console.log(inputs.value)
     inputs.select(); // 选中文本
     document.execCommand("copy"); // 执行浏览器复制命令
     Toast('复制成功', 500, 'success')
-    setTimeout(() => {
-      window.close()
-    }, 500)
-
   })
 
 }
@@ -378,7 +389,6 @@ function getchecks() {
     }
   });
 }
-
 function getResult(pushInfo, textType) {
   $(".but").click(function () {
     let arr = [];
@@ -388,6 +398,7 @@ function getResult(pushInfo, textType) {
     let result
     let key = false
     let proposal = ''
+    let proposals = []
     isclick = true
     $(".contentList").each(function (i) {
       if ($(this).find('input[type="radio"]:checked').val() == undefined && $(this).find('.radio_type').attr('disabled') == undefined) {
@@ -407,20 +418,17 @@ function getResult(pushInfo, textType) {
           num += parseFloat($(this).val())
         } else {
           arr.push($(this).attr("data_obj"))
+          proposals.push($(this).attr("proposal"))
         }
       });
       $('input[type="checkbox"]:checkbox:checked').each(function () {
         if (!isNaN($(this).val())) {
           num += parseFloat($(this).val())
         } else {
-          multname = $(this).parents('.item-content').siblings('.item-titles').html()
-          multarr.push($(this).attr("data_obj"))
+          arr.push($(this).attr("data_obj"))
+          proposals.push($(this).attr("proposal"))
         }
       });
-
-      if (multarr.join("、")) {
-        arr.push(multname + multarr.join("、"))
-      }
       tmp = arr.join(";");
       if (pushInfo.length > 0) {
         for (var i = 0; i < pushInfo.length; i++) {
@@ -438,6 +446,7 @@ function getResult(pushInfo, textType) {
         }
       } else {
         result = tmp
+        proposal = proposals.join(";");
       }
 
       if (result == undefined) {
@@ -451,6 +460,7 @@ function getResult(pushInfo, textType) {
         $(".hel").attr({
           "title": proposal
         });
+
         $(".result_title").html(result);
         if ($.inArray(13, textType) > 0) {
           $(".score").html('总分:' + num + '分');
@@ -461,17 +471,16 @@ function getResult(pushInfo, textType) {
         $(".foot").css('display', 'block')
       }
     } else {
-      Toast('温馨提示:必填选项不能为空~', 500, 'warn')
+      Toast('温馨提示:必填选项不能为空~', 500000, 'warn')
     }
   })
   $(".printing").hover(
     function () {
-      $(".slideImg").attr("src", printing2);
+      $(".slideImg").attr("src", "./../images/printing2.png");
     }, function () {
-      $(".slideImg").attr("src", printing);
+      $(".slideImg").attr("src", "./../images/printing.png");
 
     });
-
 }
 
 function addLinkClickEvent(contentWrapClassName) {
@@ -499,12 +508,12 @@ function renderTab(detailList, scale) {
     $(".tabList").append(`<span class="tab" data-module="notice" data-title="` + noticeName + `">注意事项</span>`)
     //$(".tabBox .title").html(noticeName);
   }
-  if (scale) {
+  if (scale || getUrlArgObject('gauge') == 'gauge' || getUrlArgObject('type') == 8) {
     $(".tabList").append(`<span class="tab" data-module="scale" data-title="` + showName + `">评估内容</span>`)
     //$(".tabBox .title").html(noticeName);
   }
   let defaultModuleName
-  if ((getUrlArgObject('page') && getUrlArgObject('page') == 1 && scale)) {
+  if (getUrlArgObject('page') && getUrlArgObject('page') == 1 && scale && detailList['静态知识']) {
     $(".tabList .tab").eq(1).addClass("activeTab")
     defaultModuleName = $(".tabList .tab").eq(1).attr("data-module")
   } else {
@@ -533,22 +542,24 @@ function bindTabClick() {
     const hospitalId = getUrlArgObject('hospitalId');
     const hisName = getUrlArgObject('hisName');
     const hisDetailName = getUrlArgObject('hisDetailName');
-    openNewWin("informationOut.html?hospitalId=" + encodeURIComponent(hospitalId) + "&hisName=" + encodeURIComponent(hisName) + "&hisDetailName=" + encodeURIComponent(hisDetailName || '') + "&type=" + encodeURIComponent(type) + "&d=" + selectedDrop + "&t=" + selectedTab);
+    openNewWin("informationOut.html?hospitalId=" + encodeURIComponent(hospitalId) + "&hisName=" + encodeURIComponent(hisName) + "&hisDetailName=" + encodeURIComponent(hisDetailName || '') + "&type=" + encodeURIComponent(type) + "&d=" + selectedDrop + "&t=" + selectedTab & + "&gauge=gauge");
   })
 }
 function adjustHeight() {
-  const extHt = window.opener ? 60 : 0;
   var ht = window.innerHeight || document.documentElement.clientHeight;
-  $(".content,.content .infos").height(ht - 158 + extHt + "px");
-  /*$(".anchors").height(ht - 258 + "px");*/
+  $(".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 - 200 + 'px')
+  $(".content .infos").width(wt - 243 + 'px');
 }
 $(window).on('resize', function () {
   adjustHeight()
   adjustWidth()
 })
+$(window).on('resize', function () {
+  adjustHeight()
+  adjustWidth()
+})
 

+ 3 - 5
src/js/staticInfo.js

@@ -159,9 +159,9 @@ function renderContentscale(list, contentWrapClassName, name) {
             } 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)) + '"/>'
             } 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 +'"/>'
+              str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="radio" value="' + its.result + '" data_obj="' + it.content + '' + its.result + '" proposal="' + its.pushInfo + '"/>'
             } 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 +'"/>'
+              str += '<label><input class="radio_type" name="scale' + its.parentId + '" type="checkbox" value="' + its.result + '" data_obj="' + it.content + '' + its.result + '" proposal="' + its.pushInfo + '"/>'
             }
             str += its.content
             if (item.resultType == 1) {
@@ -472,7 +472,6 @@ function bindTabClick() {
       $(".activeTab").removeClass("activeTab")
       $(this).addClass("activeTab")
       $(".container").css("display", "none")
-
       $(`.${moduleName}`).css("display", "block")
       $(`.${moduleName} .infos`).scrollTop(0)
     }
@@ -491,8 +490,7 @@ function adjustHeight() {
 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- 210 + 'px');
-  //$("pre").width(wt- 0.2*wt - 240 + 'px')
+  $(".content .infos").width(wt - 243 + 'px');
 }
 $(window).on('resize', function () {
   adjustHeight()