Explorar o código

术语关联与否

luolei %!s(int64=4) %!d(string=hai) anos
pai
achega
2c81d19437

BIN=BIN
src/common/images/left3.png


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

@@ -6,6 +6,7 @@ import logo from "../../common/images/logoa.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';
@@ -53,6 +54,7 @@ class Banner extends Component {
     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(){
@@ -148,10 +150,11 @@ class Banner extends Component {
       showHos:!tmpshow
     })
   }
-  showCheckModal(id,name){
+  showCheckModal(id,name,connect){
     this.setState({
       hosIdTmp:id,
       hosNameTmp:name,
+      connectTmp:connect,
       showM:true,
     })
   }
@@ -160,11 +163,13 @@ class Banner extends Component {
       this.setState({
           showM: false,
           hosName:this.state.hosNameTmp,
-          hosId:this.state.hosIdTmp
+          hosId:this.state.hosIdTmp,
+          connect:this.state.connect
       })
       changeHospital({
         hosName:this.state.hosNameTmp,
-        hosId:this.state.hosIdTmp
+        hosId:this.state.hosIdTmp,
+        connect:this.state.connectTmp
       })
       clearAll()
       store.dispatch(embedPush({
@@ -183,10 +188,16 @@ class Banner extends Component {
         showM: false
       })
   }
+  showConnect(e){
+    this.setState({
+      showHos: false
+    })
+    e.stopPropagation()
+  }
   render() {
     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} = this;
+    const {showConfigModal, changeType, showHospitalLis,showCheckModal,showConnect} = this;
     const domNode = document.getElementById('root');
     const disabled = !(hasMain||hasCurrent||hasOther);
     return (
@@ -203,11 +214,15 @@ class Banner extends Component {
             <i> 预问诊信息</i>
           </div>:null} */}
           <div className={style["showHospitalLis"]} onClick={showHospitalLis} id="showHospitalLis">
-          <p className={`${style["selectedHos"]}`}><span className={style["ellipsis"]}>{curHos.hosName}</span><img src={bannerDown} /></p>
+            <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.name}</li>
+                  return <li className={style['ellipsis']} key={item.id} title={item.name} onClick={()=>showCheckModal(item.id,item.name,item.connect)}>{item.name}</li>
                 })
               }
             </ul>

+ 21 - 3
src/components/Banner/index.less

@@ -56,15 +56,33 @@
     }
     .showHospitalLis {
       float: right;
+      margin-right: 114px;
       height: 22px;
       line-height: 22px;
       width: 120px;
-      margin-top: 7px;
+      margin-top: 6px;
       cursor: pointer;
       .selectedHos {
         box-shadow: 0px 1px 3px 3px #45A3D2 inset;
         background-color: #65B5D9;
         padding-left: 10px;
+        i {
+          position: absolute;
+          right: 20px;
+          top: 7px;
+          height: 26px;
+          line-height: 26px;
+          font-weight: normal;
+          background-color: #EDF8FF;
+          border-radius: 3px;
+          padding: 0 10px;
+          cursor: default;
+          img {
+            position: absolute;
+            left: -27px;
+            top: 5px;
+          }
+        }
         span {
           width: 90px;
           top: 3px;
@@ -73,9 +91,9 @@
           display: inline-block;
           font-size: 12px;
         }
-        img {
+        img.bannerDown {
           position: absolute;
-          right: 10px;
+          right: 124px;
           top: 11px;
         }
       }

+ 2 - 1
src/store/reducers/homePage.js

@@ -39,7 +39,8 @@ const initState = {
   }],
   curHos:{
     hosId:-1,
-    hosName:'杭州朗通信息技术有限公司'
+    hosName:'杭州朗通信息技术有限公司',
+    connect:1
   }
 
 };