Browse Source

滚动兼容

Luolei 6 years ago
parent
commit
935c0cf687
3 changed files with 4 additions and 5 deletions
  1. 3 3
      src/components/PreviewBody/index.jsx
  2. 1 1
      src/containers/OtherHistory.js
  3. 0 1
      src/utils/tools.js

+ 3 - 3
src/components/PreviewBody/index.jsx

@@ -16,7 +16,7 @@ class PreviewBody extends Component {
         this.getCurrentDate();
         this.getCurrentDate();
     }
     }
     componentWillReceiveProps(){
     componentWillReceiveProps(){
-        this.$content.current.scrollTo(0,0)
+        $(this.$content.current)[0].scrollIntoView(true);
     }
     }
     getCurrentDate(){
     getCurrentDate(){
         let myDate = new Date();
         let myDate = new Date();
@@ -55,8 +55,8 @@ class PreviewBody extends Component {
     render() {
     render() {
         const { show, preInfo, dataJson, dataStr,baseObj } = this.props;
         const { show, preInfo, dataJson, dataStr,baseObj } = this.props;
 
 
-        return <div className={style['content']} ref={this.$content}>
-            <div style={{ clear: 'both', fontSize: '24px', margin: '0px 0px 30px 0px',textAlign:'center' }}>{preInfo.hospitalName}</div>
+        return <div className={style['content']}>
+            <div ref={this.$content} style={{ clear: 'both', fontSize: '24px', margin: '0px 0px 30px 0px',textAlign:'center' }}>{preInfo.hospitalName}</div>
             <table className={style['patInfo']} style={{ margin: '0px 15px 30px 0px', borderCollapse: 'collapse', width: "100%",fontSize:'12px' }}>
             <table className={style['patInfo']} style={{ margin: '0px 15px 30px 0px', borderCollapse: 'collapse', width: "100%",fontSize:'12px' }}>
                 <tr>
                 <tr>
                     <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>卡号:{baseObj?baseObj.patientIdNo:JSON.stringify(preInfo) == '{}'?'':preInfo.patientIdNo}</td>
                     <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>卡号:{baseObj?baseObj.patientIdNo:JSON.stringify(preInfo) == '{}'?'':preInfo.patientIdNo}</td>

+ 1 - 1
src/containers/OtherHistory.js

@@ -9,7 +9,7 @@ import {fullfillText} from '@common/js/func';
 import {didPushParamChange} from '@utils/tools.js';
 import {didPushParamChange} from '@utils/tools.js';
 import {ISREAD} from "../store/types/homePage";
 import {ISREAD} from "../store/types/homePage";
 
 
-function mapStateToProps(state){
+function mapStateToProps(state){ console.log(state)
   const {otherHistory,homePage,typeConfig,mainSuit} = state;
   const {otherHistory,homePage,typeConfig,mainSuit} = state;
   const hasMain = mainSuit.saveText.join('')||mainSuit.data.length;
   const hasMain = mainSuit.saveText.join('')||mainSuit.data.length;
   return {
   return {

+ 0 - 1
src/utils/tools.js

@@ -506,7 +506,6 @@ function filterDataArr(arrTmp){   //数据处理
     }
     }
     return (tmpArr.join('')).replace(/^,+/,"").replace(/,+$/,"").replace(/,+$/,"").replace(/,+$/,"").replace(/、+$/,"");
     return (tmpArr.join('')).replace(/^,+/,"").replace(/,+$/,"").replace(/,+$/,"").replace(/,+$/,"").replace(/、+$/,"");
 }
 }
-filterDataArr(['sds','、',',','sds'])
 // 取消默认行为
 // 取消默认行为
 function preventDefault(event) {
 function preventDefault(event) {
     if (event.preventDefault) {
     if (event.preventDefault) {