Просмотр исходного кода

右侧推送添加诊断,左侧滚动条定位(2841)

zhangxc 5 лет назад
Родитель
Сommit
91f24f7d5f
2 измененных файлов с 9 добавлено и 3 удалено
  1. 7 2
      src/components/DiagnosticItem/index.jsx
  2. 2 1
      src/containers/DiagnosticItem.js

+ 7 - 2
src/components/DiagnosticItem/index.jsx

@@ -64,9 +64,8 @@ class DiagnosticItem extends Component{
         getTips && getTips({id:item.id,type:7,name: item.name, position: 1});
     }
     addDiagodal(diagType){
-        const {item, isChronicMag,mode} = this.props;
+        const {item, isChronicMag,mode,EMRScrollCont,type,addDiagnostic, clearInput, hideSearch} = this.props;
         item.type = diagType;
-         const {  addDiagnostic, clearInput, hideSearch } = this.props;
 
          if(item.type == 2&&mode=='0') {      //文本模式不走慢病
              isChronicMag(item);
@@ -76,6 +75,12 @@ class DiagnosticItem extends Component{
          hideSearch&&hideSearch();
         this.context.scrollArea&&this.context.scrollArea.refresh();
          //document.getElementById("diagnosisResult").scrollIntoView(true)
+         if(type == 'disSelect') {
+            const scrollTop = document.getElementById("diagnosisResult").offsetTop
+            setTimeout(() =>{
+               EMRScrollCont.scrollYTo(scrollTop);
+            })
+         }
     }
     handleMouseEnterDrug() {
         this.setState({

+ 2 - 1
src/containers/DiagnosticItem.js

@@ -12,7 +12,8 @@ import {billing, getConceptDetail} from '../store/async-actions/pushMessage';
 function mapStateToProps(state) {
     return {
         diagnosticList: state.diagnosticList.diagnosticList,
-        mode:state.typeConfig.mode
+        mode:state.typeConfig.mode,
+        EMRScrollCont:inspect.context.scrollArea,             //滚动条对象
     }
 }