import React, { Component } from "react"; import { connect } from "react-redux"; import BannerContainer from '@containers/TypeConfigContainer'; // 引入组件 import BodyContainer from "@components/BodyContainer"; import {ConfirmModal} from '@commonComp'; import store from '@store'; import {HIDEDROP,SETMINSCREEN,SETSYSTEMCONFIG,SETPRE,SETREADDITEMS,RESET_SELECT_TAG} from '@store/types/homePage.js'; import {billing} from '@store/async-actions/pushMessage'; import {CLEAR_SEARCH,DELETE_MAIN_SELECTED_TAGS} from '@types/mainSuit'; import {CURRENT_CLEAR,DELETE_CURRENT_SELECTED_TAGS} from '@types/currentIll'; import {OTHERHIS_CLEAR,DELETE_OTHER_SELECTED_TAGS} from '@types/otherHistory'; import {CHECKBODY_CLEAR,DELETE_CHECK_SELECTED_TAGS} from '@types/checkBody'; import style from './index.less'; import {getInitModules,getChronic,getSystemConfig} from '@store/async-actions/homePage.js'; import {getPreMsg} from '@store/async-actions/patInfo.js'; import { getUrlArgObject,parseNameVal,pushAllDataList } from "@utils/tools"; import $ from 'jquery'; import loading from '@common/images/loading.gif'; class HomePage extends Component { constructor() { super(); this.state={ timer:null, }; this.hidePops = this.hidePops.bind(this); } componentDidMount(){ const {setWindow,getChronicList,getConfig,clearAddItems} = this.props; //清除已保存的血压标签数据 clearAddItems(); //获取配置 getConfig(); getChronicList&&getChronicList();//获取慢病列表 // 获取并监听窗口宽度,用于有横向滚动条时患者信息和打印预览跟随滚动 let width = $(window).width(); let height = $(window).height(); setWindow && setWindow({width,height}); $(window).resize(function(){ let reWidth = $(window).width(); let reHeight = $(window).height(); setWindow && setWindow({width:reWidth,height:reHeight}); }) //光标没落到元素上继续backspace防止页面回退 $(window).on("keydown",(e)=>{ let ev = e || window.event; if(ev.keyCode==8){ const elem = ev.srcElement || ev.target; const nodeN = elem.nodeName; if(nodeN != "SPAN" && nodeN != "DIV" && nodeN != "INPUT" && nodeN != "TEXTAREA"){ return false; } } }) } hidePops(){ const {hideAllDrop,handleClear,resetSelect } = this.props; //重置选中范围 resetSelect(); if(!this.isBar){ //onMousrdown的目标为滚动条时,标签填写单不关闭 hideAllDrop(); //隐藏填写单 handleClear&&handleClear(); //清空搜索结果 } } setElem(e){ //onMousedown的目标为滚动条时,标签填写单不关闭 if(e.target.className=='scrollbar'){ this.isBar = true; }else{ this.isBar = false; } } handleKeyUp(e){ const {deleteLabels} = this.props; //删除选中标签 if(e.keyCode==8||e.keyCode==46){ //backspace或del都可删除 deleteLabels(); } } render() { const {flag,showPre,noReferRecord,referRecord} = this.props; return
(引用数据会清除当前内容)