소스 검색

治疗方案点确定大滚动条跳到底部

zhouna 5 년 전
부모
커밋
18513db78d

+ 2 - 2
src/components/AddInspect/SlideSelect/index.jsx

@@ -89,8 +89,8 @@ class SlideSelect extends Component {
     handleFillShow(e,idx);
     //弹窗高度超出屏幕,增加页面高度
     setPosition(e,"#inspectFill",setHighter);
-    /*setTimeout(function(){
-      refreshScroller()&&refreshScroller().scrollBottom();
+    /*setTimeout(function(){//如果化验下面有很多数据,则会跳过头
+      refreshScroller()&&refreshScroller().scrollYTo(290);
     })*/
   }
   render() {

+ 5 - 5
src/components/Diagnosis/index.jsx

@@ -28,16 +28,16 @@ class Diagnosis extends Component {
 
 
   showSearch() {
-    const { showSearch } = this.props
+    const { showSearch } = this.props;
     showSearch && showSearch()
   }
   hideSearch() {
-    const { hideSearch } = this.props
+    const { hideSearch } = this.props;
     hideSearch && hideSearch()
   }
   handleshowSearch(e) {
-    this.props.show ? this.hideSearch() : this.showSearch()
-    this.setState({ pageTop:getPageCoordinate(e).boxTop })
+    this.props.show ? this.hideSearch() : this.showSearch();
+    this.setState({ pageTop:getPageCoordinate(e).boxTop });
     setPosition(e,"#searchOption",this.props.setHighter)
   }
   refreshScroller(){
@@ -50,7 +50,7 @@ class Diagnosis extends Component {
   render() {
     return (<div id="diagnosisResult">
       <ItemBox id="diagnosis" title='诊断' boxHeight='auto' titleTop='22px' marginTop='9px' backgroundColor='#EAF7FD'>
-        <DiagnosticList></DiagnosticList>
+        <DiagnosticList refreshScroller={this.refreshScroller}></DiagnosticList>
         <div style={{ marginLeft: '10px', position: 'relative' }}>
           <Add showText="添加诊断结果" handleClick={this.handleshowSearch} id="addDiag" height="50px" />
           <DiagResultSearch

+ 2 - 2
src/components/DiagnosticList/index.jsx

@@ -243,7 +243,7 @@ class DiagnosticList extends Component {
       })
     }
     render(){
-        const { list, treatment, showReferRecord, showHistoryCase ,chronicMagItem,loading} = this.props;
+        const { list, treatment, showReferRecord, showHistoryCase ,chronicMagItem,loading,refreshScroller} = this.props;
         const {visible, treatTitle, showAssess, isAssessConfirm, assessId, disName, hasOndel, hasOnIndex} = this.state;
         const chronicList = JSON.parse(localStorage.getItem('chronic')||null);
         let isChronic = false;      //是否要显示管理评估
@@ -275,7 +275,7 @@ class DiagnosticList extends Component {
                                     <img className={style['diag-del']} src={hasOnIndex == index ? hasOndel ? del_on : del_icon : del_icon} onMouseEnter={this.handleEnterDel.bind(this,index)} onMouseLeave={this.handleLeaveDel.bind(this)} onClick={()=>{this.handleDeleteItem(item)}}/>
                         </div>)
                     })}
-                     {treatment&&<Treat title={treatTitle}></Treat>}
+                     {treatment&&<Treat title={treatTitle} refreshScroller={refreshScroller}></Treat>}
                      {showAssess?<ComplexModal onclose={this.showAssessFn.bind(this)} footer={footer}
                                                title='管理和评估'
                                                icon={manageIcon}

+ 6 - 2
src/components/Treat/index.jsx

@@ -46,11 +46,15 @@ class Treat extends Component {
     }
     handleDetermine() {
         const { title, treatment, advice, treatItem, adversReactionList, saveAllAdverseReaction, setAllFollowUp } = this.props
-        const { addScheme } = this.props
+        const { addScheme,refreshScroller } = this.props
         addScheme && addScheme(title, treatment);
         saveAllAdverseReaction && saveAllAdverseReaction(treatItem);
         setAllFollowUp && setAllFollowUp(treatItem)
-        this.hideTreat()
+        this.hideTreat();
+        //滚动条滚到最底部,避免直接上滚滚动条消失bug
+        setTimeout(function(){
+          refreshScroller()&&refreshScroller().scrollBottom();
+        },100);
     }
     showDrugInfo() {
         const {  showDrugInfo } = this.props;