Explorar el Código

Merge remote-tracking branch 'origin/dev/zhangxc1' into dev/new1

# Conflicts:
#	src/components/TreatDesc/DrugInfo/index.less
#	src/store/async-actions/treat.js
#	src/store/reducers/treat.js
zhouna hace 6 años
padre
commit
db4e7559fb

+ 4 - 4
src/components/CopyRight/index.jsx

@@ -87,7 +87,7 @@ class CopyRight extends Component {
           {hasNewVersion && <span>new</span>} &copy;<b>朗通医疗</b>
           <div className={style['disclaimer']} onClick={showDisclatmerModal}>免责声明</div>
         </div>
-        <div
+        {copyVisible && <div
           className={style["copyModal"]}
           style={copyVisible ? { display: "block" } : { display: "none" }}
         >
@@ -100,8 +100,8 @@ class CopyRight extends Component {
             </div>
             <div className={style["content"]}>{copyContent}</div>
           </div>
-        </div>
-        <div
+        </div>}
+       {disVisible && <div
           className={style["disModal"]}
           style={disVisible ? { display: "block" } : { display: "none" }}
         >
@@ -111,7 +111,7 @@ class CopyRight extends Component {
             <div className={style["content"]}>{this.disclatmerContent()}</div>
             <div className={style["btnBox"]}><span  className={style["btn"]} onClick={closeDisclatmerModal}>确定</span></div>
           </div>
-        </div>
+        </div>}
       </div>
     );
   }

+ 10 - 3
src/components/CopyRight/index.less

@@ -50,21 +50,28 @@
         position: fixed;
         width: 820px;
         left: 50%;
+        top: 20%;
         margin-left: -410px;
         background: #fff;
-        top: 65px;
-       
+        height: 60%;
+        padding: 80px 0 40px;
         img{
           float: right;
           margin: -5px 5px 0px 0px;
           cursor: pointer;
         }
         .header {
+          position: absolute;
+          width: 100%;
+          top: 0;
           font-size: 14px;
           padding: 10px 0px 10px 10px;
           border-bottom: 1px solid #EAEDF1;
         }
         .now{
+          position: absolute;
+          width: 100%;
+          top: 35px;
           font-size: 18px;
           padding: 15px 10px;
           border-bottom:1px solid #EAEDF1;
@@ -75,8 +82,8 @@
           }
         }
         .content {
+          height: 100%;
           padding: 10px;
-          max-height: 400px;
           overflow-y: auto;
         }
       }

+ 1 - 0
src/components/Treat/DrugTreat/index.less

@@ -2,6 +2,7 @@
     background: #EAF7FA;
     height: 36px;
     line-height: 36px;
+    font-weight: bold;
 }
 .drug-icon {
     width: 16px;

+ 1 - 0
src/components/Treat/GeneralTreat/index.less

@@ -16,6 +16,7 @@
     top: 10px;
     height: 36px;
     line-height: 36px;
+    font-weight: bold;
 }
 .general-icon {
     width: 16px;

+ 6 - 0
src/components/TreatDesc/DrugInfo/index.jsx

@@ -17,6 +17,12 @@ class DrugInfo extends Component {
                         return <div className={style['drug-desc-item']}><span className={style['drug-desc-title']}>{item.title}</span> <span className={style['drug-desc-content']} dangerouslySetInnerHTML ={{__html: item.content}}></span> </div>
                     })}
                 </div> }
+                { !drugInfo || (drugInfo && drugInfo.drugDesc.length === 0) && <div className={style['drug-desc-wrapper']}>
+                    <div>
+                        该药品暂无说明
+                    </div>
+                    
+                </div> }
 
         </div>)
     }

+ 8 - 6
src/components/TreatDesc/DrugInfo/index.less

@@ -1,21 +1,23 @@
 .drug-info-wrapper {
     position: fixed;
-    width: 850px;
-    height: 680px;
+    width: 950px;
+    height: 70%;
     left: 50%;
-    top: 50%;
-    margin-left: -425px;
-    margin-top: -340px;
+    top: 15%;
+    margin-left: -475px;
     background: #fff;
     z-index: 303;
+    padding: 40px 0 60px;
     
 }
 .drug-desc-wrapper {
-    height: 640px;
+    height: 100%;
     overflow-y: auto;
     padding: 0 40px;
 }
 .drug-title {
+    position: absolute;
+    top: 0;
     width: 100%;
     height: 40px;
     line-height: 40px;

+ 4 - 1
src/containers/Treat.js

@@ -1,7 +1,7 @@
 import React from 'react';
 import { connect } from 'react-redux';
 import Treat from '@components/Treat';
-import { SELECT_DRUG, SET_OTHER_DRUG, SET_DRUG_INFO, HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO } from '@store/types/treat.js';
+import { SELECT_DRUG, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO } from '@store/types/treat.js';
 import { getInstroduce, getRecommendBasic } from '@store/async-actions/treat';
 import { ADD_SCHEME } from '@store/types/pushMessage.js'
 import { showDrugInfo } from '../store/actions/treat';
@@ -57,6 +57,9 @@ function mapDispatchToProps(dispatch) {
             })
         },
         hideDrugInfo: () =>{
+            dispatch({
+                type: CLEAR_DRUG_INFO
+            })
             dispatch({
                 type: HIDE_DRUG_INFO
             })

+ 0 - 1
src/containers/TreatDrug.js

@@ -4,7 +4,6 @@ import TreatDrug from '@components/TreatDrug';
 // import { ADD_DRUG } from '@stroe/types/treatDrug.js';
 
 function mapStateToProps(state){
-    console.log('state1111',state.treatDrug)
     return {
         treatDrugList: state.treatDrug
     }

+ 6 - 0
src/store/actions/treat.js

@@ -59,6 +59,12 @@ export const setDrugInfo = (state, action) => {
     return res
 }
 
+export const clearDrugInfo = (state, action) => {
+    const res = JSON.parse(JSON.stringify(state));
+    res.drugInfo.drugDesc = [];
+    return res
+}
+
 export const setRecommendBasic = (state, action) => {
     // const res = Object.assign({}, state)
     const res = JSON.parse(JSON.stringify(state));

+ 4 - 4
src/store/async-actions/treat.js

@@ -1,6 +1,6 @@
 import { json } from "@utils/ajax";
 import { SET_TREAT } from '@store/types/diagnosticList';
-import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR} from '@store/types/diagnosticList';
+import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR} from '@store/types/diagnosticList'; 
 import { SET_DRUG_INFO, SET_TREATMENT, SET_TREAT_INFO, SET_RECOMMEND_BASIC } from '@store/types/treat';
 import {storageLocal,getEMRParams} from '@utils/tools';
 import { isAddMainSuit } from '@store/async-actions/diagnosticList';
@@ -27,7 +27,7 @@ export const addDiagnostic = (item) => {
                     } else {
                         diag = diag + ',' + diagnosticList[i].name;
                     }
-
+                    
                 }
             }
             if (item.type === 1) {
@@ -47,7 +47,7 @@ export const addDiagnostic = (item) => {
                 "symptom": emrData.current + emrData.main,
                 "vital": emrData.vital
             };
-
+            
             json(url, params).then((data) =>{
                 if (data.data.data) {
                     item.treat = data.data.data.treat
@@ -137,7 +137,7 @@ export const getTreatResult = (item) =>{
                         surgeryTreat: treat.surgeryTreatment,
                     })
                 }
-                
+
         }).catch((e) =>{
             console.log(e)
         })

+ 4 - 2
src/store/reducers/treat.js

@@ -1,5 +1,5 @@
-import { SELECT_DRUG, SET_TREAT_INFO, SET_OTHER_DRUG, SET_DRUG_INFO, SHOW_TREAT, HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, SET_GENERAL_TREAT, SET_TREATMENT, SET_SURGERY_TREAT, SET_RECOMMEND_BASIC } from '../types/treat'
-import { selectDrug, setTreatInfo, setOtherDrug, setDrugInfo, showTreat, hideTreat, clearTreat, showDrugInfo, hideDrugInfo, setTreatment, setGeneralTreat, setSurgeryTreat, setRecommendBasic } from '../actions/treat'
+import { SELECT_DRUG, SET_TREAT_INFO, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,SHOW_TREAT, HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, SET_GENERAL_TREAT, SET_TREATMENT, SET_SURGERY_TREAT, SET_RECOMMEND_BASIC } from '../types/treat'
+import { selectDrug, setTreatInfo, setOtherDrug, setDrugInfo, clearDrugInfo, showTreat, hideTreat, clearTreat, showDrugInfo, hideDrugInfo, setTreatment, setGeneralTreat, setSurgeryTreat, setRecommendBasic } from '../actions/treat'
 const initState = {
     show: false, //治疗方案显示隐藏
     showDrugInfo: false, //药品信息显示隐藏
@@ -193,6 +193,8 @@ export default function(state=initState, action){
             return hideDrugInfo(state, action);
         case SET_TREAT_INFO:
             return setTreatInfo(state, action);
+        case CLEAR_DRUG_INFO:
+            return clearDrugInfo(state, action);
         default:
             return state
     }

+ 1 - 0
src/store/types/treat.js

@@ -1,6 +1,7 @@
 export const SELECT_DRUG = 'SELECT_DRUG';   //选则药品
 export const SET_OTHER_DRUG = 'SET_OTHER_DRUG'; //设置其他推荐
 export const SET_DRUG_INFO = 'SET_DRUG_INFO'; //设置药品说明
+export const CLEAR_DRUG_INFO = 'CLEAR_DRUG_INFO'; //清除药品说明
 export const SHOW_TREAT = 'SHOW_TREAT';
 export const HIDE_TREAT = 'HIDE_TREAT';
 export const CLEAR_TREAT = 'CLEAR_TREAT'; //清除治疗方案内容