Преглед изворни кода

Merge remote-tracking branch 'origin/dev/zhangxc1' into dev/new1

zhouna пре 6 година
родитељ
комит
53e7314bbc

+ 1 - 1
src/common/components/ConfirmModal/index.jsx

@@ -57,7 +57,7 @@ const defaultProps = {
     titleBg: '#fff',
     noFooter: false,
     mask: true,
-    maskClosable: false,
+    maskClosable: true,
     closable: true,
     okText: '确认',
     okColor: 'red',

+ 21 - 15
src/common/components/SearchOption/index.jsx

@@ -3,6 +3,7 @@ import styles from './index.less';
 import clear from './imgs/clear.png';
 import search from './imgs/search.png';
 import PropTypes from "prop-types";
+import config from '@config/index';
 /**
  * 前提条件父元素有定位
  * visible  搜索显示隐藏
@@ -14,7 +15,8 @@ class SearchOption extends React.Component {
         this.state = {
             val:'',
             border:'',
-            show:false
+            show:false,
+            timer:null
         }
         this.textInput = React.createRef();
         this.handleClearVal = this.handleClearVal.bind(this);
@@ -50,20 +52,24 @@ class SearchOption extends React.Component {
     }
     handleInput(e){
       const { handleChangeValue } = this.props;
-      if((e.target.value).trim() != ''){
-          handleChangeValue(e.target.value);
-          this.setState({
-              val:e.target.value,
-              show:true
-          })
-      }else{
-          // this.handleClearVal('')            //这个要放开,输入为空清除列表ie8会有问题
-          handleChangeValue('');
-          this.setState({
-              show:false
-          })
-          return;
-      }
+        clearTimeout(this.state.timer);
+        let timer = setTimeout(()=>{
+            clearTimeout(this.state.timer);
+            if(e.target.value.trim() == ''){
+                this.setState({
+                    show:false
+                })
+                return  handleChangeValue('');
+            }
+            this.setState({
+                val:e.target.value,
+                show:true
+            })
+            handleChangeValue(e.target.value);
+        },config.delayTime);
+        this.setState({
+            timer
+        });
     }
     handleFocus(){
       if(this.state.val.trim() != ''){

+ 1 - 1
src/components/Banner/index.jsx

@@ -74,7 +74,7 @@ class Banner extends Component {
           设置
         </div>
         {visible?<div className={style['modal']}>
-          <div className={style['shade']}></div>
+          <div className={style['shade']} onClick={closeConfigModal}></div>
           <div className={style['content']}>
             <div className={style['close']}>设置<img src={close} onClick={closeConfigModal} /></div>
             <p className={style['title']}>模式切换<i>(模式说明:切换模式会清空当前所有的数据)</i></p>

+ 2 - 2
src/components/CopyRight/index.jsx

@@ -91,7 +91,7 @@ class CopyRight extends Component {
           className={style["copyModal"]}
           style={copyVisible ? { display: "block" } : { display: "none" }}
         >
-          <div className={style["shade"]}/>
+          <div className={style["shade"]}  onClick={closeCopyModal}/>
           <div className={style["copyContent"]}>
             <div className={style["header"]}>版本信息<img src={close} onClick={closeCopyModal} /></div>
             <div className={style["now"]}>
@@ -105,7 +105,7 @@ class CopyRight extends Component {
           className={style["disModal"]}
           style={disVisible ? { display: "block" } : { display: "none" }}
         >
-          <div className={style["shade"]} />
+          <div className={style["shade"]} onClick={closeDisclatmerModal}/>
           <div className={style["disContent"]}>
             <div className={style["header"]}>免责声明<img src={close} onClick={closeDisclatmerModal} /></div>
             <div className={style["content"]}>{this.disclatmerContent()}</div>

+ 9 - 2
src/components/DiagnosticItem/index.jsx

@@ -33,11 +33,18 @@ class DiagnosticItem extends Component{
             })
         }
     chooseDiagodal(item) {
+        const { diagnosticList,getTips } = this.props;
+        getTips && getTips(item);
+        for (let i = 0; i < diagnosticList.length; i++) {
+            if(diagnosticList[i].id === item.id && diagnosticList[i].name === item.name) {
+                Notify.info('该诊断已存在');
+                return
+            }
+        }
         this.setState({
             visible: true
         })
-        const { getTips } = this.props;
-        getTips && getTips(item);
+       
     }
     addDiagodal(diagType){
         const {item} = this.props;

+ 1 - 1
src/components/HistoryCaseContainer/index.jsx

@@ -35,7 +35,7 @@ class HistoryCaseContainer extends React.Component {
         const domNode = document.getElementById('root');
         return ReactDom.createPortal(
             <div className={styles.historyCaseWrap} style={{display:showHistoryCases?'block':'none'}}>
-                <div className={styles.maskHistory}></div>
+                <div className={styles.maskHistory} onClick={showHistoryBox}></div>
                 <HistoryList 
                     items={items}
                     activeHistory={activeHistory}

+ 1 - 1
src/components/Preview/index.jsx

@@ -17,7 +17,7 @@ class Preview extends Component {
     const dataStr = getAllDataStringList(baseList);
 
     return <div className={style['container']} style={visible? {display: 'block'}: {display: 'none'}}>
-      <div className={style['shade']}></div>
+      <div className={style['shade']} onClick={onClose}></div>
       <div className={style['modal']}>
         <div className={style['close']}>预览<img src={close} onClick={onClose} /></div>
         <PreviewBody

+ 1 - 1
src/components/PrintPreview/index.jsx

@@ -30,7 +30,7 @@ class PrintPreview extends Component {
         const dataStr = getAllDataStringList(baseList);
 
         return <div className={style['container']} style={visible ? { display: 'block' } : { display: 'none' }}>
-            <div className={style['shade']}></div>
+            <div className={style['shade']} onClick={onClose}></div>
             <div className={style['modal']}>
                 <div className={style['close']}>打印<img src={close} onClick={onClose} /></div>
                 {/* <div id="content"> */}

+ 1 - 1
src/components/PushItems/DetailsModal/index.jsx

@@ -80,7 +80,7 @@ class DetailsModal extends Component {
                         })}
                 </div>
            </div>
-           <div className={styles['details-mask']}>
+           <div className={styles['details-mask']} onClick={this.hideTips}>
            </div>
         </div>
     </NewPortal>)

+ 2 - 2
src/components/PushItems/PushDiag/index.jsx

@@ -46,14 +46,14 @@ class PushDiag extends Component {
             <h1 className={style['push-diag-title']} style={{background:titleBg}}><img className={style['push-diag-icon']} src={icon} />{title}</h1>
             <div className={style['push-diag-box']}>
                 {maxShowNum ? diagList.map((item, index) => {
-                    ItemNum = ItemNum + item.name.length + 2;
+                    ItemNum = ItemNum + item.name.length + 1;
                     if (ItemNum <= moreNum) {
                         return <div key={item.id} className={style['push-diag-item']}><DiagnosticItem item={item}/></div>
                     }
                 }) : diagList.map((item, index) => {
                 return <div key={item.id} className={style['push-diag-item']}><DiagnosticItem item={item}/></div>
                 })}
-                {ItemNum > maxShowNum && <div onClick={() => this.handleShow(ItemNum)} className={style['push-diag-more']}>{showMore ? ' 查看更多': '收起'}<img className={style['push-diag-more-icon']} src={showMore ? showImg : hideImg}/></div>}
+                {ItemNum > maxShowNum && <div onClick={() => this.handleShow(ItemNum)} className={style['push-diag-more']}>{showMore ? ' 更多': '收起'}<img className={style['push-diag-more-icon']} src={showMore ? showImg : hideImg}/></div>}
 
             </div>
             

+ 6 - 6
src/components/PushItems/index.jsx

@@ -109,7 +109,7 @@ class PushItems extends Component {
     let assayNum = 0;
     let assayHide = assay.map((item, index) => {
       assayNum = assayNum + item.name.length + 2;
-      if (assayNum > 22) {
+      if (assayNum > 23) {
         return;
       } else {
         return (
@@ -143,7 +143,7 @@ class PushItems extends Component {
     let checkNum = 0;
     let checkHide = check.map((item, index) => {
       checkNum = checkNum + item.name.length + 2;
-      if (checkNum > 22) {
+      if (checkNum > 23) {
         return;
       } else {
         return (
@@ -199,7 +199,7 @@ class PushItems extends Component {
                 icon={doubtImg}
                 title="疑似诊断"
                 diagList={doubt}
-                maxShowNum={28}
+                maxShowNum={26}
               />
             )}
             {possible && possible.length > 0 && (
@@ -208,7 +208,7 @@ class PushItems extends Component {
                 icon={possibleImg}
                 title="可能诊断"
                 diagList={possible}
-                maxShowNum={28}
+                maxShowNum={26}
               />
             )}
             <div className={style["diagnose"]}>
@@ -238,14 +238,14 @@ class PushItems extends Component {
               </h1>
               <div>
                 {assay.length === 0 && check.length === 0 ? (
-                  "无"
+                  <span>无</span>
                 ) : (
                   <ul>
                     <li className={style["firstLi"]}>
                       <div className={style["title"]}>化验:</div>
                       <div className={style["content"]}>
                         {assay.length === 0
-                          ? "无"
+                          ?<span >无</span>
                           : moreAssay
                           ? assays
                           : assayHide}

+ 7 - 5
src/components/PushItems/index.less

@@ -56,7 +56,7 @@
       }
       div{
         font-size: 14px;
-        padding:6px 15px;
+        padding:6px  0 6px 15px;
         span{
           cursor: pointer;
         }
@@ -96,7 +96,7 @@
     h1{
       font-size: 14px;
       color: #000;
-      padding: 8px 15px;
+      padding: 8px 6px 8px 15px;
       background: #EAF7FA;
       font-weight: bold;
       img {
@@ -122,7 +122,7 @@
     }
     div{
       font-size: 14px;
-      padding:6px 15px;
+      padding:6px 0px 6px 15px;
       ul{
         .firstLi{
           border-bottom: 1px solid #DFDFDF;
@@ -135,13 +135,15 @@
           overflow: hidden;
           .title{
             float: left;
+            height: 26px;
+            line-height: 26px;
             padding: 0px 0px 0px 0px;
           }
           .content{
             float: left;
-            width: 352px;
+            width: 359px;
+            line-height: 26px;
             padding: 0px 0px 0px 0px;
-            margin-top: -2px;
             span{
               font-size: 14px;
               line-height: 14px;

+ 1 - 1
src/components/Treat/index.jsx

@@ -44,7 +44,7 @@ class Treat extends Component {
         const { setDrugInfoMore } = this.props
         return(
             <div   className={style['treat-wrapper']}>
-                <div className={style['treat-mask']}>
+                <div className={style['treat-mask']} onClick={this.hideTreat}>
                 </div>
                 <div id='treatWrapper' className={style['treat-box']}>
                     <div className={style['treat-title']}>治疗方案 ({treatItem.name})<img onClick={this.hideTreat} src={close}/></div>

+ 2 - 2
src/components/Treat/index.less

@@ -31,8 +31,8 @@
     background: #fff;
     width: 680px;
     left: 50%;
-    top: 20%;
-    height: 60%;
+    top: 10%;
+    height: 80%;
     margin-left: -340px;
     z-index: 301;
     padding-top: 40px;

+ 53 - 3
src/components/TreatDesc/DrugInfo/index.jsx

@@ -1,21 +1,71 @@
 import React, { Component } from 'react';
 import style from './index.less';
 import close from './../img/close.png';
+import $ from "jquery";
+
 
 class DrugInfo extends Component {
     constructor(props) {
         super(props);
+        this.state = {
+            currentIndex: 0
+        }
+    }
+    handleClickMenu(index, item, drugDesc) {
+        const that = this
+        setTimeout(function(){
+            that.setState({
+                currentIndex: index
+            })
+        },0)
+        
+        let scrollTop = 60 //标题高度为60px
+        drugDesc.map((it, ii) => {
+            if( ii < index) {
+                scrollTop = scrollTop + parseInt($('#' + it.title.trim()).css('height'))
+            }
+        })
+        $('#drugDesc').scrollTop(scrollTop)
+    }
+    handleScrollModal(drugDesc) {
+        const scrollTop = $('#drugDesc').scrollTop()
+        let divHeight = 60; //标题高度为60px
+        for (let i = 0; i < drugDesc.length; i++) {
+            divHeight = divHeight + parseInt($('#' + drugDesc[i].title.trim()).css('height'))
+            if(divHeight > scrollTop) {
+                this.setState({
+                    currentIndex: i
+                })
+                return
+            }
+        }
     }
 
     render() {
         const { drugInfo, hideDrugInfo, drugInfoList,hideDrugInfoMore } = this.props
+        const { currentIndex } = this.state
         return (<div className={style['drug-info-wrapper']}>
                 <h3 className={style['drug-title']}>{drugInfo.title}说明书  <img src={close} onClick={hideDrugInfo} className={style['close-drug-desc']}/> </h3>
-                { drugInfo && drugInfo.drugDesc.length > 0 && <div className={style['drug-desc-wrapper']}>
-                    <div className={style['drug-title1']}>{drugInfo.title}说明书</div>
+                { drugInfo && drugInfo.drugDesc.length > 0 && <div className={style['drug-desc-wrapper']} id='drugDesc' onScroll={this.handleScrollModal.bind(this,  drugInfo.drugDesc)}>
+                    <div className={style['drug-title1']} >{drugInfo.title}说明书</div>
                     {drugInfo.drugDesc.map((item, index) =>{
-                        return <div className={style['drug-desc-item']}><span className={style['drug-desc-title']}>{item.title.trim()}</span> <div className={style['drug-desc-content']} dangerouslySetInnerHTML ={{__html: item.content}}></div> </div>
+                        return <div className={style['drug-desc-item']} id={item.title.trim()}>
+                            <span className={style['drug-desc-title']} >{item.title.trim()}</span> 
+                            <div className={style['drug-desc-content']} dangerouslySetInnerHTML ={{__html: item.content}}></div> 
+                        </div>
                     })}
+                    <div className={style['content-menu']}>
+                        {drugInfo.drugDesc.map((item, index) => {
+                            return (<div>
+                                <div className={style['details-menu-title-box']}>
+                                    {index === 0 ? '' : <div className={style['details-content-menu-line']}></div>}
+                                    <span onClick={this.handleClickMenu.bind(this, index, item, drugInfo.drugDesc)} className={style['details-content-menu-name']} style = {index === currentIndex ? {color:'#0089be'} : ''}>
+                                        <span className={style['details-content-menu-circle']} style = {index === currentIndex ? {background:'#0089be'} : ''}></span>{item.title}
+                                    </span>
+                                </div>
+                            </div>)
+                        })}
+                    </div>
                 </div> }
                 { !drugInfo || (drugInfo && drugInfo.drugDesc.length === 0) && <div className={style['drug-desc-wrapper']}>
                     <div>

+ 35 - 2
src/components/TreatDesc/DrugInfo/index.less

@@ -1,9 +1,9 @@
 .drug-info-wrapper {
     position: fixed;
     width: 950px;
-    height: 70%;
+    height: 80%;
     left: 50%;
-    top: 15%;
+    top: 10%;
     margin-left: -475px;
     background: #fff;
     z-index: 303;
@@ -66,4 +66,37 @@
 .drug-desc-content {
     /*width: 100%;*/
     margin-left: 210px;
+    margin-right: 180px;
+}
+
+.content-menu {
+    position: absolute;
+    top: 50px;
+    right: 20px;
+    background: #eee;
+    border: 1px solid #eee;
+    width: 160px;
+    padding: 15px 18px;
+}
+.details-content-menu-line {
+    height: 15px;
+    width: 0;
+    border: 1px solid #ccc;
+    background-color: #ccc;
+    margin-left: 4px
+}
+.details-content-menu-name {
+    color: #33475f;
+    font-size: 13px;
+    cursor: pointer;
+}
+.details-content-menu-circle {
+    display: inline-block;
+    width: 8px;
+    height: 8px;
+    border-radius: 5px;
+    border: 1px solid #ccc;
+    margin-top: 5px;
+    background-color: #eee;
+    margin-right: 10px;
 }