Browse Source

Merge remote-tracking branch 'origin/testMerged'

zhouna 5 years ago
parent
commit
a0bd92b5ed
3 changed files with 11 additions and 7 deletions
  1. 3 0
      src/css/indexVert.less
  2. 5 4
      src/js/indexVertDom.js
  3. 3 3
      src/js/util.js

+ 3 - 0
src/css/indexVert.less

@@ -251,6 +251,9 @@
     right: 0px;
     color: @colorBlue;
     cursor: pointer;
+    height: 25px;
+    line-height: 25px;
+    box-shadow: -2px 0px 15px 0px #fff;
 
     i {
         width: 10px;

+ 5 - 4
src/js/indexVertDom.js

@@ -3,6 +3,7 @@ const { openNewWin,imageUrlPrefix } = require('./promise.js');
 const { bindTipsEvent } = require('./popupEdit.js');
 
 function renderRecommendInfo(showNum,className,title,data, hasInfo, type, position) {
+    let showNumCopy = showNum || 5
     const dataLen = data.length
     const str = `<div class="recommendInfoWrapper ${className}">
                     <h4><i></i>${title}</h4>
@@ -13,8 +14,8 @@ function renderRecommendInfo(showNum,className,title,data, hasInfo, type, positi
                 </div>`
     $('.recommendWrap').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
     }
@@ -54,7 +55,7 @@ function renderRecommendInfo(showNum,className,title,data, hasInfo, type, positi
         const infoMsgName = $(this).attr('data-name')
         openNewWin(`information.html?type=${type}&position=${position}&name=${infoMsgName}`)
     })
-    if(dataLen > showNum) {
+    if(dataLen > showNumCopy) {
         slideToggle($("."+className+"box"), childrenNodeStrShort,childrenNodeStrLong)
     }
 }
@@ -67,7 +68,7 @@ function renderMultRecommendInfo(className,title,data, hasInfo, type, position)
     $('.recommendWrap').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="labAndPacsBox ${data[i].className} clearfix"> </div>`
         let childrenNodeStrShort =  `<span class="labAndPacsTitle">${data[i].title}<i></i></span>`

+ 3 - 3
src/js/util.js

@@ -22,14 +22,14 @@ const transConf = function(arr) {
     //     {hospitalCode: "A001", sysType: 16, name: "警惕诊断", code: "vigilant_no", value: 3}
     // ]
     const reg = /_show$/g;
-    let newArr = arr.filter(item => item.code.match(reg) && item.value === 1 )
+    let newArr = arr.filter(item => item.code.match(reg) && +item.value === 1 )
     for(let i = 0; i < newArr.length; i++) {
         for (let j = 0; j < arr.length; j++) {
             if(arr[j].code.match(/_no$/g) && arr[j].code.replace('_no', ' ') === newArr[i].code.replace('_show', ' ')) {
-                newArr[i].orderNo = arr[j].value
+                newArr[i].orderNo = +arr[j].value
             }
             if(arr[j].code.match(/_num$/g) && arr[j].code.replace('_num', ' ') === newArr[i].code.replace('_show', ' ')) {
-                newArr[i].showNum = arr[j].value
+                newArr[i].showNum = +arr[j].value
             }
         }
     }