Browse Source

Merge remote-tracking branch 'origin/optimize' into optimize

# Conflicts:
#	src/components/MedicalInfo/index.jsx
#	src/components/MedicalInfo/index.less
#	src/components/ScaleSearch/index.jsx
#	src/components/ScaleSearch/index.less
zhouna 6 years ago
parent
commit
a2c1868e1f

+ 7 - 5
src/components/Banner/index.jsx

@@ -19,7 +19,6 @@ class Banner extends Component {
     this.state = {
       mode: props.typeConfig,
       zIndex:204,
-      emergency:true,
       emergencyBox:false
     };
     this.showConfigModal = this.showConfigModal.bind(this);
@@ -90,8 +89,8 @@ class Banner extends Component {
     dragBox('previewWrapper','previewStatic','del')    
   }
   render() {
-    const {visible,disVisible,copyVisible} = this.props;
-    const {mode,zIndex,emergency,emergencyBox} = this.state;
+    const {visible,disVisible,copyVisible,ifShow,deptName} = this.props;
+    const {mode,zIndex,emergencyBox} = this.state;
     const {showConfigModal, closeConfigModal, changeType, confirmType} = this;
 
     return (
@@ -99,7 +98,7 @@ class Banner extends Component {
         <img src={logo} />
         <span className={style["logo-name"]}>|&nbsp;&nbsp;智能辅助临床决策系统</span>
         <div className={style["buon"]}>
-          {emergency?<div className={style["buon1"]} onClick={this.showHisModal}>
+          {ifShow==1&&deptName=='急诊科'?<div className={style["buon1"]} onClick={this.showHisModal}>
                       <img className={`${style["st"]} ${style["his"]}`} src={emergIcon} />
                       本科室近期全部病历
                     </div>:''}
@@ -131,8 +130,11 @@ class Banner extends Component {
 }
 
 const mapStateToProps = function(state){
+  const {sysConfig} = state.homePage;
+  const {message} = state.patInfo;
   return {
-
+    ifShow:sysConfig.general_show,
+    deptName:message.selfDeptName
   }
 }
 

+ 20 - 21
src/components/MedicalInfo/index.jsx

@@ -8,6 +8,7 @@ class MedicalInfo extends Component {
         super(props);
         this.$inp = React.createRef();
         this.$cont = React.createRef();
+        this.$contList = React.createRef();
         this.state={
           val:''
         };
@@ -15,7 +16,6 @@ class MedicalInfo extends Component {
         this.handleChange = this.handleChange.bind(this);
         this.clear = this.clear.bind(this);
         this.getSearchList = this.getSearchList.bind(this);
-        this.handleEnter = this.handleEnter.bind(this);
     }
     getSearchList() {
         const { getAllConceptDetail,searchResult } = this.props;
@@ -33,16 +33,10 @@ class MedicalInfo extends Component {
       handleChangeValue&&handleChangeValue(val);
     }
   handleChange(){
-      console.log('change')
       this.setState({
         val:this.$inp.current.value
       });
   }
-  handleEnter(e){
-      if(e.keyCode==13){
-        this.search();
-      }
-  }
   clear(){
     this.$inp.current.value = '';
     this.setState({
@@ -50,12 +44,14 @@ class MedicalInfo extends Component {
     });
   }
   componentDidMount(){
-    const height = getWindowInnerHeight()-170;
+    const height = getWindowInnerHeight()-234;
     this.$cont.current.style.height = height+"px";
+    this.$contList.current.style.height = height-30+"px";
     if(this.$cont.current){
       windowEventHandler('resize', ()=>{
-        const height = getWindowInnerHeight()-170;
+        const height = getWindowInnerHeight()-234;
         this.$cont.current.style.height = height+"px";
+        this.$contList.current.style.height = height-30+"px";
       });
     }
   }
@@ -63,24 +59,27 @@ class MedicalInfo extends Component {
         const {searchResult} = this.props;
         const {val} = this.state;
         return (
-            <div className={style['search-cont']} ref={this.$cont}>
-              <div className={style['search-box']}>
+        <div className={style['mefical-info-wrapper']}>
+            <div className={style['search-cont']}>
                 <p className={style['title']}>医学知识搜索</p>
                 <p className={style['cont']}>
-                  <input type="text" className={style['input']} ref={this.$inp} onInput={this.handleChange} onKeyUp={this.handleEnter}/>
+                  <input type="text" className={style['input']} ref={this.$inp} onInput={this.handleChange}/>
                   {val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
                   <button onClick={this.search}>搜索</button>
                 </p>
-              </div>
-              {searchResult&&searchResult.length>0?<div className={style['result']}>
-                    <p className={style['title']}>查询内容</p>
-                    <ul>
-                      {this.getSearchList()}
-                    </ul>
-              </div>:<p className={style['no-data']}>暂无搜索结果!</p>}
+                <div className={style['result-box']} ref={this.$cont}>
+                  <div className={style['result']} style={searchResult&&searchResult.length>0? {'display': 'block'} : {'display': 'none'}}>
+                      <p className={style['title']}>查询内容</p>
+                      <ul className={style['result-list']} ref={this.$contList}>
+                        {this.getSearchList()}
+                      </ul>
+                  </div>
+                  <p className={style['no-data']} style={searchResult&&searchResult.length>0? {'display': 'none'} : {'display': 'block'}}>暂无搜索结果!</p>
+                </div>
+              
              </div>
-
-
+        </div>
+        
         )
 
         

+ 5 - 16
src/components/MedicalInfo/index.less

@@ -7,17 +7,6 @@
     position: relative;
 }
 .search-cont{
-    padding: 0px 15px;
-    line-height: 20px;
-    position: relative;
-    overflow: hidden;
-    .search-box{
-        position: fixed;
-        z-index: 9;
-        background: #fff;
-        width: 430px;
-        padding: 0 0 15px;
-    }
     .cont{
         position: relative;
         img{
@@ -48,14 +37,15 @@
         line-height: 34px;
         color: #fff;
         background: #2A9BD5;
+        border:1px #2A9BD5 solid;
         text-align: center;
         border: none;
     }
-    .result{
-        padding: 78px 5px 0 0;
-        height: 100%;
+    .result-list {
         overflow: auto;
-        box-sizing: border-box;
+    }
+    .result{
+        padding-top: 15px;
         li{
             border-bottom:1px #CECECE solid;
             line-height: 42px;
@@ -88,6 +78,5 @@
         color:#979797;
         text-align: center;
         line-height: 40px;
-        margin-top: 66px;
     }
 }

+ 25 - 24
src/components/ScaleSearch/index.jsx

@@ -8,13 +8,13 @@ class ScaleSearch extends Component {
     super(props);
     this.$inp = React.createRef();
     this.$cont = React.createRef();
+    this.$contList = React.createRef();
     this.state={
       val:''
     };
     this.search = this.search.bind(this);
     this.handleChange = this.handleChange.bind(this);
     this.clear = this.clear.bind(this);
-    this.handleEnter = this.handleEnter.bind(this);
   }
   getResult(id){
     const {formulaResult} = this.props;
@@ -52,11 +52,6 @@ class ScaleSearch extends Component {
       val:this.$inp.current.value
     });
   }
-  handleEnter(e){
-    if(e.keyCode==13){
-      this.search();
-    }
-  }
   clear(){
     this.$inp.current.value = '';
     this.setState({
@@ -64,12 +59,14 @@ class ScaleSearch extends Component {
     });
   }
   componentDidMount(){
-    const height = getWindowInnerHeight()-170;
+    const height = getWindowInnerHeight()-234;
     this.$cont.current.style.height = height+"px";
+    this.$contList.current.style.height = height-30+"px";
     if(this.$cont.current){
       windowEventHandler('resize', ()=>{
-        const height = getWindowInnerHeight()-170;
+        const height = getWindowInnerHeight()-234;
         this.$cont.current.style.height = height+"px";
+        this.$contList.current.style.height = height-30+"px";
       });
     }
   }
@@ -77,24 +74,28 @@ class ScaleSearch extends Component {
     const {searchResult} = this.props;
     const {val} = this.state;
     return (
-        <div className={style['search-cont']} ref={this.$cont}>
-          <div className={style['search-box']}>
-            <p className={style['title']}>量表搜索</p>
-            <p className={style['cont']}>
-              <input type="text" className={style['input']} ref={this.$inp} onInput={this.handleChange} onKeyUp={this.handleEnter}/>
-              {val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
-              <button onClick={this.search}>搜索</button>
-            </p>
-          </div>
-          {searchResult&&searchResult.length>0?<div className={style['result']}>
-            <p className={style['title']}>查询内容</p>
-            <ul>
-              {this.getSearchList()}
-            </ul>
-          </div>:<p className={style['no-data']}>暂无搜索结果!</p>}
+      <div className={style['mefical-info-wrapper']}>
+            <div className={style['search-cont']}>
+                <p className={style['title']}>量表搜索</p>
+                <p className={style['cont']}>
+                  <input type="text" className={style['input']} ref={this.$inp} onInput={this.handleChange}/>
+                  {val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
+                  <button onClick={this.search}>搜索</button>
+                </p>
+                <div className={style['result-box']} ref={this.$cont}>
+                  <div className={style['result']} style={searchResult&&searchResult.length>0? {'display': 'block'} : {'display': 'none'}}>
+                      <p className={style['title']}>查询内容</p>
+                      <ul className={style['result-list']} ref={this.$contList}>
+                        {this.getSearchList()}
+                      </ul>
+                  </div>
+                  <p className={style['no-data']} style={searchResult&&searchResult.length>0? {'display': 'none'} : {'display': 'block'}}>暂无搜索结果!</p>
+                </div>
+              
+             </div>
         </div>
-    )
 
+    )
 
 
   }

+ 5 - 16
src/components/ScaleSearch/index.less

@@ -7,17 +7,6 @@
   position: relative;
 }
 .search-cont{
-  padding: 0px 15px;
-  line-height: 20px;
-  position: relative;
-  overflow: hidden;
-  .search-box{
-    position: fixed;
-    z-index: 9;
-    background: #fff;
-    width: 430px;
-    padding: 0 0 15px;
-  }
   .cont{
     position: relative;
     img{
@@ -48,14 +37,15 @@
     line-height: 34px;
     color: #fff;
     background: #2A9BD5;
+    border:1px #2A9BD5 solid;
     text-align: center;
     border: none;
   }
-  .result{
-    padding: 78px 5px 0 0;
-    height: 100%;
+  .result-list {
     overflow: auto;
-    box-sizing: border-box;
+  }
+  .result{
+    padding-top: 15px;
     li{
       border-bottom:1px #CECECE solid;
       line-height: 42px;
@@ -93,6 +83,5 @@
     color:#979797;
     text-align: center;
     line-height: 40px;
-    margin-top: 66px;
   }
 }