wyq hace 4 años
padre
commit
cd0e06a74e
Se han modificado 1 ficheros con 46 adiciones y 46 borrados
  1. 46 46
      src/js/staticInfo.js

+ 46 - 46
src/js/staticInfo.js

@@ -30,48 +30,48 @@ let showName, noticeName, clinicalPathwayName, isclick
 
 
 
-function getInfomation() {
-  var param = {
-    "type": getUrlArgObject('type'),
-    "name": getUrlArgObject('name'),
-    "position": getUrlArgObject('position'),
-    "contentTypes": [1, 2, 3],
-    "mrId": getUrlArgObject('mrId')
-  };
-  showName = param.name
-  $(".tabBox .title").html(showName);
-
-  post(config.information, param).then((res) => {
-    const data = res.data.data
-    // const data = dataaaa.data
-    document.title = showName
-    var str = '';
-    var anchors = '';
-    if (!data) {
-      $(".title").html("暂时没有数据");
-      $(".anchors").css("display", "none");
-      return;
-    }
-    var detailList = data.details
-    var scale = data.scale
-    var staticKnowList = detailList['静态知识']
-    var noticeInfo = detailList['注意事项']
-    var clinicalPathwayInfo = detailList['临床路径']
-    var scaleInfo = data.scale ? data.scale.scaleDetails : ''
-    var name = data.name
-    noticeName = data.noticeName || "注意事项"
-    clinicalPathwayName = data.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
-    })
+  function getInfomation() {
+    var param = {
+      "type": getUrlArgObject('type'),
+      "name": getUrlArgObject('name'),
+      "position": getUrlArgObject('position'),
+      "contentTypes": [1, 2, 3],
+      "mrId": getUrlArgObject('mrId')
+    };
+    showName = param.name
+    $(".tabBox .title").html(showName);
+
+    post(config.information, param).then((res) => {
+      const data = res.data.data
+      // const data = dataaaa.data
+      document.title = showName
+      var str = '';
+      var anchors = '';
+      if (!data) {
+        $(".title").html("暂时没有数据");
+        $(".anchors").css("display", "none");
+        return;
+      }
+      var detailList = data.details
+      var scale = data.scale
+      var staticKnowList = detailList['静态知识']
+      var noticeInfo = detailList['注意事项']
+      var clinicalPathwayInfo = detailList['临床路径']
+      var scaleInfo = data.scale ? data.scale.scaleDetails : ''
+      var name = data.name
+      noticeName = data.noticeName || "注意事项"
+      clinicalPathwayName = data.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
+      })
 
-  })
-}
+    })
+  }
 getInfomation();
 
 
@@ -153,9 +153,9 @@ 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 + '"/>'
             } else if (it.selectType == 22 && item.resultType == 2) {
@@ -163,7 +163,7 @@ function renderContentscale(list, contentWrapClassName, name) {
             }
             str += its.content
             if (item.resultType == 1) {
-              str += '<span class="num">' + '(' + its.score + ')' + '</span>'
+              str += '<span class="num">' + '(' + parseFloat(((its.score * it.factor + it.constant) * item.factor + item.constant)) + ')' + '</span>'
             }
             str += '</label>'
             str += `${its.match == 1 ? `<img class="recommend" src=${recommend} />` : ``}</div>`
@@ -186,8 +186,8 @@ function renderContentscale(list, contentWrapClassName, name) {
     }
   }
   str = '<div class="scalebot">'
-  str += '<p class="score"></p>'
-  str += '<button class="but">结果</button></div>'
+  str += '<button class="but">结果</button><p class="score"></p>'
+  str += '</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>`
   $(`.${contentWrapClassName} .infos .infos-box`).append(str);