Explorar el Código

全部量表加入病例记录bug修改

zhouna hace 6 años
padre
commit
f829aaddce
Se han modificado 2 ficheros con 8 adiciones y 7 borrados
  1. 4 4
      src/components/AssessResult/index.jsx
  2. 4 3
      src/components/ChronicInfo/index.jsx

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

@@ -6,15 +6,15 @@ import ScaleItem from "./ScaleItem";
 import Information from '../Information'
 import ChartItem from "./ChartItem";
 import Notify from '@commonComp/Notify';
-import {readyKeepHistory} from '@utils/tools';
+import {readyKeepHistory,deepClone} from '@utils/tools';
 import loadingIcon from '@common/images/loading.gif';
 
 class AssessResult extends Component {
   constructor(props) {
     super(props);
-    const chooseSelecteds = JSON.parse(JSON.stringify(props.chooseSelecteds)||{});
-    const wholeIndexs = JSON.parse(JSON.stringify(props.wholeIndexs)||{});      //深度复制,Object.assgin为浅复制,下下级会同源
-    const wholeScale = JSON.parse(JSON.stringify(props.wholeScaleItems)||{});
+    const chooseSelecteds = deepClone(props.chooseSelecteds);
+    const wholeIndexs = deepClone(props.wholeIndexs);      //深度复制,Object.assgin为浅复制,下下级会同源
+    const wholeScale = deepClone(props.wholeScaleItems);
 
     this.state={
       chooseSelecteds:chooseSelecteds,     //大数据选择模块

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

@@ -4,8 +4,6 @@ import chronicPic from "../../common/images/chronic.png";
 import level1 from "../../common/images/级别1.png";
 import tableIcon from '@common/images/table.png';
 import allTableIcon from '@common/images/all-table.png';
-import add from '@common/images/add-result.png';
-import added from '@common/images/first.png';
 import checkIcon from '@common/images/check.png';
 import up from '@common/images/slide-up.png';
 import down from '@common/images/slide-down.png';
@@ -152,6 +150,9 @@ class ChronicInfo extends React.Component{
         return ;
       }
       this.handleAddAssessItem(scaleParam.v,scaleParam.i,scaleParam.j);
+      this.setState({
+        scaleParam:{}
+      });
     }
     this.props.hideList({name:'showTable',value:false});
   }
@@ -501,7 +502,7 @@ class ChronicInfo extends React.Component{
     const scaleFooter = <Footer print={true}
                                 footText={showHide.isPop||!chronicMagItem?"确定":"加入病例记录"}
                                 handlePrint={this.onPrint}
-                                handleConfirm={()=>{this.comfirnTable()}}/>;
+                                handleConfirm={this.comfirnTable}/>;
     return <div className={style["tips"]} style={{marginBottom:'15px'}}>
               <div className={`${style["tips-title"]} ${style["chronic"]}`}>
                 <div className={style["tips-name"]}>