Explorar o código

Merge remote-tracking branch 'origin/dev5.4.1' into innterfaceUpdate

zhouna %!s(int64=5) %!d(string=hai) anos
pai
achega
7045d1ecf1

+ 31 - 11
src/components/ChronicInfo/index.jsx

@@ -51,6 +51,8 @@ class ChronicInfo extends React.Component{
     };
     this.$result = React.createRef();
     this.$content = React.createRef();
+    this.$calcuFormula = React.createRef();
+    this.$resultLikely = React.createRef();
     this.showInfo = this.showInfo.bind(this);
     this.closeInfo = this.closeInfo.bind(this);
     this.showOption = this.showOption.bind(this);
@@ -96,16 +98,24 @@ class ChronicInfo extends React.Component{
       infoId:null
     })
   }
-  showOption(id){
+  showOption(id,e){
     this.setState({
       optionId:id,
       formulaId:null //关闭计算公式
     });
     const {patDom} = this.props;
     const ht = $(patDom.current).height();
-    setTimeout(function(){
-      $(patDom.current).scrollTop(ht+200);
-    })
+    const bottom = ht+120-e.clientY
+    
+    // setTimeout(function(){
+
+    //   $(patDom.current).scrollTop(ht);
+    // })
+    if(bottom < 220) {
+      setTimeout(()=>{
+        this.$resultLikely.current.scrollIntoView(true)
+      })
+    }
   }
   closeOption(){
     // 关闭-有可能结果则保持与结果一致,没有就保持最新选择的内容
@@ -190,18 +200,28 @@ class ChronicInfo extends React.Component{
       ff:false
     })
   }
- 
-  showFormula(id){//计算公式
+  showFormula(id,e){//计算公式
     this.setState({
       formulaId:id,
       optionId:null  //关闭可能结果
     });
     const {patDom} = this.props;
     const ht = $(patDom.current).height();
-    setTimeout(function(){
-      $(patDom.current).scrollTop(ht+200);
-    })
+  
+    const bottom = ht+120-e.clientY
+    
+    // setTimeout(function(){
+
+    //   $(patDom.current).scrollTop(ht);
+    // })
+    if(bottom < 340) {
+      setTimeout(()=>{
+        this.$calcuFormula.current.scrollIntoView(true)
+      })
+    }
+   
   }
+
   closeFormula(it){
     const {formulaId,isCalculated} =this.state;
     if(!isCalculated){
@@ -415,7 +435,7 @@ class ChronicInfo extends React.Component{
                           // const details = calcuValues&&calcuValues[v.conceptId]||it.content.details;
                           //每次都取最新推送内容
                           const details = it.content.details || [];
-                          return <div className={style["marTop"]}>
+                          return <div className={style["marTop"]}  ref={this.$calcuFormula}>
                             <span className={style["limit"]}>
                               计算公式结果:
                               <i className={style["blue"]} onClick={this.showFormula.bind(this,v.conceptId)}>{result?result:'请选择'}</i>
@@ -484,7 +504,7 @@ class ChronicInfo extends React.Component{
                             </MiniToast>}
                           </div>
                         }else if(it.type==3){
-                          return <div className={style["marTop"]}>
+                          return <div className={style["marTop"]} ref={this.$resultLikely}>
                             <span className={style["limit"]}>
                               可能结果:
                               <i onClick={this.showOption.bind(this,v.conceptId)} className={style["blue"]}>{possible[v.conceptId]?possible[v.conceptId]:'请选择'}</i>

+ 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:state.inspect.context.scrollArea,             //滚动条对象
     }
 }
 

+ 2 - 2
src/store/actions/currentIll.js

@@ -357,7 +357,7 @@ export const confirm = (state,action) =>{
      for(let i=0;i<exists.length; i++){
       tempArr.push(getLabel(exists[i].id,exists[i].questionMapping && exists[i].questionMapping.length==0?exists[i].name+',':exists[i].name),...(exists[i].questionMapping && exists[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==1;})));
     }
-    arr.splice(ikey,0,...tempArr);
+    arr.splice(ikey,0,...formatContinueDots(tempArr));
   }
   
   let length = arr.length - length1;
@@ -368,7 +368,7 @@ export const confirm = (state,action) =>{
     for(let i=0;i<withs.length; i++){
       tempArr.push(banText,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(withs[i].name+','):(withs[i].name)),...(withs[i].questionMapping&&withs[i].questionMapping.length>0?withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;}):[]));
     }
-    withsArr.splice(parseInt(ikey)+length,0,...tempArr);
+    withsArr.splice(parseInt(ikey)+length,0,...formatContinueDots(tempArr));
   }
 
   // 无 不用展开

+ 1 - 1
src/utils/utils.js

@@ -152,7 +152,7 @@ export function recoveTag(state,action) {
       arr.splice(sonMInx,1);
     }
     const lastReTag = [...action.data].reverse()[0];
-    if(lastReTag.tagType=='8'&&arr[action.index].tagType=='8'){
+    if(lastReTag.tagType=='8'&&(arr[action.index]&&arr[action.index].tagType=='8')){
       //要恢复的标签组最后为文本标签,插入位置也为文本标签,则将2个合并为一个文本标签
       arr[action.index]=Object.assign(arr[action.index],lastReTag,{value:lastReTag.value+arr[action.index].value});
       action.data.length=action.data.length-1;