Quellcode durchsuchen

Merge branch 'ChronicMag' into optimize

Luolei vor 6 Jahren
Ursprung
Commit
eb92209e76

+ 2 - 2
src/common/components/Calendar/index.jsx

@@ -25,7 +25,7 @@ class Calendar extends React.Component {
             select:{
                 year:  this.year,
                 month:  this.month,
-                day: 0,
+                day: 0,//这里设置初始选中的值
                 hour:0,
                 minute:0,
                 second:0
@@ -59,6 +59,7 @@ class Calendar extends React.Component {
         this.inputing=true;
         info.year=this.state.year;
         info.month=this.state.month;
+        // info.day = this.day;//没选日就加上默认值
         if(info.hour==null){
             info.hour=this.state.select.hour;
             info.minute=this.state.select.minute;
@@ -88,7 +89,6 @@ class Calendar extends React.Component {
     genTimeComponent(){
         return this.props.needTime?<Time hour={this.state.select.hour} minute={this.state.select.minute} second={this.state.select.second} handleChange={(info)=>{this.handleChange(info)}}/>:null;
     }
-
     render() {
         return (
             <div className={style.wrapper}>

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

@@ -29,7 +29,7 @@ class DelToast extends React.PureComponent{
       return <div className={style['del-box']} id="delBox">
         <div className={style['del-con']}>
           <div className={style['del-tri']}></div>
-          <div className={style['del-title']}>删除 {name} ?</div>
+          <div className={style['del-title']} id="delTit">删除 {name} ?</div>
           <div className={style['del-foot']}>
             <span className={`${style['del-btn']} ${style['del-del']}`} onClick={this.handleDel}>删除</span>
             <span className={`${style['del-btn']} ${style['del-cancel']}`} onClick={this.handleCancel}>取消</span>

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

@@ -63,14 +63,14 @@ class AddAssistCheck extends React.Component {
       let _cons = $('#datePick');   // 设置目标区域
       let _del = $('#delBox')[0];   // 删除弹窗
       let _close = $('#assiClose')[0];   // 删除icon
-      // console.log(111,event.target,_del,_close)
+      let _closeTil = $('#delTit')[0];   // 弹窗标题
       if (_con && searchWrapAssist != event.target && !_con.is(event.target) && _con.has(event.target).length === 0) { // Mark 1
         this.setState({ show: false });
       }
       if (!_cons.is(event.target) && _cons.has(event.target).length === 0) { // Mark 1
         this.setState({ date: false });
       }
-      if(event.target != _close && event.target != _del && event.target.parentNode != _del){
+      if(!event.target.isEqualNode(_close) && !event.target.isEqualNode(_del)  && event.target.parentNode != _del && !event.target.isEqualNode(_closeTil)){
           this.setState({
             visible: false,
             id: null,

+ 2 - 0
src/components/AddAssistCheck/index.less

@@ -133,9 +133,11 @@
 }
 .tagSpan {
   position: relative;
+  cursor: default;
 }
 .tagSpan:hover {
   .imgInfo {
     display: block;
+    cursor: pointer;
   }
 }

+ 5 - 5
src/components/AddInspect/SlideSelect/index.jsx

@@ -62,7 +62,7 @@ class SlideSelect extends Component {
     })
   }
   render() {
-    const {getInfomation,handleConfirm,changeActivePart,handleDelClick,getItemList,date,item,idx,handleFillShow,showDetails,handleLabelSub,showFill,changeShowFill,handlePush,dateTime,currentIdx,currentData,fillActive,handleShowDate,handleChangeDate} = this.props;
+    const {getInfomation,handleConfirm,changeActivePart,handleDelClick,getItemList,date,item,idx,handleFillShow,showDetails,handleLabelSub,showFill,changeShowFill,handlePush,dateTime,currentIdx,currentData,fillActive,handleShowDate,handleChangeDate,showToast} = this.props;
     const {show,activeInd,activeName} = this.state;
     let numPlus = 0,numPlus1 = 0;
     return (
@@ -163,8 +163,8 @@ class SlideSelect extends Component {
                     >
                     
                         <div className={styles.searchResultT}>
-                            <img style={{"position":"absolute","top":"8px","right":"8px"}} src={date1} alt="" onClick={handleShowDate}/>
-                            <p style={{position:"absolute",right:"38px",top:"4px",lineHeight:"28px"}}>
+                            <img style={{"position":"absolute","top":"8px","right":"8px",cursor:"pointer"}} src={date1} alt="" onClick={handleShowDate}/>
+                            <p style={{position:"absolute",right:"25px",top:"4px",lineHeight:"28px",cursor:"pointer",paddingRight:"10px"}} onClick={handleShowDate}>
                                 {
                                   dateTime
                                 }
@@ -181,8 +181,8 @@ class SlideSelect extends Component {
             }
         </div>
         {/*<img className={styles.partDel} src={close} alt="删除项" onClick={()=>{handleDelClick(1,idx)}}/>*/}
-        <span className={styles.partDel} onClick={this.handleDel}></span>
-        <DelToast show={activeInd?true:false}
+        <span id="addClose" className={styles.partDel} onClick={this.handleDel}></span>
+        <DelToast show={showToast&&activeInd?true:false}
                     name={activeName} 
                     cancel={this.handleCancel}
                     confirm={this.delConfirm}/>

+ 1 - 1
src/components/AddInspect/SlideSelect/index.less

@@ -1,7 +1,7 @@
 @import "~@less/variables.less";
 .slideLi {
     // cursor: pointer;
-    color: #767676;
+    // color: #767676;
     position: relative;
     padding: 10px 10px 10px 0;
     border-bottom:1px dashed #989DA3;

+ 30 - 14
src/components/AddInspect/index.jsx

@@ -26,7 +26,7 @@ class Inspect extends React.Component {
       id: null,
       pageTop:'',
       // tmpIds: [],      //内层外层
-      importFlag:false   //导入数据删除标识
+      impId:null
     }
     this.handleChangeDate = this.handleChangeDate.bind(this)
     this.handleShowDate = this.handleShowDate.bind(this)
@@ -45,28 +45,32 @@ class Inspect extends React.Component {
   }
   delConfirm() {//弹窗确定
     const { delPartItem, handleCloseExcel, handlePush } = this.props;
-    const { type, id } = this.state;
+    const { type, id ,impId} = this.state;
     if (type == 1) {
       delPartItem(id)
     } else if (type == 2) {
-      handleCloseExcel(id)
+      handleCloseExcel(impId)
     }
     this.setState({
       type: null,
       id: null,
-      importFlag:false
+      impId: null
     })
     Notify.success("删除成功");
     handlePush && handlePush();       //右侧推送
   }
-  handleDelClick(type, idx) {
-    this.setState({
-      type: type,
-      id: idx
-    })
+  handleDelClick(type, idx) { 
     if (type == 2){
       this.setState({
-        importFlag: true
+        impId:idx,
+        type: type,
+        id:null
+      })
+    }else{
+      this.setState({
+        type: type,
+        id: idx,
+        impId:null
       })
     }
   }
@@ -74,7 +78,7 @@ class Inspect extends React.Component {
     this.setState({
       type: null,
       id: null,
-      importFlag:false
+      impId: null
     })
   }
   componentDidMount() {
@@ -82,6 +86,11 @@ class Inspect extends React.Component {
       let searchWrap = $('#searchWrap')[0];   // 搜索按钮
       let searchOption = $('#searchOption')[0];   // 搜索列表
       let inspectFill = $('#inspectFill')[0];         // 公共填写单
+
+      let _del = $('#delBox')[0];       // 删除弹窗  
+      let _impClose = $('#impClose')[0];         // 导入删除按钮
+      let _addClose = $('#addClose')[0];         // 添加删除按钮
+      let _closeTil = $('#delTit')[0];   // 弹窗标题
       if (searchOption) {
         if (searchOption != event.target && searchWrap != event.target && searchWrap != event.target.parentNode && !$.contains(searchOption, event.target)) { // Mark 1
           this.setState({ show: false });
@@ -92,6 +101,12 @@ class Inspect extends React.Component {
           this.setState({ showFill: false, date: false });
         }
       }
+      if(!event.target.isEqualNode(_impClose) && !event.target.isEqualNode(_addClose) && !event.target.isEqualNode(_del)  && event.target.parentNode != _del && !event.target.isEqualNode(_closeTil)){
+          this.setState({
+            id: null,
+            impId: null
+          })
+      }
     });
     this.getCurrentDate();
   }
@@ -280,7 +295,7 @@ class Inspect extends React.Component {
   }
   render() {
     const { getInfomation,handleChangeValue,inspectVal, list, labelList,windowHeight, delPartItem, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush } = this.props;
-    const { tmpId, tmpIdx,id ,importFlag,pageTop} = this.state;
+    const { tmpId, tmpIdx,id,pageTop,impId} = this.state;
 
     return (
       <div className={styles.wrapper}>
@@ -291,8 +306,8 @@ class Inspect extends React.Component {
                 {
                   items && items.lisExcelRes.length > 0 ? <ul className={styles.excelDataLists}>
                     {/*<img className={styles.close} src={close} alt="关闭导入excel数据" onClick={() => { this.handleDelClick(2, id) }} />*/}
-                    <span className={styles.close} onClick={() => { this.handleDelClick(2, ind) }}></span>
-                    <DelToast show={id==ind && importFlag?true:false}
+                    <span className={styles.close} id="impClose" onClick={() => { this.handleDelClick(2, ind) }}></span>
+                    <DelToast show={impId==ind?true:false}
                     name="该导入项" 
                     cancel={this.handleCancel}
                     confirm={this.delConfirm}/>
@@ -318,6 +333,7 @@ class Inspect extends React.Component {
                 return <SlideSelect
                   item={item}
                   idx={idx}
+                  showToast={idx==id?true:false}
                   showFill={this.state.showFill}
                   handlePush={handlePush}
                   fillActive={fillActive}

+ 4 - 3
src/components/AddInspect/index.less

@@ -1,7 +1,7 @@
 @import "~@less/variables.less";
 .labelWrap>li {
     // cursor: pointer;
-    color: #767676;
+    // color: #767676;
     position: relative;
     padding-top: 10px;
     padding-bottom: 10px;
@@ -151,15 +151,16 @@
     }
     .itemPartT {
         float: right;
-        max-width: 110px;
+        width: 120px;
         input {
             width: 40px;
             text-align: center;
             float: left;
+            margin-right: 10px;
         }
         .unit {
             display: inline-block;
-            max-width: 70px;
+            width: 70px;
             overflow: hidden;
             text-overflow: ellipsis;
             white-space: nowrap;

+ 0 - 1
src/components/AssistCheck/index.jsx

@@ -41,7 +41,6 @@ class AssistCheck extends React.Component {
                             assistVal={assistVal}
                             windowHeight={windowHeight}
                         >
-
                         </AddAssistCheck>
                     </div>
                 </ItemBox>

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

@@ -45,7 +45,7 @@ class DiagResultSearch extends Component {
 
       {
         searchResult && searchResult.map((item) => {
-          return (<div key={item.id} className={style['search-result-item']}><DiagnosticItem title={true} item={item} clearInput={this.clearInput} /></div>)
+          return (<div key={item.id} className={style['search-result-item']}><DiagnosticItem title={true} item={item} clearInput={this.clearInput} type='search'/></div>)
         })
       }
     </div>

+ 48 - 6
src/components/DiagnosticItem/index.jsx

@@ -2,6 +2,8 @@ import React, { Component } from 'react';
 import style from './index.less';
 import {ConfirmModal} from '@commonComp';
 import Notify from '@commonComp/Notify';
+import infoShow from '@common/images/info-show.png';
+import infoMove from '@common/images/info-move.png';
 import {getChronic} from '@store/async-actions/homePage.js';
 import {storageLocal} from '@utils/tools';
 
@@ -10,7 +12,9 @@ class DiagnosticItem extends Component{
         super(props);
 
         this.state = {
-            visible: false
+            visible: false,
+            hasEnterItem: false,
+            hasEnterImg: false
         }
 
         this.addDiagodal = this.addDiagodal.bind(this);
@@ -18,6 +22,7 @@ class DiagnosticItem extends Component{
         this.confirm = this.confirm.bind(this);
         this.cancel = this.cancel.bind(this)
         this.close = this.close.bind(this)
+        this.getTips = this.getTips.bind(this)
     }
     confirm() {
         this.close();
@@ -35,9 +40,11 @@ class DiagnosticItem extends Component{
         })
     }
     chooseDiagodal(item) {
-        const { diagnosticList,getTips } = this.props;
+        const { diagnosticList,getTips, type } = this.props;
         // getTips && getTips(item);
-        getTips && getTips({id:item.id,type:7});
+        if (type == 'search') {
+            getTips && getTips({id:item.id,type:7});
+        }
         for (let i = 0; i < diagnosticList.length; i++) {
             if(diagnosticList[i].id === item.id && diagnosticList[i].name === item.name) {
                 Notify.info('该诊断已存在');
@@ -49,6 +56,11 @@ class DiagnosticItem extends Component{
         })
        
     }
+    getTips(item, e) {
+        e.stopPropagation();
+        const {getTips } = this.props;
+        getTips && getTips({id:item.id,type:7});
+    }
     addDiagodal(diagType){
         const {item, isChronicMag,mode} = this.props;
         item.type = diagType;
@@ -87,15 +99,45 @@ class DiagnosticItem extends Component{
         // }, 0)
         document.getElementById("diagnosisResult").scrollIntoView(true)
     }
+    handleMouseEnterDrug() {
+        this.setState({
+            hasEnterItem: true, 
+        })
+      }
+      handleMouseLeaveDrug() {
+        this.setState({
+            hasEnterItem: false, 
+        })
+      }
+      handleMouseEnterImg() {
+        this.setState({
+          hasEnterImg: true
+        })
+      }
+      handleMouseLeaveImg() {
+        this.setState({
+          hasEnterImg: false
+        })
+      }
 
     render(){
-        const { visible } = this.state
-        const { item, title } = this.props
+        const { visible,hasEnterItem,hasEnterImg } = this.state
+        const { item, title, type } = this.props
         return (<span className={style['diag-item']} >
                     <span className={style['diag-name']} 
                           title = {title && item.name + (item.showType === 2 || item.showType === 3 ? '('+ item.retrievalName+')': '')}
-                          onClick={() =>{this.chooseDiagodal(item)}}>
+                          onMouseEnter={this.handleMouseEnterDrug.bind(this)}
+                          onMouseLeave = {this.handleMouseLeaveDrug.bind(this)}
+                          onClick={() =>{this.chooseDiagodal(item)}}
+                          >
                         {item.name} {item.showType === 2 || item.showType === 3 ? '('+ item.retrievalName+')': ''}
+                        {type== 'disSelect' &&<img className={style['info-img']}  
+                                style ={hasEnterItem  ? {display: "inline-block"} : {display: "none"}}
+                                src={hasEnterImg ? infoMove : infoShow} 
+                                onMouseEnter={this.handleMouseEnterImg.bind(this)}
+                                onMouseLeave = {this.handleMouseLeaveImg.bind(this)}
+                                onClick={this.getTips.bind(this,item)}
+                        />}
                     </span>
                     <ConfirmModal visible={visible} okText='初诊' cancelText='复诊' confirm={this.confirm}  cancel={this.cancel} close={this.close}>
                         <div className={style['confirm-info']}>确定选择“{item.name}”为</div> 

+ 13 - 3
src/components/DiagnosticItem/index.less

@@ -10,10 +10,20 @@
     width: 100%;
 }
 .diag-name {
+    position: relative;
     display: inline-block;
     width: 100%;
     height: 100%;
-    overflow: hidden;
-    text-overflow: ellipsis;
-    white-space: nowrap;
+    // overflow: hidden;
+    // text-overflow: ellipsis;
+    // white-space: nowrap;
+}
+.info-img {
+    position: absolute;
+    width: 15px;
+    top: -14px;
+    left: 50%;
+    margin-left: -7px;
+    cursor: pointer;
+    z-index: 2;
 }

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

@@ -48,10 +48,10 @@ class PushDiag extends Component {
                 {maxShowNum ? diagList.map((item, index) => {
                     ItemNum = ItemNum + item.name.length + 1;
                     if (ItemNum <= moreNum) {
-                        return <div key={item.id} className={style['push-diag-item']}><DiagnosticItem item={item}/></div>
+                        return <div key={item.id} className={style['push-diag-item']}><DiagnosticItem item={item} type='disSelect'/></div>
                     }
                 }) : diagList.map((item, index) => {
-                return <div key={item.id} className={style['push-diag-item']}><DiagnosticItem item={item}/></div>
+                return <div key={item.id} className={style['push-diag-item']}><DiagnosticItem item={item} type='disSelect'/></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>}
 

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

@@ -263,7 +263,7 @@ class PushItems extends Component {
     });
 
     const vigilants = vigilant.map((item, index) => {
-      return <div key={item.id} className={style['push-diag-item']}><DiagnosticItem item={item}/></div>;
+      return <div key={item.id} className={style['push-diag-item']}><DiagnosticItem item={item} type='disSelect'/></div>;
     });
 
     return (