瀏覽代碼

Merge branch 'dynamicScale0609' into testNew

wyq 4 年之前
父節點
當前提交
980426b938
共有 3 個文件被更改,包括 72 次插入66 次删除
  1. 13 12
      src/css/staticInfo.less
  2. 3 0
      src/html/staticInfo.html
  3. 56 54
      src/js/staticInfo.js

+ 13 - 12
src/css/staticInfo.less

@@ -159,7 +159,7 @@
     margin-left: 30px;
     padding: 15px 0px 15px 20px;
     border-radius: 4px;
-    behavior: url("<%=basePath%>css/PIE.htc");
+    
     border: 1px solid #EDFAFF;
     /*background-color: #EDFAFF;*/
     line-height: 19px;
@@ -185,7 +185,7 @@
   height: 16px;
   background: #fff;
   border-radius: 16px;
-  behavior: url("<%=basePath%>css/PIE.htc");
+  
   position: absolute;
   left: 41px;
   z-index: 1;
@@ -201,7 +201,7 @@
     width: 16px;
     height: 16px;
     border-radius: 8px;
-    behavior: url("<%=basePath%>css/PIE.htc");
+    
     border: 1px solid @staticMainColor;
     background-color: @staticMainColor;
     left: -10px;
@@ -237,7 +237,8 @@
     border-radius: 0;
     border: none;
     background-color: #F5F6F7;
-    background: url('../images/icon_current.svg') center center no-repeat;
+    background: url('../images/icon_current.png');
+    background-repeat: no-repeat;
   }
   .disCopy {
     -webkit-touch-callout: none;
@@ -274,7 +275,7 @@
     font-size: 14px;
     color: #333333;
     border-radius: 6px 6px 0px 0px;
-    behavior: url("<%=basePath%>css/PIE.htc");
+    
   }
   .activeTab{
     background: @staticMainColor;
@@ -327,7 +328,7 @@
   /*滚动条里面小方块*/
   width: 6px;
   border-radius: 5px;
-  behavior: url("<%=basePath%>css/PIE.htc");
+  
   background: @staticMainColor;
   height: 100px;
 }
@@ -335,7 +336,7 @@
 .infos::-webkit-scrollbar-track, .anchors::-webkit-scrollbar-track {
   /*滚动条里面轨道*/
   border-radius: 2px;
-  behavior: url("<%=basePath%>css/PIE.htc");
+  
   background: #f0f2f5;
   opacity: .2;
 }
@@ -402,7 +403,7 @@
     height: 34px;
     background: #FFFFFF;
     border-radius: 8px;
-    behavior: url("<%=basePath%>css/PIE.htc");
+    
     border: 1px solid #2A9BD5;
     font-size: 16px;
     font-weight: 400;
@@ -420,7 +421,7 @@
 .result{
   background: #EDFAFF;
   border-radius: 10px;
-  behavior: url("<%=basePath%>css/PIE.htc");
+  
   font-size: 14px;
   font-weight: 500;
   color: #333333;
@@ -436,7 +437,7 @@
       height: 21px;
       background: #2C96E5;
       border-radius: 50%;
-      behavior: url("<%=basePath%>css/PIE.htc");
+      
       display: flex;
       align-items: center;
       justify-content: center;
@@ -464,7 +465,7 @@
       height: 32px;
       background: #FFFFFF;
       border-radius: 4px;
-      behavior: url("<%=basePath%>css/PIE.htc");
+      
       border: 1px solid #333333;
       cursor: pointer;
       & img{
@@ -481,7 +482,7 @@
       height: 32px;
       background: #FFFFFF;
       border-radius: 4px;
-      behavior: url("<%=basePath%>css/PIE.htc");
+      
       border: 1px solid #333333;
       text-align: center;
       line-height: 32px;

+ 3 - 0
src/html/staticInfo.html

@@ -71,4 +71,7 @@
   <div class="btmFix"></div>
 </body>
 
+ 
+
+
 </html>

+ 56 - 54
src/js/staticInfo.js

@@ -19,7 +19,7 @@ const {
 } = require('./promise.js');
 const $ = require("jquery");
 require("./jquery-migrate");
-require("./PIE");
+
 const jqprint = require("../js/jquery.PrintArea")
 let printing = require('./../images/printing.png');
 let printing2 = require('./../images/printing2.png');
@@ -27,49 +27,51 @@ let recommend = require('./../images/recommend.png');
 let hel = require('./../images/icon-hel.png');
 
 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();
 
 
@@ -151,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) {
@@ -161,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>`
@@ -184,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);
@@ -291,7 +293,7 @@ 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"); // 执行浏览器复制命令
@@ -356,8 +358,8 @@ function getResult(pushInfo, textType) {
           multarr.push($(this).attr("data_obj"))
         }
       });
-      
-      if (multarr.join(";")){
+
+      if (multarr.join(";")) {
         arr.push(multname + multarr.join(";"))
       }
       tmp = arr.join(";");
@@ -367,7 +369,7 @@ function getResult(pushInfo, textType) {
             result = pushInfo[i].result + '(' + num + '分' + ')'
             proposal = pushInfo[i].pushInfo
             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
             proposal = pushInfo[i].pushInfo
             break
@@ -378,7 +380,7 @@ function getResult(pushInfo, textType) {
       } else {
         result = tmp
       }
-      
+
       if (result == undefined) {
         if ($.inArray(13, textType) > 0) {
           $(".score").html('总分:' + num + '分');
@@ -442,7 +444,7 @@ function renderTab(detailList, scale) {
     //$(".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 {