|
@@ -38,7 +38,7 @@ class NumberDrop extends Component{
|
|
|
let timer = null;
|
|
|
clearTimeout(this.state.sltTimer);
|
|
|
clearTimeout(this.state.blurTimer);
|
|
|
- const {handleSelect,ikey,suffix,prefix,mainSaveText,min,max} = this.props;
|
|
|
+ const {handleSelect,ikey,suffix,prefix,mainSaveText,min,max,formulaCode} = this.props;
|
|
|
const needCompare=min!=undefined&&max!=undefined;
|
|
|
if(!text){
|
|
|
this.setState({
|
|
@@ -64,7 +64,7 @@ class NumberDrop extends Component{
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
|
|
|
+ handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText,formulaCode});
|
|
|
//BMI相关数据上传
|
|
|
this.emitBMIData(text);
|
|
|
}
|
|
@@ -85,9 +85,9 @@ class NumberDrop extends Component{
|
|
|
}
|
|
|
}
|
|
|
beyondArea(){
|
|
|
- const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
|
|
|
+ const {handleSelect,ikey,suffix,prefix,mainSaveText,formulaCode} = this.props;
|
|
|
Notify.info("输入数值不符合规范,请重新输入!");
|
|
|
- handleSelect&&handleSelect({ikey,text:'',suffix,prefix,mainSaveText});
|
|
|
+ handleSelect&&handleSelect({ikey,text:'',suffix,prefix,mainSaveText,formulaCode});
|
|
|
this.emitBMIData('');
|
|
|
this.setState({
|
|
|
placeholder:this.props.placeholder,
|
|
@@ -153,7 +153,7 @@ class NumberDrop extends Component{
|
|
|
}
|
|
|
numInpBlur(e){ //数字框失焦,保存值到store中
|
|
|
e.stopPropagation();
|
|
|
- const {handleSelect,ikey,suffix,prefix,mainSaveText,min,max,show} = this.props;
|
|
|
+ const {handleSelect,ikey,suffix,prefix,mainSaveText,min,max,show,formulaCode} = this.props;
|
|
|
/*if(show){ //修改清空后第一次点击键盘不触发click事件bug--失焦placehoder消失,弃用
|
|
|
return;
|
|
|
}*/
|
|
@@ -184,7 +184,7 @@ class NumberDrop extends Component{
|
|
|
const {placeholder} = this.state;
|
|
|
let text = val===placeholder?'':val;
|
|
|
//e.target.innerText = ''; //避免出现重复输入值
|
|
|
- handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
|
|
|
+ handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText,formulaCode});
|
|
|
this.emitBMIData(text);
|
|
|
}
|
|
|
handleSpanInp(e){ //数字框输入事件
|
|
@@ -227,11 +227,11 @@ class NumberDrop extends Component{
|
|
|
//BMI存值
|
|
|
const {formulaCode,bmi,suffix,prefix,ikey,handleSelect,mainSaveText,wrBmi} = this.props;
|
|
|
if(formulaCode==="BMI_RES"&&nextProps.bmi!==bmi){
|
|
|
- handleSelect&&handleSelect({ikey,text:nextProps.bmi,suffix,prefix,mainSaveText});
|
|
|
+ handleSelect&&handleSelect({ikey,text:nextProps.bmi,suffix,prefix,mainSaveText,formulaCode});
|
|
|
}
|
|
|
//手动修改BMI时身高体重清空
|
|
|
if(wrBmi!==nextProps.wrBmi&&(formulaCode==="BMI_SG"||formulaCode==="BMI_TZ")){
|
|
|
- handleSelect&&handleSelect({ikey,text:'',suffix,prefix,mainSaveText});
|
|
|
+ handleSelect&&handleSelect({ikey,text:'',suffix,prefix,mainSaveText,formulaCode});
|
|
|
}
|
|
|
|
|
|
if((nextProps.placeholder == this.props.placeholder)&&(nextProps.value == this.props.value)){
|