Parcourir la source

月经史公式显示bug修改

zhouna il y a 6 ans
Parent
commit
c5675d4202

+ 1 - 1
src/components/NumberDrop/index.jsx

@@ -194,7 +194,7 @@ class NumberDrop extends Component{
       <span onFocus={this.handleNumFocus}
             onClick={allClick?null:this.handleNumClick}
             contentEditable={true}
-            style={{minWidth:'10px',display:'inline-block'}}
+            style={{minWidth:'10px',display:'inline-block',textAlign:'center'}}
             ref = {this.$span}
             onBlur={this.numInpBlur}
             onInput={this.handleSpanInp}

+ 4 - 4
src/components/NumberUnitDrop/index.jsx

@@ -41,7 +41,7 @@ class NumberUnitDrop extends Component{
     this.changeToEdit = this.changeToEdit.bind(this);
   }
   select(obj){         //选中键盘上数字事件
-    const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
+    const {handleSelect,ikey,suffix,prefix,mainSaveText,formulaCode} = this.props;
     this.setState({
       hasSelect:true
     });
@@ -50,7 +50,7 @@ class NumberUnitDrop extends Component{
         value:''
       });
     }
-    handleSelect&&handleSelect({ikey,text:obj.text,suffix,prefix,mainSaveText,mark:obj.mark});
+    handleSelect&&handleSelect({ikey,text:obj.text,suffix,prefix,mainSaveText,mark:obj.mark,formulaCode});
   }
   
   handleNumClick(e){ 
@@ -85,13 +85,13 @@ class NumberUnitDrop extends Component{
   //数字框失焦,保存值到store中
   numInpBlur(e){
     e.stopPropagation();
-    const {handleSelect,ikey,suffix,prefix,mainSaveText,handleLabelChange,boxMark} = this.props;
+    const {handleSelect,ikey,suffix,prefix,mainSaveText,handleLabelChange,boxMark,formulaCode} = this.props;
     const {editable} = this.state;
     if(editable){
       const text = e.target.innerText || e.target.innerHTML;
       // this.$span.current.innerText='';      //修改生成文字变成输入的2倍bug 
       // handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
-      handleLabelChange&&handleLabelChange({ikey,changeVal:text,suffix,prefix,mainSaveText,type:boxMark});
+      handleLabelChange&&handleLabelChange({ikey,changeVal:text,suffix,prefix,mainSaveText,type:boxMark,formulaCode});
       
     }
     this.setState({