|
@@ -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)}`}
|