Sfoglia il codice sorgente

多个结果样式修改

wyq 4 anni fa
parent
commit
6e23423b33
3 ha cambiato i file con 47 aggiunte e 32 eliminazioni
  1. 1 7
      src/css/staticInfo.less
  2. 1 7
      src/css/staticInfoOut.less
  3. 45 18
      src/js/staticInfo.js

+ 1 - 7
src/css/staticInfo.less

@@ -409,21 +409,18 @@
   }
 }
 .result{
-  height: 72px;
   background: #EDFAFF;
   border-radius: 10px;
   font-size: 14px;
   font-weight: 500;
   color: #333333;
-  text-align: center;
   display: none;
   margin: 0 6.5%;
   .result_box{
-    height: 72px;
     display: flex;
     align-items: center;
     justify-content: center;
-    padding:  0 20px;
+    padding:20px;
     .hel{
       width: 21px;
       height: 21px;
@@ -441,9 +438,6 @@
 }
 .result_title{
   max-width: 85%;
-  overflow: hidden;
-  text-overflow:ellipsis;
-  white-space: nowrap;
 }
 .foot{
   margin-bottom: 20px;

+ 1 - 7
src/css/staticInfoOut.less

@@ -453,21 +453,18 @@ div,li,span,i,p,h1,h2,h3,h4,h5,pre{
   }
 }
 .result{
-  height: 72px;
   background: #EDFAFF;
   border-radius: 10px;
   font-size: 14px;
   font-weight: 500;
   color: #333333;
-  text-align: center;
   display: none;
   margin: 0 6.5%;
   .result_box{
-    height: 72px;
     display: flex;
     align-items: center;
     justify-content: center;
-    padding:  0 20px;
+    padding: 20px;
     .hel{
       width: 21px;
       height: 21px;
@@ -485,9 +482,6 @@ div,li,span,i,p,h1,h2,h3,h4,h5,pre{
 }
 .result_title{
   max-width: 85%;
-  overflow: hidden;
-  text-overflow:ellipsis;
-  white-space: nowrap;
 }
 .foot{
   margin-bottom: 20px;

+ 45 - 18
src/js/staticInfo.js

@@ -25,7 +25,7 @@ let printing2 = require('./../images/printing2.png');
 let recommend = require('./../images/recommend.png');
 
 
-let showName, noticeName, clinicalPathwayName
+let showName, noticeName, clinicalPathwayName, isclick
 function getInfomation() {
   var param = {
     "type": getUrlArgObject('type'),
@@ -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="' + its.score + '" />'
             } 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="' + its.result + '"/>'
+              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) {
-              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 + '"/>'
             }
             str += its.content
             if (item.resultType == 1) {
@@ -237,24 +237,38 @@ function getcheck() {
     if ($radio.data('waschecked') == true) {
       $radio.prop('checked', false);
       $("input:radio[name='" + domName + "']").data('waschecked', false);
+      
       // $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.radio_type').attr("disabled", false);
+      if (isclick){
+        getchecks()
+      }
+      
     } else {
       $radio.prop('checked', true);
       $("input:radio[name='" + domName + "']").data('waschecked', false);
       $radio.data('waschecked', true);
       // $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.radio_type').attr("disabled", true);
+      if (isclick) {
+        getchecks()
+      }
+    }
+  });
+  $('input:checkbox').click(function () {
+    const domName = $(this).attr('name');
+    const $radio = $(this);
+    const id = $(this).parents('.contentList').data("id");
+    if ($radio.data('waschecked') == true) {
+      // $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.radio_type').attr("disabled", false);
+      if (isclick) {
+        getchecks()
+      }
+    } else {
+      // $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.radio_type').attr("disabled", true);
+      if (isclick) {
+        getchecks()
+      }
     }
   });
-  // $('input:checkbox').click(function () {
-  //   const domName = $(this).attr('name');
-  //   const $radio = $(this);
-  //   const id = $(this).parents('.contentList').data("id");
-  //   if ($radio.data('waschecked') == true) {
-  //     $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.radio_type').attr("disabled", false);
-  //   } else {
-  //     $radio.parents('.contentList').siblings(".contentList[data-id='" + id + "']").find('.radio_type').attr("disabled", true);
-  //   }
-  // });
 }
 
 function copy(name) {
@@ -276,13 +290,27 @@ function copy(name) {
   })
 
 }
-
+function getchecks(){
+  $(".contentList").each(function (i) {
+    if ($(this).find('input[type="radio"]:checked').val() == undefined && $(this).find('.radio_type').attr('disabled') == undefined) {
+      $(this).find(".item-title").addClass('chColor');
+    } else {
+      $(this).find(".item-title").removeClass('chColor');
+    }
+    if ($(this).find('input[type="checkbox"]:checked').val() == undefined && $(this).find('.radio_type').attr('disabled') == undefined) {
+      $(this).find(".item-titles").addClass('chColor');
+    } else {
+      $(this).find(".item-titles").removeClass('chColor');
+    }
+  });
+}
 function getResult(pushInfo, textType) {
   $(".but").click(function () {
     let arr = [];
     let num = 0
     let result
     let key = false
+    isclick = true
     $(".contentList").each(function (i) {
       if ($(this).find('input[type="radio"]:checked').val() == undefined && $(this).find('.radio_type').attr('disabled') == undefined) {
         $(this).find(".item-title").addClass('chColor');
@@ -310,7 +338,7 @@ function getResult(pushInfo, textType) {
           arr.push($(this).attr("data_obj"))
         }
       });
-      tmp = arr.join(",");
+      tmp = arr.join(";");
       if (pushInfo.length > 0) {
         for (var i = 0; i < pushInfo.length; i++) {
           if (pushInfo[i].content.max >= num >= pushInfo[i].content.min) {
@@ -318,13 +346,13 @@ function getResult(pushInfo, textType) {
               if (num == 0){
                 result = pushInfo[i].result + ';' + tmp
               }else{
-                result = pushInfo[i].result + '(' + num + ')' + ';' + tmp
+                result = pushInfo[i].result + '(' + num + '分' + ')' + ';' + tmp
               }
             } else {
               if (num == 0) {
                 result = pushInfo[i].result
               } else {
-                result = pushInfo[i].result + '(' + num + ')'
+                result = pushInfo[i].result + '(' + num + '分' +')'
               }
             }
           }
@@ -364,7 +392,6 @@ function getResult(pushInfo, textType) {
 function addLinkClickEvent(contentWrapClassName) {
   $(`.${contentWrapClassName} .anchors li:first`).addClass("active");
   $(`.${contentWrapClassName}  .anchors li>a`).on("click", function () {
-
     const that = this
     setTimeout(function () {
       $(`.${contentWrapClassName} .anchors .active`).removeClass('active');