Jelajahi Sumber

Merge branch 'optimize' of http://192.168.2.236:10080/zhouna/newICSS into optimize

Luolei 6 tahun lalu
induk
melakukan
4feb237ce9

+ 5 - 4
src/common/components/ComplexModal/index.less

@@ -51,16 +51,17 @@
     position: absolute;
     top:0;
     width: 100%;
-  }
-  img{
-    vertical-align: text-top;
-  }
+    img{
+      vertical-align: text-top;
+    }
+  }  
   .closeIcon{
     cursor: pointer;
     position: absolute;
     top: 14px;
     right: 10px;
     z-index: 100;
+    vertical-align: text-top;
   }
 }
 

+ 7 - 9
src/components/CheckBody/index.jsx

@@ -26,8 +26,13 @@ class CheckBody extends Component{
     this.showHide = this.showHide.bind(this);
     //this.handleInput = this.handleInput.bind(this);
   }
-  componentWillReceiveProps(nextProps){
-    this.setState({boxLeft:nextProps.boxLeft})
+  componentWillReceiveProps(next){
+    if((this.props.defaultShowAll&&!next.defaultShowAll)||(!this.props.defaultShowAll&&next.defaultShowAll)||(!this.props.isEmpty&&next.isEmpty)){
+      this.setState({
+        showAll:next.defaultShowAll
+      })
+    }
+    this.setState({boxLeft:next.boxLeft})
   }
   getLabels(){
     const {data,showArr,saveText,selecteds,importLabel} = this.props;
@@ -105,13 +110,6 @@ class CheckBody extends Component{
       showAll:!this.state.showAll
     });
   }
-  componentWillUpdate(next){
-    if((this.props.defaultShowAll&&!next.defaultShowAll)||(!this.props.defaultShowAll&&next.defaultShowAll)||(!this.props.isEmpty&&next.isEmpty)){
-      this.setState({
-        showAll:next.defaultShowAll
-      })
-    }
-  }
   render(){
     const {searchData,totalHide,data,boxLeft,boxTop,saveText} = this.props;
 

+ 5 - 2
src/components/NumberDrop/index.jsx

@@ -256,8 +256,11 @@ class NumberDrop extends Component{
     const spanWidth = window.getComputedStyle(this.$span.current).width;
     this.$span.current.style.minWidth=spanWidth;
     //保存输入框dom以便聚焦
-    const {saveDoms} = this.props;
-    saveDoms&&saveDoms(this.$span);
+    const that = this;
+    setTimeout(function(){        //多个其他史/现病史bug修改
+      const {saveDoms} = that.props;
+      saveDoms&&saveDoms(that.$span);
+    })
   }
   render(){
     const {prefix,suffix,show,value,handleHide,allClick} = this.props;

+ 1 - 0
src/components/PushItems/DetailsModal/index.less

@@ -17,6 +17,7 @@
     background: #fff;
     overflow: hidden;
     z-index: 10;
+    word-break: break-all;
 }
 
 .details-content-name {

+ 5 - 5
src/components/Treat/AdverseReactions/index.jsx

@@ -15,7 +15,7 @@ class AdverseReactions extends Component {
         this.setDrugInfo = this.setDrugInfo.bind(this);
       
     }
-    changeReact(it, index) {
+    changeReact(it, index, item) {
         this.props.changeReact(it, index);
     }
     handleMouseEnterDrug(index, item) {
@@ -55,7 +55,7 @@ class AdverseReactions extends Component {
                 {/* {console.log('adversReactionList', adversReactionList)} */}
 
                 {adversReactionList.map((item, index) => {
-                    return (<div className={style['adverse-reactions-item']} key={item.conceptId}>
+                    return (<div className={style['adverse-reactions-item']} key={item.conceptId+item.name}>
                     <span className={style['last-treat-name-box']}>   
                         <span   
                                 className={style['last-treat-big-name-box']} 
@@ -74,9 +74,9 @@ class AdverseReactions extends Component {
                         
                     </span>
                         {item.details.map((it, idx) => {
-                            return <span className={style['adverse-reactions-name']} key={item.id + it.name}>
-                                <input type="checkbox" checked={it.select} id={item.id + it.name} onChange={this.changeReact.bind(this, it, index)}/>
-                                <label for={item.id + it.name}> {it.name} </label>
+                            return <span className={style['adverse-reactions-name']} key={item.conceptId + item.name + it.name}>
+                                <input type="checkbox" checked={it.select} id={item.conceptId +item.name + it.name} onChange={this.changeReact.bind(this, it, index)}/>
+                                <label for={item.conceptId +item.name + it.name}> {it.name} </label>
                                 {it.value==1 && <span className={style['adverse-reactions-recommend']}>(智能推荐)</span>}
                             </span>
                         })}

+ 1 - 0
src/components/TreatDesc/DrugInfo/index.less

@@ -10,6 +10,7 @@
     z-index: 303;
     padding: 40px 0 60px;
     box-shadow: 0px 0px 5px -2px #7d7c7c;
+    word-break: break-all;
 }
 .drug-desc-wrapper {
     height: 100%;

+ 8 - 7
src/containers/DiagnosticItem.js

@@ -19,14 +19,15 @@ function mapStateToProps(state) {
 function mapDispatchToProps(dispatch) {
     return{
         addDiagnostic: (item) => {
+            
+            dispatch({
+                type: ADD_DIAGNOSTIC,
+                item: item
+            });
+            dispatch({
+                type: GET_DIAGNOSTIC_STR
+            });
             dispatch(addDiagnostic(item))
-            // dispatch({
-            //     type: ADD_DIAGNOSTIC,
-            //     item: item
-            // });
-            // dispatch({
-            //     type: GET_DIAGNOSTIC_STR
-            // });
         },
         showSearch:()=>{
             dispatch({

+ 11 - 0
src/store/actions/diagnosticList.js

@@ -111,4 +111,15 @@ export const hideHistoryCase = (state, action) => {
     const res = Object.assign({}, state);
     res.showHistoryCase = false
     return res;
+}
+
+export const addTreat = (state, action) => {
+    const res = JSON.parse(JSON.stringify(state))
+    const diagnosticList = res.diagnosticList
+    for(let i = 0; i< diagnosticList.length; i++) {
+        if(diagnosticList[i].conceptId == action.item.conceptId && diagnosticList[i].name == action.item.name) {
+            diagnosticList[i] = action.item
+        }
+    }
+    return res;
 }

+ 10 - 11
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,SET_TREAT,SHOW_LOADING} from '@store/types/diagnosticList';
+import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR,SET_TREAT,SHOW_LOADING,ADD_TREAT} from '@store/types/diagnosticList';
 import { SET_COMMONTREATMENT } from '@store/types/pushMessage'
 import { SET_DRUG_INFO, SET_TREATMENT, SET_TREAT_INFO, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST, IS_FIRST_MAIN_DIAG, SET_ADVERSE_REACTIONS, SET_ALL_ADVERSE_REACTIONS, SET_FOLLOW_UP, DEL_FOLLOW_UP, SET_ALL_FOLLOW_UP } from '@store/types/treat';
 import {storageLocal,getEMRParams} from '@utils/tools';
@@ -87,23 +87,22 @@ export const addDiagnostic = (item) => {
 
 //判断是否存在治疗方案
 function hasTreatment(dispatch, state,item,url, params) {
+    const itemTreat = JSON.parse(JSON.stringify(item))
     json(url, params).then((data) =>{
         if (data.data.data) {
-            item.treat = data.data.data
+            itemTreat.treat = data.data.data
             dispatch({
-                type: ADD_DIAGNOSTIC,
-                item: item
+                type: ADD_TREAT,
+                item: itemTreat
             })
         } else {
             item.treat = null
             dispatch({
-                type: ADD_DIAGNOSTIC,
-                item: item
+                type: ADD_TREAT,
+                item: itemTreat
             })
         }
-        dispatch({
-            type: GET_DIAGNOSTIC_STR
-        });
+        
         dispatch(isAddMainSuit())
 
     }).catch((e) =>{
@@ -219,7 +218,7 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
                              if(item.conceptId == allAdversReactionList[i].conceptId) {    //判断是否存过不良反应
                                  for (let j = 0; j < adverseReactions.length; j++) { //判断不良反应是否有相同的不良反应,如果有,替换
                                      for(let z = 0; z < allAdversReactionList[i].adversReactionList.length; z++) {
-                                         if(adverseReactions[j].conceptId == allAdversReactionList[i].adversReactionList[z].conceptId) {
+                                         if(adverseReactions[j].conceptId == allAdversReactionList[i].adversReactionList[z].conceptId && adverseReactions[j].name == allAdversReactionList[i].adversReactionList[z].name) {
                                              for(let x = 0; x < allAdversReactionList[i].adversReactionList[z].details.length; x++) {
                                                  for(let y = 0; y < adverseReactions[j].details.length; y++) {//判断每一项是否选择过
                                                      if(allAdversReactionList[i].adversReactionList[z].details[x].name == adverseReactions[j].details[y].name && allAdversReactionList[i].adversReactionList[z].details[x].select) {
@@ -393,7 +392,7 @@ export const commonTreatAddToAdvice = () => {
             })
             dispatch({
                 type: SET_COMMONTREATMENT,
-                commontreatment: state.treat.treatItem.treat.commonTreatment.text
+                commontreatment: state.treat.treatItem.treat.commonTreatment.content
             })
             if(followUp) {
                 dispatch({

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

@@ -1,8 +1,8 @@
 import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, SET_TREAT, GET_DIAGNOSTIC_STR, SET_DIAG_TO_MAINSUIT, 
             GET_IS_FIRST,CLEAR_ALL_DIAG, SET_CLICK_DIAG ,CLEAR_DIAGNOSE, SET_CHRONIC_MAG_ITEM, SHOW_REFER_RECORD, HIDE_REFER_RECORD, 
-            SHOW_HISTORY_CASE,  HIDE_HISTORY_CASE,SHOW_LOADING} from '../types/diagnosticList';
+            SHOW_HISTORY_CASE,  HIDE_HISTORY_CASE,SHOW_LOADING, ADD_TREAT} from '../types/diagnosticList';
 import { addDiagnostic,  delDiagnostic, upDiagnostic, downDiagnostic, setTreat, getDiagnosticStr, setDiagToMainSuit, 
-        getIsFirst,clearAllDiag, setClickDiag, setChronicMagItem, showReferRecord, hideReferRecord, showHistoryCase, hideHistoryCase} from '../actions/diagnosticList';
+        getIsFirst,clearAllDiag, setClickDiag, setChronicMagItem, showReferRecord, hideReferRecord, showHistoryCase, hideHistoryCase, addTreat} from '../actions/diagnosticList';
 
 const initState = {
     isFirst: true,
@@ -71,6 +71,8 @@ export default function (state=initState, action) {
             return showHistoryCase(state, action);
         case HIDE_HISTORY_CASE: 
         return hideHistoryCase(state, action);
+        case ADD_TREAT:
+                return addTreat(state, action);
         case CLEAR_DIAGNOSE: 
             res.mainSuitStr = "";
             return res;

+ 1 - 1
src/store/reducers/treat.js

@@ -2,7 +2,7 @@ import { SELECT_DRUG, SET_TREAT_INFO, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_
         HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, SET_GENERAL_TREAT, SET_TREATMENT, 
         SET_SURGERY_TREAT, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST,IS_FIRST_MAIN_DIAG,CLEAR_FIRST_MAIN_DIAG ,
         SET_ADVERSE_REACTIONS, SET_ALL_ADVERSE_REACTIONS,CHANGE_REACT, DEL_REACT, SET_FOLLOW_UP, 
-        DEL_FOLLOW_UP, SET_ALL_FOLLOW_UP, CLEAR_ALL_TREAT } from '../types/treat'
+        DEL_FOLLOW_UP, SET_ALL_FOLLOW_UP, CLEAR_ALL_TREAT} from '../types/treat'
 import { selectDrug, setTreatInfo, setOtherDrug, setDrugInfo, clearDrugInfo, showTreat, hideTreat, 
         clearTreat, showDrugInfo, hideDrugInfo, setTreatment, setGeneralTreat, setSurgeryTreat, 
         setRecommendBasic, setDrugInfoList, isFirstMainDiag, clearFirstMainDiag, setAdverseReactions, 

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

@@ -16,5 +16,6 @@ export const HIDE_REFER_RECORD = 'HIDE_REFER_RECORD';  //隐藏引用历史病
 export const SHOW_HISTORY_CASE = 'SHOW_HISTORY_CASE';  //显示历史病历列表弹窗
 export const HIDE_HISTORY_CASE = 'HIDE_HISTORY_CASE' ; //隐藏历史病历列表弹窗
 export const SHOW_LOADING = 'SHOW_LOADING';    //显示loading
+export const ADD_TREAT = Symbol('ADD_TREAT') ;   //设置治疗