Преглед изворни кода

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

zhouna пре 4 година
родитељ
комит
970daf4af0

+ 122 - 2
src/css/cdss.less

@@ -222,6 +222,9 @@ body{
     color: @tabColor;
     margin-right: 20px;
     display: inline-block;
+  &:last-child {
+    margin-right: 0;
+  }
 }
 .moduleItem{
     border: 1px solid #EAEDF1;
@@ -316,7 +319,7 @@ body{
 }
 .tabList{
     line-height: 39px;
-    margin-bottom: 4px;
+  margin-bottom: 8px;
     padding: 0 20px 0 20px;
     box-sizing: border-box;
 }
@@ -337,7 +340,7 @@ body{
         left: 32%;
         background: #3B9ED0;
         position: absolute;
-        bottom: 0;
+      bottom: 3px;
     }
 }
 .moduleWrapper{
@@ -452,4 +455,121 @@ body{
     img{
         margin-left: 4px;
     }
+}
+
+/*******中医********/
+.tcmWarp {
+  box-sizing: border-box;
+  width: 100%;
+  height: 100%;
+  overflow-y: auto;
+}
+.tcm-item {
+  margin: 0 15px 10px;
+  border: 1px #EEF5FD solid;
+  border-radius: 8px;
+  .title {
+    background: #EEF5FD;
+    height: 30px;
+    line-height: 30px;
+    padding: 0 12px;
+    border-radius: 8px 8px 0px 0px;
+    img {
+      vertical-align: middle;
+      width: 24px;
+      height: 24px;
+    }
+    .h2 {
+      font-weight: bold;
+      font-size: 16px;
+      color: #333;
+    }
+    .go {
+      float: right;
+      margin-right: 10px;
+      font-size: 12px;
+      color: #333;
+      text-decoration: none;
+      cursor: pointer;
+      img {
+        width: 5px;
+        height: 9px;
+        vertical-align: inherit;
+      }
+    }
+  }
+  .infos {
+    padding-top: 10px;
+    li {
+      margin-bottom: 5px;
+      padding-left: 18px;
+      .label {
+        display: inline-block;
+        width: 98px;
+        margin-right: 15px;
+        font-size: 14px;
+        color: #333;
+      }
+      .val {
+        color: #666;
+      }
+    }
+  }
+  .detail {
+    margin: 0 10px;
+    border-top: 1px #E6E6E6 solid;
+    padding-top: 5px;
+    /*max-height: 134px;*/
+    overflow-y: hidden;
+    li {
+      margin: 0 0 6px 10px;
+    }
+    .label {
+      float: left;
+      border-left: 2px solid #267FD7;
+      padding-left: 5px;
+      line-height: 12px;
+      margin-top: 4px;
+    }
+    .val {
+      margin-left: 65px;
+      .name {
+        color: #333;
+      }
+      .desc {
+        color: #666;
+        overflow-x: hidden;
+        white-space: nowrap;
+        width: 100%;
+        text-overflow: ellipsis;
+      }
+
+    }
+  }
+  &.recipe {
+    display: none;
+  }
+  &.knowledge .content {
+    padding: 8px 10px 12px;
+    li {
+      display: inline-block;
+      width: 29%;
+      text-align: center;
+      padding: 0 2%;
+      margin-top: 8px;
+    }
+    .a-link {
+      display: inline-block;
+      width: 100%;
+      border: 1px #3B9ED0 solid;
+      color: #3B9ED0;
+      height: 30px;
+      line-height: 30px;
+      border-radius: 4px;
+      cursor: pointer;
+      background: url("../images/go.png") 94% center no-repeat;
+      text-indent: -8px;
+      text-decoration: none;
+    }
+  }
 }

+ 153 - 0
src/css/cdssHorizontal.less

@@ -447,4 +447,157 @@
 .lisBox {
     // position: absolute;
     // left: 50px;
+}
+
+/*******中医********/
+.tcm-item {
+    .title {
+        float: left;
+        height: 30px;
+        padding: 0 12px;
+        margin-top: 14px;
+        border-radius: 8px 8px 0px 0px;
+        img {
+            vertical-align: middle;
+            width: 20px;
+            height: 20px;
+        }
+        .h2 {
+            font-size: 14px;
+            color: #267FD7;
+        }
+        .go {
+            margin-right: 10px;
+            font-size: 12px;
+            color: #409ED1;
+            text-decoration: none;
+            cursor: pointer;
+            img {
+                width: 5px;
+                height: 9px;
+                vertical-align: inherit;
+            }
+        }
+    }
+    .go-btn, .go-push {
+        display: inline-block;
+        width: 80px;
+        height: 25px;
+        line-height: 25px;
+        border-radius: 4px;
+        text-align: center;
+        background: #DEF1FB;
+        text-decoration: none;
+        color: #409ED1;
+    }
+    .content {
+        .infos {
+            .label {
+                color: #333;
+            }
+            .val {
+                color: #666;
+            }
+            li {
+                float: left;
+                margin-right: 40px;
+            }
+        }
+        .infos {
+            height: 24px;
+        }
+        .detail {
+            padding: 0 8px 8px 4px;
+            margin-right: 20px;
+            max-height: 118px;
+            overflow-y: hidden;
+            position: relative;
+            .go-push {
+                cursor: pointer;
+                width: 60px;
+                position: absolute;
+                left: 502px;
+                bottom: 0;
+            }
+            li {
+                margin-bottom: 6px;
+            }
+            .label {
+                float: left;
+                border-left: 2px solid #267FD7;
+                padding-left: 5px;
+                line-height: 12px;
+                margin-top: 4px;
+            }
+            .val {
+                margin-left: 65px;
+                .name {
+                    color: #333;
+                }
+                .desc {
+                    color: #666;
+                }
+
+            }
+        }
+        .a-link {
+            display: inline-block;
+            width: 100%;
+            border: 1px #3B9ED0 solid;
+            color: #3B9ED0;
+            height: 30px;
+            line-height: 30px;
+            border-radius: 4px;
+            cursor: pointer;
+            background: url("../images/go.png") 94% center no-repeat;
+            text-indent: -8px;
+            text-decoration: none;
+        }
+    }
+}
+
+.recipe {
+    .title {
+        width: 124px;
+        margin-top: 0;
+    }
+    .content {
+        margin-left: 146px;
+    }
+}
+
+.idea {
+    .val {
+        border: 1px #3B9ED0 solid;
+        padding: 1px 4px;
+        color: #3B9ED0;
+        border-radius: 2px;
+      cursor: pointer;
+      &.active {
+        background: #3B9ED0;
+        color: #fff;
+      }
+    }
+    .go-text {
+        color: #49A3D2;
+        font-size: 14px;
+        text-decoration: none;
+    }
+  .zhifa {
+    display: inline-block;
+    .val {
+      margin-right: 10px;
+    }
+  }
+    img {
+        vertical-align: middle;
+    }
+}
+
+.knowledge .content p {
+    display: inline-block;
+    width: 88px;
+    margin-top: 8px;
+    margin-right: 10px;
+    text-align: center;
 }

+ 55 - 0
src/html/cdss.html

@@ -80,6 +80,61 @@
           <div class="followUpWrap moduleWrapper">
             
           </div>
+            <div class="tcmWarp moduleWrapper">
+                <div class="go-push tcm-item">
+                    <p class="title">
+                        <img class="icon" src="./images/t1.png" alt="">
+                        <span class="h2">病症推导</span>
+                        <a class="go" id="goPush">去推导 <img class="icon" src="./images/g1.png" alt=""></a>
+                    </p>
+                </div>
+                <div class="recipe tcm-item">
+                    <p class="title">
+                        <img class="icon" src="./images/t2.png" alt="">
+                        <span class="h2">中医处方推荐</span>
+                        <a class="go" id="goTreat">更多 <img class="icon" src="./images/g1.png" alt=""></a>
+                    </p>
+                    <div class="content">
+                        <ul class="infos clearfix">
+                            <li>
+                                <span class="label">中医诊断病症:</span>
+                                <span class="val" id="jibing"></span>
+                            </li>
+                            <li>
+                                <span class="label">中医病名:</span>
+                                <span class="val" id="bingming"></span>
+                            </li>
+                            <li>
+                                <span class="label">中医症候:</span>
+                                <span class="val" id="zhenghou"></span>
+                            </li>
+                        </ul>
+                        <div class="detail">
+                            <ul>
+
+                            </ul>
+                        </div>
+                    </div>
+                </div>
+                <div class="knowledge tcm-item">
+                    <p class="title">
+                        <img class="icon" src="./images/t3.png" alt="">
+                        <span class="h2">中医知识库</span>
+                    </p>
+                    <div class="content">
+                        <ul class="item">
+                            <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>
+                        <ul class="item">
+                            <li><a class="a-link" code="jfcx">经方查询</a></li>
+                            <li><a class="a-link" code="jbcx">疾病查询</a></li>
+                            <li><a class="a-link" code="xwcx">穴位查询</a></li>
+                        </ul>
+                    </div>
+                </div>
+            </div>
           <div class="disclaimer clearfix">
             <span class="version-tip"><span class="version-txt">版本说明 <img class="newIcon" src="./images/new.png"></span></span>
             <span class="logo">&copy; 朗通医疗</span>

+ 55 - 0
src/html/cdssHorizontal.html

@@ -47,6 +47,61 @@
         </div>
         <div class="followUpWrap moduleWrapper">
             
+        </div>
+        <div class="tcmWarp moduleWrapper">
+          <div class="go-push tcm-item clearfix">
+            <p class="title">
+              <img class="icon" src="./images/t1.png" alt="">
+              <span class="h2">病症推导:</span>
+              <a class="go go-btn" id="goPush">去推导 <img class="icon" src="./images/go.png" alt=""></a>
+            </p>
+          </div>
+          <div class="recipe tcm-item clearfix">
+            <p class="title">
+              <img class="icon" src="./images/t2.png" alt="">
+              <span class="h2">中医处方推荐:</span>
+            </p>
+            <div class="content">
+              <ul class="infos clearfix">
+                <li>
+                  <span class="label">中医诊断病症:</span>
+                  <span class="val" id="jibing"></span>
+                </li>
+                <li>
+                  <span class="label">中医病名:</span>
+                  <span class="val" id="bingming"></span>
+                </li>
+                <li>
+                  <span class="label">中医症候:</span>
+                  <span class="val" id="zhenghou"></span>
+                </li>
+              </ul>
+              <!--<div class="idea">
+                <span class="label">治法:</span>
+                <p class="zhifa" id="zhifa"><span class="val">&#45;&#45;</span></p>
+                <a class="go go-text" href="">展开 <img src="../images/dn.png" alt=""></a>
+              </div>-->
+              <div class="detail">
+                <ul>
+
+                </ul>
+              </div>
+            </div>
+          </div>
+          <div class="knowledge tcm-item clearfix">
+            <p class="title fl">
+              <img class="icon" src="./images/t3.png" alt="">
+              <span class="h2">中医知识库:</span>
+            </p>
+            <div class="content">
+              <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>
+              <p><a class="a-link" code="jbcx">疾病查询</a></p>
+              <p><a class="a-link" code="xwcx">穴位查询</a></p>
+            </div>
+          </div>
         </div>
         <div class="medicalKonwledgeWrap moduleWrapper">
          <div class="searchBox">

BIN
src/images/dn.png


BIN
src/images/g1.png


BIN
src/images/go.png


BIN
src/images/t1.png


BIN
src/images/t2.png


BIN
src/images/t3.png


+ 20 - 6
src/js/cdss.js

@@ -18,7 +18,11 @@ require('./../images/empty3.png').replace(/^undefined/g, '')
 require('./../images/loading.gif').replace(/^undefined/g, '')
 require('./../images/right.png').replace(/^undefined/g, '')
 require('./../images/new.png').replace(/^undefined/g, '')
-
+require('./../images/t1.png').replace(/^undefined/g, '')
+require('./../images/t2.png').replace(/^undefined/g, '')
+require('./../images/t3.png').replace(/^undefined/g, '')
+require('./../images/go.png').replace(/^undefined/g, '')
+require('./../images/g1.png').replace(/^undefined/g, '')
 // require('./popupEdit.js');
 
 let infoImg = require('./../images/icon_info.png').replace(/^undefined/g, '')
@@ -33,6 +37,7 @@ let warnImgWhite = require('./../images/icon_waring_white.png').replace(/^undefi
 const $ = require("jquery");
 const { post,config,getUrlArgObject,openNewWin,titleConfig } = require('./promise.js');
 const { renderFollowUp, followEmpty } = require('./followUp.js');
+const {getTcmMr} = require('./tcmiss.js');
 
 const { transConf } = require('./util.js');
 
@@ -43,7 +48,8 @@ let moduleConfig={
   auxiliary:"recommendWrap",
   qc:"qcWrap",
   medical:"medicalKonwledgeWrap",
-  followup:"followUpWrap"
+    followup: "followUpWrap",
+    tcmiss: 'tcmWarp',
 }
 let allInterface = 0
 let hasCompleteTnterface = 0
@@ -67,7 +73,7 @@ if(mrId){
     if(!(msg&&msg.diseaseName&&msg.diseaseName.name)){
       msg.diseaseName={}
     }
-    window.msg = msg
+      window.msg = msg;
     renderPage(data)
   })
 } else{
@@ -207,10 +213,17 @@ function renderPage(pageSet){
   const hasAuxiliary = hasTab("辅助信息",pageSet.sysSetInfo)
   const hasMedical = hasTab("医学知识",pageSet.sysSetInfo)
   const hasFollowUp = hasTab("随访计划",pageSet.sysSetInfo)
+    const hasTcm = hasTab("中医辅助", pageSet.sysSetInfo);
+
   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)
@@ -767,9 +780,10 @@ $(function(){
     }  
   });  
   // $(".iframeWrap").preventScroll();  
-  $(".iframeWrap").preventScroll();  
-  $(".recommendWrap").preventScroll();  
-  $(".infoWrap").preventScroll();  
+    $(".iframeWrap").preventScroll();
+    $(".recommendWrap").preventScroll();
+    $(".TcmWrap").preventScroll();
+    $(".infoWrap").preventScroll();
   $(".medicalKonwledgeWrap .staticSearchB ul").preventScroll();  
   $(window).on("resize", function(){
     $(".iframeWrap").preventScroll();  

+ 12 - 5
src/js/cdssHorizontal.js

@@ -13,6 +13,7 @@ require('./../css/popup.css');
 require('./../css/staticSearch.css')
 require('./../js/staticSearch.js')
 require('./../images/empty2.png').replace(/^undefined/g, '')
+require('./../images/dn.png').replace(/^undefined/g, '')
 require('./../images/loading.gif').replace(/^undefined/g, '')
 let emptyImg = require('./../images/empty3.png').replace(/^undefined/g, '')
 require('./../images/new2.png').replace(/^undefined/g, '')
@@ -26,13 +27,15 @@ let collapseImg = require('./../images/collapse2.png').replace(/^undefined/g, ''
 let treatDisName,treatUniqueName
 let generalTreatInfo
 const { renderFollowUp } = require('./followUp.js');
+const {getTcmMr} = require('./tcmiss.js');
 
 setWidth()
 let moduleConfig={
   auxiliary:"recommendWrap",
   qc:"qcWrap",
   medical:"medicalKonwledgeWrap",
-  followup:'followUpWrap'
+    followup: 'followUpWrap',
+    tcmiss: 'tcmWarp',
 }
 let allInterface = 0
 let hasCompleteTnterface = 0
@@ -101,7 +104,11 @@ function renderPage(pageSet){
   const hasAuxiliary = hasTab("辅助信息",pageSet.sysSetInfo)
   const hasMedical = hasTab("医学知识",pageSet.sysSetInfo)
   const hasFollowUp = hasTab("随访计划",pageSet.sysSetInfo)
- 
+    const hasTcm = hasTab("中医辅助", pageSet.sysSetInfo)
+
+    if (hasTcm) {
+        getTcmMr(mrId);
+    }
   if(hasAuxiliary){
     renderModuleWrapper(hasAuxiliary.planDetails)
     let needPush = isNeedPush(hasAuxiliary.planDetails)
@@ -119,9 +126,9 @@ function renderPage(pageSet){
       renderCaseWrite()
       allInterface++
     }
-  if(hasFollowUp){
-    renderFollowUp(msg,1)
-  }
+      if (hasFollowUp) {
+          renderFollowUp(msg, 1)
+      }
   }
  }
  function renderTab(tabList){

+ 24 - 3
src/js/promise.js

@@ -101,6 +101,26 @@ const getUrlArgObject = function getQueryString(name) {
   }
 }
 
+const get = function (url, data) {
+    return new Promise((resolve, reject) => {
+        $.ajax({
+            method: 'get',
+            url: url,
+            //data: data,
+            contentType: "application/json; charset=UTF-8",
+            beforeSend: function (xmlHttp) {
+                xmlHttp.setRequestHeader("If-Modified-Since", "0");
+                xmlHttp.setRequestHeader("Cache-Control", "no-cache");
+            },
+            success: function (res) {
+                resolve({data: res});
+            },
+            error: function (error) {
+                reject(error);
+            },
+        });
+    });
+}
 const post = function (url, data) {
   return new Promise((resolve, reject) => {
     $.ajax({
@@ -128,10 +148,10 @@ const newinConf = {
   top: '0',    //窗口的 y 坐标。以像素计。
   openMode: "_blank"  //每次都是新窗口打开为_blank,打开同一窗口填写任意字符串
 }
-
+const newWindowLocationTcm = `width=800, height=600, left=${newinConf.left}, top=${newinConf.top},resizable=yes, scrollbars=yes`
 const newWindowLocation = `width=${newinConf.width}, height=${newinConf.height}, left=${newinConf.left}, top=${newinConf.top},resizable=yes, scrollbars=yes`
-const openNewWin = function (url) {
-  window.open(url, newinConf.openMode, newWindowLocation)
+const openNewWin = function (url, isTcm) {
+    window.open(url, newinConf.openMode, isTcm ? newWindowLocationTcm : newWindowLocation)
 }
 
 //判断浏览器是否为Ie8
@@ -319,6 +339,7 @@ const titleConfigH = {
 }
 module.exports = {
   config,
+    get,
   post,
   getUrlArgObject,
   imageUrlPrefix,

+ 92 - 0
src/js/tcmiss.js

@@ -0,0 +1,92 @@
+const $ = require("jquery");
+const {get, post, config, getUrlArgObject, openNewWin, titleConfig} = require('./promise.js');
+const targetUrl = 'http://114.55.109.16:81/lantone/index';
+$(function () {
+    let mrId = getUrlArgObject('mrId')
+    $(".knowledge .a-link").click(function () {
+        const code = $(this).attr("code");
+        openNewWin(targetUrl + '?page=' + code, true);
+    })
+    $("#goPush").on("click", function () {
+        openNewWin(targetUrl + '?page=bztd', true);
+    });
+});
+
+function getTcmMr(mrId, num) {
+    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)
+        } else {
+
+        }
+    })
+}
+
+//获取处方推荐
+function getTcmData(param, num) {
+    $(".recipe").show();
+    const {tcmDiag, tcmSyndrome} = param;
+    $("#jibing").text(tcmDiag + "-" + tcmSyndrome);
+    $('#bingming').text(tcmDiag);
+    $('#zhenghou').text(tcmSyndrome);
+    $("#goTreat").on("click", function () {
+        openNewWin(targetUrl + '?jibing=' + tcmDiag + "&zhengxing=" + tcmSyndrome, true);
+    });
+    //处方推荐
+    get('/lantone/private/zycftj?jibing=' + tcmDiag + "&zhengxing=" + tcmSyndrome).then((res) => {
+        //console.log(res)
+        let data = res.data.data || []
+        if (res.data.status) {
+            renderTcm(data, num)
+        } else {
+
+        }
+    })
+    //治法推荐-暂时不用
+    /*get('/lantone/private/zhongyizx?type=1&code=' + tcmDiag + '&value=' + tcmSyndrome).then((res) => {
+        console.log(res)
+        let data = res.data.data || {}
+        if (res.data.status) {
+            //renderTcm(data)
+        } else {
+
+        }
+    })*/
+}
+
+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 > 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);
+    //更多治法
+    $("#goTreat").on('click', function () {
+        openNewWin(targetUrl, true);
+    });
+}
+
+module.exports = {
+    getTcmMr
+}

+ 3 - 1
webpack.config.js

@@ -4,7 +4,7 @@ const CleanWebpackPlugin = require('clean-webpack-plugin') // 清空打包目录
 const MiniCssExtractPlugin = require('mini-css-extract-plugin');
 const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
 const webpack = require('webpack');
-const proxyHost = "http://192.168.2.241:6060";
+const proxyHost = "http://192.168.2.236:6060";
 module.exports = {
   entry: {
     index: path.resolve(__dirname, 'src/js', 'index.js'),
@@ -32,6 +32,7 @@ module.exports = {
     searchStaticList:path.resolve(__dirname, 'src/js', 'searchStaticList.js'),
     staticInfo:path.resolve(__dirname, 'src/js', 'staticInfo.js'),
     staticInfoOut:path.resolve(__dirname, 'src/js', 'staticInfoOut.js'),
+      tcmiss: path.resolve(__dirname, 'src/js', 'tcmiss.js'),
     vendor: 'lodash'// 多个页面所需的公共库文件,防止重复打包带入
   },
   output: {
@@ -474,6 +475,7 @@ module.exports = {
   devServer: {
     contentBase: "./dist", //静态文件根目录
     proxy: {
+        '/lantone': 'http://114.55.109.16:81',
       '*': proxyHost
     },
     hot: true,