|
@@ -2,6 +2,7 @@ import React,{Component} from 'react';
|
|
|
import className from 'classnames';
|
|
|
import {NumberPan,Notify} from '@commonComp';
|
|
|
import style from './index.less';
|
|
|
+import {setFontColorSize} from '@utils/tools'
|
|
|
/***
|
|
|
* author:zn@2018-11-19
|
|
|
* 接收参数:
|
|
@@ -196,18 +197,19 @@ class NumberDrop extends Component{
|
|
|
const {handleHide} = this.props;
|
|
|
handleHide&&handleHide();
|
|
|
}
|
|
|
- getClasses(){ //整个标签是否有值的状态
|
|
|
+ getClasses(nospecial){ //整个标签是否有值的状态
|
|
|
const {hideTag,placeholder,isImports,isExtBlue} = this.props;
|
|
|
const val = this.state.value;
|
|
|
const isSelected = val&&val!=placeholder?style['selected']:style['container'];
|
|
|
const orgBorder = isImports&&!(val&&val!=placeholder)?style['orange-border']:'';
|
|
|
const ext = isExtBlue?style['ext']:'';
|
|
|
const noTag = hideTag?style['no-tag']:'';
|
|
|
- return className(isSelected,noTag,orgBorder,ext);
|
|
|
+
|
|
|
+ return className(isSelected,noTag,orgBorder,ext,setFontColorSize(isExtBlue?2:1));
|
|
|
}
|
|
|
- getSpanClass(){ //将被替换的文字选中状态显示
|
|
|
+ getSpanClass(nospecial){ //将被替换的文字选中状态显示
|
|
|
const cls = this.props.show?style['blued']:style['nol'];
|
|
|
- return cls;
|
|
|
+ return cls+' '+setFontColorSize(nospecial?'':2);
|
|
|
}
|
|
|
stopBubble(e){
|
|
|
e.stopPropagation();
|
|
@@ -243,13 +245,13 @@ class NumberDrop extends Component{
|
|
|
});
|
|
|
}
|
|
|
render(){
|
|
|
- const {prefix,suffix,show,value,handleHide,allClick,bmi,formulaCode} = this.props;
|
|
|
+ const {prefix,suffix,show,value,handleHide,allClick,bmi,formulaCode,nospecial} = this.props;
|
|
|
const val = formulaCode==="BMI_RES"?(+bmi===Infinity||isNaN(bmi)?'':bmi):value;
|
|
|
const {placeholder,hasSelect} = this.state;
|
|
|
- return <div className={this.getClasses()}
|
|
|
+ return <div className={this.getClasses(nospecial)}
|
|
|
style={{position:'relative'}}
|
|
|
onClick={allClick?this.handleNumClick:null}>
|
|
|
- <span>{prefix}</span>
|
|
|
+ <span className={`${setFontColorSize(nospecial?'':2)}`}>{prefix}</span>
|
|
|
<span onFocus={this.handleNumFocus}
|
|
|
onClick={allClick?null:this.handleNumClick}
|
|
|
contentEditable={true}
|
|
@@ -258,9 +260,9 @@ class NumberDrop extends Component{
|
|
|
onkeyup={this.handleKeyDowm}
|
|
|
onBlur={this.numInpBlur}
|
|
|
onInput={this.handleSpanInp}
|
|
|
- className={this.getSpanClass()}
|
|
|
+ className={this.getSpanClass(nospecial)}
|
|
|
> {val||placeholder}</span>
|
|
|
- <span>{suffix}</span>
|
|
|
+ <span className={`${setFontColorSize(nospecial?'':2)}`}>{suffix}</span>
|
|
|
<NumberPan handleSelect={this.select.bind(this)}
|
|
|
noString={formulaCode?true:false}
|
|
|
onClose={handleHide}
|