Browse Source

竖版个数配置

zhouna 4 years atrás
parent
commit
63a7f6f4ea
6 changed files with 43 additions and 32 deletions
  1. 10 7
      src/css/cdss.less
  2. 1 1
      src/html/cdss.html
  3. 1 1
      src/html/cdssHorizontal.html
  4. 4 2
      src/js/cdss.js
  5. 1 1
      src/js/cdssHorizontal.js
  6. 26 20
      src/js/tcmiss.js

+ 10 - 7
src/css/cdss.less

@@ -458,6 +458,12 @@ body{
 }
 
 /*******中医********/
+.tcmWarp {
+  box-sizing: border-box;
+  width: 100%;
+  height: 100%;
+  overflow-y: auto;
+}
 .tcm-item {
   margin: 0 15px 10px;
   border: 1px #EEF5FD solid;
@@ -513,14 +519,8 @@ body{
     margin: 0 10px;
     border-top: 1px #E6E6E6 solid;
     padding-top: 5px;
-    max-height: 134px;
+    /*max-height: 134px;*/
     overflow-y: hidden;
-    .go-push {
-      width: 60px;
-      position: absolute;
-      left: 502px;
-      bottom: 0;
-    }
     li {
       margin: 0 0 6px 10px;
     }
@@ -546,6 +546,9 @@ body{
 
     }
   }
+  &.recipe {
+    display: none;
+  }
   &.knowledge .content {
     padding: 8px 10px 12px;
     li {

+ 1 - 1
src/html/cdss.html

@@ -80,7 +80,7 @@
           <div class="followUpWrap moduleWrapper">
             
           </div>
-            <div class="TcmWrap moduleWrapper">
+            <div class="tcmWarp moduleWrapper">
                 <div class="go-push tcm-item">
                     <p class="title">
                         <img class="icon" src="./images/t1.png" alt="">

+ 1 - 1
src/html/cdssHorizontal.html

@@ -48,7 +48,7 @@
         <div class="followUpWrap moduleWrapper">
             
         </div>
-        <div class="TcmWrap moduleWrapper">
+        <div class="tcmWarp moduleWrapper">
           <div class="go-push tcm-item clearfix">
             <p class="title">
               <img class="icon" src="./images/t1.png" alt="">

+ 4 - 2
src/js/cdss.js

@@ -49,7 +49,7 @@ let moduleConfig={
   qc:"qcWrap",
   medical:"medicalKonwledgeWrap",
     followup: "followUpWrap",
-    tcmiss: 'TcmWrap',
+    tcmiss: 'tcmWarp',
 }
 let allInterface = 0
 let hasCompleteTnterface = 0
@@ -220,7 +220,9 @@ function renderPage(pageSet){
     return
   }
     if (hasTcm) {
-        getTcmMr(mrId);
+        console.log(hasTcm)
+        const item = hasTcm.planDetails.find((it) => it.code === "treatment");
+        getTcmMr(mrId, (item || {}).number || 3);
     }
   if(hasAuxiliary){
     renderModuleWrapper(hasAuxiliary.planDetails)

+ 1 - 1
src/js/cdssHorizontal.js

@@ -35,7 +35,7 @@ let moduleConfig={
   qc:"qcWrap",
   medical:"medicalKonwledgeWrap",
     followup: 'followUpWrap',
-    tcmiss: 'TcmWrap',
+    tcmiss: 'tcmWarp',
 }
 let allInterface = 0
 let hasCompleteTnterface = 0

+ 26 - 20
src/js/tcmiss.js

@@ -12,17 +12,13 @@ $(function () {
     });
 });
 
-function getTcmMr(mrId) {
+function getTcmMr(mrId, num) {
     post('/sys/mr/getTcmMr', {mrId: mrId}).then((res) => {
-        console.log(res)
+        //console.log(res)
         let data = res.data.data || {}
         const {tcmdisease, tcmsyndrome} = data;
-        if (!tcmdisease) {
-            $(".recipe").hide();
-            return;
-        }
         if (res.data.code === '0') {
-            getTcmData({tcmDiag: tcmdisease.uniqueName, tcmSyndrome: tcmsyndrome.uniqueName})
+            getTcmData({tcmDiag: tcmdisease.uniqueName, tcmSyndrome: tcmsyndrome.uniqueName}, num)
         } else {
 
         }
@@ -30,7 +26,7 @@ function getTcmMr(mrId) {
 }
 
 //获取处方推荐
-function getTcmData(param) {
+function getTcmData(param, num) {
     $(".recipe").show();
     const {tcmDiag, tcmSyndrome} = param;
     $("#jibing").text(tcmDiag + "-" + tcmSyndrome);
@@ -41,16 +37,16 @@ function getTcmData(param) {
     });
     //处方推荐
     get('/lantone/private/zycftj?jibing=' + tcmDiag + "&zhengxing=" + tcmSyndrome).then((res) => {
-        console.log(res)
-        let data = res.data.data || {}
+        //console.log(res)
+        let data = res.data.data || []
         if (res.data.status) {
-            renderTcm(data)
+            renderTcm(data, num)
         } else {
 
         }
     })
-    //治法推荐
-    get('/lantone/private/zhongyizx?type=1&code=' + tcmDiag + '&value=' + tcmSyndrome).then((res) => {
+    //治法推荐-暂时不用
+    /*get('/lantone/private/zhongyizx?type=1&code=' + tcmDiag + '&value=' + tcmSyndrome).then((res) => {
         console.log(res)
         let data = res.data.data || {}
         if (res.data.status) {
@@ -58,21 +54,31 @@ function getTcmData(param) {
         } else {
 
         }
-    })
+    })*/
 }
 
-function renderTcm(data) {
-    let str = ``;
-    data.map((it, i) => {
+function renderTcm(data, num = 3) {
+    let str = ``, it;
+    $("#goTreat").hide();
+    console.log(num)
+    const n = num < data.length ? num : data.length;
+    for (let i = 0; i < n; i++) {
+        it = data[i];
         str += `<li class="clearfix"><div class="label">处方${i + 1}:</div>
                     <div class="val">
                     <p class="name">${it.name}</p>
                     <p class="desc">${it.matStr}</p>
                 </div></li>`;
+    }
 
-    })
-    if (data.length > 3) {
-        str += `<a class="go go-push" id="goTreat">更多 <img class="icon" src="./images/go.png" alt=""></a>`;
+    if (data.length > num) {
+        if ($("#goTreat").length) {       //竖版不增加更多按钮,显示即可
+            str += ``;
+            $("#goTreat").show();
+        } else {
+            str += `<a class="go go-push" id="goTreat">更多 <img class="icon" src="./images/go.png" alt=""></a>`;
+            $("#goTreat").show();
+        }
     }
     $('.detail ul').html(str);
     //更多治法