瀏覽代碼

清除刷新推送

zhangxc 4 年之前
父節點
當前提交
ad9b1a0343
共有 2 個文件被更改,包括 3 次插入7 次删除
  1. 2 6
      src/components/PushData/index.jsx
  2. 1 1
      src/store/actions/print.js

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

@@ -29,17 +29,13 @@ class PushData extends Component{
         togglePushData()
     }
     componentWillReceiveProps(next){
-        // if(next.update!=this.props.update){
-          this.setState({
-            hashNum:Math.random()
-          });
-        // }
+      
       }
 
     render(){
         const {hashNum } = this.state
         const {mrId,planCode,showPushData,togglePushData ,windowWidth,windowHeight,hospitalId} = this.props
-        const url =`${pushPage2}?mrId=${mrId=="reStart" ? '':mrId}&planCode=${planCode}&hospitalId=${hospitalId}`;
+        const url =`${pushPage2}?mrId=${mrId.indexOf("reStart") > - 1?"":mrId}&planCode=${planCode}&hospitalId=${hospitalId}${mrId.indexOf("reStart") > - 1 ? '&reStart='+Math.random():""}`;
         return <div >
             {!showPushData&&<div className={style['slideButton']} style={{right:(windowWidth-1200)/2+'px'}} onClick={this.showPushData}> 
                 朗通智能提醒 

+ 1 - 1
src/store/actions/print.js

@@ -55,7 +55,7 @@ export const clearMrId = (state, action) => {
   const res = Object.assign({}, state);
   res.mrInfo = {
     update: 0,
-    mrId: 'reStart',
+    mrId: 'reStart'+Math.random(),
     mode: 'patientia',
   };
   return res;