浏览代码

Merge remote-tracking branch 'origin/TCM0513' into testNew

zhouna 4 年之前
父节点
当前提交
3f6753d55d
共有 7 个文件被更改,包括 40 次插入18 次删除
  1. 2 1
      src/css/cdss.less
  2. 2 1
      src/css/cdssHorizontal.less
  3. 1 1
      src/html/cdss.html
  4. 1 1
      src/html/cdssHorizontal.html
  5. 3 5
      src/js/cdss.js
  6. 1 1
      src/js/cdssHorizontal.js
  7. 30 8
      src/js/tcmiss.js

+ 2 - 1
src/css/cdss.less

@@ -465,6 +465,7 @@ body{
   overflow-y: auto;
 }
 .tcm-item {
+  display: none;
   margin: 0 15px 10px;
   border: 1px #EEF5FD solid;
   border-radius: 8px;
@@ -567,7 +568,7 @@ body{
       line-height: 30px;
       border-radius: 4px;
       cursor: pointer;
-      background: url("../images/go.png") 94% center no-repeat;
+      background: url("../images/go.png") 95% center no-repeat;
       text-indent: -8px;
       text-decoration: none;
     }

+ 2 - 1
src/css/cdssHorizontal.less

@@ -451,6 +451,7 @@
 
 /*******中医********/
 .tcm-item {
+    display: none;
     .title {
         float: left;
         height: 30px;
@@ -468,7 +469,7 @@
         }
         .go {
             margin-right: 10px;
-            font-size: 12px;
+            font-size: 14px;
             color: #409ED1;
             text-decoration: none;
             cursor: pointer;

+ 1 - 1
src/html/cdss.html

@@ -123,7 +123,7 @@
                     </p>
                     <div class="content">
                         <ul class="item">
-                            <li><a class="a-link" code="zyzsjyk">中医知识库</a></li>
+                            <li><a class="a-link" code="zyzsjyk">中医经验库</a></li>
                             <li><a class="a-link" code="zycx">中药查询</a></li>
                             <li><a class="a-link" code="fjcx">方剂查询</a></li>
                         </ul>

+ 1 - 1
src/html/cdssHorizontal.html

@@ -94,7 +94,7 @@
               <span class="h2">中医知识库:</span>
             </p>
             <div class="content">
-              <p><a class="a-link" code="zyzsjyk">中医知识库</a></p>
+              <p><a class="a-link" code="zyzsjyk">中医经验库</a></p>
               <p><a class="a-link" code="zycx">中药查询</a></p>
               <p><a class="a-link" code="fjcx">方剂查询</a></p>
               <p><a class="a-link" code="jfcx">经方查询</a></p>

+ 3 - 5
src/js/cdss.js

@@ -215,15 +215,13 @@ function renderPage(pageSet){
   const hasFollowUp = hasTab("随访计划",pageSet.sysSetInfo)
     const hasTcm = hasTab("中医辅助", pageSet.sysSetInfo);
 
+    if (hasTcm) {
+        getTcmMr(mrId, hasTcm);
+    }
   if(!mrId){
     empty()
     return
   }
-    if (hasTcm) {
-        console.log(hasTcm)
-        const item = hasTcm.planDetails.find((it) => it.code === "treatment");
-        getTcmMr(mrId, (item || {}).number || 3);
-    }
   if(hasAuxiliary){
     renderModuleWrapper(hasAuxiliary.planDetails)
     let needPush = isNeedPush(hasAuxiliary.planDetails)

+ 1 - 1
src/js/cdssHorizontal.js

@@ -107,7 +107,7 @@ function renderPage(pageSet){
     const hasTcm = hasTab("中医辅助", pageSet.sysSetInfo)
 
     if (hasTcm) {
-        getTcmMr(mrId);
+        getTcmMr(mrId, hasTcm);
     }
   if(hasAuxiliary){
     renderModuleWrapper(hasAuxiliary.planDetails)

+ 30 - 8
src/js/tcmiss.js

@@ -1,6 +1,7 @@
 const $ = require("jquery");
 const {get, post, config, getUrlArgObject, openNewWin, titleConfig} = require('./promise.js');
 const targetUrl = 'http://114.55.109.16:81/lantone/index';
+let treatUrl = targetUrl;
 $(function () {
     let mrId = getUrlArgObject('mrId')
     $(".knowledge .a-link").click(function () {
@@ -12,13 +13,31 @@ $(function () {
     });
 });
 
-function getTcmMr(mrId, num) {
+function renderConfig(config) {
+    const classMap = {
+        'conditionder': 'go-push',
+        'treatment': 'recipe',
+        'tcmknowledge': 'knowledge',
+    };
+    config.map((it) => {
+        if (+it.status === 1) {
+            $(".tcmWarp ." + classMap[it.code]).show();
+        }
+    })
+}
+
+function getTcmMr(mrId, config) {
+    renderConfig(config.planDetails || []);
+    if (!mrId) {
+        $(".recipe").hide();
+        return;
+    }
     post('/sys/mr/getTcmMr', {mrId: mrId}).then((res) => {
         //console.log(res)
         let data = res.data.data || {}
         const {tcmdisease, tcmsyndrome} = data;
         if (res.data.code === '0') {
-            getTcmData({tcmDiag: (tcmdisease || {}).uniqueName, tcmSyndrome: (tcmsyndrome || {}).uniqueName}, num)
+            getTcmData({tcmDiag: (tcmdisease || {}).uniqueName, tcmSyndrome: (tcmsyndrome || {}).uniqueName}, config)
         } else {
 
         }
@@ -26,15 +45,18 @@ function getTcmMr(mrId, num) {
 }
 
 //获取处方推荐
-function getTcmData(param, num) {
-    $(".recipe").show();
+function getTcmData(param, config) {
+    const item = config.planDetails.find((it) => it.code === "treatment");
+    const num = (item || {}).number || 3;
     const {tcmDiag, tcmSyndrome} = param;
+    if (!tcmDiag) {
+        $(".recipe").hide();
+        return;
+    }
     $("#jibing").text(tcmDiag + "-" + tcmSyndrome);
     $('#bingming').text(tcmDiag);
     $('#zhenghou').text(tcmSyndrome);
-    $("#goTreat").on("click", function () {
-        openNewWin(targetUrl + '?jibing=' + tcmDiag + "&zhengxing=" + tcmSyndrome, true);
-    });
+    treatUrl = targetUrl + '?jibing=' + tcmDiag + "&zhengxing=" + tcmSyndrome;
     //处方推荐
     get('/lantone/private/zycftj?jibing=' + tcmDiag + "&zhengxing=" + tcmSyndrome).then((res) => {
         //console.log(res)
@@ -83,7 +105,7 @@ function renderTcm(data, num = 3) {
     $('.detail ul').html(str);
     //更多治法
     $("#goTreat").on('click', function () {
-        openNewWin(targetUrl, true);
+        openNewWin(treatUrl, true);
     });
 }