Просмотр исходного кода

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

zhouna 5 лет назад
Родитель
Сommit
b3b3ac3aa2

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

@@ -173,7 +173,7 @@ class DiagnosticList extends Component {
         }
     }
     handleQuoteClick(item, index) {
-        const { handleQuoteClick } = this.props
+        // const { handleQuoteClick } = this.props
         // handleQuoteClick && handleQuoteClick(item)
         this.setState({
             activeHistory: index,

+ 2 - 10
src/components/EmergencyProcedure/EmergencyModal/index.jsx

@@ -1,6 +1,7 @@
 import styles from './index.less'
 import small from '../img/small.png'
 import EmergencyPart from '../EmergencyPart'
+import ImgView from '../ImgView'
 import pic from '../img/pic.png'
 import pic1 from '../img/pic1.png'
 import pic2 from '../img/pic2.png'
@@ -67,16 +68,7 @@ class EmergencyModal extends React.Component{
               idx == 0?null:<img className={styles.imgs} src={pic} onClick={()=>{this.handleImgShow(true)}} alt=""/>
             }
             {
-              this.state.imgShow?<React.Fragment>
-                <div className={styles.imageModalWrap} onClick={()=>{this.handleImgShow(false)}}></div>
-                <div className={styles.imageModal} id="dragModalWrap">
-                  <div id="dragModalTitle" className={`${styles.dragImgWrap} drag-title`}>
-                    {data.emergencyname}
-                  </div>
-                  <img id="preImg" className={styles.emergencyImg} src={idx==1?pic1:idx==2?pic2:idx==3?pic3:idx==4?pic4:idx==5?pic5:null}/>
-                  <img className={styles.img} src={close} onClick={()=>{this.handleImgShow(false)}} />
-                </div>
-              </React.Fragment>:null
+              this.state.imgShow?<ImgView name={data.emergencyname} idx={idx} handleImgShow={this.handleImgShow}></ImgView>:null
             }
           </div>
           <div className={styles.modalTopR} onClick={()=>{this.handleSlideShow()}} id="modalTopR">其他危重症状</div>

+ 59 - 3
src/components/EmergencyProcedure/EmergencyModal/index.less

@@ -6,7 +6,7 @@
   bottom: 10px;
   width: 450px;
   right: 10px;
-  z-index: 205;
+  z-index: 202;
   padding: 15px;
   background-color: #fff;
   .modalTop {
@@ -86,10 +86,10 @@
     background-color: #fff;
     overflow: hidden;
     z-index: 500;
-    width: 1000px;
+    width: 900px;
     padding-top: 30px;
     box-sizing: border-box;
-    margin-left: -500px;
+    margin-left: -450px;
     // margin-top: -400px;
     // height: 800px;
     // top: 50%;
@@ -124,4 +124,60 @@
     right: 10px;
     z-index: 800;
   }
+}
+.imageModalWrap {
+  position: fixed;
+  left: 0;
+  top: 0;
+  z-index: 300;
+  width: 100%;
+  height: 100%;
+  background-color: #000;
+  opacity: 0.6;
+  filter: alpha(opacity=60);
+  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
+}
+.imageModal {
+  position: fixed;
+  background-color: #fff;
+  overflow: hidden;
+  z-index: 500;
+  width: 900px;
+  padding-top: 30px;
+  box-sizing: border-box;
+  margin-left: -450px;
+  // margin-top: -400px;
+  // height: 800px;
+  // top: 50%;
+  left: 50%;
+  top: 40px;
+  bottom: 40px;
+  .emergencyImg{
+    height: 100%;
+    width: 100%;
+    max-height: 800px;
+    position: relative;
+    float: left;
+    // position: absolute;
+    // left: 50%;
+    // transform: translateX(-50%);
+  }
+}
+.dragImgWrap {
+  width: 100%;
+  height: 30px;
+  line-height: 36px;
+  text-indent: 1em;
+  z-index: 502;
+  background-color: transparent;
+  position: absolute;
+  top: 0;
+  left: 0;
+}
+img.img{
+  cursor: pointer;
+  position: absolute;
+  top: 6px;
+  right: 10px;
+  z-index: 800;
 }

+ 30 - 0
src/components/EmergencyProcedure/ImgView/index.jsx

@@ -0,0 +1,30 @@
+import styles from '../EmergencyModal/index.less'
+import pic1 from '../img/pic1.png'
+import pic2 from '../img/pic2.png'
+import pic3 from '../img/pic3.png'
+import pic4 from '../img/pic4.png'
+import pic5 from '../img/pic5.png'
+import close from '@common/images/icon_close.png';
+import ReactDom from "react-dom";
+
+class ImgView extends React.Component{
+  constructor(props){
+    super(props)
+  }
+  render(){
+    const {name,idx,handleImgShow} = this.props;
+    const domNode = document.getElementById('root');
+    return ReactDom.createPortal(<React.Fragment>
+            <div className={styles.imageModalWrap} onClick={()=>{handleImgShow(false)}}></div>
+            <div className={styles.imageModal} id="dragModalWrap">
+              <div id="dragModalTitle" className={`${styles.dragImgWrap} drag-title`}>
+                {name}
+              </div>
+              <img id="preImg" className={styles.emergencyImg} src={idx==1?pic1:idx==2?pic2:idx==3?pic3:idx==4?pic4:idx==5?pic5:null}/>
+              <img className={styles.img} src={close} onClick={()=>{handleImgShow(false)}} />
+            </div>
+          </React.Fragment>,domNode)
+  }
+}
+
+export default ImgView;

BIN
src/components/EmergencyProcedure/img/pic1.png


BIN
src/components/EmergencyProcedure/img/pic2.png


BIN
src/components/EmergencyProcedure/img/pic3.png


BIN
src/components/EmergencyProcedure/img/pic4.png


BIN
src/components/EmergencyProcedure/img/pic5.png


+ 2 - 3
src/components/EmergencyProcedure/index.jsx

@@ -13,7 +13,6 @@ class EmergencyProcedure extends React.Component {
     }
     this.handleShow=this.handleShow.bind(this)
   }
-  
   slideToggle(type){
     if(type){
       $("#emergencyName").css({"display":"block"})
@@ -36,9 +35,9 @@ class EmergencyProcedure extends React.Component {
     !type&&this.slideToggle(0)
   }
   render(){
-    const {data,setDataIdx,idx,windowHeight} = this.props;
+    const {data,setDataIdx,idx,windowHeight,hideAllDrop} = this.props;
     const domNode = document.getElementById('root');
-    return ReactDom.createPortal(<div className={styles.emergencyProdureWrap}>
+    return ReactDom.createPortal(<div className={styles.emergencyProdureWrap} onClick={hideAllDrop}>
       <div id="emergencyWrap" className={styles.emergencyWrap}>
         <span id="emergencys" onClick={()=>this.slideToggle(1)} className={styles.emergency}>急</span>
         <span id="emergency" className={`${styles.emergency}`} onClick={()=>this.slideToggle(0)}>急</span>

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

@@ -160,7 +160,7 @@ class PushItems extends Component {
       tipsDetails,
       tmpFlg,
     } = this.props.pushMessage;
-    const { tipsDiscalimer,chronicPushItems,wholeIndexs,setPushEmergencyIdx,sysConfig,windowHeight} = this.props;
+    const { tipsDiscalimer,chronicPushItems,wholeIndexs,setPushEmergencyIdx,sysConfig,windowHeight,hideAllDrop} = this.props;
     const {
       billing,
       changeCheck,
@@ -281,7 +281,7 @@ class PushItems extends Component {
             tipsDetails = {tipsDetails}/>}
             
             {
-              (setPushEmergencyIdx+'')&&(sysConfig.emergency_show==1)&&<EmergencyProcedure windowHeight={windowHeight} data={dataLis[this.state.idx]||dataLis[setPushEmergencyIdx]} idx={this.state.idx||setPushEmergencyIdx} setDataIdx={this.setDataIdx}></EmergencyProcedure>
+              (setPushEmergencyIdx+'')&&(sysConfig.emergency_show==1)&&<EmergencyProcedure hideAllDrop={hideAllDrop} windowHeight={windowHeight} data={dataLis[this.state.idx]||dataLis[setPushEmergencyIdx]} idx={this.state.idx||setPushEmergencyIdx} setDataIdx={this.setDataIdx}></EmergencyProcedure>
             }
       </div>
     );

+ 6 - 0
src/containers/PushItemsContainer.js

@@ -5,6 +5,7 @@ import {CHANGE_ASSAY, CHANGE_CHECK, ADD_BILLING, SHOW_TIPS_DETAILS, HIDE_TIPS_DE
 import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR } from '@store/types/diagnosticList';
 import {billing, getAllConceptDetail} from '../store/async-actions/pushMessage';
 import { isAddMainSuit } from '@store/async-actions/diagnosticList';
+import { HIDEDROP } from '@store/types/homePage.js';
 
 function mapStateToProps(state) {//console.log(state)
   const {pushMessage,diagnosticList} = state;
@@ -24,6 +25,11 @@ function mapStateToProps(state) {//console.log(state)
 
 function mapDispatchToProps(dispatch) {
     return {
+        hideAllDrop(){
+            dispatch({
+              type:HIDEDROP
+            });
+        },
         changeAssay: (item) => {
             dispatch({type: CHANGE_ASSAY, item})
         },

+ 2 - 1
src/store/async-actions/treat.js

@@ -398,6 +398,7 @@ export const getInstroduce = (item, type, position)=>{
 export const commonTreatAddToAdvice = () => {
     return (dispatch, getState) => {
         const state = getState();
+
         const followUp = state.treat.followUp
         if(state.treat.treatItem.conceptId === state.diagnosticList.diagnosticList[0].conceptId && state.treat.isFirstMainDiag) {
             dispatch({
@@ -405,7 +406,7 @@ export const commonTreatAddToAdvice = () => {
             })
             dispatch({
                 type: SET_COMMONTREATMENT,
-                commontreatment: state.treat.treatItem.treat.commonTreatment.content
+                commontreatment: state.treat.generalTreat.content
             })
             if(followUp) {
                 dispatch({