Browse Source

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

luolei 5 years ago
parent
commit
9124b90476
2 changed files with 23 additions and 10 deletions
  1. 3 3
      src/common/components/EditableSpan/index.jsx
  2. 20 7
      src/components/NumberDrop/index.jsx

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

@@ -358,9 +358,9 @@ class EditableSpan extends Component{
     const hasBr = br?style['editable-br']:'';       //最后一个体征标签换行
     const selectedArea = mouseSelect?style['selected-area']:'';
     const $span = this.$span.current;
-    const val = $span&&$span.innerText.trim();
-    if(br&&$span&&!$span.innerText){
-      this.$span.current.innerHTML=' ';
+    const val = $span&&$span.innerHTML.trim();
+    if(br&&$span&&!val){
+      $span.innerHTML=' ';
     }
     return classNames(style['editable-span'],isFull,hasBr,setFontColorSize(2,unselect?6:8),unselect,selectedArea);
   }

+ 20 - 7
src/components/NumberDrop/index.jsx

@@ -95,16 +95,28 @@ class NumberDrop extends Component{
       hasSelect:false
     });
   }
-  handleNumFocus(e){
-    /*const {placeholder} = this.state;
-    const val = e.target.innerText.trim();
-    //console.log(33,e.target.innerText,placeholder,e.target.innerText.trim() == placeholder)
+  handleNumFocus(e){console.log('focus')
+    const {placeholder} = this.state;
+    const val = e.target.innerText.trim();//console.log(33,e.target.innerText,placeholder,e.target.innerText.trim() == placeholder)
     if(val!=''&&val == placeholder){
       this.setState({
         placeholder:''
       });
-    }*/
+    }
     e.stopPropagation();
+    const {show,handleShow,ikey,id,patId,handleHide} = this.props;
+    if(show) {
+      handleHide && handleHide();
+      return;
+    }else{
+      this.$span.current.focus();
+      this.setState({
+        hasSelect:false,
+        placeholder:''      //火狐26placeholder点击不隐藏bug修改
+      });
+      handleShow&&handleShow({ikey,id:patId||id});
+    }
+
   }
   handleKeyDowm(e){
     if(e.keyCode==13){
@@ -115,7 +127,7 @@ class NumberDrop extends Component{
   }
   handleNumClick(e){     //数字框不可编辑的状态时点击事件,点击将数字框变为可输入且下拉不再显示直到失焦后再次聚集
     e.stopPropagation();
-    const {show,handleShow,ikey,id,patId,handleHide} = this.props;
+    /*const {show,handleShow,ikey,id,patId,handleHide} = this.props;
     if(show) {
       handleHide && handleHide();
       return;
@@ -126,7 +138,7 @@ class NumberDrop extends Component{
         placeholder:''      //火狐26placeholder点击不隐藏bug修改
       });
       handleShow&&handleShow({ikey,id:patId||id});
-    }
+    }*/
   }
   validSymbols(txt,min,max){
     //输入只有一个~或/时判断两边是否为合理数字,有多个为不合理
@@ -269,6 +281,7 @@ class NumberDrop extends Component{
             ref = {this.$span}
             onkeyup={this.handleKeyDowm}
             onmousedown={(e)=>e.stopPropagation()}
+            onmouseup={(e)=>e.stopPropagation()}
             onBlur={this.numInpBlur}
             onInput={this.handleSpanInp}
             className={`${this.getSpanClass(nospecial)}`}