瀏覽代碼

Merge remote-tracking branch 'origin/dev/new' into dev/new

zhouna 6 年之前
父節點
當前提交
2c6c28b79b
共有 2 個文件被更改,包括 36 次插入8 次删除
  1. 20 6
      src/components/Banner/index.jsx
  2. 16 2
      src/components/Operation/index.jsx

+ 20 - 6
src/components/Banner/index.jsx

@@ -10,7 +10,8 @@ class Banner extends Component {
   constructor(props){
     super(props)
     this.state = {
-      mode: props.typeConfig
+      mode: props.typeConfig,
+      zIndex:40
     };
     this.showConfigModal = this.showConfigModal.bind(this);
     this.closeConfigModal = this.closeConfigModal.bind(this);
@@ -20,13 +21,17 @@ class Banner extends Component {
 
   showConfigModal(){
     this.setState({
-      mode:this.props.typeConfig
+      mode:this.props.typeConfig,
+      zIndex:202
     });
     this.props.showConfigModal()
   }
 
   closeConfigModal(){
     this.props.closeConfigModal();
+    this.setState({
+      zIndex:40
+    })
   }
 
   changeType(typeConfig){
@@ -36,8 +41,17 @@ class Banner extends Component {
   }
 
   confirmType(){
-    this.props.confirmType(this.state.mode);
+    const {typeConfig,confirmType} = this.props;
+    const mode = this.state.mode;
+    if(mode==typeConfig){
+      this.closeConfigModal()
+      return;
+    }
+    confirmType&&confirmType(mode);
     this.closeConfigModal()
+    this.setState({
+      zIndex:40
+    })
   }
   /*componentDidUpdate(){
     const {failed} = this.props;
@@ -48,11 +62,11 @@ class Banner extends Component {
   }*/
   render() {
     const {visible} = this.props;
-    const {mode} = this.state;
+    const {mode,zIndex} = this.state;
     const {showConfigModal, closeConfigModal, changeType, confirmType} = this;
 
     return (
-      <div className={style["logo"]} >
+      <div className={style["logo"]} style={{zIndex:zIndex}}>
         <img src={logo} />
         <span>|&nbsp;&nbsp;智能辅助临床决策系统</span>
         <div className={style["buon"]} onClick={showConfigModal}>
@@ -63,7 +77,7 @@ class Banner extends Component {
           <div className={style['shade']}></div>
           <div className={style['content']}>
             <div className={style['close']}>设置<img src={close} onClick={closeConfigModal} /></div>
-            <p className={style['title']}>模式切换<i>(模式说明:切换模式会清空当前主诉、现病史、其他史填入的数据)</i></p>
+            <p className={style['title']}>模式切换<i>(模式说明:切换模式会清空当前所有的数据)</i></p>
             <ul>
               <li className={+mode===0?style['selected']:''} onClick={() => changeType(0)}><img src={ok} />智能推送模式</li>
               <li className={+mode===1?style['selected']:''} onClick={() => changeType(1)}><img src={ok} />纯文本模式</li>

+ 16 - 2
src/components/Operation/index.jsx

@@ -22,7 +22,8 @@ class Operation extends Component {
       okColor: '',
       oKBg: '',
       msg: '',
-      type: ''
+      type: '',
+      zIndex:40
     }
     this.showPrint = this.showPrint.bind(this);
     this.closePrint = this.closePrint.bind(this);
@@ -35,19 +36,31 @@ class Operation extends Component {
   }
 
   showPrint() {
+    this.setState({
+      zIndex:240
+    })
     this.props.showPrintPreview()
   }
 
   closePrint() {
+    this.setState({
+      zIndex:40
+    })
     this.props.closePrintPreview()
   }
 
 
   showPreview() {
+    this.setState({
+      zIndex:240
+    })
     this.props.showPreview()
   }
 
   closePreview() {
+    this.setState({
+      zIndex:40
+    })
     this.props.closePreview()
   }
 
@@ -244,8 +257,9 @@ class Operation extends Component {
   render() {
     const { showPrint, closePrint, showPreview, closePreview } = this;
     const { visible, preVisible } = this.props.print;
+    const {zIndex} = this.state;
 
-    return <div className={style['container']} >
+    return <div className={style['container']} style={{zIndex:zIndex}}>
       <button className={style['button']} onClick={showPrint}><img src={printImg} /> 打印病历</button>
       <button className={style['preButton']} onClick={showPreview}><img src={preview} /> 预览</button>
       <button className={style['preButton']} onClick={() => { this.saveHis(3) }}><img src={saveHistory} /> 保存病历模板</button>