ソースを参照

Merge branch 'newVersion6.0' into byll6.0

luolei 4 年 前
コミット
19042e67ce

BIN
src/common/images/selectSex.png


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

@@ -378,7 +378,7 @@ class Inspect extends React.Component {
         <div style={{ position: "relative", clear: "both", top: "5px" }}>
           <Add showText="添加检验项" handleClick={(e) => this.handleSearchShow(e)} id="searchWrap" />
           {this.state.show ? <SearchOption searchType="1" detailClick={detailClick} windowHeight={windowHeight} height={280} refreshScroller={refreshScroller} pageTop={pageTop} handleChangeValue={handleChangeValue} visible={true}>
-            {list && list.length > 0 ? this.getSearchList(list) : (inspectVal == '' ? '' : <p style={{ padding: '5px 30px', color: '#bfbfbf' }}>暂无筛选项</p>)}
+            {list && list.length > 0 ? this.getSearchList(list) : (inspectVal == '' ? '' : <p style={{ padding: '5px 136px', color: '#bfbfbf' }}>暂无筛选项</p>)}
             {/* {
               (list && list.length > 0) || (inspectVal != '') || (inspectList&&inspectList.length==0) ? '' : <div>
                 <p style={{ padding: '5px 30px', color: '#bfbfbf' }}>常用检验项</p>

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

@@ -380,7 +380,7 @@ class AddNewInspect extends React.Component {
         <div style={{ position: "relative", clear: "both", top: "5px" }}>
           <Add showText="添加医嘱" handleClick={(e) => this.handleSearchAdvice(e)} id="searchWrapAdvice" />
           {this.state.show ? <SearchOption searchType="2" detailClick={detailClick} windowHeight={windowHeight} height={280} refreshScroller={refreshScroller} pageTop={pageTop} handleChangeValue={handleChangeValue} visible={true}>
-            {list && list.length > 0 ? this.getSearchList(list) : (inspectVal == '' ? '' : <p style={{ padding: '5px 30px', color: '#bfbfbf' }}>暂无筛选项</p>)}
+            {list && list.length > 0 ? this.getSearchList(list) : (inspectVal == '' ? '' : <p style={{ padding: '5px 136px', color: '#bfbfbf' }}>暂无筛选项</p>)}
             {/* {
               (list && list.length > 0) || (inspectVal != '') || (inspectList&&inspectList.length==0) ? '' : <div>
                 <p style={{ padding: '5px 30px', color: '#bfbfbf' }}>常用检验项</p>

+ 28 - 2
src/components/BlockEmrCont/MenstruationHistory.jsx

@@ -1,21 +1,47 @@
 import React, { Component } from 'react';
 import BlockInp from '@containers/BlockInpContainer';
 import { connect } from "react-redux";
-
+import {  CLEARMENSTRUATIONTEXTDATA, } from '@store/types/menstruationHistory';
+import store from '@store';
 class MenstruationHistory extends Component {
   constructor(props) {
     super(props)
+    this.state = {
+      isShowSexInput: true
+    }
+  }
+
+
+  componentWillReceiveProps(nextProps) {
+    // console.log(nextProps.patInfoData.patInfoData[3].value);
+    if (nextProps.patInfoData.patInfoData[3].value === 1) {
+      this.setState({
+        isShowSexInput: false
+      })     
+    } else {
+      this.setState({
+        isShowSexInput: true
+      })
+    }
+    // store.dispatch({
+    //   type: CLEARMENSTRUATIONTEXTDATA,
+    // });
   }
+
   render() {
     const { value, isRead } = this.props;
-    return <BlockInp title='月经史' boxMark='17' value={value} isRead={isRead}></BlockInp>;
+    return(
+      this.state.isShowSexInput?(<BlockInp title='月经史' boxMark='17' value={value} isRead={isRead}></BlockInp>) : null
+    );
   }
 }
 
 function mapStateToProps(state) {
   const { menstruationHistory } = state;
+
   return {
     value: menstruationHistory && menstruationHistory.saveText[0],
+    patInfoData: state.patInfo
   }
 }
 function mapDispatchToProps(dispatch, store) {

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

@@ -47,7 +47,7 @@ class BlockEMRCont extends Component {
   }
 
   componentWillReceiveProps(nextProps) {
-    if (nextProps.patInfoData.patInfoData[3].value === 1){
+    if (nextProps.patInfoData && nextProps.patInfoData.patInfoData[3].value === 1){
       this.setState({
         isShowSexInput : false
       })

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

@@ -1,6 +1,6 @@
 import EMRContainer from "../EMRContainer";
-// import BlockEMRCont from "../BlockEmrCont/index.jsx";
-import BlockEMRCont from "../../containers/BlockEMRContanier";
+import BlockEMRCont from "../BlockEmrCont/index.jsx";
+// import BlockEMRCont from "../../containers/BlockEMRContanier";
 import PushContainer from '../PushContainer';
 
 import style from './index.less';

+ 31 - 2
src/components/HistoryCaseContainer/HistoryList/index.jsx

@@ -1,4 +1,5 @@
 import React from 'react';
+import PropTypes from 'prop-types';
 import store from '@store';
 import styles from './index.less';
 import ReactDom from "react-dom";
@@ -21,7 +22,7 @@ import editHover from '../../../common/images/icon_edit_hover@2x.png';
 import del from '../../../common/images/icon_del_default@2x.png';
 import delHover from '../../../common/images/icon_del_hover@2x.png';
 import Notify from '@commonComp/Notify';
-
+import ScrollArea from 'react-scrollbar';
 class HistoryCaseContainer extends React.Component {
     constructor(props){
         super(props);
@@ -138,6 +139,11 @@ class HistoryCaseContainer extends React.Component {
                 return
               }
               this.handleCaseClick(0, items[0])
+              // this.$scrollRef.scrollArea.refresh();
+              // this.context.scrollArea.scrollYTo(40);
+              console.log(this.$scrollRef,'this.$scrollRef');
+              console.log(this.context,'this.context');
+              this.forceUpdate()
             }
           })
         }
@@ -321,6 +327,15 @@ class HistoryCaseContainer extends React.Component {
             jsonDataString.advice = dataStr[11] && dataStr[11].content || '';       //医嘱
             return jsonDataString;
         }
+      const contStyle = {
+        opacity: '0.4',
+        right: '0',
+        top: '1px',
+        zIndex: '15',
+        width: '14px',
+        background: '#f1f1f1'
+      };
+      const barStyle = { background: '#777', width: '100%' };
         return (
             <div className={styles.mainHistory} id="hisWrapMove">
                 <div className={`${styles.closeHis} drag-title`} id="closeHis"></div>
@@ -331,7 +346,18 @@ class HistoryCaseContainer extends React.Component {
                         <span className={styles.sort} onClick={this.handleSortClick}>排序 <img src={sort} alt="排序"/></span>
                     </div>
                     <div className={styles.lists}>
-                        <ul id="hislistLeft" ref={this.$scrollRef}>
+                <ScrollArea speed={0.8}
+                  key= {items.length}
+                  // ref={this.$scrollRef}
+                  horizontal={false}
+                  // stopScrollPropagation={items.length > 6 ? true : false}
+                  style={{ maxHeight: '722px' }}
+                  onScroll={(value) => {}}
+                  className={styles["area"]}
+                  verticalContainerStyle={contStyle}
+                  verticalScrollbarStyle={barStyle}
+                  contentClassName="content">
+                        <ul id="hislistLeft"   >
                             {(items && items.length > 0) ? items.map((val,idx)=>{
                                     // return <li key={val.id} className={val.id == activeHistory.id?styles.bgc:''} onClick={(e)=>{this.handleCaseClick(e,idx)}}>
                               return <li key={val.id} onClick={() => { this.handleCaseClick(idx, val) }} onMouseEnter={() => this.handleMouseEnterLi(idx)} onMouseLeave={() => this.handleMouseLeaveLi(idx)}>
@@ -360,6 +386,9 @@ class HistoryCaseContainer extends React.Component {
                                 }):<Empty message={'无历史病历'}></Empty>
                             }
                         </ul>
+
+                  </ScrollArea>
+
                     </div>
                 </div>
                 <div className={styles.mainHistoryRight}>

+ 1 - 1
src/components/HistoryCaseContainer/HistoryList/index.less

@@ -50,7 +50,7 @@
         }
         .lists {
             box-sizing: border-box;
-            overflow-y: auto;
+            // overflow-y: auto;
             height: 100%;
            
             li {

+ 1 - 1
src/components/InfoTitle/index.less

@@ -1,7 +1,7 @@
 @import "~@less/variables.less";
 .title-wrapper{
   .contentZIndex2;
-  overflow: hidden;
+  // overflow: hidden;
   /*padding: 12px 20px 8px 20px;*/
   margin-bottom: 40px;
   background-color: #fff;

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

@@ -296,7 +296,7 @@ class NewAdvice extends React.Component {
           // style={{marginRight:'0'}}
           marginTop={'0px'}
         >
-          <div style={{ padding: '0 10px 10px 10px', boxSizing: 'border-box',color:'#000' }} >
+          <div style={{ padding: '0px 10px 10px 10px', boxSizing: 'border-box',color:'#000' }} >
             <AddNewInspect
               checkOnOff={checkOnOff}
               handleDelConfirm={handleDelConfirm}

+ 116 - 0
src/components/PatInfo/Select/index.jsx

@@ -0,0 +1,116 @@
+import React, { Component } from "react";
+// import cx from "classnames";
+import style from "./../index.less";
+import selectSex from '../../../common/images/selectSex.png'
+import { CLEARMENSTRUATIONTEXTDATA, } from '@store/types/menstruationHistory';
+import store from '@store';
+export default class Select extends Component {
+  constructor(props) {
+    super(props);
+    this.state = { 
+      isOpen: false, 
+      value: "",
+      options: [
+        {
+          label: 'patientSex',
+          id: 'patientSex',
+          value: 1,
+          title: '性别',
+          maxlength: 11
+        },
+        {
+          label: 'patientSex',
+          id: 'patientSex',
+          value: 2,
+          title: '性别',
+          maxlength: 11
+        },
+      ]
+    };
+    this.toggleContainer = React.createRef();
+    this.onClickHandler = this.onClickHandler.bind(this)
+    this.onClickOutsideHandler = this.onClickOutsideHandler.bind(this)
+    this.onChange = this.onChange.bind(this)
+  }
+  componentDidMount() {
+    window.addEventListener("click", this.onClickOutsideHandler);
+    this.setState({
+      value: this.props.default,
+    });
+  }
+
+  componentWillUnmount() {
+    window.removeEventListener("click", this.onClickOutsideHandler);
+  }
+
+  componentWillReceiveProps(nextProps){
+    if (nextProps.default.value !== this.state.value.value) {
+      this.setState({
+        value: nextProps.default
+      })
+    }
+  }
+
+  onClickHandler() {
+    this.setState(currentState => ({
+      isOpen: !currentState.isOpen
+    }));
+  };
+
+  onClickOutsideHandler(event) {
+    if (
+      this.state.isOpen &&
+      !this.toggleContainer.current.contains(event.target)
+    ) {
+      this.setState({ isOpen: false });
+    }
+  };
+
+  onChange(e,val) {
+    e.stopPropagation()
+    this.setState({
+      value: val,
+      isOpen: false
+    });
+    this.props.onChange(val);
+    store.dispatch({
+      type: CLEARMENSTRUATIONTEXTDATA,
+    });
+  };
+  render() {
+    const { isOpen, value, options} = this.state;
+    const { label,  placeholder } = this.props;
+    return (
+      <div className={style.selectBox}>
+        {label && <label className={style.label}>{label}:</label>}
+
+        <div className={style.select} ref={this.toggleContainer}>
+          <input
+            className={[style.selfInput, isOpen ? style.selfInput : ''].join('')}
+            readonly=""
+            value={value.value=== 2? '女' : '男'}
+            onClick={this.onClickHandler}
+            placeholder={placeholder}
+          />
+          <div className={style.down} onClick={this.onClickHandler}>
+            <img src={selectSex} alt=""/>
+          </div>
+          <div  className={[isOpen ? '' : style.optionsHidden, isOpen ? style.options :''].join('')}>
+            {options &&
+              options.map((item) => {
+                return (
+                  <div
+                    key={item.id}
+                    className={style.item}
+                    onClick={(e)=>this.onChange( e, item)}
+                  >
+                    {item.value === 2 ? '女' : '男'}
+                  </div>
+                );
+              })}
+          </div>
+        </div>
+      </div>
+    );
+  }
+}

+ 23 - 2
src/components/PatInfo/index.jsx

@@ -1,5 +1,6 @@
 import React, { Component } from "react";
 import style from "./index.less";
+import Select from './Select/index'
 import {
   timesYMDTime
 } from '@utils/tools';
@@ -69,6 +70,7 @@ class PatInfo extends Component {
       ]
     }
     this.handleChange = this.handleChange.bind(this)
+    this.handleSexChange = this.handleSexChange.bind(this)
   }
   componentWillMount() {
     const { getMessage, initPatInfoData } = this.props;
@@ -82,7 +84,7 @@ class PatInfo extends Component {
     // console.log(nextProps,'nextProps');
     const { patInfoData } = nextProps.patInfo
     this.setState({
-      // patientInfo:patInfoData
+      patientInfo:patInfoData
     })
   }
 
@@ -113,6 +115,17 @@ class PatInfo extends Component {
     initPatInfoData && initPatInfoData(newInfo)
   }
 
+  handleSexChange (item){
+    const { initPatInfoData } = this.props;   
+    let { patientInfo } = this.state;
+    let newInfo = Object.assign([], patientInfo);
+    newInfo[3] = item
+    this.setState({
+      patientInfo: newInfo
+    })
+    initPatInfoData && initPatInfoData(newInfo)
+  }
+
   render(){
     const {message} = this.props.patInfo;
      return (
@@ -122,11 +135,19 @@ class PatInfo extends Component {
               return (
                 <div className={style["infoItem"]} key={item.id}>
                   <label for={item.label}>{item.title}:</label>
-                  {item.id === 'patientSex' && (
+                  {/* {item.id === 'patientSex' && (
                     <select id={item.id} value={item.value} onChange={this.handleChange}>
                       <option value='1'>男</option>
                       <option value='2'>女</option>
                     </select>
+                  )} */}
+                  {item.id === 'patientSex' && (
+                    <Select
+                      default={this.state.patientInfo[3]}
+                      label=""
+                      placeholder="请选择"
+                      onChange={(item) => this.handleSexChange(item)}
+                    ></Select>
                   )}
                   {item.id === 'patientAge' && (<input id={item.id} type="text" autocomplete="off" maxlength={11}  value={item.value} onChange={this.handleChange} />)}
                   {/* {item.id === 'patientSex' && (<input id={item.id} type="text" autocomplete="off" value={item.value == 1 ? '男' : '女'} onChange={this.handleChange} />)} */}

+ 103 - 0
src/components/PatInfo/index.less

@@ -9,6 +9,7 @@
   .infoItem{
     width: 25%;
     min-width: 25%;
+    padding: 0px 10px;
     // min-width: 230px;
     float: left;
     flex: 1;
@@ -28,6 +29,9 @@
       overflow: hidden;
       color: #000
     }
+    .selectBox{
+      flex:1;    
+    }
     select {
       // appearance:none;
       // -moz-appearance:none;
@@ -88,3 +92,102 @@
     max-width: 110px;
   }
 }
+
+
+.selectBox {
+  display: flex;
+  align-items: center;
+  .label {
+    // display: inline-block;
+    // padding-right: 8px;
+    // color: #333333;
+  }
+  .select {
+    flex : 1;
+    position: relative;
+    .selfInput {
+      width:100%;
+      box-sizing: border-box;
+      margin: 0;
+      padding: 0;
+      list-style: none;
+      display: inline-block;
+      height: 32px;
+      padding: 4px 11px;
+      color: rgba(0, 0, 0, 0.65);
+      font-size: 14px;
+      line-height: 1.5;
+      background-color: #fff;
+      background-image: none;
+      border-radius: 4px;
+      transition: all 0.3s;
+      overflow: visible;
+      cursor: pointer;
+      position: relative;
+      top: 0px;
+      background-color: transparent;
+    }
+    .inputHover {
+        box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
+        border: 1px solid rgba(24, 144, 255, 1);
+    }
+    .down{
+      width: 20px;
+      height: 13px;
+      position: absolute;
+      margin-top: -6px;
+      top: 50%;
+      left: 38px;
+      cursor: pointer;
+      img{
+        width: 100%;
+        height: 100%;
+      }
+    }
+    .options {
+      z-index: 666;
+      width: 120px;
+      box-sizing: border-box;
+      position: absolute;
+      top: 25px;
+      left: -4px;
+      color: rgba(0, 0, 0, 0.65);
+      font-size: 14px;
+      background-color: #fff;
+      background-image: none;
+      border: 1px solid #d9d9d9;
+      border-radius: 4px;
+      cursor: pointer;
+      transition: 0.35s;
+      opacity: 1;
+      box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.3);
+      .item {
+        position: relative;
+        line-height: 20px;
+        padding: 8px;
+        &:hover {
+          background: rgba(226,241,248,1);
+        }
+      }
+    }
+    .optionsHidden {
+      // opacity: 0;
+      display: none;
+    }
+    // 修改输入框默认样式
+    input:-moz-placeholder,
+    textarea:-moz-placeholder {
+      color: #999999;
+    }
+ 
+    input:-ms-input-placeholder,
+    textarea:-ms-input-placeholder {
+      color: #999999;
+    }
+ 
+    input::-webkit-input-placeholder,
+    textarea::-webkit-input-placeholder {
+      color: #999999;
+    }
+  }
+}

+ 2 - 1
src/components/SearchDrop/index.jsx

@@ -90,10 +90,11 @@ class SearchDrop extends Component{
         <ScrollArea speed={0.8}
                     horizontal={false}
                     stopScrollPropagation={data.length>6?true:false}
-                    style={{maxHeight:'180px'}}
+                    style={{height:'180px'}}
                     className={style["area"]}
                     verticalContainerStyle={contStyle}
                     verticalScrollbarStyle={barStyle}
+                    smoothScrolling= {true}
                     contentClassName="content">
           <ul>
             {data&&data.map((it)=>{

+ 1 - 1
src/store/reducers/patInfo.js

@@ -61,7 +61,7 @@ export default function(state = initState,action){
         {
           label: 'patientSex',
           id: 'patientSex',
-          value: 0,
+          value: 2,
           title: '性别',
         },
         {