Pārlūkot izejas kodu

结果添加文字

wyq 3 gadi atpakaļ
vecāks
revīzija
5728ac0901

+ 2 - 1
src/css/informationOut.less

@@ -467,7 +467,8 @@ div,li,span,i,p,h1,h2,h3,h4,h5,pre{
     padding:25px 56px;
     padding:25px 56px;
     display: inline-block;
     display: inline-block;
     .result_left{
     .result_left{
-      display: flex;
+      display: flex; 
+      justify-content: center;
       & span{
       & span{
         display: block;
         display: block;
         width: 42px;
         width: 42px;

+ 2 - 0
src/css/staticInfo.less

@@ -407,6 +407,8 @@
     display: inline-block;
     display: inline-block;
     .result_left{
     .result_left{
       display: flex;
       display: flex;
+      
+    justify-content: center;
       & span{
       & span{
         display: block;
         display: block;
         width: 42px;
         width: 42px;

+ 9 - 6
src/js/informationOut.js

@@ -281,7 +281,7 @@ function renderContentscale(list, contentWrapClassName, name) {
   str = '<div class="scalebot">'
   str = '<div class="scalebot">'
   str += '<button class="but">结果</button><p class="score"></p>'
   str += '<button class="but">结果</button><p class="score"></p>'
   str += '</div>'
   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></div></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>`
   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);
   $(`.${contentWrapClassName} .infos .infos-box`).append(str);
   function addScrollEvent() {
   function addScrollEvent() {
@@ -310,11 +310,14 @@ function getprinting() {
   $('.printing').click(function () {
   $('.printing').click(function () {
     $('.foot').hide()
     $('.foot').hide()
     $('.scalebot').hide()
     $('.scalebot').hide()
+    $('.result_title_tip').hide()
+    
     $('#Print').css({
     $('#Print').css({
       'height': 'auto', //高度自动
       'height': 'auto', //高度自动
     }).print();
     }).print();
     $('.foot').show()
     $('.foot').show()
     $('.scalebot').show()
     $('.scalebot').show()
+    $('.result_title_tip').show()
     $('#Print').css({
     $('#Print').css({
       'height': '100%', //高度自动
       'height': '100%', //高度自动
     });
     });
@@ -478,12 +481,12 @@ function getResult(pushInfo, textType, constant) {
         }
         }
       });
       });
       num = num + constant
       num = num + constant
-      num = parseFloat(num).toFixed(2)
+      num = parseFloat(num)
       tmp = arr.join(";");
       tmp = arr.join(";");
       if (pushInfo.length > 0) {
       if (pushInfo.length > 0) {
         for (var i = 0; i < pushInfo.length; i++) {
         for (var i = 0; i < pushInfo.length; i++) {
           if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && !tmp) {
           if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && !tmp) {
-            result = pushInfo[i].result + '(' + num + '分' + ')'
+            result = pushInfo[i].result + '(' + num.toFixed(2) + '分' + ')'
             if (proposals.join(";")) {
             if (proposals.join(";")) {
               proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
               proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
             } else {
             } else {
@@ -491,7 +494,7 @@ function getResult(pushInfo, textType, constant) {
             }
             }
             break
             break
           } else if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && tmp) {
           } else if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && tmp) {
-            result = pushInfo[i].result + '(' + num + '分' + ')' + ';' + tmp
+            result = pushInfo[i].result + '(' + num.toFixed(2) + '分' + ')' + ';' + tmp
             if (proposals.join(";")) {
             if (proposals.join(";")) {
               proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
               proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
             } else {
             } else {
@@ -513,7 +516,7 @@ function getResult(pushInfo, textType, constant) {
         });
         });
         $(".result_title").html('结果:' + result);
         $(".result_title").html('结果:' + result);
         if (num >= 0 && numType) {
         if (num >= 0 && numType) {
-          $(".score").html('总分:' + num + '分');
+          $(".score").html('总分:' + num.toFixed(2) + '分');
         }
         }
         $(".result").css('display', 'block')
         $(".result").css('display', 'block')
         $(".score").css('display', 'block')
         $(".score").css('display', 'block')
@@ -521,7 +524,7 @@ function getResult(pushInfo, textType, constant) {
         $(".foot").css('display', 'block')
         $(".foot").css('display', 'block')
       } else {
       } else {
         if (num >= 0 && numType) {
         if (num >= 0 && numType) {
-          $(".score").html('总分:' + num + '分');
+          $(".score").html('总分:' + num.toFixed(2) + '分');
         }
         }
         $(".score").css('display', 'block')
         $(".score").css('display', 'block')
         $(".copy").css('display', 'none')
         $(".copy").css('display', 'none')

+ 21 - 16
src/js/staticInfo.js

@@ -212,7 +212,7 @@ function renderContentscale(list, contentWrapClassName, name) {
   str = '<div class="scalebot">'
   str = '<div class="scalebot">'
   str += '<button class="but">结果</button><p class="score"></p>'
   str += '<button class="but">结果</button><p class="score"></p>'
   str += '</div>'
   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></div></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>`
   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);
   $(`.${contentWrapClassName} .infos .infos-box`).append(str);
   function addScrollEvent() {
   function addScrollEvent() {
@@ -238,16 +238,21 @@ function renderContentscale(list, contentWrapClassName, name) {
 }
 }
 function getprinting() {
 function getprinting() {
   $('.printing').click(function () {
   $('.printing').click(function () {
-    $('.foot').hide()
-    $('.scalebot').hide()
-    $('#Print').css({
-      'height': 'auto', //高度自动
-    }).print()
-    $('.foot').show()
-    $('.scalebot').show()
-    $('#Print').css({
-      'height': '100%', //高度自动
-    });
+    $('.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%', //高度自动
+      });
+    })
   })
   })
 }
 }
 
 
@@ -407,12 +412,12 @@ function getResult(pushInfo, textType, constant) {
         }
         }
       });
       });
       num = num + constant
       num = num + constant
-      num = parseFloat(num).toFixed(2)
+      num = parseFloat(num)
       tmp = arr.join(";");
       tmp = arr.join(";");
       if (pushInfo.length > 0) {
       if (pushInfo.length > 0) {
         for (var i = 0; i < pushInfo.length; i++) {
         for (var i = 0; i < pushInfo.length; i++) {
           if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && !tmp) {
           if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && !tmp) {
-            result = pushInfo[i].result + '(' + num + '分' + ')'
+            result = pushInfo[i].result + '(' + num.toFixed(2) + '分' + ')'
             if (proposals.join(";")) {
             if (proposals.join(";")) {
               proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
               proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
             } else {
             } else {
@@ -420,7 +425,7 @@ function getResult(pushInfo, textType, constant) {
             }
             }
             break
             break
           } else if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && tmp) {
           } else if (pushInfo[i].content.max >= num && num >= pushInfo[i].content.min && tmp) {
-            result = pushInfo[i].result + '(' + num + '分' + ')' + ';' + tmp
+            result = pushInfo[i].result + '(' + num.toFixed(2) + '分' + ')' + ';' + tmp
             if (proposals.join(";")) {
             if (proposals.join(";")) {
               proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
               proposal = pushInfo[i].pushInfo + ';' + proposals.join(";");
             } else {
             } else {
@@ -442,7 +447,7 @@ function getResult(pushInfo, textType, constant) {
         });
         });
         $(".result_title").html('结果:' + result);
         $(".result_title").html('结果:' + result);
         if (num >= 0 && numType) {
         if (num >= 0 && numType) {
-          $(".score").html('总分:' + num + '分');
+          $(".score").html('总分:' + num.toFixed(2) + '分');
         }
         }
         $(".result").css('display', 'block')
         $(".result").css('display', 'block')
         $(".score").css('display', 'block')
         $(".score").css('display', 'block')
@@ -450,7 +455,7 @@ function getResult(pushInfo, textType, constant) {
         $(".foot").css('display', 'block')
         $(".foot").css('display', 'block')
       } else {
       } else {
         if (num >= 0 && numType) {
         if (num >= 0 && numType) {
-          $(".score").html('总分:' + num + '分');
+          $(".score").html('总分:' + num.toFixed(2) + '分');
         }
         }
         $(".score").css('display', 'block')
         $(".score").css('display', 'block')
         $(".copy").css('display', 'none')
         $(".copy").css('display', 'none')