Bläddra i källkod

Merge branch 'dev5.3.1' of http://192.168.2.236:10080/zhouna/newICSS into dev5.3.1

luolei 5 år sedan
förälder
incheckning
1b17fc163f

+ 10 - 5
src/common/components/EditableSpan/index.jsx

@@ -172,8 +172,10 @@ class EditableSpan extends Component{
           ev.preventDefault();
         }else{
           ev.returnValue=false;
+        }
+        if(obj){
+          this.moveEnd(obj[0]);
         } 
-        this.moveEnd(obj[0]);
       }
     }
     if(ev.keyCode==39){//向右
@@ -185,8 +187,9 @@ class EditableSpan extends Component{
         }else{
           ev.returnValue=false;
         }
-        // obj.focus();
-        obj[0].focus();
+        if(obj){
+          obj.focus();
+        }
       }
     }
   }  
@@ -215,10 +218,11 @@ class EditableSpan extends Component{
       //action里往后删除
       if(innerVal == preVal){
         let data = innerVal.trim();
-        if(nextObj && !config.punctuationReg.test(data)){
+        if(nextObj && !config.punctuationReg.test(data) || data=='<br>'){
           handleKeydown&&handleKeydown({boxMark,i:index,text:data,flag:'del'});
           // nextObj.focus();  
           if(nextObj && nextObj[0] && nextObj[0].nodeName !=="DIV"){
+            // IE浏览器focus光标在最后,其他浏览器在最前
             nextObj.focus();
           }
           /*this.setState({
@@ -258,7 +262,8 @@ class EditableSpan extends Component{
         //判断是否为空、中英文:, 。、;,且不是第一位
         // let pattern = new RegExp(/^\,?$|^\,?$|^\.?$|^\。?$|^\、?$|^\;?$|^\;?$|^\:?$|^\:?$|\s/);
         // if(index!==0 && pattern.test(data)){
-        if(index!==0 && !config.punctuationReg.test(data)){
+        // 后半段是处理IE
+        if(index!==0 && !config.punctuationReg.test(data) || index!==0 && data=='<br>'){
           // let preObj = $(this.$span.current).prev();
           let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
           handleKeydown&&handleKeydown({boxMark,i:index,text:data,flag:'backsp'});

+ 21 - 6
src/components/ChronicInfo/index.jsx

@@ -352,21 +352,36 @@ class ChronicInfo extends React.Component{
       hasEnterImg: false
     })
   }
-  
+  getCritical(v) {
+    let hasCritical = false;
+    if(v.details) {
+      for (let i = 0; i < v.details.length; i++) {
+        if(v.details[i].type == 4) {
+          hasCritical = true
+        }
+      }
+    }
+    return hasCritical
+  }
   getDetail(){
     const {data,formulaResult,calcuResult,chronicMagItem} = this.props;
     const {formulaId,optionId,possible,radioVal,calcuValues,currentIndex,hasEnterImg} = this.state;
+    /*let names = [];*/
     let list = data&&data.map((v,i)=>{
+                    /*if(this.getCritical(v)&&names.includes(v.name)){    //重复项
+                      return '';
+                    }
+                    names.push(v.name);*/
                     return <div className={style["list"]}>
                       {v.name?<p>
-                                <span>患者可能有</span>
+                                {this.getCritical(v) ? '':<span>患者可能有</span>}
                                 <span
-                                  className={style['dis-name']}
+                                  className={this.getCritical(v)?style['dis-name-no-line']: style['dis-name']}
                                   onMouseEnter={this.handleMouseEnterDrug.bind(this, i)}
                                   onMouseLeave = {this.handleMouseLeaveDrug.bind(this)}
                                 >
                                   {v.name}
-                                  {<img className={style['info-img']}
+                                  {this.getCritical(v)?'':<img className={style['info-img']}
                                     style ={currentIndex === i  ? {display: "inline-block"} : {display: "none"}}
                                     src={currentIndex === i ?(hasEnterImg ? infoMove : infoShow ): infoShow}
                                     onMouseEnter={this.handleMouseEnterImg.bind(this)}
@@ -376,7 +391,7 @@ class ChronicInfo extends React.Component{
                                 </span>
                                 {/* <img src={infoShow} className={style["infoPic"]} onClick={this.showInfo.bind(this,v.id)}/> */}
 
-                                :
+                                {this.getCritical(v)?'':''}
                               </p>:''}
                       {v.details&&v.details.map((it,j)=>{
                         if(it.type==1){
@@ -489,7 +504,7 @@ class ChronicInfo extends React.Component{
                         }
                       })}
                     </div>
-                  })
+                  });
     return list;
   }
   componentWillReceiveProps(next){

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

@@ -44,7 +44,7 @@ class CurrentIll extends Component{
       this.setState({
         forbidInput:true
       })
-    }else if(!text) {//现病史框里没有内容时才设置模板
+    }else if(!text || (isIE() && text=='<br>')) {//现病史框里没有内容时才设置模板
       let num = moduleNum.num;//主诉使用了几个模板
       if(data.length==0 && !isChronic){
         clearTimeout(setDataTimer);

+ 5 - 1
src/components/Emergency/HisList/index.less

@@ -27,6 +27,10 @@
     // margin: 0 20px 8px;
     padding-top: 6px;
     position: relative;
+    img{
+      vertical-align: middle;
+      margin: 0 10px;
+    }
   }
   .filter-box{
     font-size: 12px;
@@ -84,7 +88,7 @@
       width: 14px;
       // height: 14px;
       position: absolute;
-      left: 0px;
+      left: 20px;
       top: 27px;
     }
     .more{

+ 7 - 0
src/components/MainSuit/index.jsx

@@ -200,6 +200,13 @@ class MainSuit extends Component{
         symptom:true
       })
     }
+
+    // IE11聚焦时也会触发change事件,导致常见症状下拉出不来
+    if(isIE() && data == '<br>'){
+      this.setState({
+        symptom:true
+      })
+    }
     /*clearTimeout(this.state.timer);
     const timer = setTimeout(function(){
       pushMessage && pushMessage(data);

+ 1 - 1
src/store/async-actions/fetchModules.js

@@ -32,7 +32,7 @@ const api={
 };
 
 export const getFeature = (item)=>{
-  const datas = json(api.getSymptomFeature+'?text='+item,{});
+  const datas = json(api.getSymptomFeature+'?text='+encodeURIComponent(item),{});
   return datas;
 }