Kaynağa Gözat

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

# Conflicts:
#	src/common/js/func.js
#	src/components/PatInfo/index.jsx
#	src/components/PatInfo/index.less
#	src/containers/OtherHistory.js
#	src/store/actions/currentIll.js
#	src/store/async-actions/patInfo.js
#	src/utils/tools.js
zhouna 6 yıl önce
ebeveyn
işleme
d70619fba6
100 değiştirilmiş dosya ile 3961 ekleme ve 818 silme
  1. 2 0
      package.json
  2. 2 2
      src/common/components/Calendar/index.jsx
  3. 64 0
      src/common/components/CheckBtn/index.jsx
  4. 24 0
      src/common/components/CheckBtn/index.less
  5. 49 0
      src/common/components/ComplexModal/index.jsx
  6. 92 0
      src/common/components/ComplexModal/index.less
  7. 7 2
      src/common/components/ConfirmModal/index.jsx
  8. 9 3
      src/common/components/ConfirmModal/index.less
  9. 44 0
      src/common/components/DelToast/index.jsx
  10. 51 0
      src/common/components/DelToast/index.less
  11. 2 2
      src/common/components/DropList/index.jsx
  12. 1 1
      src/common/components/EditableSpan/index.jsx
  13. 38 5
      src/common/components/InlineTag/index.jsx
  14. 3 1
      src/common/components/InspectCommon/index.less
  15. 5 6
      src/common/components/Loading/index.jsx
  16. 7 3
      src/common/components/Loading/index.less
  17. 48 0
      src/common/components/MiniToast/index.jsx
  18. 44 0
      src/common/components/MiniToast/index.less
  19. 18 17
      src/common/components/NumberPan/index.jsx
  20. 6 5
      src/common/components/NumberUnitPan/index.jsx
  21. 0 65
      src/common/components/Radio/index.js
  22. 66 0
      src/common/components/Radio/index.jsx
  23. 3 3
      src/common/components/Radio/index.less
  24. 5 0
      src/common/components/SearchOption/index.jsx
  25. 5 5
      src/common/components/SearchOption/index.less
  26. 3 3
      src/common/components/Textarea/index.jsx
  27. 10 2
      src/common/components/index.js
  28. BIN
      src/common/images/1.png
  29. BIN
      src/common/images/2.png
  30. BIN
      src/common/images/3.png
  31. BIN
      src/common/images/4.png
  32. BIN
      src/common/images/5.png
  33. BIN
      src/common/images/6.png
  34. BIN
      src/common/images/7.png
  35. BIN
      src/common/images/8.png
  36. BIN
      src/common/images/add-result.png
  37. BIN
      src/common/images/added.png
  38. BIN
      src/common/images/all-table.png
  39. BIN
      src/common/images/check.png
  40. BIN
      src/common/images/chronic.png
  41. BIN
      src/common/images/close-icon.png
  42. BIN
      src/common/images/close-icon1.png
  43. BIN
      src/common/images/del_hor.png
  44. BIN
      src/common/images/del_nor.png
  45. BIN
      src/common/images/delete.png
  46. BIN
      src/common/images/info-move.png
  47. BIN
      src/common/images/info-pic.png
  48. BIN
      src/common/images/info-pic1.png
  49. BIN
      src/common/images/info-show.png
  50. BIN
      src/common/images/manage.png
  51. BIN
      src/common/images/table.png
  52. BIN
      src/common/images/加入@3x.png
  53. BIN
      src/common/images/已加入@3x.png
  54. BIN
      src/common/images/筛选表.png
  55. BIN
      src/common/images/级别1.png
  56. BIN
      src/common/images/级别2.png
  57. BIN
      src/common/images/级别3.png
  58. BIN
      src/common/images/级别4.png
  59. BIN
      src/common/images/级别5.png
  60. 15 6
      src/common/js/func.js
  61. 1 1
      src/common/less/base.less
  62. 56 1
      src/common/less/variables.less
  63. BIN
      src/components/AddAssistCheck/img/info2.png
  64. BIN
      src/components/AddAssistCheck/img/info3.png
  65. 194 140
      src/components/AddAssistCheck/index.jsx
  66. 58 4
      src/components/AddAssistCheck/index.less
  67. 17 4
      src/components/AddInspect/SlideExcel/index.jsx
  68. 29 0
      src/components/AddInspect/SlideExcel/index.less
  69. 65 16
      src/components/AddInspect/SlideSelect/index.jsx
  70. 48 9
      src/components/AddInspect/SlideSelect/index.less
  71. BIN
      src/components/AddInspect/img/info2.png
  72. BIN
      src/components/AddInspect/img/info3.png
  73. 350 313
      src/components/AddInspect/index.jsx
  74. 31 7
      src/components/AddInspect/index.less
  75. 4 1
      src/components/Advice/Textarea/index.jsx
  76. 6 7
      src/components/Advice/index.jsx
  77. 164 0
      src/components/AssessResult/AssessHis/index.jsx
  78. 76 0
      src/components/AssessResult/AssessHis/index.less
  79. 273 0
      src/components/AssessResult/ChartItem/index.jsx
  80. 76 0
      src/components/AssessResult/ChooseItem/index.jsx
  81. 359 0
      src/components/AssessResult/ScaleItem/index.jsx
  82. 182 0
      src/components/AssessResult/index.jsx
  83. 213 0
      src/components/AssessResult/index.less
  84. 5 2
      src/components/AssistCheck/index.jsx
  85. 5 0
      src/components/BodyContainer/index.less
  86. 11 18
      src/components/CheckBody/index.jsx
  87. 1 0
      src/components/CheckBody/index.less
  88. 528 0
      src/components/ChronicInfo/index.jsx
  89. 278 0
      src/components/ChronicInfo/index.less
  90. 34 0
      src/components/CopyRight/CopyModalSon/index.jsx
  91. 31 0
      src/components/CopyRight/DiscontentSon/index.jsx
  92. 7 24
      src/components/CopyRight/index.jsx
  93. 7 5
      src/components/CopyRight/index.less
  94. 31 20
      src/components/CurrentIll/index.jsx
  95. 52 52
      src/components/DiagResultSearch/index.jsx
  96. 5 3
      src/components/DiagResultSearch/index.less
  97. 48 45
      src/components/Diagnosis/index.jsx
  98. 75 12
      src/components/DiagnosticItem/index.jsx
  99. 18 3
      src/components/DiagnosticItem/index.less
  100. 0 0
      src/components/DiagnosticList/img/delete-on.png

+ 2 - 0
package.json

@@ -26,6 +26,7 @@
     "copy-webpack-plugin": "^4.5.1",
     "cross-env": "^5.1.4",
     "css-loader": "^0.28.10",
+    "echarts": "^4.2.1",
     "es3ify-webpack-plugin": "0.0.1",
     "eventsource-polyfill": "^0.9.6",
     "express": "^4.16.2",
@@ -62,6 +63,7 @@
     "anujs": "1.4.8",
     "axios": "^0.18.0",
     "babel-polyfill": "6.26.0",
+    "echarts": "^4.2.1",
     "jquery": "1.12.4",
     "koa-body": "^4.0.4",
     "koa-router": "^7.4.0",

+ 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}>

+ 64 - 0
src/common/components/CheckBtn/index.jsx

@@ -0,0 +1,64 @@
+import React from 'react';
+/*import PropTypes from 'prop-types';*/
+import on from '@common/images/checked.png';
+import style from './index.less';
+
+/**
+ * 多选按钮
+ * handleClick:点击触发按键 会将输入的props信息作为参数传入
+ * isSelect:是否选中
+ * label:右侧显示文字
+ */
+class CheckBtn extends React.Component {
+  constructor(props){
+    super(props);
+    this.handleClick = this.handleClick.bind(this);
+  }
+
+  handleClick(id){
+    const {handleClick} = this.props;
+    handleClick&&handleClick(id);
+  }
+
+  getStyle(){
+    if(this.props.display=='block'){
+      return {
+        display:'block',
+        // marginBottom:'10px'
+      }
+    }
+    return {
+      display:'inline-block',
+      /*marginLeft:'10px'*/
+    }
+  }
+
+  render() {
+    const {id,label,isSelect,disabled} = this.props;
+    /*if(disabled){
+        return (
+            <div className={style['check-box']}
+                 style={this.getStyle()}>
+                <span className={style['img']}></span>
+                <span style={{color:'#aaa'}}>{label}</span>
+            </div>
+        )
+    }*/
+    return (
+      <div className={style['check-box']}
+           onClick={() =>this.handleClick(id)}
+           style={this.getStyle()}>
+        <span className={isSelect?style['on']:style['img']}></span>
+        <span>{label}</span>
+      </div>
+    )
+  }
+}
+
+/*Radio.propTypes = {
+    handleClick:PropTypes.func,
+    isSelect:PropTypes.bool,
+    name:PropTypes.string
+};*/
+
+export default CheckBtn;

+ 24 - 0
src/common/components/CheckBtn/index.less

@@ -0,0 +1,24 @@
+.check-box{
+  max-width: 120px;
+  height: 35px;
+  line-height: 35px;
+  cursor: pointer;
+  .img{
+    display: inline-block;
+    width: 14px;
+    height: 14px;
+    vertical-align: middle;
+    margin-right: 4px;
+    background: #fff;
+    -webkit-appearance: none;
+    border: 1px solid #c9c9c9;
+    border-radius: 4px;
+    outline: none;
+    cursor: pointer;
+  }
+  .on{
+    .img;
+    background: url("../../images/first.png") no-repeat;
+    background-size: 93% 100%;
+  }
+}

+ 49 - 0
src/common/components/ComplexModal/index.jsx

@@ -0,0 +1,49 @@
+import React, { Component } from "react";
+import ReactDom from "react-dom";
+import style from "./index.less";
+import Notify from '@commonComp/Notify';
+import close from '@common/images/icon_close.png';
+import { dragBox } from '@utils/tools';
+
+/**
+ * title:标题
+ * children:弹窗内容
+ * onClose:弹窗关闭事件
+ * shadeClose:点蒙层关闭,默认true
+ *footer:固定在弹窗底部的内容如确定按钮
+ *icon:标题前的图标
+ *width:弹窗的宽度
+ *height:弹窗的高度
+ * **/
+
+
+class ComplexModal extends Component {
+  constructor(props) {
+    super(props);
+  }
+  componentDidMount(){
+    dragBox('complexModalWrap','complexModalTitle')
+  }
+
+  render() {
+    const { onclose,title,children,footer,shadeClose,icon,width,top,bottom} = this.props;
+    const marginLeft = width? -parseInt(width)/2 : '';
+    //const marginTop = height? -parseInt(height)/2: '';
+    const domNode = document.getElementById('root');
+    return ReactDom.createPortal(<div className={style['container']}>
+      <div className={style['shade']} onClick={shadeClose===false?'':onclose}></div>
+      <div id="complexModalWrap" className={style['modal']} style={{width: width?width:'auto', marginLeft:marginLeft, top:top?top+'px':'',bottom:bottom?bottom+'px':''}}>
+        <div className={`${style['close']} drag-title`} id="complexModalTitle">
+          {icon?<img src={icon} />:''}
+          {title}
+          <img src={close} onClick={onclose} className={style['closeIcon']} />
+        </div>
+        <i className={style['flg']}>患者基本信息</i>
+        <div className={style["content"]} style = {{width: width?width:'auto'}}>{children}</div>
+        <div className={style['footer']} style = {{width: width?width:'auto'}}>{footer}</div>
+      </div>
+    </div>,domNode);
+  }
+}
+
+export default ComplexModal;

+ 92 - 0
src/common/components/ComplexModal/index.less

@@ -0,0 +1,92 @@
+.container {
+  position: relative;
+  z-index: 2000;
+  padding-top: 40px;
+  .content{
+    overflow: auto;
+    position: relative;
+    height: 100%;
+    padding-bottom: 30px;
+    // bottom: 70px;
+    // top: 70px;
+    // width: 820px;
+  }
+  .footer{
+    // width: 820px;
+    position: relative;
+    padding:15px 0px;
+    bottom: 0;
+    text-align: right;
+    background-color: #fff;
+  }
+  // @media print {
+  //   .close{
+  //     display: none;
+  //   }
+  //   .flg {
+  //     display: block !important;
+  //   }
+  // }
+  .flg {
+    display: none;
+  }
+  .shade {
+    position: fixed;
+    left: 0;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    background-color: #000;
+    opacity: 0.6;
+    filter:alpha(opacity=60);
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
+  }
+  .modal {
+    // width: 820px;
+    background: #fff;
+    position: fixed;
+    left: 50%;
+    top: 3%;
+    bottom: 3%;
+    height: 94%;
+    overflow: hidden;
+    padding-top: 50px;
+    padding-bottom: 64px;
+  }
+  .close {
+    padding:  15px 15px 15px 20px;
+    border-bottom: 1px solid #EAEDF1;
+    background: #e5eefe;
+    position: absolute;
+    top:0;
+    width: 100%;
+    img{
+      vertical-align: text-top;
+    }
+    .closeIcon{
+      float:right;
+      cursor: pointer;
+      margin-top: -5px;
+    }
+  }
+  .button {
+    position: fixed;
+    bottom: 75px;
+    left: 50%;
+    margin-left: 280px;
+    span{
+      display: inline-block;
+      width: 80px;
+      height: 34px;
+      background: #3B9ED0;
+      font-size: 14px;
+      color: #FFFFFF;
+      font-size: 14px;
+      text-align: center;
+      line-height: 34px;
+      border-radius: 4px;
+      cursor: pointer;
+    }
+  }
+}
+

+ 7 - 2
src/common/components/ConfirmModal/index.jsx

@@ -122,7 +122,8 @@ class ConfirmModal extends Component {
             width, 
             height, 
             closable, 
-            noFooter
+            noFooter,
+            icon
         } = this.props;
         const marginLeft = -parseInt(width)/2
         const marginTop = -parseInt(height)/2
@@ -130,7 +131,11 @@ class ConfirmModal extends Component {
             <NewPortal visible={visible}>
                 <div className={styles['modal-wrapper']} id='confirm'>
                     <div className={styles[['modal']]} style = {{width: width, marginLeft:marginLeft, height:height, marginTop:marginTop}}>
-                        <div className={styles['modal-title']} style={{background: titleBg}}>{title ? title : ''} {closable ? <img onClick={this.closeModal} className={styles['modal-close']} src = {close}/> : false}</div>
+                        <div className={styles['modal-title']} style={{background: titleBg}}>
+                            {icon?<img src={icon} className={styles['icon']}/>:''}
+                            {title ? title : ''} 
+                            {closable ? <img onClick={this.closeModal} className={styles['modal-close']} src = {close}/> : false}
+                        </div>
                         <div className={styles['modal-content']}>{children}</div>
                         {noFooter ? '' : <div className={styles['modal-operator']+' clearfix'}>
                             <div className={styles['modal-btn-box']}>

+ 9 - 3
src/common/components/ConfirmModal/index.less

@@ -6,7 +6,7 @@
     border-radius: 5px;
     background: #fff;
     overflow: hidden;
-    z-index: 9999;
+    z-index: 1999;
 }
 
 .modal-title {
@@ -17,11 +17,17 @@
     background: #e5e5e5
 }
 
+.icon{
+    vertical-align: text-top;
+    margin-right: 2px;
+}
+
 .modal-close {
     position: absolute;
     right: 0px;
     width: 40px;
     height: 40px;
+    cursor: pointer;
 }
 
 .modal-content {
@@ -79,5 +85,5 @@
     opacity: .6;
     filter:alpha(opacity=60);
     -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
-    z-index: 9998;
-}
+    z-index: 1998;
+}

+ 44 - 0
src/common/components/DelToast/index.jsx

@@ -0,0 +1,44 @@
+import React from 'react';
+import style from './index.less';
+/**
+* 化验辅检删除弹窗 @Liucf 2019-5-22
+* 接收参数:
+* show:展示组件
+* name:删除项的名称
+* confirm:删除事件处理函数
+* cancel:取消事件处理函数
+*/
+
+class DelToast extends React.PureComponent{
+  constructor(props){
+    super(props);
+    this.handleDel = this.handleDel.bind(this);
+    this.handleCancel = this.handleCancel.bind(this);
+  }
+  handleDel(){
+    const {confirm} = this.props;
+    confirm&&confirm();
+  }
+  handleCancel(){
+    const {cancel} = this.props;
+    cancel&&cancel();
+  }
+  render(){
+    const {show,name} = this.props;
+    if(show){
+      return <div className={style['del-box']} id="delBox">
+        <div className={style['del-con']}>
+          <div className={style['del-tri']}></div>
+          <div className={style['del-title']} id="delTit" title={'删除 ' + name + '?'}>删除 {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>
+          </div>
+        </div>
+      </div>
+    }
+    return ''
+  }
+}
+
+export default DelToast;

+ 51 - 0
src/common/components/DelToast/index.less

@@ -0,0 +1,51 @@
+// @import "~@less/mixin.less";
+.del-box{
+  position: absolute;
+  width: 206px;
+  height: 106px;
+  box-shadow: 2px 2px 5px rgba(0,0,0,.4);
+  background: #fff;
+  z-index: 66;
+  text-align: center;
+  padding: 20px;
+  right: -30px;
+  top: 40px;
+}
+.del-con{
+  position: relative;
+  .del-tri{
+    width: 0; 
+    height: 0;
+    border-width: 10px;
+    border-style: solid;
+    border-color: transparent transparent #fff transparent;
+    position: absolute;
+    top: -40px;
+    right: 10px;
+  }
+  .del-title{
+    margin-bottom: 19px;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+    overflow: hidden;
+  }
+  .del-foot{
+    .del-btn{
+      display: inline-block;
+      width: 63px;
+      height: 26px;
+      line-height: 26px;
+      text-align: center;
+      cursor: pointer;
+    }
+    .del-del{
+      color: #fff;
+      background: #EC3E3E;
+      margin: 0 20px 0 10px;
+    }
+    .del-cancel{
+      color:#000;
+      background: #E5E5E5;
+    }
+  }
+}

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

@@ -43,14 +43,14 @@ class DropList extends Component{
     onSelect&&onSelect(undefined);
   }
   render(){
-    const {data,hideTag} = this.props;
+    const {data,hideTag,boxMark} = this.props;
     const domNode = document.getElementById('root');
     return ReactDom.createPortal(
       <div className={this.getClass()} style={this.getStyle()} contentEditable='false'>
         <ul>
           {data&&data.map((it)=>{
             /*return <li onClick={(e)=>this.handleSelect(e,it)} className={it.selected||(it.selected!==false&&+it.defaultSelect===1)?style['selected']:''}>{it.labelPrefix}{it.questionDetailList&&it.questionDetailList.length>0?it.questionDetailList[0].name:it.name}{it.labelSuffix}</li>*/
-            return <li onClick={(e)=>this.handleSelect(e,it)} className={it.selected||(!hideTag&&it.selected!==false&&+it.defaultSelect===1)?style['selected']:''}>{it.labelPrefix}{it.name}{it.labelSuffix}</li>
+            return <li onClick={(e)=>this.handleSelect(e,it)} className={it.selected||(boxMark!=1&&!hideTag&&it.selected!==false&&+it.defaultSelect===1)?style['selected']:''}>{it.labelPrefix}{it.name}{it.labelSuffix}</li>
           })}
           <li onClick={(e)=>this.handleClear(e)} className='red'>清空选项</li>
         </ul>

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

@@ -82,7 +82,7 @@ class EditableSpan extends Component{
     this.setState({
       labelVal:text1
     });
-
+    
     const that = this;
     handleChange&&handleChange({text1,boxMark,i});
 

+ 38 - 5
src/common/components/InlineTag/index.jsx

@@ -21,7 +21,7 @@ class InlineTag extends Component {
     this.$span = React.createRef();
     this.state = {
       editable:false,
-      value:props.value
+      value:props.value||''
     };
     this.changeToEdit = this.changeToEdit.bind(this);
     this.changeToClick = this.changeToClick.bind(this);
@@ -29,15 +29,29 @@ class InlineTag extends Component {
     this.handleInput = this.handleInput.bind(this);
     this.handleFocus = this.handleFocus.bind(this);
     this.handleFixClick = this.handleFixClick.bind(this);
+    this.handleBoxInput = this.handleBoxInput.bind(this);
   }
   changeToEdit(e){
     const {handledbClick,id} = this.props;
+    // 输入框有值才可以双击编辑
+    const text = this.$span.current.innerText;
+    if(!text.trim()){
+      return
+    }
     this.setState({
       editable:true
     });
     //埋点记录
     handledbClick&&handledbClick({id});
   }
+  handleBoxInput(e){
+    const {handleInput,ikey,prefix,suffix} = this.props;
+    const total = e.target.innerText;
+    const text = this.$span.current.innerText;
+    if(!total){
+      handleInput&&handleInput({text:total,ikey});
+    }
+  }
   changeToClick(event){
     event.returnValue = true;
     const {canEditable} = this.props;
@@ -47,17 +61,32 @@ class InlineTag extends Component {
     });
   }
   handleInput(e){       //输入时保存临时值,在修改灰显为黑色时判断用
+    e.stopPropagation();
+    const {handleInput,ikey,prefix,suffix} = this.props;
     const text = e.target.innerText || e.target.innerHTML;
+    // 内容全部删除时,要把空值存到store,否则会遗留最后一个字且为灰色无法删除
+    if(!text){
+      this.$span.current.innerText?(this.$span.current.innerText=''):(this.$span.current.innerHTML='');      //修改生成文字变成输入的2倍bug
+      handleInput&&handleInput({text:text,ikey,prefix,suffix});
+      this.setState({
+        value:" "
+      });
+      return
+    }
     this.setState({
       value:text
     });
-   // e.target.innerText = text;
+   // e.target.innerText = text;  
   }
   handleBlur(e){         //鼠标离开是保存值到store中
+    e.stopPropagation(); //不阻止会触发外层div的失焦事件
     const {value} = this.state;
     const {handleInput,ikey,prefix,suffix} = this.props;
     this.$span.current.innerText?(this.$span.current.innerText=''):(this.$span.current.innerHTML='');      //修改生成文字变成输入的2倍bug
-    handleInput&&handleInput({text:value,ikey,prefix,suffix});
+    handleInput&&handleInput({text:value.trim(),ikey,prefix,suffix});
+    this.setState({
+      value:value.trim()
+    });
   }
   handleFocus(e){
     e.stopPropagation();
@@ -105,12 +134,16 @@ class InlineTag extends Component {
   }
   render(){
     const {placeholder,value,prefix,suffix} = this.props;
+    const {editable} = this.state;
     const inp = this.state.value;
     return <div className={this.getStyle()}
                  onDoubleClick={this.changeToEdit}
-                  onClick={this.handleFixClick}
+                  onClick={!editable?this.handleFixClick:''}
                  onkeydown={handleEnter}
-                 onBlur={this.changeToClick} ref={this.$box} contentEditable={this.state.editable}>
+                 onBlur={this.changeToClick} 
+                 ref={this.$box} 
+                 contentEditable={editable}
+                 onInput={this.handleBoxInput}>
                 {prefix}
                 <span className={style['free-in']}
                       contentEditable={true}

+ 3 - 1
src/common/components/InspectCommon/index.less

@@ -6,7 +6,7 @@
     background-color: #fff;
     padding:28px 8px 8px 8px;
     min-width: 300px;
-    max-width: 600px;
+    max-width: 680px;
     box-sizing: border-box;
     margin-bottom: 80px;
     .llStyle;
@@ -25,11 +25,13 @@
         float: right;
         color: @blue;
         font-weight: bold;
+        cursor: pointer;
     }
     .clear {
         float: left;
         // font-weight: bold;
         bottom: 0;
+        cursor: pointer;
     }
 }
 

+ 5 - 6
src/common/components/Loading/index.jsx

@@ -8,7 +8,8 @@
 import React, {Component} from 'react';
 /*import PropTypes from 'prop-types';*/
 import style from './index.less';
-import icon from './img/loading.gif';
+// import icon from './img/loading.gif';
+import icon from '@common/images/loading.gif';
 
 /*const propTypes = {
     text: PropTypes.string,
@@ -35,10 +36,11 @@ const defaultProps = {
 
 class Loading extends React.Component{
     render(){
-        const {text, img, show} = this.props;
+        const {text,show} = this.props;
         return (
             <div className={style['loading']} style={{display: show ? 'block' : 'none'}}>
-                {this.props.shadeIsShow?<div className={style['cover']}/>:null}
+                {/*{this.props.shadeIsShow?<div className={style['cover']}/>:null}*/}
+                <div className={style['cover']}/>
                 <div className={style['info']}>
                     <img src={icon}/>
                     <p>{text}</p>
@@ -48,7 +50,4 @@ class Loading extends React.Component{
     }
 }
 
-/*Loading.propTypes = propTypes;
-Loading.defaultProps = defaultProps;*/
-
 export default Loading;

+ 7 - 3
src/common/components/Loading/index.less

@@ -8,9 +8,9 @@
   .cover{
     width: 100%;
     height: 100%;
-    background: #333;
-    opacity: .6;
-    filter:alpha(opacity=60);
+    background: #000;
+    opacity: .4;
+    filter:alpha(opacity=40);
     -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
   }
   .info{
@@ -18,6 +18,10 @@
     top: 40%;
     left: 45%;//calc(50% - 50px);
     text-align: center;
+    img{
+      width: 40px;
+      height: 40px;
+    }
   }
   p{
     color: #fff;

+ 48 - 0
src/common/components/MiniToast/index.jsx

@@ -0,0 +1,48 @@
+import React from 'react';
+import style from './index.less';
+import close from "../../images/close-icon.png";
+/**
+*小弹窗,没有蒙层,例如计算公式结果
+*title:弹窗标题
+*icon:标题旁边的icon,不传不显示
+*children:弹窗内容
+*show:弹窗显示
+*footer:是否显示底部“确定”按钮,默认不显示
+*confirmText:确认按钮文字
+*close:关闭弹窗事件
+*confirm:确定事件
+*使用时,父元素需要加相对定位position: relative;
+*/
+class MiniToast extends React.Component{
+  constructor(props){
+    super(props);
+  }
+
+  close(){
+    const {close} = this.props;
+    close&&close();
+  }
+
+  confirm(){
+    const {confirm} = this.props;
+    confirm&&confirm();
+  }
+
+
+  render(){
+    const {show,title,icon,children,footer,confirmText} = this.props;
+    return <div className={style["infoBox"]} style={{display:show?'block':'none'}}>
+              <p className={style["infoTitle"]}>
+                {icon?<img src={icon} />:''}
+                {title}
+                <img src={close} onClick={this.close.bind(this)} className={style["closeIcon"]}/>
+              </p>
+              <div className={style["infoCon"]}>{children}</div>
+              <div className={style["infoFoot"]} style={{display:footer?'block':'none'}}>
+                <span onClick={this.confirm.bind(this)}>{confirmText?confirmText:'确定'}</span>
+              </div>
+            </div>
+  }
+}
+
+export default MiniToast;

+ 44 - 0
src/common/components/MiniToast/index.less

@@ -0,0 +1,44 @@
+.infoBox{
+  position: absolute;
+  top:27px;
+  width: 388px;
+  background: #fff;
+  z-index: 40;
+  border: 1px solid #EAEDF1;
+  /*box-shadow: 0 5px 10px 0 rgba(0,0,0,0.10);*/
+  box-shadow: 0 10px 20px 0 #989DA3;
+  .infoTitle{
+    height: 40px;
+    line-height: 40px;
+    padding-left: 18px;
+    // border-bottom: 1px solid #EAEDF1;
+    background: #DFEAFE;
+    img{
+      vertical-align: text-top;
+    }
+    .closeIcon{
+      // vertical-align: middle;
+      float: right;
+      cursor: pointer;
+    }
+  }
+  .infoCon{
+    padding: 15px 26px 25px;
+  }
+  .infoFoot{
+    text-align: right;
+    // border-top: 1px solid #EAEDF1;
+    padding: 10px 20px 10px 0;
+    span{
+      color:#3B9ED0;
+      display: inline-block;
+      width: 66px;
+      height: 32px;
+      line-height: 32px;
+      text-align: center;
+      border: 1px solid #3B9ED0;
+      border-radius: 4px;
+      cursor: pointer;
+    }
+  }
+}

+ 18 - 17
src/common/components/NumberPan/index.jsx

@@ -9,6 +9,7 @@ class NumberPan extends Component{
     this.state = {
       value:''
     }
+    this.handleSelect = this.handleSelect.bind(this);
   }
   handleSelect(e){
     e.stopPropagation();
@@ -57,7 +58,7 @@ class NumberPan extends Component{
     }
   }
   render(){
-    const select = this.handleSelect.bind(this); 
+    const select = this.handleSelect;
     const domNode = document.getElementById('root');
     return ReactDom.createPortal(
        <div className={style['panBox']} 
@@ -66,28 +67,28 @@ class NumberPan extends Component{
                 onDoubleClick={(e)=>e.stopPropagation()}>
       <table className={style['pan']} >
         <tr>
-          <td><button onClick={select}>1</button></td>
-          <td><button onClick={select}>2</button></td>
-          <td><button onClick={select}>3</button></td>
-          <td><button onClick={select}>/</button></td>
+          <td><button onMouseUp={select}>1</button></td>
+          <td><button onMouseUp={select}>2</button></td>
+          <td><button onMouseUp={select}>3</button></td>
+          <td><button onMouseUp={select}>/</button></td>
         </tr>
         <tr>
-          <td><button onClick={select}>4</button></td>
-          <td><button onClick={select}>5</button></td>
-          <td><button onClick={select}>6</button></td>
-          <td><button onClick={this.handleBack.bind(this)}><img src={backspace} onClick={this.handleBack.bind(this)} /></button></td>
+          <td><button onMouseUp={select}>4</button></td>
+          <td><button onMouseUp={select}>5</button></td>
+          <td><button onMouseUp={select}>6</button></td>
+          <td><button onMouseUp={this.handleBack.bind(this)}><img src={backspace} onClick={this.handleBack.bind(this)} /></button></td>
         </tr>
         <tr>
-          <td><button onClick={select}>7</button></td>
-          <td><button onClick={select}>8</button></td>
-          <td><button onClick={select}>9</button></td>
-          <td><button onClick={this.handleClear.bind(this)} className={style['clearN']}>清空</button></td>
+          <td><button onMouseUp={select}>7</button></td>
+          <td><button onMouseUp={select}>8</button></td>
+          <td><button onMouseUp={select}>9</button></td>
+          <td><button onMouseUp={this.handleClear.bind(this)} className={style['clearN']}>清空</button></td>
         </tr>
         <tr>
-          <td><button onClick={select}>.</button></td>
-          <td><button onClick={select}>0</button></td>
-          <td><button onClick={select}>~</button></td>
-          <td><button onClick={this.handleClose.bind(this)} className={style['confirm']}>确定</button></td>
+          <td><button onMouseUp={select}>.</button></td>
+          <td><button onMouseUp={select}>0</button></td>
+          <td><button onMouseUp={select}>~</button></td>
+          <td><button onMouseUp={this.handleClose.bind(this)} className={style['confirm']}>确定</button></td>
         </tr>
       </table>
       </div>

+ 6 - 5
src/common/components/NumberUnitPan/index.jsx

@@ -83,7 +83,7 @@ class NumberUnitPan extends Component{
           <td><span onClick={this.handleSelect}>1</span></td>
           <td><span onClick={this.handleSelect}>2</span></td>
           <td><span onClick={this.handleSelect}>3</span></td>
-          <td><span onClick={this.handleSelect}>分</span></td>
+          <td><span onClick={this.handleSelect}>分</span></td>
           <td><span onClick={this.handleSelect}>周</span></td>
           <td><span onClick={this.handleSelect}>余</span></td>
         </tr>
@@ -91,8 +91,8 @@ class NumberUnitPan extends Component{
           <td><span onClick={this.handleSelect}>4</span></td>
           <td><span onClick={this.handleSelect}>5</span></td>
           <td><span onClick={this.handleSelect}>6</span></td>
-          <td><span onClick={this.handleSelect}>时</span></td>
-          <td><span onClick={this.handleSelect}></span></td>
+          <td><span onClick={this.handleSelect}>时</span></td>
+          <td><span onClick={this.handleSelect}></span></td>
           <td><span onClick={this.handleSelect}>次</span></td> 
         </tr>
         <tr>
@@ -100,7 +100,7 @@ class NumberUnitPan extends Component{
           <td><span onClick={this.handleSelect}>8</span></td>
           <td><span onClick={this.handleSelect}>9</span></td>
           <td><span onClick={this.handleSelect}>天</span></td>
-          <td><span onClick={this.handleSelect}></span></td>
+          <td><span onClick={this.handleSelect}></span></td>
           <td><span onClick={this.handleSelect}>岁</span></td> 
         </tr>
         <tr>
@@ -108,7 +108,8 @@ class NumberUnitPan extends Component{
           <td><span onClick={this.handleSelect}>0</span></td>
           <td><span onClick={this.handleSelect}>~</span></td>
           <td><span onClick={this.handleSelect}>/</span></td>
-          <td colspan="2" className={style['imgN']}><img src={backspace} onClick={this.handleBack.bind(this)} /></td>
+          <td onClick={(e)=>e.stopPropagation()}></td>
+          <td className={style['imgN']}><img src={backspace} onClick={this.handleBack.bind(this)} /></td>
         </tr>
         <tr>
           <td colspan="3"><span onClick={this.handleClear.bind(this)} className={style['clearN']}>清空</span></td>

+ 0 - 65
src/common/components/Radio/index.js

@@ -1,65 +0,0 @@
-import React from 'react';
-/*import PropTypes from 'prop-types';*/
-import on from './img/on.png';
-import off from './img/off.png';
-import disable from './img/disable.png';
-import style from './index.less';
-
-/**
- * 单选按钮
- * handleClick:点击触发按键 会将输入的props信息作为参数传入
- * isSelect:是否选中
- * name:右侧显示文字
- */
-class Radio extends React.Component {
-    constructor(props){
-        super(props);
-        this.handleClick = this.handleClick.bind(this);
-    }
-
-    handleClick(id){
-        this.props.handleClick(id);
-    }
-
-    getStyle(){
-        if(this.props.display=='block'){
-            return {
-                display:'block',
-                // marginBottom:'10px'
-            }
-        }
-        return {
-            display:'inline-block',
-            marginLeft:'10px'
-        }
-    }
-
-    render() {
-        const {id,name,isSelect,disabled} = this.props;
-        if(disabled){
-            return (
-                <div className={style['radio']}
-                     style={this.getStyle()}>
-                    <img src={isSelect?disable:off}/>
-                    <span style={{color:'#aaa'}}>{name}</span>
-                </div>
-            )
-        }
-        return (
-            <div className={style['radio']}
-                 onClick={() =>this.handleClick(id)}
-                 style={this.getStyle()}>
-                <img src={isSelect?on:off}/>
-                <span>{name}</span>
-            </div>
-        )
-    }
-}
-
-/*Radio.propTypes = {
-    handleClick:PropTypes.func,
-    isSelect:PropTypes.bool,
-    name:PropTypes.string
-};*/
-
-export default Radio;

+ 66 - 0
src/common/components/Radio/index.jsx

@@ -0,0 +1,66 @@
+import React from 'react';
+/*import PropTypes from 'prop-types';*/
+import on from '@common/images/icon-radio-active.png';
+import off from '@common/images/icon-radio-default.png';
+import disable from './img/disable.png';
+import style from './index.less';
+
+/**
+ * 单选按钮
+ * handleClick:点击触发按键 会将输入的props信息作为参数传入
+ * isSelect:是否选中
+ * label:右侧显示文字
+ */
+class Radio extends React.Component {
+  constructor(props){
+    super(props);
+    this.handleClick = this.handleClick.bind(this);
+  }
+
+  handleClick(id){
+    const {handleClick} = this.props;
+    handleClick&&handleClick(id);
+  }
+
+  getStyle(){
+    if(this.props.display=='block'){
+      return {
+        display:'block',
+        // marginBottom:'10px'
+      }
+    }
+    return {
+      display:'inline-block',
+      /*marginLeft:'10px'*/
+    }
+  }
+
+  render() {
+    const {id,label,isSelect,disabled} = this.props;
+    if(disabled){
+      return (
+        <div className={style['radio']}
+             style={this.getStyle()}>
+          <img src={isSelect?disable:off}/>
+          <span style={{color:'#aaa'}}>{label}</span>
+        </div>
+      )
+    }
+    return (
+      <div className={style['radio']}
+           onClick={() =>this.handleClick(id)}
+           style={this.getStyle()}>
+        <img src={isSelect?on:off}/>
+        <span>{label}</span>
+      </div>
+    )
+  }
+}
+
+/*Radio.propTypes = {
+    handleClick:PropTypes.func,
+    isSelect:PropTypes.bool,
+    name:PropTypes.string
+};*/
+
+export default Radio;

+ 3 - 3
src/common/components/Radio/index.less

@@ -1,7 +1,7 @@
 .radio{
-  width: 120px;
-  height: 44px;
-  line-height: 44px;
+  // max-width: 120px;
+  height: 35px;
+  line-height: 35px;
   cursor: pointer;
   img{
     vertical-align: middle;

+ 5 - 0
src/common/components/SearchOption/index.jsx

@@ -4,6 +4,7 @@ import clear from './imgs/clear.png';
 import search from './imgs/search.png';
 import PropTypes from "prop-types";
 import config from '@config/index';
+import $ from 'jquery';
 /**
  * 前提条件父元素有定位
  * visible  搜索显示隐藏
@@ -39,6 +40,10 @@ class SearchOption extends React.Component {
     componentDidMount(){
       this.props.handleChangeValue('');
       this.textInput.current.focus();
+      const {windowHeight,pageTop,height} = this.props;
+      if(windowHeight - pageTop < height){
+        $("#searchOption")[0].scrollIntoView(false);
+      }
     }
     handleClearVal(){
         const { handleChangeValue } = this.props;

+ 5 - 5
src/common/components/SearchOption/index.less

@@ -5,15 +5,15 @@
     padding: 8px;
     box-sizing: border-box;
     position: absolute;
-    top: 40px;
+    top: 30px;
     z-index: 99;
     background-color: #fff;
-    margin-bottom: 80px;
+    // margin-bottom: 80px;
     .llStyle;
     .autoList {
-        max-height: 225px;
-        min-height: 80px;
-        overflow-y: auto;
+        // max-height: 225px;
+        // min-height: 80px;
+        // overflow-y: auto;
     }
     input {
         width: 100%;

+ 3 - 3
src/common/components/Textarea/index.jsx

@@ -21,10 +21,10 @@ class Textarea extends Component {
     this.handleKeydown = this.handleKeydown.bind(this);
   }
   handleFocus(){            //初始显示props中的值,focus已经显示输入的值,避免值更新闪烁
-    const {handleFocus,fuzhen,handleInput} = this.props;
+    const {handleFocus,fuzhen,handleInput,isChronic} = this.props;
     handleFocus&&handleFocus();         //其他史、查体获取数据的方法
-    if(fuzhen&&!(this.$dom.current.innerText?this.$dom.current.innerText:this.$dom.current.innerHTML)){
-      const text = config.currentText.replace("(**)",fuzhen);
+    if(fuzhen&& !isChronic.name&&!(this.$dom.current.innerText?this.$dom.current.innerText:this.$dom.current.innerHTML)){
+      const text = config.currentText.replace("(**)",fuzhen.replace(";",''));
       this.$dom.current.innerText?(this.$dom.current.innerText = text):(this.$dom.current.innerHTML = text);
       handleInput&&handleInput({text});
     }

+ 10 - 2
src/common/components/index.js

@@ -3,7 +3,8 @@ import Button from "./Button";
 import Loading from "./Loading";
 import Message from "./Message";
 import Modal from "./Modal";
-import Radio from "./Radio";
+import Radio from "./Radio/index";
+import CheckBtn from './CheckBtn';
 import InlineTag from './InlineTag';
 import ItemBox from './ItemBox';
 import Tab from './Tab';
@@ -20,11 +21,15 @@ import EditableSpan from "./EditableSpan";
 import Textarea from "./Textarea";
 import NumberUnitPan from "./NumberUnitPan";
 import Add from "./Add";
+import ComplexModal from "./ComplexModal";
+import MiniToast from "./MiniToast";
+import DelToast from "./DelToast";
 
 module.exports = {
     Banner,
     Modal,
     Radio,
+    CheckBtn,
     Loading,
     Button,
     Message,
@@ -43,5 +48,8 @@ module.exports = {
     EditableSpan,
     Textarea,
     NumberUnitPan,
-    Add
+    Add,
+    ComplexModal,
+    MiniToast,
+    DelToast
 };

BIN
src/common/images/1.png


BIN
src/common/images/2.png


BIN
src/common/images/3.png


BIN
src/common/images/4.png


BIN
src/common/images/5.png


BIN
src/common/images/6.png


BIN
src/common/images/7.png


BIN
src/common/images/8.png


BIN
src/common/images/add-result.png


BIN
src/common/images/added.png


BIN
src/common/images/all-table.png


BIN
src/common/images/check.png


BIN
src/common/images/chronic.png


BIN
src/common/images/close-icon.png


BIN
src/common/images/close-icon1.png


BIN
src/common/images/del_hor.png


BIN
src/common/images/del_nor.png


BIN
src/common/images/delete.png


BIN
src/common/images/info-move.png


BIN
src/common/images/info-pic.png


BIN
src/common/images/info-pic1.png


BIN
src/common/images/info-show.png


BIN
src/common/images/manage.png


BIN
src/common/images/table.png


BIN
src/common/images/加入@3x.png


BIN
src/common/images/已加入@3x.png


BIN
src/common/images/筛选表.png


BIN
src/common/images/级别1.png


BIN
src/common/images/级别2.png


BIN
src/common/images/级别3.png


BIN
src/common/images/级别4.png


BIN
src/common/images/级别5.png


+ 15 - 6
src/common/js/func.js

@@ -22,7 +22,7 @@ export function dateParser(timestamp,link = '-'){
     let hour = time.getHours().toString().padStart(2,'0');
     let minute = time.getMinutes().toString().padStart(2,'0');
     // let result = year+link+month+link+date;
-    let result = year+link+month+link+date+' '+hour+':'+minute;
+    let result = year+link+(month<10?"0"+month:month)+link+(date<10?"0"+date:date)+' '+hour+':'+minute;
     return result;
 }
 
@@ -95,12 +95,15 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       tempText = '',
       value = '',
       item={},
-      checkHiddenDefault=false;
+      cNum = 0,
+      checkHiddenDefault=false;//console.log(arr)
   arr&&arr.map((it,i)=>{
     notText = notTextLabel(it);
+    cNum = i;
     value = it.value||'';
     textLabel = !ifEmpty&&i==0?Object.assign({},JSON.parse(config.textLabel),{showInCheck:true}):JSON.parse(config.textLabel);
-    _textLabel = !ifEmpty&&i<config.showCheckNum+1?Object.assign({},JSON.parse(config._textLabel),{showInCheck:true}):JSON.parse(config._textLabel);
+    //n个显示的标签最后一个标签后面要落关标,所以+1
+    _textLabel = !ifEmpty&&cNum<config.showCheckNum+1?Object.assign({},JSON.parse(config._textLabel),{showInCheck:true}):JSON.parse(config._textLabel);
     if(i===0){
       //第一个标签不是文本标签时在前面添加文本标签
       if(!noPre&&notText){
@@ -116,11 +119,16 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
         tempText = getSaveText(it);
       }
       saveText.push(tempText);
+      // 模板只有一个标签时第一项后面也要加空标签
+      if(arr.length==1&&notText){
+        newArr.push(textLabel);
+        saveText.push('');
+      }
     }else{
       pre = arr[i-1];
-      item = !ifEmpty&&i<config.showCheckNum?Object.assign({},it,{showInCheck:true}):it;
+      item = !ifEmpty&&cNum<config.showCheckNum?Object.assign({},it,{showInCheck:true}):it;
       //判断单选项是否有默认选中,位置在隐藏区域时,查体所有标签展示
-      if(!ifEmpty&&!checkHiddenDefault&&i>config.showCheckNum&&+it.tagType===1&&(+it.controlType===0||+it.controlType===1)){
+      if(!ifEmpty&&!checkHiddenDefault&&cNum>config.showCheckNum&&+it.tagType===1&&(+it.controlType===0||+it.controlType===1)){
         if(it.questionDetailList.find((it)=>it.defaultSelect=='1')){
           checkHiddenDefault=true;
         }
@@ -148,7 +156,8 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       }
       if(notText&&!noEnd&&i===arr.length-1){//最后一个非文本标签,后面添加一个文本标签
         //不能用上面的变量textLabel,因为上一个if可能也进了,这样就是同一个对象,值改变时会同步
-        newArr.push(JSON.parse(config.textLabel));
+        const _text = arr.length>config.showCheckNum?JSON.parse(config._textLabel):_textLabel;
+        newArr.push(ifEmpty?textLabel:_text);
         saveText.push("");
       }
     }

+ 1 - 1
src/common/less/base.less

@@ -63,4 +63,4 @@ html,body {
 }
 :global(.mainsuit-box) {
     
-}
+}

+ 56 - 1
src/common/less/variables.less

@@ -44,6 +44,9 @@
 @dropdwon-long-width:600px;
 @dropdwon-height:200px;
 @selected-bg:#fff;
+@import-color:#ffad5f;
+@closeIcon:url(../images/del_nor.png) no-repeat;
+@closeHor:url(../images/del_hor.png) no-repeat;
 
 /*********推送内容容器宽度*************/
 @push-width: 450px;
@@ -177,4 +180,56 @@
   border:2px @blue solid;
   border-radius: 2px;
   /*box-shadow: 0px 0px 2px @blue;*/
-}
+}
+
+.orange-border{
+  border:1px solid @import-color;
+  //color: @import-color!important;
+}
+:global(.drag-title) {
+  cursor: move;
+  moz-user-select: -moz-none;
+  -moz-user-select: none;
+  -o-user-select: none;
+  -khtml-user-select: none;
+  -webkit-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}
+// 加入病历
+.add-record{
+  float: right;
+  text-align: left;
+  padding-left: 5px;
+  cursor: default;
+  width: 99px;
+  height: 26px;
+  line-height: 26px;
+  border: 1px solid #EAEDF1;
+  border-radius: 4px;
+  font-size: 12px;
+  img{
+    vertical-align: middle;
+    width: 12px;
+    margin:-3px 3px 0 0;
+  }
+}
+.disable-add{
+  float: right;
+  text-align: left;
+  padding-left: 5px;
+  cursor: default;
+  width: 99px;
+  height: 26px;
+  line-height: 26px;
+  border: 1px solid #EAEDF1;
+  border-radius: 4px;
+  font-size: 12px;
+  color: @placeholder-color;
+  img{
+    vertical-align: middle;
+    width: 12px;
+    margin:-3px 3px 0 0;
+    opacity: .5;
+  }
+}

BIN
src/components/AddAssistCheck/img/info2.png


BIN
src/components/AddAssistCheck/img/info3.png


+ 194 - 140
src/components/AddAssistCheck/index.jsx

@@ -1,159 +1,213 @@
 import React from 'react';
-import { SearchOption, Calendar ,ConfirmModal,Notify,Add} from '@commonComp';
+import { SearchOption, Calendar, ConfirmModal, Notify, Add ,DelToast} from '@commonComp';
 import styles from './index.less';
 import $ from 'jquery';
 import Textarea from './Textarea';
+import { getPageCoordinate } from '@utils/tools';
 import close from './img/close.png';
 
 class AddAssistCheck extends React.Component {
-    constructor(props) {
-        super(props);
-        this.state = {
-            show: false,
-            date: false,
-            dateTime:"",
-            active:'',
-            visible:false,
-            id:null
-        }
-        this.handleShowDate = this.handleShowDate.bind(this)
-        this.getCurrentDate = this.getCurrentDate.bind(this)
-        this.getSearchList = this.getSearchList.bind(this)
-        this.getAssistLabel = this.getAssistLabel.bind(this)
-        this.handleDelClick = this.handleDelClick.bind(this)
-        this.delConfirm = this.delConfirm.bind(this)
-        this.handleCancel = this.handleCancel.bind(this)
+  constructor(props) {
+    super(props);
+    this.state = {
+      show: false,
+      date: false,
+      dateTime: "",
+      active: '',
+      visible: false,
+      pageTop:'',
+      id: null,
+      activeName:''
     }
+    this.handleShowDate = this.handleShowDate.bind(this)
+    this.getCurrentDate = this.getCurrentDate.bind(this)
+    this.getSearchList = this.getSearchList.bind(this)
+    this.getAssistLabel = this.getAssistLabel.bind(this)
+    this.handleDelClick = this.handleDelClick.bind(this)
+    this.delConfirm = this.delConfirm.bind(this)
+    this.handleCancel = this.handleCancel.bind(this)
+  }
 
-    handleDelClick(id){
-        this.setState({
-            visible:true,
-            id:id
-        })
-    }
+  handleDelClick(id,item) {
+    this.setState({
+      visible: true,
+      id: id,
+      activeName:item.name
+    })
+  }
 
-    delConfirm(){
-        const {handleDelAssist,handlePush} = this.props;
-        const {id} = this.state;
-        handleDelAssist&&handleDelAssist(id);
-        handlePush&&handlePush();           //右侧推送
-        this.setState({
-            visible:false,
-            id:null
-        })
-        Notify.success("删除成功");
-    }
+  delConfirm() {
+    const { handleDelAssist, handlePush } = this.props;
+    const { id } = this.state;
+    handleDelAssist && handleDelAssist(id);
+    handlePush && handlePush();           //右侧推送
+    this.setState({
+      visible: false,
+      id: null,
+      activeName:''
+    })
+    Notify.success("删除成功");
+  }
 
-    handleCancel(){
-        this.setState({
-            visible:false,
-            id:null
-        })
-    }
+  handleCancel() {
+    this.setState({
+      visible: false,
+      id: null,
+      activeName:''
+    })
+  }
 
-    componentDidMount() {
-        $(document).click((event) => {
-            let _con = $('#searchWrapAssist');   // 设置目标区域
-            let _cons = $('#datePick');   // 设置目标区域
-            if (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 });
-            }
-        });
-        this.getCurrentDate();
-    }
-    handleSearchShow(e) {
-        let tmpShow = this.state.show;
-        this.setState({ show: !tmpShow })
-        // e.stopPropagation();
-    }
-    handleShowDate(idx){
-        this.setState({
-            date:!this.state.date,
-            active:idx
+  componentDidMount() {
+    $(document).click((event) => {
+      let _con = $('#searchWrapAssist');   // 设置目标区域
+      let _cons = $('#datePick');   // 设置目标区域
+      let _del = $('#delBox')[0];   // 删除弹窗
+      let _close = $('#assiClose')[0];   // 删除icon
+      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.isEqualNode(_close) && !event.target.isEqualNode(_del)  && event.target.parentNode != _del && !event.target.isEqualNode(_closeTil)){
+          this.setState({
+            visible: false,
+            id: null,
+            activeName:''
+          })
+      }
+    });
+    this.getCurrentDate();
+  }
+  handleSearchShow(e) {
+    let tmpShow = this.state.show;
+    this.setState({ show: !tmpShow,pageTop:getPageCoordinate(e).boxTop })
+    // e.stopPropagation();
+  }
+  handleShowDate(idx) {
+    this.setState({
+      date: !this.state.date,
+      active: idx
+    })
+  }
+  getCurrentDate() {
+    let myDate = new Date();
+    let year = myDate.getFullYear();       //获取完整的年份(4位,1970-????)
+    let mon = myDate.getMonth() - 0 + 1;       //获取当前月份(0-11,0代表1月)
+    let day = myDate.getDate();            //获取当前日(1-31)
+    let date = year + '-' + (mon < 10 ? '0' + mon : mon) + '-' + (day < 10 ? '0' + day : day);
+    this.setState({ dateTime: date })
+  }
+
+  getSearchList(list) {      //搜索列表
+    const { handleSign } = this.props;
+    return <ul className={styles.searchLiUl}>
+      {
+        list && list.map((item, idx) => {
+          return <li key={item.id}
+            className={styles.searchLi}
+            title={item.name}
+            onClick={() => {
+              handleSign(item.questionId, idx,'search');
+              this.setState({ show: false })
+            }}
+          >
+            {item.name}{item.name == item.retrievalName ? null : '(' + item.retrievalName + ')'}
+          </li>
         })
-    }
-    getCurrentDate(){
-        let myDate = new Date();
-        let year = myDate.getFullYear();       //获取完整的年份(4位,1970-????)
-        let mon = myDate.getMonth()-0+1;       //获取当前月份(0-11,0代表1月)
-        let day = myDate.getDate();            //获取当前日(1-31)
-        let date = year+'-'+(mon<10?'0'+mon:mon)+'-'+(day<10?'0'+day:day);
-        this.setState({dateTime:date})
-    }
-    
-    getSearchList(list){      //搜索列表
-        const {handleSign} = this.props;
-        return <ul>
-        {
-            list && list.map((item,idx) => {
-                return <li key={item.id}
-                    className={styles.searchLi}
-                    title={item.name}
-                    onClick={() => {
-                        handleSign(item.questionId,idx);
-                        this.setState({ show: false })
-                    }}
-                >
-                    {item.name}{item.name == item.retrievalName?null:'('+item.retrievalName+')'}
-                </li>
-            })
-        }
+      }
     </ul>
-    }
-    getAssistLabel(){
-        const {assistLabel,handleChangeAssistValue,handleChangeDate,isRead,handlePush,winWidth} = this.props;
-        return <ul className={styles.labelWrap} id="datePick">
+  }
+  getCommonList() {      //常用列表
+    const { handleSign,assistList } = this.props;
+    return <ul className={styles.searchLiUl}>
+      {
+        assistList && assistList.map((item, idx) => {
+          return <li key={item.id}
+            className={styles.searchLi}
+            title={item.name}
+            onClick={() => {
+              handleSign(item.questionId, idx,'common');
+              this.setState({ show: false })
+            }}
+          >
+            {item.name}
+          </li>
+        })
+      }
+    </ul>
+  }
+  getAssistLabel() {
+    const { assistLabel, handleChangeAssistValue, handleChangeDate, isRead, handlePush, winWidth,getInfomation } = this.props;
+    const { visible,activeName,id } = this.state;
+    return <ul className={styles.labelWrap} id="datePick">
+      {
+        assistLabel.map((item, idx) => {
+          return (<li key={item.questionId} className={styles.assistLists}>
+            <span className={styles.assistName} style={{ width: winWidth < 1200 ? '120px' : 'auto' }}>
+              <span className={styles.tagSpan}>
+                {item.name}:
+                <span className={styles.imgInfo} onClick={()=>getInfomation(item.questionId,item.name)}></span>
+              </span>
+            </span>
+            <div className={styles.textareaWrap}>
+              <Textarea value={item.value} handlePush={handlePush} isRead={isRead} handleChangeAssistValue={handleChangeAssistValue} idx={idx}></Textarea>
+            </div>
+            <div className={styles.pointerFinger}>
+              <p onClick={() => this.handleShowDate(idx)}>报告日期:<span>{item.time || this.state.dateTime}</span></p>
+              <i onClick={() => this.handleShowDate(idx)}></i>
+              {/*<a href="javascript:void(0);" onClick={() => { this.handleDelClick(idx,item) }}><img src={close} alt="" /></a>*/}
+              <span className={styles.closeIcon} id="assiClose" onClick={() => { this.handleDelClick(idx,item) }}></span>
+              <div style={{ display: this.state.date && idx == this.state.active ? "block" : "none", position: "relative" }}>
+                <Calendar isShow={true} handleChange={(info) => { handleChangeDate(info, idx); this.setState({ date: false }) }}></Calendar>
+              </div>
+            </div>
+          <DelToast show={idx==id?visible:false}
+                    name={activeName} 
+                    cancel={this.handleCancel}
+                    confirm={this.delConfirm}/>
+          </li>)
+        })
+      }
+    </ul>
+  }
+  render() {
+    const { handleChangeValue, list,assistVal,windowHeight } = this.props;
+    const { visible,pageTop } = this.state;
+    return (
+      <div className={styles.wrapper}>
+        {this.getAssistLabel()}
+        <div id="searchWrapAssist" style={{ position: "relative", clear: 'both' }}>
+          <Add showText="添加辅检项" handleClick={(e) => this.handleSearchShow(e)} id="assistCheck" />
+          {this.state.show ? <SearchOption windowHeight={windowHeight} pageTop={pageTop} height={280} handleChangeValue={handleChangeValue} visible={true}>
+            {list && list.length>0?this.getSearchList(list):(assistVal == ''?'':<p style={{padding:'5px 30px',color:'#bfbfbf'}}>暂无筛选项</p>)}
             {
-              assistLabel.map((item,idx) => {
-                    return (<li key={item.id} className={styles.assistLists}>
-                        <span className={styles.assistName} style={{width:winWidth < 1200?'120px':'auto'}}>{item.name}:</span>
-                        <div className={styles.textareaWrap}>
-                            <Textarea value={item.value} handlePush={handlePush} isRead={isRead} handleChangeAssistValue={handleChangeAssistValue} idx={idx}></Textarea>
-                        </div>
-                        <div className={styles.pointerFinger}>
-                            <p onClick={()=>this.handleShowDate(idx)}>报告日期:<span>{item.time || this.state.dateTime}</span></p>
-                            <i onClick={()=>this.handleShowDate(idx)}></i>
-                            <a href="javascript:void(0);" onClick={()=>{this.handleDelClick(idx)}}><img src={close} alt=""/></a>
-                            <div style={{display:this.state.date && idx == this.state.active?"block":"none",position:"relative"}}>
-                                <Calendar isShow={true} handleChange={(info)=>{handleChangeDate(info,idx);this.setState({date:false})}}></Calendar>
-                            </div>
-                        </div>
-                    </li>)
-                })
+              list && list.length>0 || (assistVal != '')?'':<div>
+                <p style={{padding:'5px 30px',color:'#bfbfbf'}}>常用辅检项</p>
+                {
+                  this.getCommonList()
+                }
+              </div>
             }
-        </ul>
-    }
-    render() {
-        const { handleChangeValue, list } = this.props;
-        const { visible } = this.state;
-        return (
-            <div className={styles.wrapper}>
-                {this.getAssistLabel()}
-                <div id="searchWrapAssist" style={{position:"relative",clear:'both'}}>
-                    <Add showText="添加辅检项" handleClick={(e) => this.handleSearchShow(e)} id="assistCheck"/>
-                  {this.state.show?<SearchOption handleChangeValue={handleChangeValue} visible={true}>
-                        {this.getSearchList(list)}
-                    </SearchOption>:''}
-                </div>
-                <ConfirmModal 
-                    visible={visible}
-                    confirm={this.delConfirm}
-                    close={this.handleCancel}
-                    cancel={this.handleCancel}
-                    okText="删除"
-                    cancelText='取消'
-                    // okBorderColor={'#3B9ED0'}
-                    // okColor={'#fff'}
-                    // oKBg={'#3B9ED0'}
-                >
-                    <p className={styles['center']}>是否删除该辅检项?</p>
-                </ConfirmModal>
-            </div>
-        )
-    }
+          </SearchOption> : ''}
+        </div>
+        {/*<ConfirmModal
+          visible={visible}
+          confirm={this.delConfirm}
+          close={this.handleCancel}
+          cancel={this.handleCancel}
+          okText="删除"
+          cancelText='取消'
+          okBorderColor={'#3B9ED0'}
+          okColor={'#fff'}
+          oKBg={'#3B9ED0'}
+        >
+          <p className={styles['center']}>是否删除该辅检项?</p>
+        </ConfirmModal>*/}
+      </div>
+    )
+  }
 }
 
 export default AddAssistCheck;

Dosya farkı çok büyük olduğundan ihmal edildi
+ 58 - 4
src/components/AddAssistCheck/index.less


+ 17 - 4
src/components/AddInspect/SlideExcel/index.jsx

@@ -31,17 +31,25 @@ class SlideExcel extends Component {
     })
   }
   render() {
-    const {items,item,idx,dateTime} = this.props;
+    const {items,item,idx,dateTime,getInfomation} = this.props;
     const {show} = this.state;
     return (
       <li className={styles.excelDataLis} style={{border:items.lisExcelRes.length-1 == idx? 0:''}}>
           <span className={styles.excelDataTitle}>
-              {item.menus}
+              <span className={styles.tagSpan}>
+                {item.menus}
+                <span className={styles.imgInfo} onClick={()=>getInfomation('',item.lisExcelItem[0].uniquemealName || '','excel')}></span>
+              </span>
           </span>
           <table className={styles.table}>
              {  show ? (item.lisExcelItem && item.lisExcelItem.map((value,idx)=>{
                   return <tr>
-                      <td style={{width:'30%'}}>{value.itemName}</td>
+                      <td style={{width:'30%'}}>
+                        <span className={styles.tagSpan}>
+                          {value.itemName}
+                          <span className={styles.imgInfo} onClick={()=>getInfomation('',value.uniqueName || '','excel')}></span>
+                        </span>
+                      </td>
                       <td style={{width:'20%'}}><span className={value.type == 1?'red':null}>{value.value}</span> {value.unit}</td>
                       <td style={{width:'25%'}}>
                           {normalVal(value.min,value.max)}
@@ -51,7 +59,12 @@ class SlideExcel extends Component {
                 })):(item.lisExcelItem && item.lisExcelItem.map((value,idx)=>{
                   if(idx < 4){
                     return <tr>
-                        <td style={{width:'30%'}}>{value.itemName}</td>
+                        <td style={{width:'30%'}}>
+                          <span className={styles.tagSpan}>
+                            {value.itemName}
+                            <span className={styles.imgInfo} onClick={()=>getInfomation('',value.uniqueName || '','excel')}></span>
+                          </span>
+                        </td>
                         <td style={{width:'20%'}}><span className={value.type == 1?'red':null}>{value.value}</span> {value.unit}</td>
                         <td style={{width:'25%'}}>
                             {normalVal(value.min,value.max)}

+ 29 - 0
src/components/AddInspect/SlideExcel/index.less

@@ -113,6 +113,7 @@
         td {
             text-align: left;
             padding-top: 6px;
+            cursor: default;
         }
         .excelUnit {
             width: auto;
@@ -142,4 +143,32 @@
   .num {
     color: @blue;
   }
+}
+.imgInfo {
+  position: relative;
+}
+.imgInfo {
+  width: 15px;
+  height: 17px;
+  border-bottom: 0 none !important;
+  background: url('../img/info2.png') no-repeat center center;
+  background-size: 100% auto; 
+  position: absolute;
+  top: -10px;
+  left: 50%;
+  margin-left: -8px;
+  display: none;
+  cursor: pointer;
+}
+.imgInfo:hover {
+  background: url('../img/info3.png') no-repeat center center;
+  background-size: 100% auto; 
+}
+.tagSpan {
+  position: relative;
+}
+.tagSpan:hover {
+  .imgInfo {
+    display: block;
+  }
 }

+ 65 - 16
src/components/AddInspect/SlideSelect/index.jsx

@@ -1,19 +1,25 @@
 import React, { Component } from "react";
 import styles from "./index.less";
 import { normalVal,timestampToTime } from '@utils/tools';
-import { InspectCommon, Calendar} from '@commonComp';
+import { InspectCommon, Calendar,DelToast} from '@commonComp';
 import slideUp from "@common/images/slide-up.png";
 import slideDown from "@common/images/slide-down.png";
 import date1 from '../img/date1.png';
 import close from '../img/close.png';
+
 class SlideSelect extends Component {
   constructor(props) {
     super(props);
     this.state = {
       show:false,
+      activeInd:false,
+      activeName:''
     };
     this.toTime = this.toTime.bind(this)
     this.handleSlide = this.handleSlide.bind(this)
+    this.handleDel = this.handleDel.bind(this)
+    this.handleCancel = this.handleCancel.bind(this)
+    this.delConfirm = this.delConfirm.bind(this)
   }
   toTime(time){
     let tmpTim = time.split(',').join('')-0
@@ -33,9 +39,31 @@ class SlideSelect extends Component {
       show:!tmpShow
     })
   }
+  handleDel(){
+    const {handleDelClick,idx,item} = this.props;
+    this.setState({
+      activeInd:true,
+      activeName:item.name
+    })
+    handleDelClick&&handleDelClick(1,idx);
+  }
+  handleCancel(){
+    this.setState({
+      activeInd:false,
+      activeName:''
+    })
+  }
+  delConfirm(){
+    const {handleDelConfirm} = this.props;
+    handleDelConfirm&&handleDelConfirm();
+    this.setState({
+      activeInd:false,
+      activeName:''
+    })
+  }
   render() {
-    const {handleConfirm,changeActivePart,handleDelClick,getItemList,date,item,idx,handleFillShow,showDetails,handleLabelSub,showFill,changeShowFill,handlePush,dateTime,currentIdx,currentData,fillActive,handleShowDate,handleChangeDate} = this.props;
-    const {show} = this.state;
+    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 (
       <li key={item.questionId} className={styles.slideLi}> 
@@ -43,28 +71,39 @@ class SlideSelect extends Component {
             // 标签,血常规。。
             item.show ?
             <p className={styles.staticTagActive}>
-                <span data-flg="current" style={{color:"#000"}} onClick={(e) => { handleLabelSub(e, item.questionId,idx); handleFillShow(e,idx) }}>{item.name}</span>
+                <span className={styles.tagSpan} data-flg="current" style={{color:"#000"}} onClick={(e) => { handleLabelSub(e, item.questionId,idx); handleFillShow(e,idx) }}>
+                  {item.name}
+                  <span className={styles.imgInfo} onClick={()=>getInfomation(item.questionId,item.name)}></span>
+                </span>
             </p>:
-            <p>
-                <i data-flg="current" onClick={(e) => { handleLabelSub(e,item.questionId,idx); handleFillShow(e,idx) }}>{item.name}</i>
+            <p >
+                <i className={styles.tagSpan} data-flg="current" onClick={(e) => { handleLabelSub(e,item.questionId,idx); handleFillShow(e,idx) }}>
+                  {item.name}
+                  <span className={styles.imgInfo} onClick={()=>getInfomation(item.questionId,item.name)}></span>
+                </i>
             </p>
         }
         
         {
           item.details && item.details.map((val)=>{
             if(val.value && val.value != ''){
-                numPlus = ++numPlus
-              }
-            })
-          }
+              numPlus = ++numPlus
+            }
+          })
+        }
         {
-            item.show ? 
+            item.show ?
                 <table className={styles.table}>
                     {
                         show?(item.details.map((val)=>{
                             if(val.value && val.value != ''){
                                 return <tr>
-                                    <td style={{width:'30%'}}>{val.name}</td>
+                                    <td style={{width:'30%'}}>
+                                      <span className={styles.tagSpan}>
+                                        {val.name}
+                                        <span className={styles.imgInfo} onClick={()=>getInfomation(val.id)}></span>                                        
+                                      </span>
+                                    </td>
                                     {showDetails(val)}
                                     <td style={{width:'25%'}}>
                                         {normalVal(val.minValue,val.maxValue)}
@@ -77,7 +116,12 @@ class SlideSelect extends Component {
                               ++numPlus1;
                               if(numPlus1 < 5){
                                 return <tr>
-                                    <td style={{width:'30%'}}>{val.name}</td>
+                                    <td style={{width:'30%'}}>
+                                      <span className={styles.tagSpan}>
+                                        {val.name}
+                                        <span className={styles.imgInfo} onClick={()=>getInfomation(val.id)}></span>
+                                      </span>
+                                    </td>
                                     {showDetails(val)}
                                     <td style={{width:'25%'}}>
                                         {normalVal(val.minValue,val.maxValue)}
@@ -119,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
                                 }
@@ -136,7 +180,12 @@ class SlideSelect extends Component {
                 : null
             }
         </div>
-        <img className={styles.partDel} src={close} alt="删除项" onClick={()=>{handleDelClick(1,idx)}}/>
+        {/*<img className={styles.partDel} src={close} alt="删除项" onClick={()=>{handleDelClick(1,idx)}}/>*/}
+        <span id="addClose" className={styles.partDel} onClick={this.handleDel}></span>
+        <DelToast show={showToast&&activeInd?true:false}
+                    name={activeName} 
+                    cancel={this.handleCancel}
+                    confirm={this.delConfirm}/>
     </li>
     );
   }

+ 48 - 9
src/components/AddInspect/SlideSelect/index.less

@@ -1,10 +1,9 @@
 @import "~@less/variables.less";
 .slideLi {
     // cursor: pointer;
-    color: #767676;
+    // color: #767676;
     position: relative;
-    padding-top: 10px;
-    padding-bottom: 10px;
+    padding: 10px 20px 10px 0;
     border-bottom:1px dashed #989DA3;
     i {
         font-style: normal;
@@ -26,17 +25,27 @@
         vertical-align: top;
     } 
     .partDel {
-        width: 13px;
-        height: 13px;
+        width: 15px;
+        height: 15px;
         margin-bottom: 11px;
         cursor: pointer;
         display: inline-block;
         position: absolute;
-        right: 0;
-        top: 12px;
-        background-color: #fff;
+        right: 2px;
+        top: 13px;
+        // background-color: #fff;
+        background: @closeIcon;
+        background-size: 100% 100%;
     }
 }
+.slideLi:hover{
+    background:#F2F2F2;
+    border-radius: 4px;
+       .partDel{
+        background: @closeHor;
+        background-size: 100% 100%;
+      } 
+}
 .staticTagActive {
     cursor: pointer;
     color: #333;
@@ -74,7 +83,8 @@
         height: 18px;
         width: 100%;
         td {
-            padding-top: 3px;
+          cursor: default;
+          padding-top: 3px;
         }
     }
 }
@@ -121,6 +131,7 @@
             td {
                 text-align: left;
                 padding-top: 6px;
+                cursor: default;
             }
             .excelUnit {
                 width: auto;
@@ -151,4 +162,32 @@
   .num {
     color: @blue;
   }
+}
+.imgInfo {
+  position: relative;
+}
+.imgInfo {
+  width: 15px;
+  height: 17px;
+  border-bottom: 0 none !important;
+  background: url('../img/info2.png') no-repeat center center;
+  background-size: 100% auto; 
+  position: absolute;
+  top: -10px;
+  left: 50%;
+  margin-left: -8px;
+  display: none;
+  cursor: pointer;
+}
+.imgInfo:hover {
+  background: url('../img/info3.png') no-repeat center center;
+  background-size: 100% auto; 
+}
+.tagSpan {
+  position: relative;
+}
+.tagSpan:hover {
+  .imgInfo {
+    display: block;
+  }
 }

BIN
src/components/AddInspect/img/info2.png


BIN
src/components/AddInspect/img/info3.png


+ 350 - 313
src/components/AddInspect/index.jsx

@@ -1,8 +1,8 @@
 import React from 'react';
-import { SearchOption, InspectCommon, Calendar ,Notify,ConfirmModal,Add} from '@commonComp';
+import { SearchOption, InspectCommon, Calendar ,Notify,ConfirmModal,Add,DelToast} from '@commonComp';
 import SlideExcel from './SlideExcel';
 import SlideSelect from './SlideSelect';
-import { deepClone } from '@utils/tools';
+import { deepClone,getPageCoordinate } from '@utils/tools';
 import styles from './index.less';
 import date1 from './img/date1.png';
 import close from './img/close.png';
@@ -11,335 +11,372 @@ import slideDown from "@common/images/slide-down.png";
 import store from '@store';
 import $ from 'jquery';
 class Inspect extends React.Component {
-    constructor(props) {
-        super(props);
-        this.state = {
-            show: false,
-            showFill: false,
-            date: false,
-            currentIdx: '',
-            dateTime:"",
-            currentData:{},
-            numPlus:0,     //判断是否所有的填写单都是空
-            num:0,            //暂存数据,获取一次,不能每次都是新的数据
-            toastText:'',
-            visible:false,
-            type:null,
-            id:null,
-            tmpIds:[],      //内层外层
-        }
-        this.handleChangeDate = this.handleChangeDate.bind(this)
-        this.handleShowDate = this.handleShowDate.bind(this)
-        this.getCurrentDate = this.getCurrentDate.bind(this)
-        this.getItemList = this.getItemList.bind(this)
-        this.getSearchList = this.getSearchList.bind(this)
-        this.changeActivePart = this.changeActivePart.bind(this)
-        this.showDetails = this.showDetails.bind(this)
-        this.delConfirm = this.delConfirm.bind(this)
-        this.handleCancel = this.handleCancel.bind(this)
-        this.handleSearchShow = this.handleSearchShow.bind(this)
-        this.changeShowFill = this.changeShowFill.bind(this)
-        this.handleFillShow = this.handleFillShow.bind(this)
-        this.handleDelClick = this.handleDelClick.bind(this)
+  constructor(props) {
+    super(props);
+    this.state = {
+      show: false,
+      showFill: false,
+      date: false,
+      currentIdx: '',
+      dateTime: "",
+      currentData: {},
+      numPlus: 0,     //判断是否所有的填写单都是空
+      num: 0,            //暂存数据,获取一次,不能每次都是新的数据
+      type: null,
+      id: null,
+      pageTop:'',
+      // tmpIds: [],      //内层外层
+      impId:null
     }
-    delConfirm(){//弹窗确定
-        const{delPartItem,handleCloseExcel,handlePush} = this.props;
-        const{type,id} = this.state;
-        if(type==1){
-            delPartItem(id)
-        }else if(type==2){
-            handleCloseExcel(id)
-        }
-        this.setState({
-            visible:false,
-            type:null,
-            id:null,
-        })
-        Notify.success("删除成功");
-        handlePush&&handlePush();       //右侧推送
+    this.handleChangeDate = this.handleChangeDate.bind(this)
+    this.handleShowDate = this.handleShowDate.bind(this)
+    this.getCurrentDate = this.getCurrentDate.bind(this)
+    this.getItemList = this.getItemList.bind(this)
+    this.getSearchList = this.getSearchList.bind(this)
+    this.getCommonList = this.getCommonList.bind(this)
+    this.changeActivePart = this.changeActivePart.bind(this)
+    this.showDetails = this.showDetails.bind(this)
+    this.delConfirm = this.delConfirm.bind(this)
+    this.handleCancel = this.handleCancel.bind(this)
+    this.handleSearchShow = this.handleSearchShow.bind(this)
+    this.changeShowFill = this.changeShowFill.bind(this)
+    this.handleFillShow = this.handleFillShow.bind(this)
+    this.handleDelClick = this.handleDelClick.bind(this)
+  }
+  delConfirm() {//弹窗确定
+    const { delPartItem, handleCloseExcel, handlePush } = this.props;
+    const { type, id ,impId} = this.state;
+    if (type == 1) {
+      delPartItem(id)
+    } else if (type == 2) {
+      handleCloseExcel(impId)
     }
-    handleDelClick(type,idx){
-        this.setState({
-            type:type,
-            id:idx,
-            visible:true
-        })
-        if(type==1){//单项
-            this.setState({
-                toastText:'是否删除该化验项?'
-            })
-        }else if(type==2){//导入项
-            this.setState({
-                toastText:'是否删除导入项?'
-            })
-        }
+    this.setState({
+      type: null,
+      id: null,
+      impId: null
+    })
+    Notify.success("删除成功");
+    handlePush && handlePush();       //右侧推送
+  }
+  handleDelClick(type, idx) { 
+    if (type == 2){
+      this.setState({
+        impId:idx,
+        type: type,
+        id:null
+      })
+    }else{
+      this.setState({
+        type: type,
+        id: idx,
+        impId:null
+      })
     }
-    handleCancel(){
-        this.setState({
-            visible:false,
-            type:null,
-            id:null,
-        })
-    }
-    componentDidMount() {
-        $(document).click((event) => {
-            let searchWrap = $('#searchWrap')[0];   // 搜索按钮
-            let searchOption = $('#searchOption')[0];   // 搜索列表
-            let inspectFill = $('#inspectFill')[0];         // 公共填写单
-            if(searchOption){
-                if ( searchOption != event.target && searchWrap != event.target && searchWrap != event.target.parentNode && !$.contains(searchOption, event.target)) { // Mark 1
-                    this.setState({ show: false });
-                }
-            }
-            if(inspectFill){
-                if ( event.target.getAttribute('data-flg') != 'current' && inspectFill != event.target && !$.contains(inspectFill, event.target)) { // Mark 1
-                    this.setState({ showFill: false ,date:false});
-                }
-            }
-        });
-        this.getCurrentDate();
-    }
-    componentWillReceiveProps(nextProps){
-        if(nextProps.fillActive.name != this.props.fillActive.name){
-            this.setState({num:0})
+  }
+  handleCancel() {
+    this.setState({
+      type: null,
+      id: null,
+      impId: null
+    })
+  }
+  componentDidMount() {
+    $(document).click((event) => {
+      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 });
         }
+      }
+      if (inspectFill) {
+        if (event.target.getAttribute('data-flg') != 'current' && inspectFill != event.target && !$.contains(inspectFill, event.target)) { // Mark 1
+          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();
+  }
+  componentWillReceiveProps(nextProps) {
+    if (nextProps.fillActive.name != this.props.fillActive.name) {
+      this.setState({ num: 0 })
     }
-    changeShowFill(){
-      this.setState({showFill:false})
-    }
-    handleChangeDate(info) {
-        let date = info.year+'-'+(info.month<10?'0'+info.month:info.month)+'-'+(info.day<10?'0'+info.day:info.day);
-        this.setState({dateTime:date,date:false})
-    }
-    handleSearchShow(e) {
-        let tmpShow = this.state.show;
-        this.setState({ show: !tmpShow })
-        // e.stopPropagation();
-    }
-    handleFillShow(e,idx) {
-        let tmpShow = this.state.showFill;
-        let baseList = store.getState().inspect.fillActive;
-        this.setState({
-            showFill: !tmpShow, 
-            currentIdx:idx,
-            currentData:baseList,
-            dateTime:baseList.time?baseList.time:this.getCurrentDate()
-        })
-        e.stopPropagation();
-    }
-    handleShowDate(){
-        this.setState({
-            date:!this.state.date
-        })
-    }
-    getCurrentDate(){
-        let myDate = new Date();
-        let year = myDate.getFullYear();       //获取完整的年份(4位,1970-????)
-        let mon = myDate.getMonth()-0+1;       //获取当前月份(0-11,0代表1月)
-        let day = myDate.getDate();            //获取当前日(1-31)
-        let date = year+'-'+(mon<10?'0'+mon:mon)+'-'+(day<10?'0'+day:day);
-        this.setState({dateTime:date})
-        return date;
+  }
+  changeShowFill() {
+    this.setState({ showFill: false })
+  }
+  handleChangeDate(info) {
+    let date = info.year + '-' + (info.month < 10 ? '0' + info.month : info.month) + '-' + (info.day < 10 ? '0' + info.day : info.day);
+    this.setState({ dateTime: date, date: false })
+  }
+  handleSearchShow(e) {
+    let tmpShow = this.state.show;
+    this.setState({ show: !tmpShow,pageTop:getPageCoordinate(e).boxTop })
+    // e.stopPropagation();
+  }
+  handleFillShow(e, idx) {
+    let tmpShow = this.state.showFill;
+    let baseList = store.getState().inspect.fillActive;
+    this.setState({
+      showFill: !tmpShow,
+      currentIdx: idx,
+      currentData: baseList,
+      dateTime: baseList.time ? baseList.time : this.getCurrentDate()
+    })
+    e.stopPropagation();
+  }
+  handleShowDate() {
+    this.setState({
+      date: !this.state.date
+    })
+  }
+  getCurrentDate() {
+    let myDate = new Date();
+    let year = myDate.getFullYear();       //获取完整的年份(4位,1970-????)
+    let mon = myDate.getMonth() - 0 + 1;       //获取当前月份(0-11,0代表1月)
+    let day = myDate.getDate();            //获取当前日(1-31)
+    let date = year + '-' + (mon < 10 ? '0' + mon : mon) + '-' + (day < 10 ? '0' + day : day);
+    this.setState({ dateTime: date })
+    return date;
+  }
+  changeActivePart(idx, val, clear) {
+    let nums = this.state.num;
+    let fillActive;
+    if (nums == 0) {
+      fillActive = this.props.fillActive;
+    } else {
+      fillActive = this.state.currentData;
     }
-    changeActivePart(idx,val,clear){
-        let nums = this.state.num;
-        let fillActive;
-        if(nums == 0){
-            fillActive = this.props.fillActive;
-        }else{
-            fillActive = this.state.currentData;
+    ++nums;
+    this.setState({ num: nums });
+    let tempArr = deepClone(fillActive);
+
+    if (clear) {    //点击清空按钮,至清初输入的数字
+      for (let i = 0; i < tempArr.details.length; i++) {
+        tempArr.details[i].value = ''
+        tempArr.show = false;
+      }
+      tempArr.time = this.getCurrentDate();
+      this.setState({ currentData: tempArr })
+      return;
+    } else {
+      let tempNumPlus = 0;
+      for (let i = 0; i < tempArr.details.length; i++) {
+        if (i == idx) {
+          tempArr.details[i].value = val
         }
-        ++nums;
-        this.setState({num:nums});
-        let tempArr = deepClone(fillActive);
-        
-        if(clear){    //点击清空按钮,至清初输入的数字
-          for (let i = 0; i < tempArr.details.length; i++) {
-            tempArr.details[i].value = ''
+        if (tempArr.details[i].value != undefined && tempArr.details[i].value != '') {
+          tempArr.show = true;
+        } else {
+          ++tempNumPlus;
+          if (tempNumPlus == tempArr.details.length) {
             tempArr.show = false;
           }
-          tempArr.time = this.getCurrentDate();
-          this.setState({currentData:tempArr})
-          return;
-        }else{
-          let tempNumPlus = 0;
-          for (let i = 0; i < tempArr.details.length; i++) {
-              if (i == idx) {
-                  tempArr.details[i].value = val
-              }
-              if(tempArr.details[i].value != undefined && tempArr.details[i].value != ''){
-                  tempArr.show = true;
-              }else{
-                  ++tempNumPlus;
-                  if(tempNumPlus == tempArr.details.length){
-                      tempArr.show = false;
-                  }
-              }
-          }
-          tempArr.time = this.state.dateTime;
-          this.setState({currentData:tempArr})
         }
+      }
+      tempArr.time = this.state.dateTime;
+      this.setState({ currentData: tempArr })
     }
-    getItemList(){        //填写单展示
-        let number = this.state.num;
-        let fillActive;
-        if(number == 0){
-            fillActive = this.props.fillActive;
-        }else{
-            fillActive = this.state.currentData;
-        }
-        return <ul className={styles.searchLis}>
-            {
-                fillActive && fillActive.details && fillActive.details.map((item,idx) => {
-                    if(item.controlType == 1){
-                        return (
-                            <li className={`${styles.itemPart} ${fillActive.details.length>1?'':styles.itemPartOne}`}>
-                                <span className={styles.itemPartL}>{item.name}</span>
-                                <select className={styles.itemPartR} onChange={(e)=>{
-                                        if(e.target.value == '请选择') {
-                                            this.changeActivePart(idx,'')
-                                            return;
-                                        }
-                                        this.changeActivePart(idx,e.target.value);
-                                    }}
-                                >
-                                    <option value="请选择">请选择</option>
-                                    {
-                                        (item.questionDetailList).map((val)=>{
-                                            return <option value={val.name} 
-                                                selected={val.name == item.value?true:false}
-                                            >{val.name}</option>
-                                        })
-                                    }
-                                </select>
-                            </li>
-                        )
-                    }else if(item.controlType == 6){
-                        return (
-                            <li className={`${styles.itemPart} ${fillActive.details.length>1?'':styles.itemPartOne}`}>
-                                <span className={styles.itemPartL} title={item.name}>{item.name}</span>
-                                <span className={styles.itemPartT}>
-                                    <input type="text" 
-                                        placeholder="(填写)"
-                                        value={item.value}
-                                        onKeyUp={(e)=>{this.changeActivePart(idx,e.target.value.trim())}} 
-                                    />
-                                    <p className={styles.unit}>{item.labelSuffix}</p>
-                                </span>
-                            </li>
-                        )
-                    }
-                })
-            }
-        </ul>
+  }
+  getItemList() {        //填写单展示
+    let number = this.state.num;
+    let fillActive;
+    if (number == 0) {
+      fillActive = this.props.fillActive;
+    } else {
+      fillActive = this.state.currentData;
     }
-    getSearchList(list){      //搜索列表
-        const {handleSign} = this.props;
-        return <ul>
-        {
-            list && list.map((item,idx) => {
-                return <li key={idx}
-                    className={styles.searchLi}
-                    title={item.name}
-                    onClick={() => {
-                        handleSign(item.questionId,idx);
-                        this.setState({ show: false })
-                    }}
-                >
-                    {item.name}{item.name == item.retrievalName?null:'('+item.retrievalName+')'}
-                </li>
-            })
-        }
+    return <ul className={styles.searchLis}>
+      {
+        fillActive && fillActive.details && fillActive.details.map((item, idx) => {
+          if (item.controlType == 1) {
+            return (
+              <li className={`${styles.itemPart} ${fillActive.details.length > 1 ? '' : styles.itemPartOne}`}>
+                <span className={styles.itemPartL}>{item.name}</span>
+                <span className={styles.itemPartT}>
+                  <select className={styles.itemPartR} onChange={(e) => {
+                    if (e.target.value == '请选择') {
+                      this.changeActivePart(idx, '')
+                      return;
+                    }
+                    this.changeActivePart(idx, e.target.value);
+                  }}
+                  >
+                    <option value="请选择">请选择</option>
+                    {
+                      (item.questionDetailList).map((val) => {
+                        return <option value={val.name}
+                          selected={val.name == item.value ? true : false}
+                        >{val.name}</option>
+                      })
+                    }
+                  </select>
+                </span>
+              </li>
+            )
+          } else if (item.controlType == 6) {
+            return (
+              <li className={`${styles.itemPart} ${fillActive.details.length > 1 ? '' : styles.itemPartOne}`}>
+                <span className={styles.itemPartL} title={item.name}>{item.name}</span>
+                <span className={styles.itemPartT}>
+                  <input type="text"
+                    placeholder="(填写)"
+                    value={item.value}
+                    onKeyUp={(e) => { this.changeActivePart(idx, e.target.value.trim()) }}
+                  />
+                  <p className={styles.unit} title={item.labelSuffix}>{item.labelSuffix}</p>
+                </span>
+              </li>
+            )
+          }
+        })
+      }
     </ul>
-    }
-    showDetails(val){
-        if(val.questionDetailList.length > 0){
-            return val.questionDetailList.map((item)=>{
-                if(val.value == item.name){
-                    return <td style={{width:'20%'}} className={item.abnormal != '0' ?"red":'' }>{val.value}</td>
-                }
-            })
-        }else{
-            return <td style={{width:'20%'}}><span className={(val.value - 0).toString() == 'NaN'?"red":(val.maxValue || val.minValue) ? (val.value > val.maxValue || val.value < val.minValue?"red":''):''}>{val.value}</span> { val.labelSuffix}</td>
+  }
+  getSearchList(list) {//搜索列表
+    const { handleSign } = this.props;
+    return <ul className={styles.searchLiUl}>
+      {
+        list && list.map((item, idx) => {
+          return <li key={idx}
+            className={styles.searchLi}
+            title={item.name == item.retrievalName ? item.name : item.name + '(' + item.retrievalName + ')'}
+            onClick={() => {
+              handleSign(item.questionId, idx,'search');
+              this.setState({ show: false })
+            }}
+          >
+            {item.name}{item.name == item.retrievalName ? null : '(' + item.retrievalName + ')'}
+          </li>
+        })
+      }
+    </ul>
+  }
+  getCommonList(){//常用列表
+    const { handleSign,inspectList } = this.props;
+    return <ul className={styles.searchLiUl}>
+      {
+        inspectList && inspectList.map((item, idx) => {
+          return <li key={idx}
+            className={styles.searchLi}
+            title={item.name}
+            onClick={() => {
+              handleSign(item.questionId, idx,'common');
+              this.setState({ show: false })
+            }}
+          >
+            {item.name}
+          </li>
+        })
+      }
+    </ul>
+  }
+  showDetails(val) {
+    if (val.questionDetailList.length > 0) {
+      return val.questionDetailList.map((item) => {
+        if (val.value == item.name) {
+          return <td style={{ width: '20%' }} className={item.abnormal != '0' ? "red" : ''}>{val.value}</td>
         }
+      })
+    } else {
+      return <td style={{ width: '20%' }}><span className={(val.value - 0).toString() == 'NaN' ? "red" : (val.maxValue || val.minValue) ? (val.value > val.maxValue || val.value < val.minValue ? "red" : '') : ''}>{val.value}</span> {val.labelSuffix}</td>
     }
-    render() {
-        const { handleChangeValue, list, labelList,delPartItem, handleLabelSub, handleClear, handleConfirm, fillActive,getExcelDataList,handleCloseExcel,handlePush } = this.props;
-        const {toastText,visible,tmpId,tmpIdx} = this.state;
-        return (
-            <div className={styles.wrapper}>
-                <div className={styles.check}>
+  }
+  render() {
+    const { getInfomation,handleChangeValue,inspectVal, list, labelList,windowHeight, delPartItem, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush } = this.props;
+    const { tmpId, tmpIdx,id,pageTop,impId} = this.state;
+
+    return (
+      <div className={styles.wrapper}>
+        <div className={styles.check}>
+          {
+            getExcelDataList.length > 0 && getExcelDataList.map((items, ind) => {
+              return <div style={{ marginTop: '10px' }}>
+                {
+                  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} id="impClose" onClick={() => { this.handleDelClick(2, ind) }}></span>
+                    <DelToast show={impId==ind?true:false}
+                    name="该导入项" 
+                    cancel={this.handleCancel}
+                    confirm={this.delConfirm}/>
                     {
-                        getExcelDataList.length > 0 && getExcelDataList.map((items,id)=>{
-                            return <div style={{marginTop:'10px'}}>
-                                {
-                                    items && items.lisExcelRes.length > 0 ? <ul className={styles.excelDataLists}>
-                                    <img className={styles.close} src={close} alt="关闭导入excel数据" onClick={()=>{this.handleDelClick(2,id)}}/>
-                                    {
-                                        items.lisExcelRes.map((item,idx)=>{
-                                            return <SlideExcel
-                                              items={items}
-                                              item={item}
-                                              idx={idx}
-                                              dateTime={this.state.dateTime}
-                                            ></SlideExcel>
-                                        })
-                                    }
-                                </ul>:null
-                                }
-                            </div>
-                        })
+                      items.lisExcelRes.map((item, idx) => {
+                        return <SlideExcel
+                          items={items}
+                          item={item}
+                          idx={idx}
+                          dateTime={this.state.dateTime}
+                          getInfomation={getInfomation}
+                        ></SlideExcel>
+                      })
                     }
-                    <ul className={styles.labelWrap} >
-                        {
-                            labelList && labelList.map((item,idx) => {
-                                return <SlideSelect
-                                  item={item}
-                                  idx={idx}
-                                  showFill={this.state.showFill}
-                                  handlePush={handlePush}
-                                  fillActive={fillActive}
-                                  handleLabelSub={handleLabelSub}
-                                  date={this.state.date}
-                                  dateTime={this.state.dateTime}
-                                  currentIdx={this.state.currentIdx}
-                                  currentData={this.state.currentData}
-                                  showDetails={this.showDetails}
-                                  handleShowDate={this.handleShowDate}
-                                  handleChangeDate={this.handleChangeDate}
-                                  changeShowFill={this.changeShowFill}
-                                  handleFillShow={this.handleFillShow}
-                                  getItemList={this.getItemList}
-                                  changeActivePart={this.changeActivePart}
-                                  handleDelClick={this.handleDelClick}
-                                  handleConfirm={handleConfirm}
-                                ></SlideSelect>
-                            })
-                        }
-                    </ul>
-                </div>
-                <div style={{position:"relative",clear:"both"}}>
-                    <Add showText="添加化验项" handleClick={(e) => this.handleSearchShow(e)} id="searchWrap"/>
-                  {this.state.show?<SearchOption handleChangeValue={handleChangeValue} visible={true}>
-                        {this.getSearchList(list)}
-                    </SearchOption>:''}
+                  </ul> : null
+                }
+              </div>
+            })
+          }
+          <ul className={styles.labelWrap} >
+            {
+              labelList && labelList.map((item, idx) => {
+                return <SlideSelect
+                  item={item}
+                  idx={idx}
+                  showToast={idx==id?true:false}
+                  showFill={this.state.showFill}
+                  handlePush={handlePush}
+                  fillActive={fillActive}
+                  handleLabelSub={handleLabelSub}
+                  date={this.state.date}
+                  dateTime={this.state.dateTime}
+                  currentIdx={this.state.currentIdx}
+                  currentData={this.state.currentData}
+                  showDetails={this.showDetails}
+                  handleShowDate={this.handleShowDate}
+                  handleChangeDate={this.handleChangeDate}
+                  changeShowFill={this.changeShowFill}
+                  handleFillShow={this.handleFillShow}
+                  getItemList={this.getItemList}
+                  changeActivePart={this.changeActivePart}
+                  handleDelClick={this.handleDelClick}
+                  handleDelConfirm={this.delConfirm}
+                  handleConfirm={handleConfirm}
+                  getInfomation={getInfomation}
+                ></SlideSelect>
+              })
+            }
+          </ul>
+        </div>
+        <div style={{ position: "relative", clear: "both" }}>
+          <Add showText="添加化验项" handleClick={(e) => this.handleSearchShow(e)} id="searchWrap" />
+          {this.state.show ? <SearchOption windowHeight={windowHeight} height={280} 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 || (inspectVal != '')?'':<div>
+                  <p style={{padding:'5px 30px',color:'#bfbfbf'}}>常用化验项</p>
+                  {
+                    this.getCommonList()
+                  }
                 </div>
-                <ConfirmModal 
-                    visible={visible}
-                    confirm={this.delConfirm}
-                    close={this.handleCancel}
-                    cancel={this.handleCancel}
-                    okText="删除"
-                    cancelText='取消'
-                    // okBorderColor={'#3B9ED0'}
-                    // okColor={'#fff'}
-                    // oKBg={'#3B9ED0'}
-                >
-                    <p className={styles['center']}>{toastText}</p>
-                </ConfirmModal>
-            </div>
-        )
-    }
+            }
+          </SearchOption> : ''}
+        </div>
+      </div>
+    )
+  }
 }
 
 export default Inspect;

+ 31 - 7
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;
@@ -88,6 +88,11 @@
 .fillWrap {
     display: none;
 }
+.searchLiUl {
+  overflow-y: auto;
+  max-height: 225px;
+  // min-height: 80px;
+}
 .searchLi {
     height: 36px;
     line-height: 36px;
@@ -122,10 +127,10 @@
 }
 .itemPart {
     height: 28px;
-    // line-height: 28px;
+    line-height: 28px;
     overflow: hidden;
     padding-top: 0 !important;
-    width: 290px;
+    width: 330px;
     float: left;
     padding: 0 15px;
     box-sizing: border-box;
@@ -142,16 +147,24 @@
     .itemPartR {
         width: 62px;
         outline: none;
-        float: right;
+        float: left;
+        margin-top: 5px;
     }
     .itemPartT {
         float: right;
+        width: 120px;
         input {
             width: 40px;
             text-align: center;
+            float: left;
+            margin-right: 10px;
         }
         .unit {
             display: inline-block;
+            width: 70px;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
         }
     }
 }
@@ -163,14 +176,17 @@
     background-color: rgba(237,237,237,0.4);
     border: 1px solid #ccc;
     .close {
-        width: 13px;
-        height: 13px;
+        display: inline-block;
+        width: 15px;
+        height: 15px;
         position: absolute;
         top: -5px;
         right: -5px;
         z-index: 30;
-        background-color: #fff;
         border-radius: 50%;
+        background: @closeIcon;
+        background-size: 100% 100%;
+        background-color: #fff;
     }
     .excelDataLis {
         padding: 2px 0px;
@@ -200,6 +216,14 @@
         }
     }
 }
+.excelDataLists:hover{
+    .close{
+        background: @closeHor;
+        background-size: 100% 100%;
+        background-color: #fff;
+        cursor: pointer;
+    }   
+}
 .center {
     text-align: center;
     font-size: 16px;

+ 4 - 1
src/components/Advice/Textarea/index.jsx

@@ -30,7 +30,7 @@ class Textarea extends Component {
     return true;
   }
   componentWillReceiveProps(next){
-    const isRead = this.props.isRead;
+    const {isRead, typeConfig} = this.props;
     // if(next.isRead != isRead && next.value!=this.props.value){      //value对比解决复诊不显示bug
     //   next.value ? this.$dom.current.innerText = next.value :  this.$dom.current.innerText = next.value 
     //   // this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
@@ -39,6 +39,9 @@ class Textarea extends Component {
       next.value ? this.$dom.current.innerText = next.value :  this.$dom.current.innerText = '' 
       // this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
     }
+    if(next.typeConfig != typeConfig) {
+      this.$dom.current.innerText = '' 
+    }
   }
   componentDidMount(){
     const {value} = this.props;

+ 6 - 7
src/components/Advice/index.jsx

@@ -2,6 +2,7 @@ import React,{Component} from 'react';
 import style from './index.less';
 import {ItemBox} from '@commonComp';
 import Textarea from './Textarea';
+import FollowUp from '@components/Treat/FollowUp'
 
 class Advice extends Component{
   constructor(props){
@@ -65,10 +66,7 @@ class Advice extends Component{
 
   render(){
     const {advice} = this.props.pushMessage;
-    const {isRead} = this.props
-
-    
-
+    const {isRead, isFirstMainDiag, followUp, hasFollowUp, saveFollowUp, typeConfig} = this.props
     let scheme = advice.scheme && advice.scheme.map((item, index) => {
       return <p>{item.treatment.map((it,ii) =>{
         return(it.treatmentStr && it.treatmentStr.length > 0 ? 
@@ -85,16 +83,17 @@ class Advice extends Component{
 
     return  <div className={`${'mainsuit-box'} ${style['main-suit']}`}>
       <ItemBox title='医嘱' editable={false} border={true} marginTop="10px">
-        {/* <div className={style['billing']}>
+        <div className={style['billing']}>
           {advice.assay && advice.assay.length > 0 || advice.check && advice.check.length > 0 ? <h1>开单项目</h1> : ''}
             {advice.assay && <span className={style['treat-input']}> {advice.assay}</span>}
             {advice.check && <span className={style['treat-input']}> {advice.check}</span>}
-        </div> */}
+        </div>
         {advice.commontreatment && advice.commontreatment.length > 0 &&<div className={style['billing']}  >
           {advice.commontreatment && advice.commontreatment.length > 0 && <h1>一般治疗</h1>}
             {/* {advice.commontreatment && <div className={style['treat-input']}  onInput={this.handleComTreatInput}  contentEditable={true} style = {{outline: 'none'}}></div>} */}
             {<Textarea value={advice.commontreatment} isRead={isRead} handleChangeAssistValue={this.handleComTreatInput} ></Textarea>}
         </div>}
+        {!isFirstMainDiag && hasFollowUp &&<div><FollowUp  noHeader="true" textStyle={{padding: '0 10px'}}  setFollowUp={saveFollowUp} followUp = {followUp} isRead={isRead}></FollowUp></div>}
         {advice.scheme && advice.scheme.length > 0 &&<div contentEditable='false' className={style['scheme']}>
           {advice.scheme && advice.scheme.length > 0  && <h1>治疗方案</h1>}
           {scheme}
@@ -102,7 +101,7 @@ class Advice extends Component{
         <div className={style['billing']} > 
             {/* {!advice.adviceInput && <Textarea value='' isRead={isRead} handleChangeAssistValue={this.handleAdviceInput} ></Textarea>}
             {advice.adviceInput && <Textarea value={advice.adviceInput} isRead={isRead} handleChangeAssistValue={this.handleAdviceInput} ></Textarea>} */}
-            <Textarea value={advice.adviceInput} isRead={isRead} handleChangeAssistValue={this.handleAdviceInput} ></Textarea>
+            <Textarea value={advice.adviceInput} isRead={isRead} handleChangeAssistValue={this.handleAdviceInput}  typeConfig={typeConfig}></Textarea>
         </div>
       </ItemBox>
     </div>

+ 164 - 0
src/components/AssessResult/AssessHis/index.jsx

@@ -0,0 +1,164 @@
+import React, { Component } from "react";
+import style from "./index.less";
+import { Radio,ComplexModal,Notify} from '@commonComp';
+import arrow from '@common/images/show.png';
+import arrowDown from '@common/images/close.png';
+import loadingIcon from '@common/images/loading.gif';
+import ChooseItem from "../ChooseItem";
+import ScaleItem from "../ScaleItem";
+import ChartItem from "../ChartItem";
+import printIcon from '@common/images/team.png';
+import tableIcon from '@common/images/table.png';
+import ScaleTableHis from '@components/ScaleTableHis';
+import $ from "jquery";
+
+class AssessResultHis extends Component {
+  constructor(props) {
+    super(props);
+    this.state={
+      chartTimeTypes:{},      //图表模块
+      tableName:'',
+      tableId:'',
+      parentIndex:0,
+      showAssess:false,     //显示收起数据
+    };
+    this.showAssessFn = this.showAssessFn.bind(this);
+    this.getAssessContent = this.getAssessContent.bind(this);
+    this.showScaleFn = this.showScaleFn.bind(this);
+  }
+  handleChartChange(i,selects){
+    const {chartTimeTypes} = this.state;
+    this.setState({
+      chartTimeTypes:Object.assign(chartTimeTypes,{[i]:selects})
+    });
+  }
+  showAssessFn(){
+    //获取历史评估数据
+    const {showAssess} = this.state;
+    this.setState({
+      showAssess:!showAssess
+    });
+    if(!showAssess){
+      this.props.getAssessHis(this.props.inquiryId);
+    }
+  }
+  handoutTypes(obj,item,i,id){
+    const {wholeAssess,wholeIndexs,chooseSelecteds,scaleResult,wholeResults,wholeAssessText,calcuResult,calcuValues,scaleItems} =obj;
+    const {getIndexData,inquiryDate,indexData,timeTypes,indexNames} = this.props;
+    const {chartTimeTypes} = this.state;
+    const name = item.regionName+":";
+    const list = item.data&&item.data.rows;
+    switch (+item.regionType){
+      case 0:     //数据来源与右侧手动添加
+        return <ScaleItem title={name}
+                          data={wholeAssess}
+                          showScaleFn={this.showScaleFn}
+                          showListScale={this.showScaleFn}
+                          indexs={wholeIndexs}
+                          formulaResult={scaleResult}
+                          calcuResult={calcuResult}
+                          calcuValues={calcuValues}
+                          scaleItems={scaleItems}
+                          result={wholeResults}
+                          disabled={true}
+                          text={wholeAssessText[id]}></ScaleItem>;
+      case 1:     //数据来源于大数据
+        return <ChooseItem title={name} data={list} selecteds={chooseSelecteds&&chooseSelecteds[i]} disabled={true}></ChooseItem>;
+      case 10:    //数据来源于后台
+        return <ChartItem title={name}
+                          data={indexData||{}}
+                          names={indexNames||{}}
+                          timeTypes={JSON.stringify(chartTimeTypes||{})=='{}'?timeTypes&&timeTypes[i]:chartTimeTypes[i]}
+                          initFn={getIndexData}
+                          endDate={inquiryDate}
+                          pindex={i}
+                          handleChange={this.handleChartChange.bind(this,i)}></ChartItem>;
+      default:
+        return '';
+    }
+  }
+  getMultAssess(){
+    const { list,inquiryId } = this.props;
+    const obj = list&&list[inquiryId];
+    const items = obj&&obj.data;
+    let arr = [];
+    for(let name in items){
+      arr.push(<div className={style['dis-item']}><p>{name}:</p>{this.getAssessContent(items[name],obj,name)}</div>)
+    }
+    return arr;
+  }
+  getAssessContent(data,obj,name){
+    if(data&&data.length>0){
+      return data.map((it,i)=>{
+        return this.handoutTypes(obj,it,i,name);
+      });
+    }else{
+      return data===null||(data&&data.length==0)?<p className={style['no-data']}>没有历史评估记录!</p>:'';
+    }
+  }
+  showScaleFn(item){
+    const { list,inquiryId } = this.props;
+    const obj = list&&list[inquiryId];
+    if(item&&item.id&&!(obj.scaleInfo&&obj.scaleInfo[item.id])){
+      Notify.info("未保存该量表数据");
+      return ;
+    }
+    if(item){
+      this.setState({
+        tableName:item.name,
+        tableId:item.id,
+        showScale:!this.state.showScale
+      });
+    }else{
+      this.setState({
+        showScale:!this.state.showScale
+      });
+    }
+
+  }
+  onPrint(){
+    let dom = $("#printcontent");
+    dom.jqprint({
+      debug: false,
+      importCSS: true,
+      printContainer: true,
+      operaSupport: false,
+    });
+  }
+  componentWillReceiveProps(next){
+    if(next.inquiryId!=this.props.inquiryId||!next.showHistoryCases){
+      this.setState({
+        showAssess:false
+      });
+    }
+  }
+  render() {
+    const { loading, list,inquiryId } = this.props;
+    const {tableName,tableId,showScale,showAssess} = this.state;
+    const obj = list&&list[inquiryId];
+    const scaleFooter = <div className={style['footer']}>
+      <span className={style['print']} onClick={this.onPrint}><img src={printIcon} alt=""/>打印</span>
+      <span className={style['okBtn']} onClick={()=>this.showScaleFn()}>关闭</span>
+    </div>;
+    return <div className={style['assess-cont']}>
+      <div className={style['assess-result']}>
+        <p className={style['enter']}>管理和评估结果:{showAssess?<a onClick={this.showAssessFn}>收起结果<img src={arrowDown} /></a>:<a onClick={this.showAssessFn}>查看结果<img src={arrow} /></a>}</p>
+      </div>
+      <div className={style['assess-box']} style={{display:showAssess?'block':'none'}}>
+        {loading?<p className={style['loading']}><img src={loadingIcon} alt='loading...'/></p>:''}
+        {/*以下必须做判断再执行getAssessContent,否则再次打开评估历史时图表显示有问题,因为提前渲染*/}
+        {showAssess?<div className='his-item'>{this.getMultAssess()}</div>:''}
+      </div>
+      {showScale?<ComplexModal onclose={this.showScaleFn} footer={scaleFooter}
+                                          title={tableName}
+                                          icon={tableIcon}
+                                          top={20}
+                                          bottom={20}
+                                          width={820}>
+        <ScaleTableHis title={tableName} tableId={tableId} result={obj.scaleResult&&obj.scaleResult[tableId]} data={obj.scaleInfo&&obj.scaleInfo[tableId]}></ScaleTableHis>
+      </ComplexModal>:''}
+    </div>;
+  }
+}
+
+export default AssessResultHis;

+ 76 - 0
src/components/AssessResult/AssessHis/index.less

@@ -0,0 +1,76 @@
+@import "~@less/variables.less";
+.assess-result{
+  border-top: 1px #e2e4e6 solid;
+  margin-top:50px;
+  .enter{
+    margin-top: 15px;
+  }
+  a{
+    color: @blue;
+    cursor: pointer;
+    img{
+      vertical-align: text-top;
+      width: 18px;
+    }
+  }
+}
+.assess-box{
+  margin: 20px 0 0 -15px;
+}
+.no-data{
+  text-align: center;
+  font-size: 20px;
+  color: @placeholder-color;
+  margin-top: 26px;
+  font-weight: bold;
+}
+.loading{
+  margin-top: 20px;
+  text-align: center;
+  img{
+    width: 30px;
+  }
+}
+.footer{
+  .print{
+    width: 111px;
+    height: 34px;
+    line-height: 34px;
+    outline: none;
+    border-radius: 4px;
+    /*color: #3B9ED0;*/
+    border: 0 none;
+    cursor: pointer;
+    background: #fff;
+    margin-right: 20px;
+    img{
+      width: 20px;
+      vertical-align: middle;
+      margin-right: 4px;
+    }
+  }
+  .okBtn{
+    width: 80px;
+    height: 34px;
+    line-height: 32px;
+    text-align: center;
+    outline: none;
+    border-radius: 4px;
+    cursor: pointer;
+    border: 1px solid #3B9ED0;
+    box-sizing: border-box;
+    margin-left: 20px;
+    background: #3B9ED0;
+    color: #fff;
+    float: right;
+    margin-right: 20px;
+  }
+}
+.dis-item{
+  p{
+    padding-left: 15px;
+    line-height: 30px;
+    background: #e4e4e4;
+    font-weight: bold;
+  }
+}

+ 273 - 0
src/components/AssessResult/ChartItem/index.jsx

@@ -0,0 +1,273 @@
+import React, { Component } from "react";
+import style from "../index.less";
+import { Radio} from '@commonComp';
+import echarts from 'echarts';
+import config from "@config";
+import 'zrender/lib/svg/svg';
+/**
+ * 来源于后台数据
+ * 图表类型
+ *
+ *
+ * **/
+class ChartItem extends Component {
+  constructor(props) {
+    super(props);
+    this.getContainers = this.getContainers.bind(this);
+    this.rangChange = this.rangChange.bind(this);
+    this.getXAxisArr = this.getXAxisArr.bind(this);
+  }
+  getXAxisArr(type){
+    const endDate = this.props.endDate;
+    let now = endDate?new Date(endDate).getTime():new Date().getTime();
+    let arr = [],temp=0;
+    //近一周
+    switch(type){
+      case 'week':
+        for(let i=0;i<7;i++){
+          temp=i*1000*60*60*24;
+          arr.unshift(...this.getDayHours(now-temp,true));
+        }
+        break;
+      case 'month':
+        for(let i=0;i<30;i++){
+          temp=i*1000*60*60*24;
+          arr.unshift(this.getDayHours(now-temp));
+        }
+        break;
+      case 'sixMonth':
+        for(let i=0;i<180;i++){
+          temp=i*1000*60*60*24;
+          arr.unshift(this.getDayHours(now-temp));
+        }
+        break;
+      case 'year':
+        for(let i=0;i<365;i++){
+          temp=i*1000*60*60*24;
+          arr.unshift(this.getDayHours(now-temp));
+        }
+        break;
+      default:
+    }
+
+    return arr;
+  }
+  getDayHours(time,isHour){
+    const year = new Date(time).getFullYear();
+    const month = new Date(time).getMonth()+1;
+    const date = new Date(time).getDate();
+    const hour = new Date(time).getHours();
+    let arr=[],temp='';
+    const str= year+'-'+(month<10?'0'+month:month)+'-'+(date<10?'0'+date:date);
+    if(isHour){
+      for(let i=0;i<24;i++){
+        temp = hour-i>-1?hour-i:hour-i+24;
+        arr.unshift(str+" "+(temp<10?'0'+temp:temp)+":00:00");
+      }
+      return arr;
+    }else{
+      return str;
+    }
+  }
+  rangChange(type,i){
+    const {initFn,handleChange,data,pindex} = this.props;
+    const times = this.getXAxisArr(type);
+    const startTime=times[0];
+    const endTime=times[times.length-1];
+    const range = [startTime,endTime];
+    const temp=this.props.timeTypes;
+    if(!data[startTime+endTime]){
+      initFn&&initFn({range,rangeType:type,index:i,pindex,getNew:false});
+    }
+    handleChange&&handleChange(Object.assign(temp,{[i]:type}));
+  }
+  getContainers(obj){
+    const timeTypes = this.props.timeTypes;
+    const {endDate} = this.props;
+    let len = 1,idx=0;    //单个图表第一条线的在所有线中的index,用于显示不同的形状,打印使用
+    let arr = [],keys = Object.keys(obj||{});
+    for(let i in obj){
+      idx = keys.findIndex((t)=>{return t==i});
+      len = idx==0?0:len+obj[keys[idx-1]].length;
+      arr.push(<Chart data={obj[i]} len={len} endDate={endDate} type={timeTypes&&timeTypes[i]} index={i} getXAxisArr={this.getXAxisArr} handleRangeChange={this.rangChange}/>)
+    }
+    return arr.length>0?arr:<p style={{color:'#acacac'}}>该模块暂无数据</p>;
+  }
+  getLegends(obj){
+    let arr = [],temp='',doms=[];
+    for(let i in obj){
+      arr = [...arr,...obj[i]];
+    }
+    arr.map((it,ix)=>{
+      doms.push(<div><img src={require('@common/images/'+(ix+1)+'.png')} /><span>{it}</span></div>);
+    });
+    return doms;
+  }
+  componentDidMount(){
+    const {initFn,pindex} = this.props;
+    const type = config.chartDismen;
+    const times = this.getXAxisArr(config.chartDismen);
+    const startTime=times[0];
+    const endTime=times[times.length-1];
+    const range = [startTime,endTime];
+    initFn&&initFn({range,rangeType:type,pindex,getNew:true});
+  }
+  render() {
+    const {title,data,names} = this.props;
+    const range = this.getXAxisArr(config.chartDismen);
+    const obj = data[range[0]+range[range.length-1]];
+    const nameObj = names&&names[range[0]+range[range.length-1]];
+    return <div className={style['assess-item']}>
+      <h2>{title}</h2>
+      <div className={style['legend']}>
+        {this.getLegends(nameObj)}
+      </div>
+      <div className={style['item-content']}>
+        {this.getContainers(obj)}
+      </div>
+    </div>;
+  }
+}
+
+class Chart extends Component{
+  constructor(props) {
+    super(props);
+    this.state={
+      chartObj:null,
+      //timeRange:'year',
+      week:props.getXAxisArr('week'),
+      month:props.getXAxisArr('month'),
+      sixMonth:props.getXAxisArr('sixMonth'),
+      year:props.getXAxisArr('year')
+    };
+    this.drawChart = this.drawChart.bind(this);
+    this.timeSwitch = this.timeSwitch.bind(this);
+  }
+  drawChart(){
+    const {index,data,getXAxisArr,type,endDate,len} = this.props;
+    const xAxis = getXAxisArr(type);
+    const id = endDate?'chart'+endDate+index:'chart'+index;
+    let series = [],names=[],inx=-1;
+    let myChart = echarts.init(document.getElementById(id) ,null, {renderer: 'svg'});
+    let xAxisArr = [...xAxis];
+    const interval = {
+      week:23,
+      month:4,
+      sixMonth:9,
+      year:60
+    };
+    data&&data.map((it,j)=>{
+      let values=new Array();
+      let name='';
+      it&&it.creatTime.map((x,i)=>{
+        inx=xAxis.findIndex((a)=>{
+          name=type=='week'?x.substr(0,13):x.substr(0,10);
+          return a.substr(0,13)==name;
+        });     //日期对应横坐标的位置
+        if(inx!=-1){
+          if(type=='week'){
+            xAxisArr[inx] = x;
+          }
+          values[inx] = it.indexValue[i];       //值对应横坐标的位置
+        }
+      });
+      names.push(it.itemName);
+      series.push({
+        name: it.itemName,
+        type: 'line',
+        data: values,
+        showAllSymbol:true,
+        symbol:'image://'+require('@common/images/'+((len+j)%8+1)+'.png'),//config.chartSymbols[(len+j)%8],
+        symbolSize:10,
+        itemStyle:{
+          color:config.chartColors[(len+j)%8]
+        }
+      });
+    });
+    // 指定图表的配置项和数据
+    var option = {
+      tooltip: {
+        trigger: 'axis',
+        textStyle:{
+          fontSize:12
+        }
+      },
+      legend: {
+        show:false
+        /*data:names,
+        padding:0,
+        itemHeight:16,*/
+      },
+      grid:{
+        top:40
+      },
+      xAxis: {
+        type: 'category',
+        boundaryGap: false,
+        data: xAxisArr,
+        splitLine:{
+          show:true
+        },
+        axisPointer:{
+          //show:false
+        },
+        axisTick:{
+          show:false,
+          interval:interval[type]
+        },
+        axisLabel:{
+          show:true,
+          showMaxLabel:true,
+          interval:interval[type],
+          rotate:65,
+          fontSize:10,
+          formatter: function(value,index){
+            return value.substr(0,10);
+          }
+        }
+      },
+      yAxis: {
+        type: 'value',
+        axisTick:{
+          show:false
+        },
+        axisLabel:{
+          show:true,
+          showMaxLabel:true
+        }
+      },
+      series: series
+    };
+
+    // 使用刚指定的配置项和数据显示图表。
+    myChart.setOption(option);
+  }
+  timeSwitch(type){
+    const {handleRangeChange,index} = this.props;
+
+    handleRangeChange&&handleRangeChange(type,index);
+
+    const that=this;
+    setTimeout(()=>{
+      that.drawChart();
+    },300);
+
+  }
+  componentDidMount(){
+    this.drawChart();
+  }
+  render(){
+    const {type,index,endDate} = this.props;
+    return <div className={style['cont']}>
+              <div className={style['time-range']}>
+                <span className={type=='year'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("year")}>近一年</span>
+                <span className={type=='sixMonth'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("sixMonth")}>近六个月</span>
+                <span className={type=='month'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("month")}>近一个月</span>
+                <span className={type=='week'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("week")}>近一周</span>
+              </div>
+              <div className={style["chart-box"]} id={endDate?'chart'+endDate+index:'chart'+index}></div>
+            </div>;
+  }
+}
+
+export default ChartItem;

+ 76 - 0
src/components/AssessResult/ChooseItem/index.jsx

@@ -0,0 +1,76 @@
+import React, { Component } from "react";
+import style from "../index.less";
+import { Radio,CheckBtn } from '@commonComp';
+/****
+ * 大数据推送出的类型
+ * 要素:名称、选项、推荐选择
+ *
+ * ****/
+class ChooseItem extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      saveData:null,
+    };
+  }
+
+  handleRadio(name,value){
+    const {handleChange,selecteds} = this.props;
+    handleChange&&handleChange(Object.assign({},selecteds,{[name]:value}));
+  }
+  handleCheckbox(name,value){
+    const {handleChange,selecteds} = this.props;
+    selecteds[name]?selecteds[name]:selecteds[name]=[];
+    const index = selecteds[name].findIndex((i)=>i==value);
+    if(index!=-1){
+      selecteds[name].splice(index,1);
+    }else{
+      selecteds[name].push(value);
+    }
+    handleChange&&handleChange(selecteds);
+  }
+  render() {
+    const {title,data,selecteds,disabled} = this.props;
+    return <div className={style['assess-item']}>
+        <h2>{title}</h2>
+        <div className={style['item-content']}>
+          <ul>
+            {data&&data.map((it)=>{
+              return <li>
+                <span>{it.name}:</span>
+                <div className={style['row']}>
+                  {it.details&&it.details.map((i)=> {
+                    if(it.controltype ==0){
+                      return <div className={style['choose-item']}>
+                                <Radio label={i.detailName}
+                                       value={i.detailName}
+                                       disabled={disabled}
+                                       isSelect={selecteds&&selecteds[it.name]==i.detailName}
+                                       handleClick={this.handleRadio.bind(this,it.name,i.detailName)}></Radio>
+                                {i.state?<i>(智能推荐)</i>:''}
+                              </div>;
+                    }else{
+                      return <div className={style['choose-item']}>
+                                <CheckBtn id={i.detailName}
+                                          value={i.detailName}
+                                          label={i.detailName}
+                                          disabled={disabled}
+                                          isSelect={selecteds&&selecteds[it.name]&&selecteds[it.name].includes(i.detailName)}
+                                          handleClick={this.handleCheckbox.bind(this,it.name,i.detailName)}/>
+                                {i.state?<i>(智能推荐)</i>:''}
+                              </div>;
+                    }
+                  })}
+                </div>
+                {/*<div className={style["recommend"]}>
+                  推荐选择:正常
+                </div>*/}
+              </li>
+            })}
+          </ul>
+        </div>
+      </div>;
+  }
+}
+
+export default ChooseItem;

+ 359 - 0
src/components/AssessResult/ScaleItem/index.jsx

@@ -0,0 +1,359 @@
+import React, { Component } from "react";
+import style from "../index.less";
+import deleteIcon from '@common/images/delete.png';
+import allTableIcon from '@common/images/all-table.png';
+import level1 from "@common/images/级别1.png";
+import checkIcon from '@common/images/check.png';
+import {ComplexModal,MiniToast,Radio} from '@commonComp';
+import Notify from '@commonComp/Notify';
+import {deepClone} from '@utils/tools';
+import { getFormulaResult } from '@store/async-actions/fetchModules'
+/**
+ * 来源于页面选择
+ *
+ * **/
+class ScaleItem extends Component {
+  constructor(props) {
+    super(props);
+    this.$area = React.createRef();
+    const {result}= props;
+    let radioVal = result&&result.radioVal;
+    this.state = {
+      scaleId:'',
+      scaleName:'',
+      parentId:'',
+      showScale:false,
+      optionId:'',
+      radioVal:Object.assign({},radioVal)||{},
+      formulaId:'',
+      text:props.text,
+      isCalculated:false,
+      calcuValues:deepClone(props.calcuValues),   //计算公式填的值
+    };
+    this.getItems = this.getItems.bind(this);
+    this.getDetailItems = this.getDetailItems.bind(this);
+    this.showOption = this.showOption.bind(this);
+    this.closeOption = this.closeOption.bind(this);
+    this.closeFormula = this.closeFormula.bind(this);
+    this.handleInputformula =this.handleInputformula.bind(this);
+  }
+  showOption(id){
+    this.setState({
+      optionId:id
+    })
+  }
+  closeOption(){
+    const {result} = this.props;
+    const possible=result&&result.possible;
+    let {radioVal} = this.state;
+    this.setState({
+      radioVal:Object.assign({},radioVal,possible),
+      optionId:null,
+    });
+  }
+  confirmOption(){
+    const {handleRes} = this.props;
+    const {radioVal} = this.state;
+    handleRes&&handleRes({
+      possible:Object.assign({},radioVal),
+      radioVal:Object.assign({},radioVal),//不设置radioVal只有最近一次选中的值
+    });
+    this.setState({
+      optionId:null,
+    });
+  }
+  handleShowScale(item){
+    const {showScaleFn,closeAssess} = this.props;
+    //closeAssess&&closeAssess();    //关闭评估弹窗
+    showScaleFn&&showScaleFn(item);
+  }
+  handleRadio(item,parent){
+    let {result} = this.props;
+    let radioVal = result&&result.radioVal;
+    this.setState({
+      radioVal:Object.assign({},radioVal,{[parent.id]:item.detailName})
+    })
+  }
+  handleInputformula(id,calcuContent,i,e) {
+    const {calcuValues} = this.state;
+    let obj = deepClone(calcuValues);
+    let values = (obj&&obj[id])||deepClone(calcuContent);
+    values[i].value = e.target.value;
+    obj[id] = values;
+    this.setState({
+      isCalculated:false,
+      calcuValues:obj
+    });
+  }
+  handleForRadio(id,calcuContent,i,fidx){//计算公式
+    const { calcuValues } = this.state;
+    let obj = deepClone(calcuValues);
+    let values = (obj&&obj[id])||deepClone(calcuContent);
+    let details = values[i].details;
+    for(let x=0;x<details.length;x++){
+      if(x!=fidx){
+        details[x].state=0;
+      }else{
+        details[x].state=1;
+      }
+    }
+    obj[id] = values;
+    this.setState({
+      isCalculated:false,
+      calcuValues:obj
+    });
+  }
+  showFormula(id){
+    this.setState({
+      formulaId:id
+    });
+  }
+  closeFormula(){
+    if(this.state.isCalculated){
+      this.setState({
+        formulaId:null,
+      });
+    }else{
+      this.setState({
+        formulaId:null,
+        calcuValues:deepClone(this.props.calcuValues)
+      });
+    }
+  }
+  calcuFormula(item) { //计算公式计算
+    const { calcuResult,handleCalcu } = this.props;
+    const {formulaId,calcuValues} = this.state;
+    let it=calcuValues&&calcuValues[formulaId];
+    let allHasInfo = true;
+    for (let i = 0; i < it.length; i++) {
+      if(it[i].controlType == 2) {  //输入框类型的有没有填值
+        if(!it[i].value) {
+          allHasInfo = false
+        }
+      } else if(it[i].controlType == 0) {
+        let hasSelect = false;
+        for( let z = 0; z <it[i].details.length; z++) {
+          if(it[i].details[z].state == 1) {
+            hasSelect= true
+          }
+        }
+        if(!hasSelect) {
+          allHasInfo = false
+        }
+      }
+    }
+    item.content.details = calcuValues[formulaId];
+    if(allHasInfo) { //所有都有值,则计算
+      let results = deepClone(calcuResult);
+      getFormulaResult({type:2,data:item}).then((res)=>{
+        if(+res.data.code==0){
+          const result = res.data.data.result;
+          results[formulaId] = result;
+          handleCalcu&&handleCalcu(calcuValues,results);
+          this.setState({
+            isCalculated:true
+          });
+        }else{
+          Notify.error(res.data.msg||'计算没有结果返回');
+        }
+      })
+    } else {  //不是所有值都填过了
+      Notify.info('请填写计算公式内容')
+    }
+  }
+  getDetailItems(item,i){
+    let arr = [],temp='';
+    const {indexs,result,formulaResult,disabled,calcuResult} = this.props;
+    const {optionId,formulaId,radioVal,calcuValues} = this.state;
+    const possible=result&&result.possible;
+
+    item.details.map((its,j)=>{
+      let it=its;
+      if(indexs[i]&&indexs[i].includes(j)){
+        if(its.type==1){     //量表
+          let scaleRes=formulaResult&&formulaResult[it.content.id]&&formulaResult[it.content.id].calcalculate;
+          temp =<span className={style['scale']}
+                      onClick={()=>this.handleShowScale(it.content)}>
+                        {scaleRes&&scaleRes.result?(' 【'+it.content.name+'】 结果:'+scaleRes.result.value+" "+(scaleRes.result.text||'')):'【'+it.content.name+'】'}
+                        </span>;
+        }else if(its.type==2){      //计算公式
+          const showRes = calcuResult&&calcuResult[item.id]||it.content.result;
+          const details = calcuValues&&calcuValues[item.id]||it.content.details;
+          const cresult = showRes&&showRes[1]&&showRes[1].text;
+                    temp = <div className={style['results']}>
+                    <span>计算公式结果:</span>
+                    <span className={style["blue"]} onClick={this.showFormula.bind(this,item.id,it)}>{cresult?cresult:'请选择'}</span>
+                    <img src={level1} />
+                    <MiniToast title={it.content.name}
+                               confirmText='关闭'
+                               icon={allTableIcon}
+                               show={formulaId&&formulaId==item.id?true:false}
+                               close={this.closeFormula}
+                               confirm={this.closeFormula}
+                               footer="true">
+                      <table>
+                        {details.map((item1,idd)=>{
+                          if(item1.controlType==0){//单选
+                            return <tr>
+                              <td>
+                                <span>{'请选择'+item1.name+':'}</span>
+                              </td>
+                              <td>
+                                {item1.details.map((ii,ind)=>{
+                                  return <div className={style["chooseItem"]}>
+                                    <Radio label={ii.detailName}
+                                           isSelect={ii.state == 1}
+                                           disabled={disabled}
+                                           handleClick={this.handleForRadio.bind(this,item.id,details,idd,ind)}>
+                                      >
+                                    </Radio>
+                                  </div>
+                                })}
+                              </td>
+                            </tr>
+                          }else if(item1.controlType==2){//输入框
+                            return <tr>
+                              <td>
+                                <span>{'请输入'+item1.name+':'}</span>
+                              </td>
+                              <td>
+                                {disabled?item1.value:<input type="text" placeholder="请输入"  value={item1.value} onInput={(e)=>this.handleInputformula(item.id,details,idd,e)}/>}
+                              </td>
+                              <td>
+                                <span>{item1.uint}</span>
+                              </td>
+
+                            </tr>
+                          }
+                        })}
+                      </table>
+                      {disabled?"":<div className={style["forMulBtn"]} onClick={this.calcuFormula.bind(this,its)}>计算</div>}
+                      <table>
+                        {showRes && Array.isArray(showRes) &&showRes.map((itemResult) => {
+                          return <tr>
+                            <td>
+                              <span>{itemResult.name+':'}</span>
+                            </td>
+                            <td>
+                              <span>{itemResult.text}</span>
+                            </td>
+                          </tr>
+                        })}
+                      </table>
+                    </MiniToast>
+                </div>
+        }else if(its.type==3){
+          temp = <div className={style['results']}>
+                    <span>可能结果:</span>
+                    <span onClick={this.showOption.bind(this,item.id)} className={style["blue"]}>{possible&&possible[item.id]?possible[item.id]:'请选择'}</span>
+                    <img src={level1} />
+                    <MiniToast title='结果选择'
+                         icon={checkIcon}
+                         show={optionId&&optionId==item.id?true:false}
+                         close={this.closeOption}
+                         confirm={this.confirmOption.bind(this,item.id)}
+                         footer="true">
+                        <div className={style["infoOption"]}>
+                          <span>{it.content.name?it.content.name+':':''}</span>
+                          {it.content.details&&it.content.details.map((lis,ind)=>{
+                            return <div className={style["chooseItem"]}>
+                              <Radio label={lis.detailName}
+                                     disabled={disabled}
+                                     isSelect={radioVal&&radioVal[item.id]==lis.detailName}
+                                     handleClick={this.handleRadio.bind(this,lis,item,i)}>
+                              </Radio>
+                              {lis.state==1?<span className={style['recomand']}>(智能推荐)</span>:''}
+                            </div>
+                          })}
+                        </div>
+                    </MiniToast>
+                  </div>;
+        }
+        const passId = item.details[j].type==1?item.details[j].content.id:undefined;
+        const li = disabled?<li>
+            <span>{item.name}:</span>
+            <div className={style['row']}>{temp}</div>
+          </li>:<li>
+          <span>{item.name}:</span>
+          <div className={style['row']}>{temp}</div>
+          <div className={style["recommend"]} onClick={()=>this.props.handleRemove(false,i,passId,j)}>
+            <img className={style["deleteIcon"]} src={deleteIcon} />
+          </div>
+        </li>;
+        arr.push(li);
+      }
+    });
+    return arr;
+  }
+  getItems(){
+    const { data } = this.props;
+    return data&&data.map((it,i)=>{
+      return this.getDetailItems(it,i);
+    });
+  }
+  getScales(){
+    const {scaleItems,disabled,formulaResult} = this.props;
+    let li='',temp='';
+    const arr = scaleItems&&scaleItems.map((it,i)=>{
+      if(!it) return '';
+      let scaleRes=formulaResult&&formulaResult[it.id]&&formulaResult[it.id].calcalculate;
+      temp =<span className={style['scale']} onClick={()=>this.handleShowScale(it)}>
+                        {scaleRes&&scaleRes.result?(' 【'+it.name+'】 结果:'+scaleRes.result.value+" "+(scaleRes.result.text||'')):'【'+it.name+'】'}
+                        </span>;
+      li = disabled?<li>
+        <span>相关量表:</span>
+        <div className={style['row']}>{temp}</div>
+      </li>:<li>
+        <span>相关量表:</span>
+        <div className={style['row']}>{temp}</div>
+        <div className={style["recommend"]} onClick={()=>this.props.handleRemove(true,i,it.id)}>
+          <img className={style["deleteIcon"]} src={deleteIcon} />
+        </div>
+      </li>;
+      return li;
+    });
+    return arr;
+  }
+  handleInput(e){
+    const text = e.target.value;
+    this.setState({
+      text
+    });
+  }
+  componentWillReceiveProps(next){        //修复bug1329,第二次保存值不显示
+    if(next.text!=this.state.text){
+      this.setState({
+        text:next.text
+      });
+    this.$area.current.value=next.text;
+    }
+  }
+  render() {
+    const {title,handleInp,disabled} = this.props;
+    return <div className={style['assess-item']}>
+      <h2>{title}</h2>
+      <div className={style['item-content']}>
+        <ul>
+          {
+            this.getItems()
+          }
+          {
+            this.getScales()
+          }
+          <li>
+            <textarea className={style['edit-row']}
+                      ref={this.$area}
+                      type="text"
+                      disabled={disabled}
+                      placeholder='评估描述'
+                      onBlur={()=>handleInp(this.state.text)}
+                      onInput={this.handleInput.bind(this)}>{this.state.text}</textarea>
+            <div className={style['textareaStatic']}>评估描述:{this.state.text}</div>
+          </li>
+        </ul>
+      </div>
+    </div>;
+  }
+}
+
+export default ScaleItem;

+ 182 - 0
src/components/AssessResult/index.jsx

@@ -0,0 +1,182 @@
+import React, { Component } from "react";
+import style from "./index.less";
+import { Radio } from '@commonComp';
+import ChooseItem from "./ChooseItem";
+import ScaleItem from "./ScaleItem";
+import Information from '../Information'
+import ChartItem from "./ChartItem";
+import Notify from '@commonComp/Notify';
+import {readyKeepHistory} from '@utils/tools';
+import loadingIcon from '@common/images/loading.gif';
+
+class AssessResult extends Component {
+  constructor(props) {
+    super(props);
+    const chooseSelecteds = JSON.parse(JSON.stringify(props.chooseSelecteds)||{});
+    const wholeIndexs = JSON.parse(JSON.stringify(props.wholeIndexs)||{});      //深度复制,Object.assgin为浅复制,下下级会同源
+    const wholeScale = JSON.parse(JSON.stringify(props.wholeScaleItems)||{});
+
+    this.state={
+      chooseSelecteds:chooseSelecteds,     //大数据选择模块
+      chartTimeTypes:{},      //图表模块
+      wholeAssessItems:wholeIndexs,     //整体评估模块
+      wholeScaleItems:wholeScale,
+      wholeAssessText:props.wholeAssessText||{},     //整体评估补充说明
+      wholeResults:{
+        possible:props.possible,
+        radioVal:props.radioVal
+      },
+      calcuResult:props.calcuResult,     //计算公式结果
+      calcuValues:props.calcuValues,    //计算公式填的值
+      addedScaleIds:props.addedScaleIds,    //已加入量表的id
+    };
+    this.handleChooseChange = this.handleChooseChange.bind(this);
+    this.handleScaleDel = this.handleScaleDel.bind(this);
+    this.handleScaleText = this.handleScaleText.bind(this);
+    this.handleResult = this.handleResult.bind(this);
+  }
+  componentWillMount(){
+    const {disId,disName,getAssess} = this.props;
+    //获取评估
+    getAssess&&getAssess(disId,disName);
+  }
+  handleScaleText(text){
+    const {disName} = this.props;
+    const obj = Object.assign({},this.state.wholeAssessText);
+    obj[disName] = text;
+      this.setState({
+        wholeAssessText:obj
+      })
+  }
+  handleScaleDel(isList,i,id,j){
+    let ids = [...this.state.addedScaleIds||[]],idIndex='';
+    if(id){
+      idIndex = ids.findIndex((ii)=>id==ii);
+      ids.splice(idIndex,1);
+    }
+    if(isList){         //删除全部量表中的项目
+      const items = [...this.state.wholeScaleItems];
+      items[i]=null;
+      this.setState({
+        wholeScaleItems: items,
+        addedScaleIds:ids
+      });
+    }else{
+      const items = Object.assign({},this.state.wholeAssessItems);
+      const inx = items[i].findIndex(x=>x==j);
+      items[i].splice(inx,1);
+      this.setState({
+        wholeAssessItems: items,
+        addedScaleIds:ids
+      });
+    }
+  }
+  handleResult(opt){
+    const {wholeResults} = this.state.wholeResults;
+    const res = Object.assign({},wholeResults,opt);
+    this.setState({
+      wholeResults:res
+    });
+  }
+  handleChooseChange(i,selects){
+    const {chooseSelecteds} = this.state;
+    this.setState({
+      chooseSelecteds: Object.assign(chooseSelecteds,{[i]:selects})
+    });
+  }
+  handleChartChange(i,selects){
+    const {chartTimeTypes} = this.state;
+    this.setState({
+      chartTimeTypes:Object.assign(chartTimeTypes,{[i]:selects})
+    });
+  }
+  handleCalcu(values,ret){
+    this.setState({
+      calcuResult:ret,
+      calcuValues:values
+    });
+  }
+  componentWillUnmount(){
+    //点确定关闭弹窗时把参数传到父组件去
+    const {saveAssessInfos,isAssessConfirm,clearChartData,handleSavePossible} = this.props;
+    clearChartData&&clearChartData();
+    if(isAssessConfirm && readyKeepHistory() == 1){
+      Notify.error("主诉不能为空");
+    }else if(isAssessConfirm && readyKeepHistory() == 2){
+      Notify.info('诊断不能为空');
+    }
+    handleSavePossible&&handleSavePossible(this.state.wholeResults);
+    if(isAssessConfirm){
+      saveAssessInfos(this.state,readyKeepHistory());
+    }
+  }
+  componentWillReceiveProps(next){
+    if(JSON.stringify(next.addedScaleIds)!=JSON.stringify(this.props.addedScaleIds)){
+      this.setState({
+        addedScaleIds:[...next.addedScaleIds||[]]
+      })
+    }
+  }
+  handoutTypes(item,i){
+    const {getIndexData,indexData,timeTypes,wholeIndexs,closeAssess,showScaleFn,chronicPushItems,
+      formulaResult,indexNames,disName} =this.props;
+    let obj = [];
+    Object.keys(wholeIndexs).map((i)=>{
+      obj[i]=chronicPushItems[i];
+    });
+    const {chooseSelecteds,wholeAssessItems,wholeScaleItems,wholeAssessText,chartTimeTypes,wholeResults,calcuResult,calcuValues} = this.state;
+    const chartData = indexData;
+    const name = item.regionName+":";
+    const list = item.data&&item.data.rows;
+    switch (+item.regionType){
+      case 0:     //数据来源与右侧手动添加
+        return <ScaleItem title={name}
+                          data={obj}
+                          handleRemove={this.handleScaleDel}
+                          handleInp={this.handleScaleText}
+                          handleRes={this.handleResult}
+                          handleCalcu={this.handleCalcu.bind(this)}
+                          text={wholeAssessText[disName]}
+                          indexs={wholeAssessItems}
+                          scaleItems ={wholeScaleItems}
+                          result={wholeResults}
+                          showScaleFn={showScaleFn}
+                          calcuResult={calcuResult}
+                          calcuValues={calcuValues}
+                          formulaResult={formulaResult}
+                          chronicPushItems={chronicPushItems}
+                          closeAssess={closeAssess}></ScaleItem>;
+      case 1:     //数据来源于大数据
+        return <ChooseItem title={name}
+                           data={list}
+                           handleChange={this.handleChooseChange.bind(this,i)}
+                           selecteds={chooseSelecteds[i]||{}} ></ChooseItem>;
+      case 10:   //数据来源于后台
+        return <ChartItem title={name}
+                          data={chartData||{}}
+                          names={indexNames||{}}
+                          timeTypes={JSON.stringify(chartTimeTypes)=='{}'?timeTypes&&timeTypes[i]:chartTimeTypes[i]}
+                          pindex={i}
+                          initFn={getIndexData}
+                          handleChange={this.handleChartChange.bind(this,i)}></ChartItem>;
+      default:
+        return '';
+    }
+  }
+  render() {
+    const {disName} =this.props;
+    const data = this.props.data&&this.props.data[disName];
+    return <div className={style['assess-cont']} id="AssistResult">
+      <div className={style['printShow']}>
+        <Information></Information>
+      </div>
+      {!data?<p className={style['loading']}><img src={loadingIcon} alt='loading...'/></p>:''}
+      {data&&data.length==0?<p className={style['no-data']}>暂无数据!</p>:''}
+      {data && data.map((it, i) => {
+        return this.handoutTypes(it, i);
+      })}
+    </div>;
+  }
+}
+
+export default AssessResult;

+ 213 - 0
src/components/AssessResult/index.less

@@ -0,0 +1,213 @@
+@import "~@less/variables.less";
+.assess-cont{
+  padding: 15px;
+}
+.assess-item{
+  h2{
+    line-height: 40px;
+    font-size: 16px;
+    /*background: #e5eefe;*/
+    padding: 0 15px;
+    font-weight: bold;
+  }
+  .item-content{
+    padding: 0 15px;
+    .choose-item{
+      margin-right: 12px;
+      display: inline-block;
+      i{
+        color: @blue;
+      }
+    }
+    input[type=checkbox]{
+      width: 14px;
+      height: 14px;
+      vertical-align: middle;
+      margin-right: 4px;
+      background-color: #fff;
+      -webkit-appearance: none;
+      border: 1px solid #c9c9c9;
+      border-radius: 4px;
+      outline: none;
+      cursor: pointer;
+    }
+  }
+  li {
+    line-height: 35px;
+    .row{
+      display: inline-block;
+    }
+    .results{
+      position: relative;
+    }
+    .chooseItem{
+      display: inline-block;
+      margin-right: 10px;
+      .recomand{
+        color: @blue;
+      }
+    }
+    .scale{
+      color: @blue;
+      cursor: pointer;
+    }
+    .blue{
+      color:#3B9ED0;
+      cursor: pointer;
+    }
+    .blue + img{
+      vertical-align: middle;
+    }
+    .recommend{
+      max-width: 200px;
+      float: right;
+      color: #929292;
+      cursor: pointer;
+    }
+  }
+  .edit-row{
+    width: 100%;
+    border:1px @placeholder-color solid;
+    border-radius: 4px;
+    padding: 5px;
+  }
+  .cont{
+    display: inline-block;
+    min-width: 302px;
+    width: 49%;
+    height: 250px;
+    margin: 15px 0 5px;
+    position: relative;
+    .chart-box{
+      width: 100%;
+      height: 100%;
+    }
+  }
+  .cont:nth-child(odd){
+    /*margin-right: 2%;*/
+  }
+  .time-range{
+    position: absolute;
+    bottom: 224px;
+    /*top: 26px;*/
+    z-index: 2;
+    width: 100%;
+    text-align: center;
+    /*margin-left: 18px;*/
+    .range{
+      display: inline-block;
+      border:1px #DFDFDF solid;
+      border-radius: 10px;
+      background: #fff;
+      padding: 5px 10px;
+      margin-right: 10px;
+      font-size: 12px;
+      cursor: pointer;
+      &.on{
+        background: @blue;
+        color: #fff;
+        border-color: @blue;
+      }
+    }
+  }
+}
+.printShow {
+  display: none;
+}
+.footer{
+  .print{
+    width: 111px;
+    height: 34px;
+    line-height: 34px;
+    outline: none;
+    border-radius: 4px;
+    /*color: #3B9ED0;*/
+    border: 0 none;
+    cursor: pointer;
+    background: #fff;
+    margin-right: 20px;
+    img{
+      width: 20px;
+      vertical-align: middle;
+      margin-right: 4px;
+    }
+  }
+  .okBtn{
+    width: 80px;
+    height: 34px;
+    line-height: 32px;
+    text-align: center;
+    outline: none;
+    border-radius: 4px;
+    cursor: pointer;
+    border: 1px solid #3B9ED0;
+    box-sizing: border-box;
+    margin-left: 20px;
+    background: #3B9ED0;
+    color: #fff;
+    float: right;
+    margin-right: 20px;
+  }
+}
+.forMulBtn{
+  height: 32px;
+  line-height: 32px;
+  text-align: center;
+  color: #fff;
+  // background: #DBDBDB;
+  background: #3B9ED0;
+  border-radius: 4px;
+  cursor: auto;
+  margin-top: 15px;
+  cursor: pointer;
+}
+.textareaStatic {
+  display: none;
+  line-height: 20px;
+  white-space: pre;
+  *white-space: pre;
+  *word-wrap: break-word;
+  border: 1px solid #bfbfbf;
+  border-radius: 4px;
+  padding: 5px;
+}
+.legend{
+  padding: 0 36px;
+  /*margin-bottom: 15px;*/
+  &>div{
+    display: inline-block;
+    margin-top: 10px;
+  }
+  span{
+    margin-right: 20px;
+  }
+  img{
+    vertical-align: middle;
+    width: 18px;
+    margin-right: 3px;
+  }
+}
+.loading{
+  text-align: center;
+  position: absolute;
+  top: 49%;
+  left: 49%;
+  img{
+    width: 40px;
+  }
+}
+.no-data{
+  color: #a5a3a3;
+  text-align: center;
+  margin-top: 40px;
+  font-size: 18px;
+  font-weight: bold;
+}
+@media print {
+  .printShow,.textareaStatic {
+    display: block;
+  }
+  .deleteIcon,.edit-row {
+    display: none;
+  }
+}

+ 5 - 2
src/components/AssistCheck/index.jsx

@@ -10,7 +10,7 @@ class AssistCheck extends React.Component {
     }
 
     render(){
-        const {list,assistLabel,handleChangeValue,handleSign,fetchPushInfos,handleDelAssist,handleChangeAssistValue,handleChangeDate,isRead,winWidth} = this.props;
+        const {list,getInfomation,windowHeight,assistLabel,assistVal,handleChangeValue,handleSign,fetchPushInfos,handleDelAssist,handleChangeAssistValue,handleChangeDate,isRead,winWidth,assistList} = this.props;
         return (
             <div className={styles.wrapper}>
                 <div className={styles.top}>
@@ -36,8 +36,11 @@ class AssistCheck extends React.Component {
                             handleChangeDate={handleChangeDate}
                             isRead={isRead}
                             winWidth={winWidth}
+                            getInfomation={getInfomation}
+                            assistList={assistList}
+                            assistVal={assistVal}
+                            windowHeight={windowHeight}
                         >
-
                         </AddAssistCheck>
                     </div>
                 </ItemBox>

+ 5 - 0
src/components/BodyContainer/index.less

@@ -1,3 +1,8 @@
+/*@media print{
+  .container{
+    display: none;
+  }
+}*/
 .container{
   padding: 50px 10px 0 10px;
   position: relative;

+ 11 - 18
src/components/CheckBody/index.jsx

@@ -30,13 +30,13 @@ class CheckBody extends Component{
     this.setState({boxLeft:nextProps.boxLeft})
   }
   getLabels(){
-    const {data,showArr,saveText,selecteds} = this.props;
-    let arr = [],list=[];//console.log(data,saveText)
+    const {data,showArr,saveText,selecteds,importLabel} = this.props;
+    let arr = [],list=[];
     const {boxMark,showAll} = this.state;
     const moreNum =data.length-[...data].reverse().findIndex((it)=>it.showInCheck)-1;//被隐藏的位置
-    const moreText = filterDataArr([...saveText].splice(moreNum+1));      //被收起的标签中是否有有值得,有则不能再收起showMoreBtn?more:''
+    const moreText = filterDataArr([...saveText].splice(moreNum+1));     //被收起的标签中是否有有值得,有则不能再收起showMoreBtn?more:''
     const more = showAll?<span className={style['more']} onClick={this.showHide}>收起<img src={hideImg} /></span>:<span className={style['more']} onClick={this.showHide}>展开<img src={showImg} /></span>;
-    const showMoreBtn = data.length>moreNum&&!moreText;
+    const showMoreBtn = data.length>config.showCheckNum&&(data.length-1>moreNum&&!data[0].full)&&!moreText;
     let showArray = data.filter((it)=>{
       if(it.showInCheck)
         return it;
@@ -45,7 +45,7 @@ class CheckBody extends Component{
     if(showData){
       list = showData;
       arr = list.map((it,i)=>{
-        return chooseType({item:it,boxMark,i,showArr,saveText,selecteds});
+        return chooseType({item:it,boxMark,i,showArr,saveText,selecteds,importLabel});
       });
     }
     showMoreBtn&&arr.push(more);      //是否显示收起展开按钮
@@ -71,17 +71,14 @@ class CheckBody extends Component{
       }
       leftL = ele.offsetLeft+90
     }
-    getSearchLocation(getPageCoordinate(e).boxTop,leftL)
+    getSearchLocation(getPageCoordinate(e).boxTop,leftL);
     this.setState({
-      // boxLeft:getPageCoordinate(e).boxLeft,
-      // boxLeft:leftL,
-      // boxTop:getPageCoordinate(e).boxTop,
       tmpScroll: $("#addScrollEvent")[0].scrollTop,
       tmpTop:getPageCoordinate(e).boxTop
     });
     windowEventHandler('scroll',()=>{      //弹窗跟随滚动条滚动或者关闭弹窗
       let scrollYs = $("#addScrollEvent")[0].scrollTop;
-      let boxTop = this.state.tmpTop - scrollYs + this.state.tmpScroll
+      let boxTop = this.state.tmpTop - scrollYs + this.state.tmpScroll;
       getSearchLocation(boxTop,this.state.boxLeft)
     },$("#addScrollEvent")[0])
   }
@@ -93,18 +90,14 @@ class CheckBody extends Component{
   getData(){
     //第一次聚焦查体时,主诉有数据则调接口,主诉无数据则显示提示;其他时间查体模板数据不调接口
     const {hasMain,isEmpty} = this.props;
-
+    if(!hasMain&&isEmpty){
+      Notify.error("无法操作,请先输入主诉");
+      return;
+    }
     //无主诉提示在EditableSpan里
     //有主诉时且本身无数据,第一次点击获取数据,(不论获取成功与否)再点击不获取(直到刷新成空白页或清空)
     if(hasMain&&isEmpty!=false){
       this.props.getInit();
-      //隐藏区域有默认选中项,默认全部展开-有延迟,弃用
-      /*const that = this;
-      setTimeout(function(){
-        that.props.showAll&&that.setState({
-          showAll:true
-        });
-      },900)*/
 
     }
   }

+ 1 - 0
src/components/CheckBody/index.less

@@ -7,6 +7,7 @@
   /*float: right;*/
   position: absolute;
   right: 0;
+  background: #fff;
   img{
     vertical-align: text-top;
     width: 15px;

+ 528 - 0
src/components/ChronicInfo/index.jsx

@@ -0,0 +1,528 @@
+import React from 'react';
+import style from './index.less';
+import infoPic from "../../common/images/info-pic.png";
+import chronicPic from "../../common/images/chronic.png";
+import level1 from "../../common/images/级别1.png";
+import printIcon from '@common/images/team.png';
+import tableIcon from '@common/images/table.png';
+import allTableIcon from '@common/images/all-table.png';
+import add from '@common/images/add-result.png';
+import added from '@common/images/first.png';
+import checkIcon from '@common/images/check.png';
+import infoShow from '@common/images/info-show.png';
+import infoMove from '@common/images/info-move.png';
+import {ComplexModal,ConfirmModal,MiniToast, Radio,CheckBtn} from '@commonComp';
+import ScaleTable from '@containers/ScaleTable';
+import Notify from '@commonComp/Notify';
+import {deepClone} from '@utils/tools';
+import $ from 'jquery';
+
+/***
+慢病右侧推送模块规则:
+慢病--显示慢病名称以及管理和评估
+普通病--不显示管理和评估和量表按钮
+明细--量表-计算公式-核心指标
+controlType:0-radio  1-checkbox  2-text  3-dropdownlist
+**/
+
+class ChronicInfo extends React.Component{
+  constructor(props){
+    super(props);
+    this.state = {
+      show:true,
+      showInfo:false,
+      showOption:false,
+      showAssess:false,      //评估弹窗
+      infoId:null,  //静态知识
+      formulaId:null, //计算公式
+      optionId:null,  //可能结果,
+      isAssessConfirm:false,    //是否点击评估弹窗确定按钮
+      radioVal:{},  //可能结果选择内容
+      possible:{},  //可能结果
+      formulaParam: {}, //量表计算公式计算入参
+      isCalculated:false,     //是否刚计算过,关闭时值与结果对应
+      calcuValues:deepClone(props.calcuValues),       //计算公式填的值
+      hasEnterImg: false, //是否移入info
+      currentIndex: -1 //当前index
+    };
+
+    this.showInfo = this.showInfo.bind(this);
+    this.closeInfo = this.closeInfo.bind(this);
+    this.showOption = this.showOption.bind(this);
+    this.closeOption = this.closeOption.bind(this);
+    this.showTable = this.showTable.bind(this);//显示量表弹窗
+    this.closeTable = this.closeTable.bind(this);//关闭量表弹窗
+    this.close = this.close.bind(this); //关闭量表列表
+    this.showFormula = this.showFormula.bind(this); //打开计算公式
+    //this.closeFormula = this.closeFormula.bind(this); //关闭计算公式
+    this.handleAddAssessItem = this.handleAddAssessItem.bind(this);   //加入病例记录
+    this.onPrint = this.onPrint.bind(this);
+    this.handleForRadio = this.handleForRadio.bind(this);
+    this.handleSaveCalcu = this.handleSaveCalcu.bind(this);     //保存评估修改的计算和可能结果
+    this.getAddBtnState = this.getAddBtnState.bind(this);
+  }
+
+  onPrint() {
+    const {showHide} = this.props;
+    let dom = showHide&&showHide.showTable?$("#printcontent"):$("#AssistResult");
+    dom.jqprint({
+      debug: false,
+      importCSS: true,
+      printContainer: true,
+      operaSupport: false,
+    });
+  }
+  
+  showTableList(id){//量表按钮
+    const {getTableList} = this.props;
+    if(id){
+      getTableList(id);
+    }
+  }
+  close(){//关闭量表列表
+    const {hideList} = this.props;
+    hideList&&hideList({name:'showList',value:false});
+  }
+  handleListClick(item){//量表列表单项点击
+    this.showTable(item,null);
+    //this.close()
+  }
+
+  showInfo(id){
+    // 静态知识显示在提示信息里(4-18)
+    const {getInfomation} = this.props;
+    const param = {
+      id:id,
+      // id:40738, //目前只有“肾功能不全”有数据
+      type:22,
+    }
+    getInfomation&&getInfomation(param);
+  }
+  closeInfo(){//关闭静态知识
+    this.setState({
+      infoId:null
+    })
+  }
+  showOption(id){
+    this.setState({
+      optionId:id,
+      formulaId:null //关闭计算公式
+    })
+  }
+  closeOption(){
+    // 关闭-有可能结果则保持与结果一致,没有就保持最新选择的内容
+    let {possible,radioVal} = this.state;
+    if(JSON.stringify(possible)=='{}'){
+      this.setState({
+        optionId:null
+      })
+    }else{
+      this.setState({
+        radioVal:Object.assign({},radioVal,possible),
+        optionId:null,
+      });
+    } 
+  }
+  showTable(it){
+    const {scaleInfo} = this.props;
+    // 密西根糖尿病周围神经病评分(MDNS), id:40744
+    const item = {
+      id:it.id,
+      name:it.name
+    };
+    // 判断:store里已经有该量表就无需重新调接口
+    if(scaleInfo&&scaleInfo[it.id]){
+      this.props.hideList({name:'showTable',value:true},it);
+    }else{
+      this.props.getScaleInfo(item);
+    }
+
+    this.setState({
+      formulaId:null, //关闭计算公式和可能结果弹窗
+      optionId:null
+    })
+  }
+  closeTable(){
+    this.props.hideList({name:'showTable',value:false});
+  }
+  showFormula(id){//计算公式
+    this.setState({
+      formulaId:id,
+      optionId:null  //关闭可能结果
+    })
+  }
+  closeFormula(it){
+    const {formulaId,isCalculated} =this.state;
+    if(!isCalculated){
+      //没有计算结果时,保存输入的值
+      const {calcuResult,calcuValues} = this.props;
+      const cres = calcuResult&&calcuResult[formulaId]||it.content.result;
+      const result = cres&&cres[1]&&cres[1].text;
+      if(result){
+        this.setState({
+          calcuValues:deepClone(calcuValues)
+        });
+      }
+    }
+    this.setState({
+      formulaId:null,
+    });
+  }
+  handleAddAssessItem(v,pIndex,i){
+    const {addAssessItem} = this.props;
+    addAssessItem(v,pIndex,i);
+  }
+  handleReg(e){   //只能输入数字
+    const hasDot = e.target.value.indexOf('.')!=-1;
+    const key = e.key;
+    if(key!='Backspace'&&((/[^\d]/.test(key)&&key!='.')||(key=='.'&&(hasDot||!e.target.value)))){
+      e.preventDefault();
+    }
+  }
+  handleInputformula(id,calcuContent,i,e) {
+    const {calcuValues} = this.state;
+    let obj = deepClone(calcuValues);
+    let values = (obj&&obj[id])||deepClone(calcuContent);
+    const txt = e.target.value;
+    values[i].value = txt.replace(/[\u4e00-\u9fa5]|[^\d|.]/g,'');       //处理中文输入法的情况
+    obj[id] = values;
+    if(/[\u4e00-\u9fa5]|[^\d|.]/g.test(txt)){
+      e.target.value = txt.replace(/[\u4e00-\u9fa5]|[^\d|.]/g,'');
+    }
+    this.setState({
+      isCalculated:false,
+      calcuValues:obj
+    });
+  }
+  handleForRadio(id,calcuContent,i,fidx){//计算公式
+    const { calcuValues } = this.state;
+    let obj = deepClone(calcuValues);
+    let values = (obj&&obj[id])||deepClone(calcuContent);
+    let details = values[i].details;
+    for(let x=0;x<details.length;x++){
+      if(x!=fidx){
+        details[x].state=0;
+      }else{
+        details[x].state=1;
+      }
+    }
+    obj[id] = values;
+    this.setState({
+      isCalculated:false,
+      calcuValues:obj
+    });
+  }
+  handleRadio(item,parent){//可能结果
+    let {radioVal} = this.props;
+    this.setState({
+      radioVal:Object.assign({},radioVal,{[parent.id]:item.detailName})
+    })
+  }
+  confirmOption(parent,pIndex){//可能结果确定
+    const {radioVal,possible} = this.state;
+    const {savePossibleResult} = this.props;
+    this.setState({
+      possible:Object.assign({},possible,radioVal),
+      radioVal:Object.assign({},possible,radioVal),//不设置radioVal只有最近一次选中的值
+      optionId:null,
+    });
+    savePossibleResult&&savePossibleResult({possible:Object.assign({},possible,radioVal),radioVal:Object.assign({},possible,radioVal)})
+  }
+  handleSaveCalcu(obj){
+    this.setState({
+      possible:Object.assign({},obj.possible),
+      radioVal:Object.assign({},obj.radioVal),//不设置radioVal只有最近一次选中的值
+    })
+  }
+  calcuFormula(id,it) { //计算公式计算
+    const { calcuFormula } = this.props;
+    let item = deepClone(it);
+    const values = this.state.calcuValues;
+    const calcuValues = Object.keys(values).length&&values[id]?values[id]:item.content.details;
+    let allHasInfo = true;
+    for (let i = 0; i < calcuValues.length; i++) {
+      if(calcuValues[i].controlType == 2) {  //输入框类型的有没有填值
+        if(!calcuValues[i].value) {
+          allHasInfo = false;
+        }
+      } else if(calcuValues[i].controlType == 1) {
+        let hasSelect = false;
+        for( let z = 0; z <calcuValues[i].details.length; z++) {
+          if(calcuValues[i].details[z].state == 1) {
+            hasSelect= true;
+          }
+        }
+        if(!hasSelect) {
+          allHasInfo = false;
+        }
+      }
+    }
+    item.content.details = calcuValues;
+    if(allHasInfo) { //所有都有值,则计算
+      let param = {
+        type: 2,
+        data: item,
+        disId: id
+      };
+      calcuFormula(param);
+      this.setState({
+        isCalculated:true
+      });
+    } else {  //不是所有值都填过了
+      Notify.info('请填写计算公式内容')
+    }
+  }
+  getAddBtnState(flag,v,i,j){
+    const {indexs,wholeScaleItems,addScaleItems,chronicMagItem,chronicDesease,addedScaleIds} = this.props;
+    let btn = '',reCheck=false;
+    let show = chronicMagItem&&chronicMagItem.name||chronicDesease&&chronicDesease.name;
+    if(!show){
+      return '';
+    }
+    if(flag){     //有结果
+      if(j!==undefined){
+        reCheck = addedScaleIds.includes(v.details[j].content.id);      //列表中是否加入同一量表
+        btn = (indexs[i]&&indexs[i].includes(j))||reCheck?<span className={style["add-record"]}>
+                   <img src={added} />
+                   已加入
+                 </span>:<span className={style["listResult"]} onClick={()=>this.handleAddAssessItem(v,i,j)}>
+                   <img src={add} />
+                   加入病历记录
+                 </span>;
+      }else{
+        reCheck = addedScaleIds.includes(v.id);         //推送中是否加入同一量表
+        btn = (wholeScaleItems&&wholeScaleItems[i])||reCheck?<span className={style["add-record"]}>
+                   <img src={added} />
+                   已加入
+                 </span>:<span className={style["listResult"]} onClick={()=>addScaleItems(v,i)}>
+                   <img src={add} />
+                   加入病历记录
+                 </span>;
+      }
+
+    }else{
+      btn = <span className={style["disable-add"]}>
+                   <img src={add} />
+                   加入病历记录
+                 </span>;
+    }
+
+    return btn;
+  }
+  handleMouseEnterDrug(index) {
+    this.setState({
+        currentIndex: index,
+    })
+  }
+  handleMouseLeaveDrug() {
+    this.setState({
+        currentIndex: -1, 
+    })
+  }
+  handleMouseEnterImg() {
+    this.setState({
+      hasEnterImg: true
+    })
+  }
+  handleMouseLeaveImg() {
+    this.setState({
+      hasEnterImg: false
+    })
+  }
+  getDetail(){
+    const {data,formulaResult,calcuResult} = this.props;
+    const {formulaId,optionId,possible,radioVal,calcuValues,currentIndex,hasEnterImg} = this.state;
+    let list = data&&data.map((v,i)=>{
+                    return <div className={style["list"]}>
+                      {v.name?<p>
+                                <span>患者可能有</span>
+                                <span
+                                  className={style['dis-name']}
+                                  onMouseEnter={this.handleMouseEnterDrug.bind(this, i)}
+                                  onMouseLeave = {this.handleMouseLeaveDrug.bind(this)}
+                                >
+                                  {v.name}
+                                  {<img className={style['info-img']}  
+                                    style ={currentIndex === i  ? {display: "inline-block"} : {display: "none"}}
+                                    src={currentIndex === i ?(hasEnterImg ? infoMove : infoShow ): infoShow} 
+                                    onMouseEnter={this.handleMouseEnterImg.bind(this)}
+                                    onMouseLeave = {this.handleMouseLeaveImg.bind(this)}
+                                    onClick={this.showInfo.bind(this,v.id)}/>}
+                                
+                                </span>
+                                {/* <img src={infoShow} className={style["infoPic"]} onClick={this.showInfo.bind(this,v.id)}/> */}
+                                
+                                :
+                              </p>:''}
+                      {v.details&&v.details.map((it,j)=>{
+                        if(it.type==1){
+                          return <p>
+                                <span className={style["listName"]}>
+                                  <i onClick={this.showTable.bind(this,it.content,v.id,i)}>{'【'+it.content.name+'】'}</i>
+                                  {formulaResult&&formulaResult[it.content.id]?<i>{'结果:'}{formulaResult[it.content.id].calcalculate&&formulaResult[it.content.id].calcalculate.result.value +' '+ formulaResult[it.content.id].calcalculate.result.text}</i>:''}
+                                </span>
+                                {
+                                  this.getAddBtnState(formulaResult&&formulaResult[it.content.id],v,i,j)
+                                }
+                              </p>
+                        }else if(it.type==2){
+                          const cres = calcuResult&&calcuResult[v.id]||it.content.result;
+                          const result = cres&&cres[1]&&cres[1].text;
+                          const details = calcuValues&&calcuValues[v.id]||it.content.details;
+                          return <div className={style["marTop"]}>
+                            <span className={style["limit"]}>
+                              计算公式结果:
+                              <i className={style["blue"]} onClick={this.showFormula.bind(this,v.id)}>{result?result:'请选择'}</i>
+                              <img src={level1} />
+                            </span>
+                            {
+                              this.getAddBtnState(result,v,i,j)
+                            }
+                            {formulaId&&formulaId==v.id&&<MiniToast title={it.content.name}
+                                icon={allTableIcon}
+                                confirmText='关闭'
+                                show={formulaId&&formulaId==v.id?true:false}
+                                close={this.closeFormula.bind(this,it)}
+                                confirm={this.closeFormula.bind(this,it)}
+                                footer="true">
+                                <table>
+                                {details.map((item,idd)=>{
+                                    if(item.controlType==0){//单选
+                                      return <tr>
+                                        <td>
+                                          <span>{'请选择'+item.name+':'}</span>
+                                        </td>
+                                        <td>
+                                          {Array.isArray(item.details)&&item.details.map((ii,ind)=>{
+                                            return <div className={style["chooseItem"]}>
+                                                    <Radio label={ii.detailName}
+                                                             isSelect={ii.state == 1}
+                                                             handleClick={this.handleForRadio.bind(this,v.id,details,idd,ind)}>
+                                                      </Radio>
+                                                  </div>
+                                          })}
+                                        </td>  
+                                      </tr>
+                                    }else if(item.controlType==2){//输入框
+                                      return <tr>
+                                        <td>
+                                          <span>{'请输入'+item.name+':'}</span>
+                                        </td>
+                                        <td>
+                                          <input type="text" placeholder="请输入"  value={item.value} onKeyDown={this.handleReg.bind(this)} onInput={this.handleInputformula.bind(this,v.id,details,idd)}/>
+                                        </td>
+                                        <td>
+                                          <span>{item.uint}</span>
+                                        </td>
+                                        
+                                      </tr>
+                                    }
+                                })}
+                                </table>
+                                <div className={style["forMulBtn"]} onClick={this.calcuFormula.bind(this,v.id,it)}>计算</div>
+                                <table>
+                                  {cres && Array.isArray(cres) &&cres.map((itemResult, resultIndex) => {
+                                    return <tr>
+                                        <td>
+                                            <span>{itemResult.name+':'}</span>
+                                        </td>
+                                        <td>
+                                            <span>{itemResult.text}</span>
+                                        </td>
+                                    </tr>
+                                  })}
+                                </table>
+                                
+                            </MiniToast>}
+                          </div>
+                        }else if(it.type==3){
+                          return <div className={style["marTop"]}>
+                            <span className={style["limit"]}>
+                              可能结果:
+                              <i onClick={this.showOption.bind(this,v.id)} className={style["blue"]}>{possible[v.id]?possible[v.id]:'请选择'}</i>
+                              <img src={level1} />
+                            </span>
+                            {
+                              this.getAddBtnState(possible[v.id],v,i,j)
+                            }
+                            <MiniToast title='结果选择'
+                                icon={checkIcon}
+                                show={optionId&&optionId==v.id?true:false}
+                                close={this.closeOption}
+                                confirm={this.confirmOption.bind(this,v,i)}
+                                footer="true">
+                                <div className={style["infoOption"]}>
+                                  <span>{it.content.name?it.content.name+':':''}</span>
+                                  {it.content.details&&it.content.details.map((lis,ind)=>{
+                                    return <div className={style["chooseItem"]}>
+                                      <Radio label={lis.detailName}
+                                               isSelect={radioVal[v.id]==lis.detailName}
+                                               handleClick={this.handleRadio.bind(this,lis,v)}>
+                                        </Radio>
+                                        {lis.state==1?<span className={style['recomand']}>(智能推荐)</span>:''}
+                                    </div>
+                                  })}
+                                </div>
+                            </MiniToast>
+                          </div>
+                        }
+                      })}
+                    </div>
+                  })
+    return list;
+  }
+  componentWillReceiveProps(next){
+    if(JSON.stringify(next.calcuValues)!=JSON.stringify(this.props.calcuValues)){
+      this.setState({
+        calcuValues:next.calcuValues
+      })
+    }
+  }
+  render(){
+    const scaleFooter = <div className={style['footer']}>
+      <span className={style['print']} onClick={this.onPrint}><img src={printIcon} alt=""/>打印</span>
+      <span className={style['okBtn']} onClick={()=>this.closeTable()}>确定</span>
+    </div>;
+    const {chronicMagItem,tableList,chronicDesease,formulaResult,showHide} = this.props;
+    return <div className={style["tips"]} style={{marginBottom:'15px'}}>
+              <div className={`${style["tips-title"]} ${style["chronic"]}`}>
+                <div className={style["tips-name"]}>
+                  <img src={chronicPic} />
+                  <h2>{chronicMagItem&&chronicMagItem.name||chronicDesease&&chronicDesease.name||'病情提示'}</h2>
+                  <span className={style["redTips"]}>(页面信息有更新可能影响评估结果)</span>
+                </div>
+                <div className={style["tips-btn"]} style={{display:chronicMagItem&&chronicMagItem.name||chronicDesease&&chronicDesease.name?'block':'none'}}>
+                  <span className={style["tipsDetails"]} onClick={() => this.showTableList(chronicDesease&&chronicDesease.id||chronicMagItem&&chronicMagItem.id)}>量表
+                  </span>
+                </div>
+              </div>
+              <div className={style["content"]}> 
+                  {this.getDetail()}
+              </div>
+              <ConfirmModal visible={showHide&&showHide.showList} noFooter='true' title='全部量表' close={this.close} titleBg="#DFEAFE" icon={allTableIcon} height={450} width={450}>
+                      <ul className={style['toast-cont']}>
+                        {tableList&&tableList.map((v,i)=>{
+                          return <li>
+                            <span className={style["scaleName"]}>
+                              <i onClick={this.handleListClick.bind(this,v)}>{'【'+v.name+'】'}</i>
+                              {formulaResult&&formulaResult[v.id]?<i className={style['res']}>{'结果:'}{formulaResult[v.id].calcalculate&&formulaResult[v.id].calcalculate.result.value+' '+ (formulaResult[v.id].calcalculate.result.text?formulaResult[v.id].calcalculate.result.text:'')}</i>:''}
+                            </span>
+                            {
+                              this.getAddBtnState(formulaResult&&formulaResult[v.id],v,i)
+                            }
+                          </li>
+                        })}
+                      </ul>
+              </ConfirmModal>
+              {showHide&&showHide.showTable?<ComplexModal onclose={this.closeTable} footer={scaleFooter}
+                      title={showHide.name}
+                      icon={tableIcon}
+                      top={20}
+                      bottom={20}
+                      width={820}>
+                <ScaleTable title={showHide.name} tableId={showHide.id}></ScaleTable>
+              </ComplexModal>:''}
+      </div>
+  }
+}
+export default ChronicInfo;

+ 278 - 0
src/components/ChronicInfo/index.less

@@ -0,0 +1,278 @@
+@import "~@less/variables.less";
+.tips{
+  border:1px solid #EAEDF1;
+  .tips-title,h1{
+    font-size: 14px;
+    color: #000;
+    padding: 8px 15px;
+    background: #EAF7FA;
+    font-weight: bold;
+    img {
+      float:left;
+      margin-top: 0px;
+      margin-right: 5px;
+    }
+  }
+  .tips-title{
+    .tips-name{
+      width: 238px;
+      display: inline-block;
+    }
+    h2{
+      display: inline-block;
+    }
+    .tips-btn{
+      display: inline-block;
+      float: right;
+    }
+    .redTips{
+      display: inline-block;
+      font-size: 12px;
+      -webkit-transform:scale(0.9);
+      color: red;
+      font-weight: normal;
+      white-space: nowrap;
+    }
+    .tipsDetails {
+      display: inline-block;
+      font-weight: normal;
+      width: 42px;
+      height: 20px;
+      border: 1px solid #262626;
+      border-radius: 4px;
+      text-align: center;
+      font-size: 12px;
+      // color: #3B9ED0;
+      color: #262626;
+      line-height: 18px;
+      margin: 0 0 -2px 10px;
+      cursor: pointer;
+      }
+    }
+    .chronic{
+      background: rgba(242,150,91,0.1);
+    }
+    .content{
+      font-size: 14px;
+      padding:6px 15px;
+      .list{
+        border-bottom: 1px solid #EAEDF1;
+        padding-bottom: 10px;
+        position: relative;
+        .infoPic{
+          vertical-align: middle;
+          margin: 0 5px;
+          cursor: pointer;
+        }
+        >p{
+          margin-top: 10px;
+        }
+        .listName{
+          color:#3B9ED0;
+          cursor: pointer;
+          display: inline-block;
+          width: 73%;
+        }
+         .listResult{
+          .add-record;
+        }
+        .infoBox{
+          position: absolute;
+          top:27px;
+          width: 388px;
+          background: #fff;
+          z-index: 66;
+          border: 1px solid #EAEDF1;
+          box-shadow: 0 5px 10px 0 rgba(0,0,0,0.10);
+          .infoTitle{
+            height: 40px;
+            line-height: 40px;
+            padding-left: 18px;
+            // border-bottom: 1px solid #EAEDF1;
+            background: #DFEAFE;
+            img{
+              vertical-align: text-top;
+            }
+            .closeIcon{
+              // vertical-align: middle;
+              float: right;
+            }
+          }
+          .infoCon{
+            padding: 15px 26px 25px;
+          }
+        }
+      }
+      .marTop{
+        margin-top: 10px;
+        position: relative;
+        .limit{
+          display: inline-block;
+          width: 72%;
+        }
+        img{
+          vertical-align: middle;
+        }
+      }
+      .blue{
+        color:#3B9ED0;
+        cursor: pointer;
+      }
+      /* .mainList{
+        .listBtn{
+          display: inline-block;
+          width: 96px;
+          height: 26px;
+          line-height: 26px;
+          text-align: center;
+          border: 1px solid #EAEDF1;
+          border-radius: 4px;
+        }
+        .listResult{
+          line-height: 26px;
+          i{
+            cursor: pointer;
+          }
+        }
+        .mainBox{
+          top: 65px;
+          .infoOption{
+            padding: 20px 0;
+          }
+          .infoConBtn{
+            text-align: right;
+            border-top: 1px solid #EAEDF1;
+            padding-top: 10px;
+            span{
+              color:#3B9ED0;
+              display: inline-block;
+              width: 66px;
+              height: 32px;
+              line-height: 32px;
+              text-align: center;
+              border: 1px solid #3B9ED0;
+              border-radius: 4px;
+            }
+          }
+        }
+      } */
+      .infoOption{
+        padding: 20px 0;
+      }
+      .infoConBtn{
+        text-align: right;
+        border-top: 1px solid #EAEDF1;
+        padding-top: 10px;
+        span{
+          color:#3B9ED0;
+          display: inline-block;
+          width: 66px;
+          height: 32px;
+          line-height: 32px;
+          text-align: center;
+          border: 1px solid #3B9ED0;
+          border-radius: 4px;
+        }
+      }
+      .list:last-child{
+        border-bottom:none;
+      }
+    }
+  }
+  .toast-title{
+    position: absolute;
+    top: 17px;
+    font-size: 16px;
+      // border-bottom: 1px solid #666;
+      width: 87%;
+      height: 25px;
+    }
+    .toast-cont{
+      line-height: 24px;
+      font-size: 14px;
+      height: 370px;
+      overflow-y: auto;
+      padding: 10px;
+      li{
+        margin-top: 10px;
+        cursor: pointer;
+      }
+      .res{
+        color:#3B9ED0;
+        margin-left: 10px;
+      }
+      .scaleName{
+        display: inline-block;
+        max-width: 290px;
+      }
+      .listResult{
+        .add-record;
+        cursor: pointer;
+      }
+    }
+    .footer{
+      .print{
+        width: 111px;
+        height: 34px;
+        line-height: 34px;
+        outline: none;
+        border-radius: 4px;
+        /*color: #3B9ED0;*/
+        border: 0 none;
+        cursor: pointer;
+        background: #fff;
+        margin-right: 20px;
+        img{
+          width: 20px;
+          vertical-align: middle;
+          margin-right: 4px;
+        }
+      }
+      .okBtn{
+        width: 80px;
+        height: 34px;
+        line-height: 32px;
+        text-align: center;
+        outline: none;
+        border-radius: 4px;
+        cursor: pointer;
+        border: 1px solid #3B9ED0;
+        box-sizing: border-box;
+        margin-left: 20px;
+        background: #3B9ED0;
+        color: #fff;
+        float: right;
+        margin-right: 20px;
+      }
+    }
+  .chooseItem{
+    display: inline-block;
+    margin-right: 10px;
+  }
+  .forMulBtn{
+    height: 32px;
+    line-height: 32px;
+    text-align: center;
+    color: #fff;
+    // background: #DBDBDB;
+    background: #3B9ED0;
+    border-radius: 4px;
+    cursor: auto;
+    margin-top: 15px;
+    cursor: pointer;
+  }
+  .recomand{
+    color:#3B9ED0;
+  }
+  .dis-name {
+    position: relative;
+    cursor: pointer;
+  }
+  .info-img {
+    position: absolute;
+    width: 15px;
+    top: -14px;
+    left: 50%;
+    margin-left: -7px;
+    cursor: pointer;
+}

+ 34 - 0
src/components/CopyRight/CopyModalSon/index.jsx

@@ -0,0 +1,34 @@
+import React, { Component } from "react";
+import style from "../index.less";
+import close from '../../../common/images/icon_close.png'
+import { dragBox } from '@utils/tools';
+
+class DiscontentSon extends Component {
+  constructor(props) {
+    super(props);
+  }
+  componentDidMount(){
+    dragBox('CopyModalWrap','CopyModalTitle')
+  }
+
+  render() {
+    const { closeCopyModal,copyVisible,date,copyContent,number } = this.props;
+
+    return <div
+        className={style["copyModal"]}
+        style={copyVisible ? { display: "block" } : { display: "none" }}
+      >
+        <div className={style["shade"]} onClick={closeCopyModal}/>
+        <div className={style["copyContent"]} id="CopyModalWrap">
+          <div className={`${style["header"]} drag-title`} id="CopyModalTitle">版本信息<img src={close} onClick={closeCopyModal} /></div>
+          <div className={style["now"]}>
+            当前版本:{number}
+            <span>{date && date.substring(0, 10)}</span>
+          </div>
+          <div className={style["content"]}>{copyContent}</div>
+        </div>
+      </div>
+  }
+}
+
+export default DiscontentSon;

+ 31 - 0
src/components/CopyRight/DiscontentSon/index.jsx

@@ -0,0 +1,31 @@
+import React, { Component } from "react";
+import style from "../index.less";
+import close from '../../../common/images/icon_close.png'
+import { dragBox } from '@utils/tools';
+
+class DiscontentSon extends Component {
+  constructor(props) {
+    super(props);
+  }
+  componentDidMount(){
+    dragBox('disContentWrap','DisclatmerTitle')
+  }
+
+  render() {
+    const { closeDisclatmerModal,disVisible,disclatmerContent } = this.props;
+
+    return <div
+          className={style["disModal"]}
+          style={disVisible ? { display: "block" } : { display: "none" }}
+        >
+          <div className={style["shade"]} onClick={closeDisclatmerModal}/>
+          <div className={style["disContent"]} id="disContentWrap">
+            <div className={`${style["header"]} drag-title`} id="DisclatmerTitle">免责声明<img src={close} onClick={closeDisclatmerModal} /></div>
+            <div className={style["content"]}>{disclatmerContent}</div>
+            <div className={style["btnBox"]}><span  className={style["btn"]} onClick={closeDisclatmerModal}>确定</span></div>
+          </div>
+      </div>
+  }
+}
+
+export default DiscontentSon;

+ 7 - 24
src/components/CopyRight/index.jsx

@@ -2,6 +2,8 @@ import React, { Component } from "react";
 import style from "./index.less";
 import close from '../../common/images/icon_close.png'
 import { storageLocal } from "../../utils/tools"
+import DiscontentSon from "./DiscontentSon"
+import CopyModalSon from "./CopyModalSon"
 
 class CopyRight extends Component {
   constructor(props) {
@@ -16,7 +18,6 @@ class CopyRight extends Component {
   }
   componentWillMount() {
     this.props.getDisMessage()
-
   }
   componentDidMount() {
     this.props.getMessage()
@@ -68,15 +69,6 @@ class CopyRight extends Component {
       );
     });
 
-    // const disclatmerContent = disContent.map(item => {
-    //   return (
-    //     <div className={style['message']}>
-    //       {item.title}
-    //       <div dangerouslySetInnerHTML={{__html: item.description}}></div>
-    //     </div>
-    //   );
-    // })
-
     return (
       <div className={style["container"]}>
         <div className={style["copy"]}>
@@ -87,11 +79,11 @@ class CopyRight extends Component {
           {hasNewVersion && <span>new</span>} &copy;<b>朗通医疗</b>
           <div className={style['disclaimer']} onClick={showDisclatmerModal}>免责声明</div>
         </div>
-        {copyVisible && <div
+        {/* {copyVisible && <div
           className={style["copyModal"]}
           style={copyVisible ? { display: "block" } : { display: "none" }}
         >
-          <div className={style["shade"]}  onClick={closeCopyModal}/>
+          <div className={style["shade"]} onClick={closeCopyModal}/>
           <div className={style["copyContent"]}>
             <div className={style["header"]}>版本信息<img src={close} onClick={closeCopyModal} /></div>
             <div className={style["now"]}>
@@ -100,18 +92,9 @@ class CopyRight extends Component {
             </div>
             <div className={style["content"]}>{copyContent}</div>
           </div>
-        </div>}
-       {disVisible && <div
-          className={style["disModal"]}
-          style={disVisible ? { display: "block" } : { display: "none" }}
-        >
-          <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>
-            <div className={style["btnBox"]}><span  className={style["btn"]} onClick={closeDisclatmerModal}>确定</span></div>
-          </div>
-        </div>}
+        </div>} */}
+        {copyVisible && <CopyModalSon copyVisible={copyVisible} date={date} closeCopyModal={closeCopyModal} copyContent={copyContent} number={number}></CopyModalSon>}
+        {disVisible && <DiscontentSon closeDisclatmerModal={closeDisclatmerModal} disVisible={disVisible} disclatmerContent={this.disclatmerContent()}></DiscontentSon>}
       </div>
     );
   }

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

@@ -2,7 +2,7 @@
   position: absolute;
   bottom: 0px;      //页面布局
   z-index: 40;
-  width: 418px;
+  width: 450px;
   .disTips{
     padding: 10px 20px 0px 20px;
     font-size: 10px;
@@ -95,9 +95,10 @@
         position: fixed;  
         width: 50%;
         height: 60%;
-        left: 20%;
+        left: 25%;
         background: #fff;
         top: 20%;
+        padding: 40px 0 60px 0;
         img{
           float: right;
           margin: -5px 5px 0px 0px;
@@ -105,7 +106,8 @@
         }
         .header {
           position: absolute;
-          top: -40px;
+          top: 0px;
+          width: 100%;
           height: 40px;
           font-size: 14px;
           padding: 10px 0px 10px 20px;
@@ -129,8 +131,8 @@
           overflow: auto;
         }
         .btnBox {
-          position: absolute;
-          bottom: -60px;
+          position: relative;
+          // bottom: -60px;
           width: 100%;
           height: 60px;
           background: #fff;

+ 31 - 20
src/components/CurrentIll/index.jsx

@@ -29,6 +29,7 @@ class CurrentIll extends Component{
     this.onchange = this.onchange.bind(this);
     this.handleSearchSelect = this.handleSearchSelect.bind(this);
     this.handleClick = this.handleClick.bind(this);
+    this.handleBlur = this.handleBlur.bind(this);
   }
   
   componentWillReceiveProps(nextProps){
@@ -43,25 +44,24 @@ class CurrentIll extends Component{
 
   handleFocus(e){
     // 判断主诉是否为空
-    const {mainData,mainText,setData,moduleNum,mainIds,data,changeEditIll,editClear,symptomFeature} = this.props;
+    const {mainData,mainText,setData,moduleNum,mainIds,data,changeEditIll,editClear,symptomFeature,isChronic} = this.props;
     const that = this;
+    const ev = e || window.event;
+    const text = ev.target.innerText||ev.target.innerHTML;
     let {setDataTimer} = this.state; 
     let mainFinallyText = filterDataArr(mainText);
-    // if(mainData.length == 0 && !mainText[0]){
     if(!mainFinallyText){
       //弹窗提醒
       Notify.error("无法操作,请先输入主诉");
       this.setState({
         forbidInput:true
       })
-    }else {
+    }else if(!text) {//现病史框里没有内容时才设置模板
       let num = moduleNum.num;//主诉使用了几个模板
-      // if(editClear && data.length==0){//第一次聚焦去设置现病史的data
-      if(data.length==0){
-        // setData && setData({useEmpty,num,mainData,mainIds});
+      if(data.length==0 && !isChronic || !isChronic.name ){
         clearTimeout(setDataTimer);
         setDataTimer = setTimeout(function(){//延时,等待主诉失焦数据返回
-          setData && setData({num,mainData,mainIds,symptomFeature:symptomFeature.featureData});
+            setData && setData({num,mainData,mainIds,symptomFeature:symptomFeature.featureData,isChronic});   
         },200)  
         this.setState({
           setDataTimer
@@ -71,17 +71,9 @@ class CurrentIll extends Component{
           showMoudle:true,
           forbidInput:false,
           boxEditable:false,
+          setDataTimer
       })
       changeEditIll(false)
-      /*const showTimer = setTimeout(function(){
-        that.setState({
-          showMoudle:true,
-          forbidInput:false,
-          boxEditable:false,
-        })
-        changeEditIll(false)
-      },150)
-      clearTimeout(showTimer);*/
     }
 
   }
@@ -128,7 +120,7 @@ class CurrentIll extends Component{
   }
 
   getInlineTag(){  
-    const {data,showArr,selecteds,processModuleName,saveText,insertProcess,symptomIds,allModules} = this.props;
+    const {data,showArr,selecteds,saveText,insertProcess,symptomIds,allModules} = this.props;
     const boxMark = '2';
 
     let list = data&&data.map((item,i)=>{
@@ -140,9 +132,22 @@ class CurrentIll extends Component{
     })
     return list;
   }
+  handleBlur(e){
+    const {freeText,data} = this.props;
+    if(data&&data.length==0){//无模板纯手动输入时存值
+      const ev = e || window.event;
+      const innerData = ev.target.innerText || e.target.innerHTML;
+      if(!isIE()){
+        e.target.innerText?(e.target.innerText=""):(e.target.innerHTML="")
+        freeText && freeText(innerData.trim());
+      }else{
+          freeText && freeText(innerData);
+      }
+    }
+  }
 
   render(){
-    const {fuzhen,type,fetchPushInfos,handleInput,isRead,saveText,searchData,totalHide,showArr,focusIndex,editClear,data,boxLeft,boxTop} = this.props;
+    const {fuzhen,isChronic,type,fetchPushInfos,handleInput,isRead,saveText,searchData,totalHide,showArr,focusIndex,editClear,data,boxLeft,boxTop} = this.props;
     const {showMoudle,forbidInput,boxMark,show} = this.state;
     const searchFlag = searchData.length > 0 ? true : false;
 
@@ -151,12 +156,18 @@ class CurrentIll extends Component{
                         isRead={isRead}
                         value={saveText[0]}
                         fuzhen={fuzhen}
+                        isChronic={isChronic}
                         handlePush={fetchPushInfos}
                         handleInput={handleInput}/>;
     }
     return  <div className={style['current-ill']}>
-      <ItemBox title='现病史' editable={editClear||data.length==0?true:false} handleFocus={this.handleFocus} onchange={forbidInput?(e)=>{this.onchange(e)}:''} handleClick={this.handleClick}>
-        {data.length>0?this.getInlineTag():''}
+      <ItemBox title='现病史' 
+      editable={editClear||data.length==0?true:false} 
+      handleFocus={this.handleFocus} 
+      onchange={forbidInput?(e)=>{this.onchange(e)}:''} 
+      handleClick={this.handleClick}
+      handleBlur={this.handleBlur}>
+        {data.length>0?this.getInlineTag():(saveText[0]?saveText[0]:'')}
       </ItemBox>
       {searchFlag ? <SearchDrop data={searchData} show={!totalHide} onSelect={this.handleSearchSelect} left={boxLeft} top={boxTop} />:""}
     </div>

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

@@ -3,67 +3,67 @@ import style from './index.less';
 import close from './img/close.png'
 import search from './img/search.png'
 import DiagnosticItem from '@containers/DiagnosticItem'
-import { SearchOption} from '@commonComp';
+import { SearchOption } from '@commonComp';
 import config from '@config/index';
 import $ from 'jquery';
 class DiagResultSearch extends Component {
-    constructor(props) {
-        super(props);
-        this.state = {
-           
-        };
-      
-        this.getSearchList =  this.getSearchList.bind(this)
+  constructor(props) {
+    super(props);
+    this.state = {
 
-    }
-    componentWillReceiveProps(nextProps){
-    }
-    componentDidMount () {
-        const that = this
-        $(document).click(function (e) {
-            var diagSearch=$('#diagSearch')[0];
-            var addDiag = $('#addDiag')[0];
-            var confirm = $('#confirm')[0];
-            if(diagSearch) {
-                if(confirm) {
-                    
-                } else {
-                    if (e.target!= diagSearch && e.target!= addDiag && e.target.parentNode!= addDiag && !$.contains(diagSearch, e.target) ) {
-                        that.props.hideSearch();
-                    }
+    };
 
+    this.getSearchList = this.getSearchList.bind(this)
+
+  }
+  componentWillReceiveProps(nextProps) {
+  }
+  componentDidMount() {
+    const that = this
+    $(document).click(function (e) {
+      var diagSearch = $('#diagSearch')[0];
+      var addDiag = $('#addDiag')[0];
+      var confirm = $('#confirm')[0];
+      if (diagSearch) {
+        if (confirm) {
+
+        } else {
+          if (e.target != diagSearch && e.target != addDiag && e.target.parentNode != addDiag && !$.contains(diagSearch, e.target)) {
+            that.props.hideSearch();
+          }
 
-                }
-                
-            }
-            
-        })
-    }
 
-    getSearchList(searchResult) {
-        return <div className={style['search-result']}>
-                    
-        {
-            searchResult && searchResult.map((item) => {
-                return(<div  key={item.id} className={style['search-result-item']}><DiagnosticItem title={true} item={item} clearInput={this.clearInput}/></div>)
-            })
         }
+
+      }
+
+    })
+  }
+
+  getSearchList(searchResult) {
+    return <div className={style['search-result']}>
+
+      {
+        searchResult && searchResult.map((item) => {
+          return (<div key={item.id} className={style['search-result-item']}><DiagnosticItem title={true} item={item} clearInput={this.clearInput} type='search'/></div>)
+        })
+      }
     </div>
-    }
-   
-    render(){
-        const  { show, searchResult, getSearchResult, handleChangeValue } = this.props
-       
-        return(
-            show&&<div id='diagSearch' className={style['search-box']}>
-                <SearchOption handleChangeValue={handleChangeValue} visible={true}>
-                    {this.getSearchList(searchResult)}
-                </SearchOption>
-            </div>
-        )
-       
-       
-    }
+  }
+
+  render() {
+    const { show, searchResult, getSearchResult, handleChangeValue,pageTop,windowHeight } = this.props
+
+    return (
+      show && <div id='diagSearch' className={style['search-box']}>
+        <SearchOption handleChangeValue={handleChangeValue} pageTop={pageTop} windowHeight={windowHeight} height={180} visible={true}>
+          {this.getSearchList(searchResult)}
+        </SearchOption>
+      </div>
+    )
+
+
+  }
 }
 
 export default DiagResultSearch;

+ 5 - 3
src/components/DiagResultSearch/index.less

@@ -41,13 +41,15 @@
 // }
 
 .search-result {
-    max-height: 266px;
+    overflow-y: auto;
+    max-height: 225px;
+    min-height: 80px;
 }
 
 .search-result-item {
     padding: 0 30px;
-    height: 44px;
-    line-height: 44px;
+    height: 36px;
+    line-height: 36px;
     cursor: pointer;
 }
 

+ 48 - 45
src/components/Diagnosis/index.jsx

@@ -1,60 +1,63 @@
 import React, { Component } from 'react';
 import style from './index.less';
-import {Button, ItemBox, ConfirmModal, Loading, Message,Add} from '@commonComp';
+import { Button, ItemBox, ConfirmModal, Loading, Message, Add } from '@commonComp';
 import DiagnosticList from '@containers/DiagnosticList.js';
 // import TreatDrug from '@containers/TreatDrug.js'
+import { getPageCoordinate } from '@utils/tools';
 import DiagResultSearch from '@containers/DiagResultSearch'
 import $ from 'jquery';
 
 class Diagnosis extends Component {
-    constructor(props) {
-        super(props);
-
-        this.state = {
-            diagType: 0,
-            showSearch: props.show,
-        }
-        this.showSearch = this.showSearch.bind(this);
-        this.hideSearch = this.hideSearch.bind(this);
-        this.handleshowSearch = this.handleshowSearch.bind(this);
-        
-    }
-    componentWillReceiveProps() {
-        this.setState({
-            showSearch: this.props.show
-        })
+  constructor(props) {
+    super(props);
+
+    this.state = {
+      diagType: 0,
+      showSearch: props.show,
+      pageTop: ''
     }
+    this.showSearch = this.showSearch.bind(this);
+    this.hideSearch = this.hideSearch.bind(this);
+    this.handleshowSearch = this.handleshowSearch.bind(this);
 
+  }
+  componentWillReceiveProps() {
+    this.setState({
+      showSearch: this.props.show
+    })
+  }
 
-    showSearch() {
-        const { showSearch } = this.props
-        showSearch && showSearch()
-    }
-    hideSearch() {
-        const { hideSearch } = this.props
-        hideSearch && hideSearch()
-    }
-    handleshowSearch() {
-        this.props.show ? this.hideSearch() : this.showSearch()
-    }
 
-    render() {
-        
-        
-        return (<div id="diagnosisResult">
-            <ItemBox  id="diagnosis" title='诊断'  boxHeight='auto' titleTop='22px' marginTop='9px' backgroundColor='#EAF7FD'>
-                <DiagnosticList></DiagnosticList>
-                <div style={{marginLeft:'10px', position:'relative'}}>
-                    <Add showText="添加诊断结果" handleClick={this.handleshowSearch} id="addDiag" height="50px"/>
-                    <DiagResultSearch></DiagResultSearch>
-                </div>
-               
-                
-            </ItemBox>
-            {/* <TreatDrug></TreatDrug> */}
-            <Message></Message>
-        </div>)
-    }
+  showSearch() {
+    const { showSearch } = this.props
+    showSearch && showSearch()
+  }
+  hideSearch() {
+    const { hideSearch } = this.props
+    hideSearch && hideSearch()
+  }
+  handleshowSearch(e) {
+    this.props.show ? this.hideSearch() : this.showSearch()
+    this.setState({ pageTop:getPageCoordinate(e).boxTop })
+  }
+
+  render() {
+
+
+    return (<div id="diagnosisResult">
+      <ItemBox id="diagnosis" title='诊断' boxHeight='auto' titleTop='22px' marginTop='9px' backgroundColor='#EAF7FD'>
+        <DiagnosticList></DiagnosticList>
+        <div style={{ marginLeft: '10px', position: 'relative' }}>
+          <Add showText="添加诊断结果" handleClick={this.handleshowSearch} id="addDiag" height="50px" />
+          <DiagResultSearch windowHeight={this.props.windowHeight} pageTop={this.state.pageTop} height={150}></DiagResultSearch>
+        </div>
+
+
+      </ItemBox>
+      {/* <TreatDrug></TreatDrug> */}
+      <Message></Message>
+    </div>)
+  }
 }
 
 export default Diagnosis;

+ 75 - 12
src/components/DiagnosticItem/index.jsx

@@ -2,13 +2,19 @@ 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';
 
 class DiagnosticItem extends Component{
     constructor(props){
         super(props);
 
         this.state = {
-            visible: false
+            visible: false,
+            hasEnterItem: false,
+            hasEnterImg: false
         }
 
         this.addDiagodal = this.addDiagodal.bind(this);
@@ -16,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();
@@ -28,13 +35,16 @@ class DiagnosticItem extends Component{
         this.addDiagodal(diagType)
     }
     close(){
-            this.setState({
-                visible: false
-            })
-        }
+        this.setState({
+            visible: false
+        })
+    }
     chooseDiagodal(item) {
-        const { diagnosticList,getTips } = this.props;
-        getTips && getTips(item);
+        const { diagnosticList,getTips, type } = this.props;
+        // getTips && getTips(item);
+        // 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('该诊断已存在');
@@ -46,8 +56,13 @@ class DiagnosticItem extends Component{
         })
        
     }
+    getTips(item, e) {
+        e.stopPropagation();
+        const {getTips } = this.props;
+        getTips && getTips({id:item.id,type:7});
+    }
     addDiagodal(diagType){
-        const {item} = this.props;
+        const {item, isChronicMag,mode} = this.props;
         item.type = diagType;
         // setTimeout(()=>{
         //     this.setState({
@@ -60,6 +75,23 @@ class DiagnosticItem extends Component{
                 //         return
                 //     }
                 // }
+                if(item.type == 2&&mode==0) {
+                    isChronicMag(item);
+                }
+                // 从缓存取慢病列表
+                // let chronicList = JSON.parse(storageLocal.get('chronic'));
+                // if(!chronicList){
+                //     getChronic();
+                //     chronicList = JSON.parse(storageLocal.get('chronic'));
+                // }
+                // console.log(999,chronicList)
+                // for(let i=0; i<chronicList.length; i++){
+                //     if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
+                //         //弹窗提示 “是否引用往期病例”?--往期病例接口、弹窗、引用
+                //         // 是--引用   否--走慢病流程
+                //         console.log("是慢病!")
+                //     }
+                // }
                 addDiagnostic&&addDiagnostic(item);
                 clearInput&&clearInput();
                 hideSearch&&hideSearch()
@@ -67,19 +99,50 @@ 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']} 
+                    <span className={`${style['diag-name']} ${type == 'search' ? style['diag-name-search'] : ''}`} 
                           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> 
                     </ConfirmModal>
+                   
                 </span>)
     }
 }

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

@@ -9,11 +9,26 @@
     display: inline-block;
     width: 100%;
 }
+.diag-name-search {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+}
 .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;
 }

+ 0 - 0
src/components/DiagnosticList/img/delete-on.png


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor