浏览代码

Revert "计算公式输入清空结果"

This reverts commit 457e27a39e03e05fbed003e4297500ae3e418e7c.
zhangxc 5 年之前
父节点
当前提交
2c1b988449
共有 2 个文件被更改,包括 4 次插入22 次删除
  1. 4 10
      src/components/ChronicInfo/index.jsx
  2. 0 12
      src/containers/ChronicInfo.js

+ 4 - 10
src/components/ChronicInfo/index.jsx

@@ -232,10 +232,9 @@ class ChronicInfo extends React.Component{
     this.closeFormula(it);
     chronicMagItem&&this.handleAddAssessItem(v,pIndex,i);
   }
-  handleInputformula(id,calcuContent,i,cres,e) {
-    // const {calcuValues} = this.state;
-    const {calcuResult,calcuValues,setCalcuInfo} = this.props;
-      let obj = deepClone(calcuValues);
+  handleInputformula(id,calcuContent,i,e) {
+    const {calcuValues} = this.state;
+    let obj = deepClone(calcuValues);
     let values = (obj&&obj[id])||deepClone(calcuContent);
     const txt = e.target.value;
     values[i].value = txt.replace(/[\u4e00-\u9fa5]|[^\d.]/g,'');       //处理中文输入法的情况
@@ -247,11 +246,6 @@ class ChronicInfo extends React.Component{
       isCalculated:false,
       calcuValues:obj
     });
-    let calcuResultCopy = calcuResult&&calcuResult[id]||cres
-    for(let i = 0; i < calcuResultCopy.length; i++) {
-      calcuResultCopy[i].text = ""
-    }
-    setCalcuInfo&&setCalcuInfo(id, obj[id], calcuResultCopy)
   }
   handleForRadio(id,calcuContent,i,fidx){//计算公式
     const { calcuValues } = this.state;
@@ -449,7 +443,7 @@ class ChronicInfo extends React.Component{
                                           <span>{item.isShow == '0' ? item.name+':':'请输入'+item.name+':'}</span>
                                         </td>
                                         <td>
-                                          {item.isShow == '0' ? item.value + ' ' +item.uint : <input type="text" className={style['itemInp']} placeholder="请输入"  value={item.value} onInput={this.handleInputformula.bind(this,v.conceptId,details,idd,cres)}/>}
+                                          {item.isShow == '0' ? item.value + ' ' +item.uint : <input type="text" className={style['itemInp']} placeholder="请输入"  value={item.value} onInput={this.handleInputformula.bind(this,v.conceptId,details,idd)}/>}
                                         </td>
                                         <td>
                                           {item.isShow != '0'&&<span>{item.uint}</span>}

+ 0 - 12
src/containers/ChronicInfo.js

@@ -105,18 +105,6 @@ function mapDispatchToProps(dispatch){
         id
       });
     },
-    setCalcuInfo(id, calcuVal, calcuResult) {
-      dispatch({
-        type: SET_CHRONIC_CALCU_RESULT,
-        result:calcuResult,
-        id:id
-      });
-      dispatch({
-        type:SET_CALCU_VALUES,
-        data:calcuVal,
-        id:id
-      })
-    },
     // 计算公式计算
     calcuFormula(param) {
       getFormulaResult(param).then((res)=>{