|
@@ -3,9 +3,10 @@ import { connect } from "react-redux";
|
|
|
import style from "./index.less";
|
|
|
import ReactDom from "react-dom";
|
|
|
import logo from "../../common/images/logoa.png";
|
|
|
-import prec from "../../common/images/prec.png";
|
|
|
+import bannerDown from "../../common/images/bannerDown.png";
|
|
|
import setup from "../../common/images/setup.png";
|
|
|
import emergIcon from '../../common/images/emergency.png'
|
|
|
+import left3 from '../../common/images/left3.png'
|
|
|
import {Notify} from '@commonComp';
|
|
|
import Emergency from '@containers/Emergency';
|
|
|
import PreInIcss from '@containers/PreInIcss';
|
|
@@ -14,10 +15,14 @@ import {timestampToTime,getCurrentDate} from '@utils/tools.js';
|
|
|
import {dragBox} from '@utils/drag';
|
|
|
import {CLEAR_COMSYMPTOMS} from '@store/types/mainSuit';
|
|
|
import { GET_PREC_LIST,SET_PREC_SHOW } from "@store/types/preIcss";
|
|
|
+import { CHANGEHOSPITAL } from "@store/types/homePage";
|
|
|
import {getPreMsg} from '@store/async-actions/preIcss';
|
|
|
import ModeChange from './ModeChange'
|
|
|
+import {ConfirmModal} from '@commonComp';
|
|
|
import { embedPush} from '../../store/async-actions/pushMessage'
|
|
|
+import { clearMessages } from "../../store/async-actions/print";
|
|
|
import {debounce} from '../../utils/tools'
|
|
|
+import $ from 'jquery';
|
|
|
import store from '@store';
|
|
|
class Banner extends Component {
|
|
|
constructor(props){
|
|
@@ -29,15 +34,38 @@ class Banner extends Component {
|
|
|
config2:conf[2], //其他史默认
|
|
|
config3:conf[3], //字体大小
|
|
|
config4:conf[4], //字体颜色
|
|
|
- emergencyBox:false
|
|
|
+ emergencyBox:false,
|
|
|
+ showHos:false,
|
|
|
+ showM:false,
|
|
|
+ hosName:"杭州朗通信息技术有限公司",
|
|
|
+ hosId:"-1",
|
|
|
+ hosNameTmp:"",
|
|
|
+ hosIdTmp:"-1",
|
|
|
};
|
|
|
this.showConfigModal = this.showConfigModal.bind(this);
|
|
|
this.changeType = this.changeType.bind(this);
|
|
|
this.confirmType = this.confirmType.bind(this);
|
|
|
this.showHisModal = this.showHisModal.bind(this);
|
|
|
this.handleHisClose = this.handleHisClose.bind(this);
|
|
|
+ this.showHospitalLis = this.showHospitalLis.bind(this);
|
|
|
this.setInitConfig = this.setInitConfig.bind(this);
|
|
|
this.handleEmbedPush = this.handleEmbedPush.bind(this);
|
|
|
+ this.deleteItem = this.deleteItem.bind(this);
|
|
|
+ this.cancel = this.cancel.bind(this);
|
|
|
+ this.close = this.close.bind(this);
|
|
|
+ this.showCheckModal = this.showCheckModal.bind(this);
|
|
|
+ this.showConnect = this.showConnect.bind(this);
|
|
|
+ }
|
|
|
+
|
|
|
+ componentDidMount(){
|
|
|
+ $(document).click((e) => {
|
|
|
+ let showHospitalLis = document.getElementById("showHospitalLis"); // 公共填写单
|
|
|
+ if(!$.contains(showHospitalLis, e.target)){
|
|
|
+ this.setState({
|
|
|
+ showHos:false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
showConfigModal(){
|
|
@@ -107,10 +135,8 @@ class Banner extends Component {
|
|
|
this.setState({
|
|
|
emergencyBox:false,
|
|
|
});
|
|
|
- dragBox('previewWrapper','previewStatic','del')
|
|
|
+ dragBox('previewWrapper','previewStatic','del')
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
// 处理点击的默认推送
|
|
|
handleEmbedPush(){
|
|
|
store.dispatch(embedPush({
|
|
@@ -118,17 +144,66 @@ class Banner extends Component {
|
|
|
mode: 1
|
|
|
}))
|
|
|
}
|
|
|
-
|
|
|
+ showHospitalLis(){
|
|
|
+ let tmpshow = this.state.showHos
|
|
|
+ this.setState({
|
|
|
+ showHos:!tmpshow
|
|
|
+ })
|
|
|
+ }
|
|
|
+ showCheckModal(id,name,connect){
|
|
|
+ this.setState({
|
|
|
+ hosIdTmp:id,
|
|
|
+ hosNameTmp:name,
|
|
|
+ connectTmp:connect,
|
|
|
+ showM:true,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ deleteItem() {
|
|
|
+ const {changeHospital,clearAll} = this.props
|
|
|
+ this.setState({
|
|
|
+ showM: false,
|
|
|
+ hosName:this.state.hosNameTmp,
|
|
|
+ hosId:this.state.hosIdTmp,
|
|
|
+ connect:this.state.connect
|
|
|
+ })
|
|
|
+ changeHospital({
|
|
|
+ hosName:this.state.hosNameTmp,
|
|
|
+ hosId:this.state.hosIdTmp,
|
|
|
+ connect:this.state.connectTmp
|
|
|
+ })
|
|
|
+ clearAll()
|
|
|
+ store.dispatch(embedPush({
|
|
|
+ action: "patientia",
|
|
|
+ mode: 1
|
|
|
+ }))
|
|
|
+ Notify.success('切换成功')
|
|
|
+ }
|
|
|
+ cancel() {
|
|
|
+ this.setState({
|
|
|
+ showM: false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ close() {
|
|
|
+ this.setState({
|
|
|
+ showM: false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ showConnect(e){
|
|
|
+ this.setState({
|
|
|
+ showHos: false
|
|
|
+ })
|
|
|
+ e.stopPropagation()
|
|
|
+ }
|
|
|
render() {
|
|
|
- const {visible,pre,ifShow,deptName, closeConfigModal,hasMain,hasCurrent,hasOther,preShow,show} = this.props;
|
|
|
- const {emergencyBox} = this.state;
|
|
|
- const {showConfigModal, changeType, confirmType} = this;
|
|
|
+ const {visible,pre,ifShow,deptName, closeConfigModal,hasMain,hasCurrent,hasOther,preShow,show,hospitalMsg,curHos} = this.props;
|
|
|
+ const {emergencyBox,showHos,showM,hosName,hosNameTmp} = this.state;
|
|
|
+ const {showConfigModal, changeType, showHospitalLis,showCheckModal,showConnect} = this;
|
|
|
const domNode = document.getElementById('root');
|
|
|
const disabled = !(hasMain||hasCurrent||hasOther);
|
|
|
return (
|
|
|
- <div className={style["logo"]} onClick={this.handleEmbedPush}>
|
|
|
- <img src={logo} />
|
|
|
- <span className={style["logo-name"]}>| 智能辅助临床决策系统</span>
|
|
|
+ <div className={style["logo"]}>
|
|
|
+ <img src={logo} onClick={this.handleEmbedPush}/>
|
|
|
+ <span className={style["logo-name"]} onClick={this.handleEmbedPush}>| 智能辅助临床决策系统</span>
|
|
|
<div className={style["buon"]}>
|
|
|
{ifShow==1&&deptName=='急诊科'?<div className={`${style["buon1"]} ${style["buon2"]}`} onClick={this.showHisModal}>
|
|
|
<img className={`${style["st"]} ${style["his"]}`} src={emergIcon} />
|
|
@@ -138,10 +213,24 @@ class Banner extends Component {
|
|
|
<img className={style["st"]} src={prec} alt="预问诊"/>
|
|
|
<i> 预问诊信息</i>
|
|
|
</div>:null} */}
|
|
|
- {/*<div className={style["buon1"]} onClick={showConfigModal}>
|
|
|
+ <div className={style["showHospitalLis"]} onClick={showHospitalLis} id="showHospitalLis">
|
|
|
+ <p className={`${style["selectedHos"]}`}>
|
|
|
+ <span className={style["ellipsis"]}>{curHos.hosName}</span>
|
|
|
+ <i style={{color:curHos.connect==1?'#3B9ED0':'#FF545B'}} onClick={(e)=>{showConnect(e)}}><img src={left3}/>{curHos.connect==1?'术语已关联':'术语未关联'}</i>
|
|
|
+ <img className={style['bannerDown']} src={bannerDown} />
|
|
|
+ </p>
|
|
|
+ <ul className={`${style["hospitalLis"]}`} style={{"display":showHos?"block":"none"}}>
|
|
|
+ {
|
|
|
+ hospitalMsg&&hospitalMsg.map((item)=>{
|
|
|
+ return <li className={style['ellipsis']} key={item.id} title={item.name} onClick={()=>showCheckModal(item.id,item.name,item.connect)}>{item.name}</li>
|
|
|
+ })
|
|
|
+ }
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ {/* <div className={style["buon1"]} onClick={showConfigModal}>
|
|
|
<img className={style["st"]} src={setup} />
|
|
|
<i> 设置</i>
|
|
|
- </div>*/}
|
|
|
+ </div> */}
|
|
|
</div>
|
|
|
{/*{visible&& <ModeChange
|
|
|
{...this.state}
|
|
@@ -159,19 +248,33 @@ class Banner extends Component {
|
|
|
</React.Fragment>
|
|
|
, domNode):''}
|
|
|
{show?<PreInIcss></PreInIcss>:null}
|
|
|
+ <ConfirmModal visible={showM}
|
|
|
+ okText='确定'
|
|
|
+ cancelText='取消'
|
|
|
+ confirm={this.deleteItem}
|
|
|
+ cancel={this.cancel}
|
|
|
+ close={this.close}
|
|
|
+ okBorderColor={'#3B9ED0'}
|
|
|
+ okColor={'#fff'}
|
|
|
+ oKBg={'#3B9ED0'}
|
|
|
+ >
|
|
|
+ <div className={style['changeHos']}>确定要切换至{hosNameTmp}吗?医院切换后将清空当前页面。</div>
|
|
|
+ </ConfirmModal>
|
|
|
</div>
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
const mapStateToProps = function(state){
|
|
|
- const {sysConfig} = state.homePage;
|
|
|
+ const {sysConfig,hospitalMsg,curHos} = state.homePage;
|
|
|
const {message} = state.patInfo;
|
|
|
return {
|
|
|
ifShow:sysConfig.general_show,
|
|
|
deptName:message.selfDeptName,
|
|
|
show:state.preIcss.preShow,
|
|
|
- pre:sysConfig.connect_prec
|
|
|
+ pre:sysConfig.connect_prec,
|
|
|
+ curHos:curHos,
|
|
|
+ hospitalMsg:hospitalMsg,
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -187,6 +290,15 @@ const mapDispatchToProps = function(dispatch){
|
|
|
},
|
|
|
preShow(show){
|
|
|
show?dispatch({type:SET_PREC_SHOW}):getPreMsg()
|
|
|
+ },
|
|
|
+ clearAll(){
|
|
|
+ clearMessages()
|
|
|
+ },
|
|
|
+ changeHospital(obj){
|
|
|
+ dispatch({
|
|
|
+ type: CHANGEHOSPITAL,
|
|
|
+ data:obj
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|