Browse Source

Merge branch 'showNumConf' into test

zhangxc 5 years ago
parent
commit
a751ae220a
2 changed files with 16 additions and 11 deletions
  1. 11 7
      src/css/indexHorizontal.less
  2. 5 4
      src/js/indexHorizontalDom.js

+ 11 - 7
src/css/indexHorizontal.less

@@ -103,6 +103,8 @@
     display: block;
     width: 20px;
     float: left;
+    position: relative;
+    top: 3px;
 }
 .labAndPacsBox, .treatItemBox {
     position: relative;
@@ -131,7 +133,6 @@
 }
 
 .slideup {
-    background-color: #fff;
     position: absolute;
     float: right;
     top: 0px;
@@ -166,22 +167,22 @@
     .mayIllness{
         float: left;
         position: relative;
-        top: -2px;
+        top: 0px;
     }
 }
 .recommendInfoItem,.diagNameBox {
     .infoMsg,
     .infoMsgOn {
-        top: 4px;
+        top: 2px;
     }
 }
 .infoMsg,
 .infoMsgOn {
-    top: 8px;
+    top: 2px;
 }
 .infoMsg,
 .infoMsgOn {
-    position: absolute;
+    position: relative;
     right: 0px;
     display: none;
     cursor: pointer;
@@ -195,7 +196,7 @@
 .diagNameBox:hover,
 .durgNameBox:hover {
     color: #267FD7;
-
+    padding-right: 0;
     .infoMsg {
         display: inline-block;
         width: 14px;
@@ -290,6 +291,9 @@
     margin-right: 5px;
     background: #e2eaf2;
     border-radius: 4px;
+    height: 22px;
+    line-height: 22px;
+    top: 1;
 }
 .pacsRecommendwrapper {
     // margin-top: 10px;
@@ -321,7 +325,7 @@
 }
 .recommendInfoItem {
     position: relative;
-    padding-right: 15px;
+    padding-right: 18px;
 }
 .recommendNull {
     color: #ADADAD;

+ 5 - 4
src/js/indexHorizontalDom.js

@@ -14,6 +14,7 @@ if(is8Ie) {
 
 //推荐诊断等单种类型的
 function renderRecommendInfo(showNum, icon, className,title,data, hasInfo, type, position) {
+    let showNumCopy = showNum || 5
     const dataLen = data.length
     const str = `<div class="recommendInfoWrapper ${className} clearfix">
                     <h4><img src=${icon} title="${title}" class="icon">${title}:</h4>
@@ -24,8 +25,8 @@ function renderRecommendInfo(showNum, icon, className,title,data, hasInfo, type,
                 </div>`
     $('.push').append(str)
     let dataShort
-    if(showNum&& dataLen > showNum) {
-        dataShort = data.slice(0, showNum)
+    if(showNumCopy&& dataLen > showNumCopy) {
+        dataShort = data.slice(0, showNumCopy)
     } else {
         dataShort = data
     }
@@ -77,7 +78,7 @@ function renderRecommendInfo(showNum, icon, className,title,data, hasInfo, type,
         const infoMsgName = $(this).attr('data-name')
         openNewWin(`information.html?type=${type}&position=${position}&name=${infoMsgName}`)
     })
-    slideToggle("."+className+"box", showNum, dataLen)
+    slideToggle("."+className+"box", showNumCopy, dataLen)
 
 }
 
@@ -91,7 +92,7 @@ function renderMultRecommendInfo(labsAndPacMode,icon, className,title,data, hasI
     $('.push').append(str)
     
     for(let i = 0; i < data.length; i++) {
-        const showNum = data[i].showNum
+        const showNum = data[i].showNum || 5
         const dataLen = data[i].data.length
         let childrenNodeBoxStr  = `<div class="labAndPacsWrapper ${data[i].className+'wrapper'}">
                 <div class="labAndPacsBox ${data[i].className+'box'} clearfix">