瀏覽代碼

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

liucf 6 年之前
父節點
當前提交
4401eb7435

+ 12 - 2
src/components/AssessResult/ScaleItem/index.jsx

@@ -75,12 +75,22 @@ class ScaleItem extends Component {
       radioVal:Object.assign({},radioVal,{[parent.conceptId]:item.detailName})
     })
   }
+  handleReg(e){   //只能输入数字和特殊符号
+    const key = e.key;
+    if(key!='Backspace'&&((/[^\d|.\/%*~]/.test(key)))){
+      e.preventDefault();
+    }
+  }
   handleInputformula(id,calcuContent,i,e) {
     const {calcuValues} = this.state;
     let obj = deepClone(calcuValues);
     let values = (obj&&obj[id])||deepClone(calcuContent);
-    values[i].value = e.target.value;
+    const txt = e.target.value;
+    values[i].value = txt.replace(/[\u4e00-\u9fa5]|[^\d|.\/%*~]/g,'');       //处理中文输入法的情况
     obj[id] = values;
+    if(/[\u4e00-\u9fa5]|[^\d|.\/%*~]/g.test(txt)){
+      e.target.value = txt.replace(/[\u4e00-\u9fa5]|[^\d|.\/%*~]/g,'');
+    }
     this.setState({
       isCalculated:false,
       calcuValues:obj
@@ -218,7 +228,7 @@ class ScaleItem extends Component {
                                 <span>{'请输入'+item1.name+':'}</span>
                               </td>
                               <td>
-                                {disabled?item1.value:<input type="text" placeholder="请输入"  value={item1.value} onInput={(e)=>this.handleInputformula(item.conceptId,details,idd,e)}/>}
+                                {disabled?item1.value:<input type="text" placeholder="请输入"  value={item1.value} onKeyDown={this.handleReg.bind(this)} onInput={(e)=>this.handleInputformula(item.conceptId,details,idd,e)}/>}
                               </td>
                               <td>
                                 <span>{item1.uint}</span>

+ 1 - 1
src/components/AssistCheck/index.jsx

@@ -35,7 +35,7 @@ import { host, prefix } from '@utils/config.js';
 // };
 // let numFlg = 0;
 class AssistCheck extends React.Component {
-    constructor(props){
+  constructor(props){
         super(props);
         this.state={
           val: '',

+ 8 - 12
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,23 +110,14 @@ 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;
 
-    return  <div className={style['container']}>
-      <ItemBox title='查体' handleClick={this.handleClick}>
+    return <ItemBox title='查体' handleClick={this.handleClick}>
         {this.getLabels()}
         {/*{showMoreBtn?more:''}*/}
         {searchData && searchData.length>0?<SearchDrop data={searchData} show={!totalHide} left={boxLeft} top={boxTop} onSelect={this.handleSearchSelect}></SearchDrop>:''}
       </ItemBox>
-    </div>
   }
 }
 

+ 1 - 1
src/components/ChronicInfo/index.jsx

@@ -221,7 +221,7 @@ class ChronicInfo extends React.Component{
     this.closeFormula(it);
     chronicMagItem&&this.handleAddAssessItem(v,pIndex,i);
   }
-  handleReg(e){   //只能输入数字
+  handleReg(e){   //只能输入数字和特殊符号
     //const hasDot = e.target.value.indexOf('.')!=-1;
     const key = e.key;
     if(key!='Backspace'&&((/[^\d|.\/%*~]/.test(key)))){

+ 0 - 2
src/components/Diagnosis/index.jsx

@@ -42,8 +42,6 @@ class Diagnosis extends Component {
   }
 
   render() {
-
-
     return (<div id="diagnosisResult">
       <ItemBox id="diagnosis" title='诊断' boxHeight='auto' titleTop='22px' marginTop='9px' backgroundColor='#EAF7FD'>
         <DiagnosticList></DiagnosticList>

+ 3 - 1
src/components/EMRContainer/index.jsx

@@ -41,7 +41,9 @@ class EMRContainer extends Component {
                 <MainSuit></MainSuit>
                 <CurrentIll></CurrentIll>
                 <OtherHistory></OtherHistory>
-                <CheckBody></CheckBody>
+                <div>
+                  <CheckBody></CheckBody>
+                </div>
                 <Inspect></Inspect>
                 <AssistCheck></AssistCheck>
                 <Diagnosis></Diagnosis>

+ 8 - 5
src/components/MedicalInfo/index.jsx

@@ -10,7 +10,8 @@ class MedicalInfo extends Component {
         this.$cont = React.createRef();
         this.state={
           val:'',
-          hasSearch: false
+          hasSearch: false,
+          msg:''
         };
         this.search = this.search.bind(this);
         this.handleChange = this.handleChange.bind(this);
@@ -31,7 +32,8 @@ class MedicalInfo extends Component {
     search(){
       if(this.state.hasSearch === false) {
         this.setState({
-          hasSearch: true
+          hasSearch: true,
+          msg:'暂无搜索结果!'
         })
       }
       const {handleChangeValue} = this.props;
@@ -53,7 +55,8 @@ class MedicalInfo extends Component {
       this.$inp.current.value = '';
       this.setState({
         val:'',
-        hasSearch: false
+        hasSearch: false,
+        msg:''
       });
       clearResult&&clearResult();
   }
@@ -74,7 +77,7 @@ class MedicalInfo extends Component {
   }
     render() {
         const {searchResult} = this.props;
-        const {val, hasSearch} = this.state;
+        const {val, hasSearch,msg} = this.state;
         return (
             <div className={style['search-cont']} ref={this.$cont}>
               <div className={style['search-box']}>
@@ -90,7 +93,7 @@ class MedicalInfo extends Component {
                     <ul>
                       {this.getSearchList()}
                     </ul>
-              </div>:<p className={style['no-data']}>{hasSearch?'搜索中...':'暂无搜索结果!'}</p>}
+              </div>:<p className={style['no-data']}>{hasSearch?'搜索中...':msg}</p>}
              </div>
 
 

+ 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 - 1
src/components/PreviewBody/index.jsx

@@ -125,7 +125,7 @@ class PreviewBody extends Component {
               }
               {dataJson.advice.commontreatment && dataJson.advice.commontreatment.length > 0 && <p  className={style.pushMessageTitle}><span>一般治疗</span></p>}
               {
-                dataJson.advice.commontreatment && <div className={style.pushMessageDes}>{dataJson.advice.commontreatment}</div>
+                dataJson.advice.commontreatment && <div dangerouslySetInnerHTML={{__html: dataJson.advice.commontreatment}} className={style.pushMessageDes}></div>
               }
               {dataJson.advice.followUp && dataJson.advice.followUp.length > 0 && <p className={style.pushMessageTitle}><span>回访时间:<span className={style['bbtm']}>{dataJson.advice.followUp}</span> 后回访,不适随诊</span></p>}
               {dataJson.advice.scheme && dataJson.advice.scheme.length > 0 && <p className={style.pushMessageTitle}><span>治疗方案</span></p>}

+ 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 {

+ 8 - 5
src/components/ScaleSearch/index.jsx

@@ -10,7 +10,8 @@ class ScaleSearch extends Component {
     this.$cont = React.createRef();
     this.state={
       val:'',
-      hasSearch: false
+      hasSearch: false,
+      msg:''
     };
     this.search = this.search.bind(this);
     this.handleChange = this.handleChange.bind(this);
@@ -46,7 +47,8 @@ class ScaleSearch extends Component {
   search(){
     if(this.state.hasSearch === false){
       this.setState({
-        hasSearch: true
+        hasSearch: true,
+        msg:'暂无搜索结果!'
       })
     }
     const {handleChangeValue} = this.props;
@@ -68,7 +70,8 @@ class ScaleSearch extends Component {
     this.$inp.current.value = '';
     this.setState({
       val:'',
-      hasSearch: false
+      hasSearch: false,
+      msg:''
     });
     clearResult&&clearResult();
   }
@@ -89,7 +92,7 @@ class ScaleSearch extends Component {
   }
   render() {
     const {searchResult} = this.props;
-    const {val, hasSearch} = this.state;
+    const {val, hasSearch,msg} = this.state;
     return (
         <div className={style['search-cont']} ref={this.$cont}>
           <div className={style['search-box']}>
@@ -105,7 +108,7 @@ class ScaleSearch extends Component {
             <ul>
               {this.getSearchList()}
             </ul>
-          </div>:<p className={style['no-data']}>{hasSearch?'搜索中...':'暂无搜索结果!'}</p>}
+          </div>:<p className={style['no-data']}>{hasSearch?'搜索中...':msg}</p>}
         </div>
     )
 

+ 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;
 }

+ 3 - 1
src/store/async-actions/pushMessage.js

@@ -7,6 +7,7 @@ import {SET_IMPORT_CHECKBODY_LABEL,PRESET} from "../types/checkBody";
 import dataLis from '@components/EmergencyProcedure/emergency';
 import { Notify} from '@commonComp';
 import {pregetCheckbodyData} from '@store/async-actions/fetchModules';
+import {tabChange} from '@store/actions/tabTemplate';
 const api={
   push:'/push/pushInner',
   getTableList:'/scale/getList', //获取量表列表
@@ -137,7 +138,8 @@ export const getConceptDetail = (item) => {
 
         json(api.getConceptDetail, params).then((res) => {
             if(res.data.code == '0'&& res.data.data.details && res.data.data.details.length > 0) {
-                if(item.position == '1') {  //右侧提示信息
+              dispatch(tabChange(0));     //tab跳回推送
+              if(item.position == '1') {  //右侧提示信息
                     dispatch({
                         type: SET_CLICK_DIAG,
                         clickDiag: item

+ 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/assessResult.js

@@ -97,8 +97,10 @@ export default (state=init,action)=>{
           });
           return subInx!=-1;
         });
-        const trueInx = res.wholeIndexs[inx].findIndex((i)=>i==subInx);
-        res.wholeIndexs[inx].splice(trueInx,1);
+        if(inx!=-1){
+          const trueInx = inx!=-1&&res.wholeIndexs[inx].findIndex((i)=>i==subInx);
+          res.wholeIndexs[inx].splice(trueInx,1);
+        }
       }else{
         res.addedScaleIds.push(action.id);
       }

+ 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') ;   //设置治疗
 
 

+ 1 - 1
src/utils/tools.js

@@ -241,7 +241,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
         store.dispatch({
             type: SET_TIPS,
             tips: {}
-          })
+        })
         store.dispatch({
             type: CLEAR_ALL_DIAG,
             data:[],