1178232204@qq.com 3 rokov pred
rodič
commit
02c4b3e173
2 zmenil súbory, kde vykonal 39 pridanie a 23 odobranie
  1. 1 1
      src/css/cdss.less
  2. 38 22
      src/js/cdss.js

+ 1 - 1
src/css/cdss.less

@@ -691,7 +691,7 @@ body {
     .box-title {
       line-height: 29px;
     }
-    .box-img {
+    .box-img,.noData {
       float: right;
       margin-top: 11px;
       margin-right: 5px;

+ 38 - 22
src/js/cdss.js

@@ -346,8 +346,8 @@ function renderPushData() {
       renderOperationPush(operationsPush, operationsNum)
       rendergeneraTreatPush(generaTreatPush)
       // renderNurse(nursePush, nurseNum)
-      renderDiagList(diagList,maydiagnoseNum)
-      renderAffListList(AffList,hasdiagnoseNum)
+      renderDiagList(diagList, maydiagnoseNum)
+      renderAffListList(AffList, hasdiagnoseNum)
       bindOpenInfo()
       moreInfo()
       bindSlide();
@@ -355,7 +355,7 @@ function renderPushData() {
     empty();  //判断是否显示空状态
   })
 }
-function renderpushByMayDisease(name, i,e) {
+function renderpushByMayDisease(name, i, e) {
   return pushByDisease(name, i).then(res => {
     $(".loading").hide();
     hasCompleteTnterface++
@@ -374,14 +374,14 @@ function renderpushByMayDisease(name, i,e) {
       let isShow = false
       for (let i = 0; i < treatPush.length; i++) {
         const it = treatPush[i];
-        if(it.generaTreat){
+        if (it.generaTreat) {
           isShow = true
         }
       }
       if (symptomPush.length == 0 && vitalPush.length == 0 && lisPush.length == 0 && pacsPush.length == 0 && scalePush.length == 0 && disPush.length == 0 && medicinesPush.length == 0 && operationsPush.length == 0 && nursePush.length == 0 && !isShow) {
         $.toast('toast1', '', 3000, '.maydiagnose', i);
         $(e.target).parents('.box').find(".box-img").attr('src', down2)
-        $(e.target).parents('.box').find(".box-img").addClass('noData')
+        $(e.target).parents('.box').find(".box-img").removeClass('box-img').addClass('noData')
       } else if (maydiagnoseType) {
         $.toast('toast2', '', 3000, '.maydiagnose', i);
       } else {
@@ -409,7 +409,7 @@ function renderpushByMayDisease(name, i,e) {
     }
   })
 }
-function renderpushByHasDisease(name, i,e) {
+function renderpushByHasDisease(name, i, e) {
   return pushByDisease(name, i).then(res => {
     $(".loading").hide();
     hasCompleteTnterface++
@@ -428,14 +428,14 @@ function renderpushByHasDisease(name, i,e) {
       let isShow = false
       for (let i = 0; i < treatPush.length; i++) {
         const it = treatPush[i];
-        if(it.generaTreat){
+        if (it.generaTreat) {
           isShow = true
         }
       }
       if (symptomPush.length == 0 && vitalPush.length == 0 && lisPush.length == 0 && pacsPush.length == 0 && scalePush.length == 0 && disPush.length == 0 && medicinesPush.length == 0 && operationsPush.length == 0 && nursePush.length == 0 && !isShow) {
         $.toast('toast1', '', 3000, '.hasdiagnose', i);
         $(e.target).parents('.box').find(".box-img").attr('src', down2)
-        $(e.target).parents('.box').find(".box-img").addClass('noData')
+        $(e.target).parents('.box').find(".box-img").removeClass('box-img').addClass('noData')
       } else if (hasdiagnoseType) {
         $.toast('toast2', '', 3000, '.hasdiagnose', i);
       } else {
@@ -625,7 +625,7 @@ function renderDiag(diagPush) {
   renderWarningDiag(warningDiagPush, "警惕", warnNumber)
   moreInfo()
 }
-function renderNursePush(list){
+function renderNursePush(list) {
   let str = ``
   for (let i = 0; i < list.length; i++) {
     const item = list[i];
@@ -704,13 +704,15 @@ function renderDiagList(list, showNum) {
       const i = $(this).attr('data-index');
       indexNow = i
       const showList = $(".maydiagnose .box[data-index=" + i + "]").find(".moduleCenter").css("display")
-      if($(e.target).parents('.box').find(".box-img").hasClass('noData')){
+      if ($(e.target).parents('.box').find(".box-img").hasClass('noData')) {
         $(".maydiagnose .box[data-index=" + i + "]").find(".moduleCenter").css("display", "block")
         $.toast('toast1', '', 3000, '.maydiagnose', i);
+        $(".maydiagnose .box").find(".box-img").attr('src', down)
         setTimeout(function () {
           $(".maydiagnose .box").find(".moduleCenter").css("display", "none")
+          $(".maydiagnose .box").find(".noData").attr('src', down2)
         }, 200);
-        
+
         return
       }
       if (showList == "none" || !showList) {
@@ -721,7 +723,7 @@ function renderDiagList(list, showNum) {
         $(".maydiagnose .box").find(".noData").attr('src', down2)
         $(".maydiagnose .box[data-index=" + i + "]").find(".moduleCenter").css("display", "block")
         $(e.target).parents('.box').find(".box-img").attr('src', ups)
-        renderpushByMayDisease(name, i,e)
+        renderpushByMayDisease(name, i, e)
       } else {
         $(".maydiagnose .box[data-index=" + i + "]").find(".moduleCenter").css("display", "none")
         $(e.target).parents('.box').find(".box-img").attr('src', down)
@@ -753,11 +755,13 @@ function renderAffListList(list, showNum) {
       const i = $(this).attr('data-index');
       indexNow = i
       const showList = $(".hasdiagnose .box[data-index=" + i + "]").find(".moduleCenter").css("display")
-      if($(e.target).parents('.box').find(".box-img").hasClass('noData')){
+      if ($(e.target).parents('.box').find(".box-img").hasClass('noData')) {
         $(".hasdiagnose .box[data-index=" + i + "]").find(".moduleCenter").css("display", "block")
+        $(".hasdiagnose .box").find(".box-img").attr('src', down)
         $.toast('toast1', '', 3000, '.hasdiagnose', i);
         setTimeout(function () {
           $(".hasdiagnose .box").find(".moduleCenter").css("display", "none")
+          $(".hasdiagnose .box").find(".noData").attr('src', down2)
         }, 200);
         return
       }
@@ -769,7 +773,7 @@ function renderAffListList(list, showNum) {
         $(".hasdiagnose .box").find(".noData").attr('src', down2)
         $(".hasdiagnose .box[data-index=" + i + "]").find(".moduleCenter").css("display", "block")
         $(e.target).parents('.box').find(".box-img").attr('src', ups)
-        renderpushByHasDisease(name, i,e)
+        renderpushByHasDisease(name, i, e)
       } else {
         $(".hasdiagnose .box[data-index=" + i + "]").find(".moduleCenter").css("display", "none")
         $(e.target).parents('.box').find(".box-img").attr('src', down)
@@ -1036,7 +1040,7 @@ function renderHasDisPush(list) {
   }
 }
 function renderMayPush(treatPush, medicinesPush, operationsPush, nursePush) {
-  let generalstate, medicinestate, operationstate, nursestate,isShow = false
+  let generalstate, medicinestate, operationstate, nursestate, isShow = false
   for (let i = 0; i < maydiagnoseList.length; i++) {
     const item = maydiagnoseList[i];
     if (item.code == 'maygeneral') {
@@ -1051,10 +1055,11 @@ function renderMayPush(treatPush, medicinesPush, operationsPush, nursePush) {
   }
   for (let i = 0; i < treatPush.length; i++) {
     const it = treatPush[i];
-    if(it.generaTreat){
+    if (it.generaTreat) {
       isShow = true
     }
   }
+
   $(".box[data-index=" + indexNow + "]").find(".moduleCenter").append("<div class='centerBox'></div>")
   let str = `<ul>
     ${treatPush.length > 0 && isShow && generalstate != 0 ? `<li class="general" data-index="0">一般治疗</li>` : ''}
@@ -1069,6 +1074,11 @@ function renderMayPush(treatPush, medicinesPush, operationsPush, nursePush) {
     ${nursePush.length > 0 && nursestate != 0 ? `<div class="checkBox nurseItem maynurse" data-index="3"></div>` : ''}
   </div>`
   $(".maydiagnose  .box[data-index=" + indexNow + "]").find(".moduleCenter .centerBox").append(str)
+  if ($(".maydiagnose .centerBox ul li").length == 0) {
+    $(".maydiagnose .centerBox").hide()
+  }else{
+    $(".maydiagnose .centerBox").show()
+  }
   renderMayTreatPush(treatPush)
   renderMayMedicPush(medicinesPush)
   renderMayOperationsPush(operationsPush)
@@ -1085,7 +1095,7 @@ function renderMayPush(treatPush, medicinesPush, operationsPush, nursePush) {
   });
 }
 function renderHasPush(treatPush, medicinesPush, operationsPush, nursePush) {
-  let generalstate, medicinestate, operationstate, nursestate,isShow = false
+  let generalstate, medicinestate, operationstate, nursestate, isShow = false
   for (let i = 0; i < maydiagnoseList.length; i++) {
     const item = maydiagnoseList[i];
     if (item.code == 'maygeneral') {
@@ -1099,7 +1109,7 @@ function renderHasPush(treatPush, medicinesPush, operationsPush, nursePush) {
   }
   for (let i = 0; i < treatPush.length; i++) {
     const it = treatPush[i];
-    if(it.generaTreat){
+    if (it.generaTreat) {
       isShow = true
     }
   }
@@ -1111,12 +1121,18 @@ function renderHasPush(treatPush, medicinesPush, operationsPush, nursePush) {
     ${nursePush.length > 0 && nursestate != 0 ? `<li class="nurse" data-index="3">推荐护理</li>` : ''}
   </ul>
   <div class="centerBoxItem">
-    ${treatPush.length > 0 && isShow &&generalstate != 0 ? `<div class="checkBox generalItem hasgeneral" data-index="0"></div>` : ''}
+    ${treatPush.length > 0 && isShow && generalstate != 0 ? `<div class="checkBox generalItem hasgeneral" data-index="0"></div>` : ''}
     ${medicinesPush.length > 0 && medicinestate != 0 ? `<div class="checkBox medicineItem hasmedicine" data-index="1"></div>` : ''}
     ${operationsPush.length > 0 && operationstate != 0 ? `<div class="checkBox operationItem hasoperation" data-index="2"></div>` : ''}
     ${nursePush.length > 0 && nursestate != 0 ? `<div class="checkBox nurseItem hasnurse" data-index="3"></div>` : ''}
   </div>`
   $(".hasdiagnose .box[data-index=" + indexNow + "]").find(".moduleCenter .centerBox").append(str)
+  console.log($(".hasdiagnose  .centerBox ul li").length, 222);
+  if ($(".hasdiagnose .centerBox ul li").length == 0) {
+    $(".hasdiagnose .centerBox").hide()
+  }else{
+    $(".hasdiagnose .centerBox").show()
+  }
   renderHasTreatPush(treatPush)
   renderHasMedicPush(medicinesPush)
   renderHasOperationsPush(operationsPush)
@@ -1246,15 +1262,15 @@ function renderItemWrapper(list, showNum, name) {
   }
   if (showNum1 >= list.length) {
     return {
-      shortStr: `<div class="shortBox"><span class="shortBox-tit">${name ? name + ':' : ''}</span><div class="${name ? `${name == '推荐检验' || name == '推荐检查' || name == '鉴别诊断' || name == '推荐量表'?'shortBox-tit1' : 'shortBox-tit1'}` : ''}">${shortStr}</div></div>`,
+      shortStr: `<div class="shortBox"><span class="shortBox-tit">${name ? name + ':' : ''}</span><div class="${name ? `${name == '推荐检验' || name == '推荐检查' || name == '鉴别诊断' || name == '推荐量表' ? 'shortBox-tit1' : 'shortBox-tit1'}` : ''}">${shortStr}</div></div>`,
       longStr: ''
     }
   } else {
     shortStr += `<span class="showMore"><img class="iconArrowImg" src="${iconArrowDown}"></span>`
     longStr += `<span class="showLess"><img class="iconArrowImg"  src="${iconArrowUp}"></span>`
     return {
-      shortStr: `<div class="shortBox"><span class="shortBox-tit">${name ? name + ':' : ''}</span><div class="${name ? `${name == '推荐检验' || name == '推荐检查' || name == '鉴别诊断' || name == '推荐量表'?'shortBox-tit1' : 'shortBox-tit1'}` : ''}">${shortStr}</div></div>`,
-      longStr: `<div class="longBox"><span class="shortBox-tit">${name ? name + ':' : ''}</span><div class="${name ? `${name == '推荐检验' || name == '推荐检查' || name == '鉴别诊断' || name == '推荐量表'?'shortBox-tit1' : 'shortBox-tit1'}` : ''}">${longStr}</div></div></div>`
+      shortStr: `<div class="shortBox"><span class="shortBox-tit">${name ? name + ':' : ''}</span><div class="${name ? `${name == '推荐检验' || name == '推荐检查' || name == '鉴别诊断' || name == '推荐量表' ? 'shortBox-tit1' : 'shortBox-tit1'}` : ''}">${shortStr}</div></div>`,
+      longStr: `<div class="longBox"><span class="shortBox-tit">${name ? name + ':' : ''}</span><div class="${name ? `${name == '推荐检验' || name == '推荐检查' || name == '鉴别诊断' || name == '推荐量表' ? 'shortBox-tit1' : 'shortBox-tit1'}` : ''}">${longStr}</div></div></div>`
     }
   }
 }