morphone1995 il y a 4 ans
Parent
commit
d1f816f338
2 fichiers modifiés avec 26 ajouts et 2 suppressions
  1. 15 2
      src/components/Banner/index.jsx
  2. 11 0
      src/utils/tools.js

+ 15 - 2
src/components/Banner/index.jsx

@@ -16,7 +16,9 @@ import {CLEAR_COMSYMPTOMS} from '@store/types/mainSuit';
 import { GET_PREC_LIST,SET_PREC_SHOW } from "@store/types/preIcss";
 import {getPreMsg} from '@store/async-actions/preIcss';
 import ModeChange from './ModeChange'
-
+import { embedPush} from '../../store/async-actions/pushMessage'
+import {debounce} from '../../utils/tools'
+import store from '@store';
 class Banner extends Component {
   constructor(props){
     super(props);
@@ -35,6 +37,7 @@ class Banner extends Component {
     this.showHisModal = this.showHisModal.bind(this);
     this.handleHisClose = this.handleHisClose.bind(this);
     this.setInitConfig = this.setInitConfig.bind(this);
+    this.handleEmbedPush = this.handleEmbedPush.bind(this);
   }
 
   showConfigModal(){
@@ -106,6 +109,16 @@ class Banner extends Component {
     });
     dragBox('previewWrapper','previewStatic','del')    
   }
+
+
+  // 处理点击的默认推送
+  handleEmbedPush(){
+    store.dispatch(embedPush({
+      action: "patientia",
+      mode: 1
+    }))
+  }
+
   render() {
     const {visible,pre,ifShow,deptName, closeConfigModal,hasMain,hasCurrent,hasOther,preShow,show} = this.props;
     const {emergencyBox} = this.state;
@@ -113,7 +126,7 @@ class Banner extends Component {
     const domNode = document.getElementById('root');
     const disabled = !(hasMain||hasCurrent||hasOther);
     return (
-      <div className={style["logo"]} >
+      <div className={style["logo"]} onClick={this.handleEmbedPush}>
         <img src={logo} />
         <span className={style["logo-name"]}>|&nbsp;&nbsp;智能辅助临床决策系统</span>
         <div className={style["buon"]}>

+ 11 - 0
src/utils/tools.js

@@ -352,6 +352,17 @@ const delHistoryDataList = () =>{
 }
 
 
+// 防抖函数
+export function debounce(func, delay) {
+  let timer = null;
+  return function (...args) {
+    if (timer) clearTimeout(timer);
+    timer = setTimeout(() => {
+      func.apply(this, args);
+    }, delay);
+  };
+}
+