Selaa lähdekoodia

Merge remote-tracking branch 'origin/ChronicMag' into ChronicMag

zhouna 6 vuotta sitten
vanhempi
commit
f2bf620441
1 muutettua tiedostoa jossa 3 lisäystä ja 12 poistoa
  1. 3 12
      src/components/CurrentIll/index.jsx

+ 3 - 12
src/components/CurrentIll/index.jsx

@@ -46,18 +46,18 @@ class CurrentIll extends Component{
     // 判断主诉是否为空
     const {mainData,mainText,setData,moduleNum,mainIds,data,changeEditIll,editClear,symptomFeature,isChronic} = this.props;
     const that = this;
+    const ev = e || window.event;
+    const text = ev.target.innerText||ev.target.innerHTML;
     let {setDataTimer} = this.state; 
     let mainFinallyText = filterDataArr(mainText);
-    // if(mainData.length == 0 && !mainText[0]){
     if(!mainFinallyText){
       //弹窗提醒
       Notify.error("无法操作,请先输入主诉");
       this.setState({
         forbidInput:true
       })
-    }else {
+    }else if(!text) {//现病史框里没有内容时才设置模板
       let num = moduleNum.num;//主诉使用了几个模板
-        // isChronic为一个对象
       if(data.length==0 && !isChronic || !isChronic.name ){
         clearTimeout(setDataTimer);
         setDataTimer = setTimeout(function(){//延时,等待主诉失焦数据返回
@@ -74,15 +74,6 @@ class CurrentIll extends Component{
           setDataTimer
       })
       changeEditIll(false)
-      /*const showTimer = setTimeout(function(){
-        that.setState({
-          showMoudle:true,
-          forbidInput:false,
-          boxEditable:false,
-        })
-        changeEditIll(false)
-      },150)
-      clearTimeout(showTimer);*/
     }
 
   }