Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/dev/otherHis' into dev/new1

zhouna 6 anni fa
parent
commit
68fb53d7ff
2 ha cambiato i file con 26 aggiunte e 17 eliminazioni
  1. 16 9
      src/components/NumberDrop/index.jsx
  2. 10 8
      static/pages/hisLib/diag_push.js

+ 16 - 9
src/components/NumberDrop/index.jsx

@@ -42,9 +42,16 @@ class NumberDrop extends Component{
   }
   select(text){        //选中键盘上数字事件
     const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
-    this.setState({
-      hasSelect:true
-    });
+    if(!text){
+      this.setState({
+        placeholder:this.props.placeholder
+      });
+    }else{
+      this.setState({
+        hasSelect:true
+      });
+    }
+
     handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
   }
   handleNumFocus(e){       //数字框可编辑状态下聚集事件,处理是否显示下拉等
@@ -93,18 +100,18 @@ class NumberDrop extends Component{
   }
   numInpBlur(e){        //数字框失焦,保存值到store中
     e.stopPropagation();
+    if(this.props.show){      //修改清空后第一次点击键盘不触发click事件bug
+      return;
+    }
     const that = this;
-    setTimeout(function(){      //第一次选中数字时placeholder闪一下优化
-      if(!that.state.hasSelect&&!e.target.innerText.trim()){
+    //setTimeout(function(){      //第一次选中数字时placeholder闪一下优化
+      if(!e.target.innerText.trim()){
         that.setState({
           placeholder:that.props.placeholder
         });
       }
-    },100);
+    //},100);
 
-    if(this.props.show){      //修改清空后第一次点击键盘不触发click事件bug
-      return;
-    }
     this.setState({
       hasSelect:false
     });

+ 10 - 8
static/pages/hisLib/diag_push.js

@@ -123,9 +123,9 @@
     var key='',modeClass='.'+config.mode;
     mapItem(modeClass+" .box5", data['lisList'],5);   //化验
     mapItem(modeClass+" .box6", data['pacsList'],6);   //辅捡
-    data['dis']['可能诊断'].length>0&&mapItem(modeClass+" .box7", data['dis']['可能诊断'],7);   //初步诊断
-    data['dis']['确诊'].length>0&&mapItem(modeClass+" .box8", data['dis']['确诊'],7);   //疑似诊断
-    data['dis']['警惕'].length>0&&mapItem(modeClass+" .box9", data['dis']['警惕'],7);   //警惕
+    data['dis']['可能诊断']&&data['dis']['可能诊断'].length>0&&mapItem(modeClass+" .box7", data['dis']['可能诊断'],7);   //初步诊断
+    data['dis']['确诊']&&data['dis']['确诊'].length>0&&mapItem(modeClass+" .box8", data['dis']['确诊'],7);   //疑似诊断
+    data['dis']['警惕']&&data['dis']['警惕'].length>0&&mapItem(modeClass+" .box9", data['dis']['警惕'],7);   //警惕
 
     $("a.info").click(function(e){
       getTreatInfo($(e.target).attr('type'),$(e.target).attr('name'),$(e.target).attr('detailName'))
@@ -136,11 +136,13 @@
   //遍历数据
   function mapItem(dom,item,type){
     var itemDom = '';
-    for(var i=0;i<item.length;i++){
-      if(i>config.num-1){
-        itemDom += '<p class="inner-item"><a href="##" class="hide">'+(item[i].name||item[i].uniqueName)+'</a><a class="info hide" target="_blank name="'+item[i].name+'" type='+type+' detail="'+item[i].detailName+'>i</a></p>';
-      }else{
-        itemDom += '<p class="inner-item"><a href="##">'+(item[i].name||item[i].uniqueName)+'</a><a class="info" target="_blank" name='+item[i].name+' type="'+type+'" detail="'+item[i].detailName+'">i</a></p>';
+    if(item){
+      for(var i=0;i<item.length;i++){
+        if(i>config.num-1){
+          itemDom += '<p class="inner-item"><a href="##" class="hide">'+(item[i].name||item[i].uniqueName)+'</a><a class="info hide" target="_blank name="'+item[i].name+'" type='+type+' detail="'+item[i].detailName+'>i</a></p>';
+        }else{
+          itemDom += '<p class="inner-item"><a href="##">'+(item[i].name||item[i].uniqueName)+'</a><a class="info" target="_blank" name='+item[i].name+' type="'+type+'" detail="'+item[i].detailName+'">i</a></p>';
+        }
       }
     }
     $(dom+" .item-content").html(itemDom||"无");