Przeglądaj źródła

Merge branch 'dev/new1' into dev/otherHis

zhouna 6 lat temu
rodzic
commit
589837405b

+ 3 - 2
src/common/components/EditableSpan/index.jsx

@@ -224,8 +224,9 @@ class EditableSpan extends Component{
         }*/
         let data = innerVal.trim();
         //判断是否为空、中英文:, 。、;,且不是第一位
-        let pattern = new RegExp(/^\,?$|^\,?$|^\.?$|^\。?$|^\、?$|^\;?$|^\;?$|^\:?$|^\:?$|\s/);
-        if(index!==0 && pattern.test(data)){
+        // let pattern = new RegExp(/^\,?$|^\,?$|^\.?$|^\。?$|^\、?$|^\;?$|^\;?$|^\:?$|^\:?$|\s/);
+        // if(index!==0 && pattern.test(data)){
+        if(index!==0 && !config.punctuationReg.test(data)){
           // let preObj = $(this.$span.current).prev();
           let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
           handleKeydown&&handleKeydown({boxMark,i:index,text:data});

+ 8 - 10
src/components/Treat/index.jsx

@@ -15,7 +15,7 @@ class Treat extends Component {
     constructor(props){
         super(props);
         this.state = {
-          zIndex:301
+          zIndex:301,
         }
         this.hideTreat = this.hideTreat.bind(this);
         this.handlePrescription = this.handlePrescription.bind(this);
@@ -45,20 +45,18 @@ class Treat extends Component {
         const {  showDrugInfo } = this.props;
         showDrugInfo && showDrugInfo();
     }
-    setTreatBox(idx){
-      this.setState({
-        zIndex:idx == 300?300 : 500
-      })
+    setTreatBox(){
+      $('#treatWrapper').css({'z-index': 302});
+      $('#drugWrapper').css({'z-index': 301});
     }
     render(){
-        const { generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore} = this.props;
-        const { setDrugInfoMore } = this.props
-        const { zIndex } = this.state
+        const {setDrugInfoMore,treatIndex,treatIndexSet, generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore} = this.props;
+        const { zIndex,show } = this.state
         return(
             <div   className={style['treat-wrapper']}>
                 <div className={style['treat-mask']} onClick={this.hideTreat}>
                 </div>
-                <div id="treatWrapper" className={style['treat-box']}  onselectstart="return false" style={{zIndex:zIndex}}>
+                <div id="treatWrapper" className={style['treat-box']}  onselectstart="return false">
                     <img className={style.close} onClick={this.hideTreat} src={close}/>
                     <div onMouseDown={this.setTreatBox} id="dragTreatTitle" className={style['treat-title']}>治疗方案 ({treatItem.name})</div>
 
@@ -88,7 +86,7 @@ class Treat extends Component {
                     </TreatDesc>}
                 </div>
                 
-                {showDrug && drugInfo && <DrugInfo setTreatBox={this.setTreatBox} drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
+                {showDrug && drugInfo && <DrugInfo setTreatBox={this.setTreatBox} treatIndexSet={treatIndexSet} drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
                 {/* 查询多个药品说明书 (添加数据查看药品说明书用)*/}
                 {/* {showDrug && <DrugInfo drugInfoList = {drugInfoList} hideDrugInfoMore = {hideDrugInfoMore}></DrugInfo>} */}
             </div>

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

@@ -43,7 +43,7 @@
     z-index: 301;
     padding-top: 40px;
     padding-bottom: 80px;
-    box-shadow: 2px 0px 5px -2px #ccc;
+    box-shadow: 0px 0px 5px -2px #7d7c7c;
 }
 .treat-title {
     width: 100%;

+ 5 - 8
src/components/TreatDesc/DrugInfo/index.jsx

@@ -10,7 +10,7 @@ class DrugInfo extends Component {
         super(props);
         this.state = {
             currentIndex: 0,
-            zIndex:301
+            zIndex:302
         }
         this.setDragBox = this.setDragBox.bind(this)
     }
@@ -47,16 +47,13 @@ class DrugInfo extends Component {
         }
     }
     setDragBox(){
-      const {zIndex,setTreatBox} = this.props
-      setTreatBox(300)
-      this.setState({
-        zIndex:zIndex+10
-      })
+      $('#treatWrapper').css({'z-index': 301});
+      $('#drugWrapper').css({'z-index': 302});
     }
     render() {
         const { drugInfo, hideDrugInfo, drugInfoList,hideDrugInfoMore } = this.props
-        const { currentIndex,zIndex } = this.state
-        return (<div className={style['drug-info-wrapper']} id="drugWrapper" style={{zIndex:zIndex}}>
+        const { currentIndex } = this.state
+        return (<div className={style['drug-info-wrapper']} id="drugWrapper">
                 <img src={close} onClick={hideDrugInfo} className={style['close-drug-desc']}/>
                 <h3 onMouseDown={this.setDragBox} id="drugTitle" className={style['drug-title']}>{drugInfo.title}说明书  </h3>
                 { drugInfo && drugInfo.drugDesc.length > 0 && <div className={style['drug-desc-wrapper']} id='drugDesc' onScroll={this.handleScrollModal.bind(this,  drugInfo.drugDesc)}>

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

@@ -9,7 +9,7 @@
     background: #fff;
     z-index: 303;
     padding: 40px 0 60px;
-    box-shadow: 2px 0px 5px -2px #ccc;
+    box-shadow: 0px 0px 5px -2px #7d7c7c;
 }
 .drug-desc-wrapper {
     height: 100%;

+ 2 - 1
src/components/TreatDesc/index.jsx

@@ -29,7 +29,7 @@ class TreatDesc extends Component {
         const drugNameWidth = parseInt($('#'+item.medicitionName)[0].offsetWidth)
         
         const imgLeft = drugNameWidth/2-10
-        console.log('imgLeft', imgLeft)
+        // console.log('imgLeft', imgLeft)
         $('#'+item.medicitionName).find('img').css('left', imgLeft)
        
         this.setState({
@@ -59,6 +59,7 @@ class TreatDesc extends Component {
         $('#treatDescBox').css({'display': 'none'});
         $('#treatDescBox').animate({'display': 'none'}, 500);
         $('#treatWrapper').animate({'margin-left': '-340px','left':'50%'}, 500);
+        
     }
 
     render(){

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

@@ -45,7 +45,7 @@
     top: 0;
     background: #fff;
     padding: 60px 20px 80px;
-    box-shadow: 2px 0px 5px -2px #ccc;
+    box-shadow: 2px 0px 5px -2px #7d7c7c;
 }
 .drug-name-box {
     display: inline-block;

+ 1 - 4
src/store/actions/mainSuit.js

@@ -384,22 +384,19 @@ export const insertSearch = (state,action)=>{
     if(index < 1){//前
       if(data[focusIndex].value==searchStr){//为空标签则替换
         res.data.splice(focusIndex,1,nText);
-        res.saveText.splice(focusIndex,1,searchData);
       }else{
         res.data.splice(focusIndex,0,nText);
-        res.saveText.splice(focusIndex,0,searchData);
         res.data[focusIndex+1].value = value;
         res.saveText[focusIndex+1] = value;
       }  
     }else{
       res.data.splice(focusIndex+1,0,nText);
-      res.saveText.splice(focusIndex+1,0,searchData);
       res.data[focusIndex].value = value;
     }
     span.current.innerText?(span.current.innerText = value):(span.current.innerHTML=value);
     res.mainIds.push(id);
   }
-  // console.log(456,res,action);
+  res.saveText = fullfillText(res.data).saveText;
   res.update=Math.random();
   return res;
 }

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

@@ -15,4 +15,3 @@ export const SET_TREAT_INFO = 'SET_TREAT_INFO' //设置治疗方案信息(name
 export const SET_DRUG_INFO_LIST = 'SET_DRUG_INFO_LIST' //查询多个药品说明书(添加数据时查看药品说明用)
 export const IS_FIRST_MAIN_DIAG = 'IS_FIRST_MAIN_DIAG' //是否为主诊断第一次开单
 export const CLEAR_FIRST_MAIN_DIAG = 'CLEAR_FIRST_MAIN_DIAG' //回读清空是否为主诊断第一次开单
-

+ 8 - 4
src/utils/tools.js

@@ -590,6 +590,9 @@ function formatContinueDots(data){
     if(i==0||(it.name&&(it.name.match(config.punctuationReg))||(data[i-1].name&&data[i-1].name.match(config.punctuationReg)))){
       return it;
     }
+    if(!it.name){       //主诉现病史病情变化
+      return it;
+    }
   });
   return arr;
 }
@@ -799,10 +802,11 @@ function dragBox(domWrap,domDrag){
     }
   },document)
   windowEventHandler('mouseup',()=>{
-    if(isMove){ //有move就设置位置没有移动就不处理
-      wrap.style.left = dragX + 'px'
-      wrap.style.top = dragY + 'px'
-    }
+    // if(isMove){ //有move就设置位置没有移动就不处理
+      // console.log(dragX)
+      // wrap.style.left = dragX + 'px'
+      // wrap.style.top = dragY + 'px'
+    // }
     isDrag = false
     return false
   },document)