فهرست منبع

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

# Conflicts:
#	src/common/components/EditableSpan/index.jsx
#	src/common/components/InlineTag/index.jsx
#	src/components/AddAssistCheck/Textarea/index.jsx
#	src/components/CheckBody/index.jsx
#	src/components/CurrentIll/index.jsx
#	src/components/Operation/index.jsx
#	src/components/PreviewBody/index.jsx
#	src/containers/CurrentIll.js
#	src/containers/MainSuit.js
#	src/store/actions/homePage.js
#	src/store/async-actions/diagnosticSearch.js
#	src/store/async-actions/homePage.js
#	src/store/reducers/homePage.js
#	src/store/types/homePage.js
#	src/utils/tools.js
zhouna 6 سال پیش
والد
کامیت
a3f7cb94bc
100فایلهای تغییر یافته به همراه2641 افزوده شده و 694 حذف شده
  1. 1 1
      src/common/components/ConfirmModal/index.jsx
  2. 2 2
      src/common/components/DropList/index.jsx
  3. 73 61
      src/common/components/EditableSpan/index.jsx
  4. 29 5
      src/common/components/InlineTag/index.jsx
  5. 2 0
      src/common/components/InlineTag/index.less
  6. 1 1
      src/common/components/InspectCommon/index.jsx
  7. 3 1
      src/common/components/InspectCommon/index.less
  8. 5 3
      src/common/components/ItemBox/index.jsx
  9. 2 1
      src/common/components/ItemBox/index.less
  10. 1 1
      src/common/components/Notify/index.less
  11. 6 5
      src/common/components/NumberPan/index.jsx
  12. 20 0
      src/common/components/NumberPan/index.less
  13. 18 17
      src/common/components/NumberUnitPan/index.jsx
  14. 24 0
      src/common/components/NumberUnitPan/index.less
  15. 21 15
      src/common/components/SearchOption/index.jsx
  16. 2 2
      src/common/components/TailInlineTag/index.jsx
  17. 19 9
      src/common/components/Textarea/index.jsx
  18. BIN
      src/common/images/backspace.png
  19. BIN
      src/common/images/slide-down.png
  20. BIN
      src/common/images/slide-up.png
  21. 20 14
      src/common/js/func.js
  22. 8 2
      src/common/less/variables.less
  23. 16 12
      src/components/AddAssistCheck/Textarea/index.jsx
  24. 4 4
      src/components/AddAssistCheck/index.jsx
  25. 78 0
      src/components/AddInspect/SlideExcel/index.jsx
  26. 145 0
      src/components/AddInspect/SlideExcel/index.less
  27. 144 0
      src/components/AddInspect/SlideSelect/index.jsx
  28. 154 0
      src/components/AddInspect/SlideSelect/index.less
  29. 44 111
      src/components/AddInspect/index.jsx
  30. 17 2
      src/components/AddInspect/index.less
  31. 67 0
      src/components/Advice/Textarea/index.jsx
  32. 0 0
      src/components/Advice/Textarea/index.less
  33. 46 22
      src/components/Advice/index.jsx
  34. 3 3
      src/components/Advice/index.less
  35. 1 1
      src/components/AssistCheck/index.jsx
  36. 1 1
      src/components/Banner/index.jsx
  37. 43 6
      src/components/CheckBody/index.jsx
  38. 14 0
      src/components/CheckBody/index.less
  39. 79 9
      src/components/CommonSymptom/index.jsx
  40. 40 8
      src/components/CommonSymptom/index.less
  41. 3 3
      src/components/CopyRight/index.jsx
  42. 17 10
      src/components/CurrentIll/index.jsx
  43. 1 1
      src/components/Diagnosis/index.jsx
  44. 16 8
      src/components/DiagnosticItem/index.jsx
  45. 6 4
      src/components/DiagnosticList/index.jsx
  46. 1 0
      src/components/DiagnosticList/index.less
  47. 1 1
      src/components/HistoryCaseContainer/index.jsx
  48. 14 8
      src/components/Inspect/index.jsx
  49. 1 0
      src/components/Inspect/index.less
  50. 41 34
      src/components/MainSuit/index.jsx
  51. 44 10
      src/components/MultSpread/index.jsx
  52. 10 9
      src/components/Multiple/index.jsx
  53. 5 0
      src/components/Multiple/index.less
  54. 136 24
      src/components/NumberDrop/index.jsx
  55. 41 24
      src/components/NumberUnitDrop/index.jsx
  56. 1 1
      src/components/NumberUnitDrop/index.less
  57. 45 26
      src/components/Operation/index.jsx
  58. 0 2
      src/components/OtherHistory/index.jsx
  59. 1 1
      src/components/Preview/index.jsx
  60. 52 22
      src/components/PreviewBody/index.jsx
  61. 1 1
      src/components/PrintPreview/index.jsx
  62. 16 13
      src/components/PushItems/DetailsModal/index.jsx
  63. 7 2
      src/components/PushItems/DetailsModal/index.less
  64. 2 2
      src/components/PushItems/PushDiag/index.jsx
  65. 117 22
      src/components/PushItems/index.jsx
  66. 17 12
      src/components/PushItems/index.less
  67. 9 9
      src/components/RadioDrop/index.jsx
  68. 223 0
      src/components/RadioInpDrop/index.jsx
  69. 29 0
      src/components/RadioInpDrop/index.less
  70. 28 11
      src/components/SearchDrop/index.jsx
  71. 16 9
      src/components/SpreadDrop/index.jsx
  72. 42 14
      src/components/Treat/DrugTreat/index.jsx
  73. 9 1
      src/components/Treat/DrugTreat/index.less
  74. 2 2
      src/components/Treat/GeneralTreat/index.jsx
  75. BIN
      src/components/Treat/img/info2.png
  76. BIN
      src/components/Treat/img/info3.png
  77. 24 16
      src/components/Treat/index.jsx
  78. 17 2
      src/components/Treat/index.less
  79. 70 8
      src/components/TreatDesc/DrugInfo/index.jsx
  80. 64 9
      src/components/TreatDesc/DrugInfo/index.less
  81. BIN
      src/components/TreatDesc/img/info2.png
  82. BIN
      src/components/TreatDesc/img/info3.png
  83. 44 9
      src/components/TreatDesc/index.jsx
  84. 5 1
      src/components/TreatDesc/index.less
  85. 6 3
      src/config/index.js
  86. 20 4
      src/containers/AdviceContainer.js
  87. 5 1
      src/containers/AssistCheck.js
  88. 1 0
      src/containers/CheckBody.js
  89. 5 1
      src/containers/CurrentIll.js
  90. 1 1
      src/containers/EditableSpan.js
  91. 1 1
      src/containers/Inspect.js
  92. 21 5
      src/containers/MainSuit.js
  93. 5 1
      src/containers/MultSpread.js
  94. 3 3
      src/containers/Multiple.js
  95. 4 1
      src/containers/NumberDrop.js
  96. 29 11
      src/containers/NumberUnitDrop.js
  97. 11 7
      src/containers/OtherHistory.js
  98. 8 5
      src/containers/RadioDrop.js
  99. 190 0
      src/containers/RadioInpDrop.js
  100. 0 0
      src/containers/SpreadDrop.js

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

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

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

@@ -43,14 +43,14 @@ class DropList extends Component{
     onSelect&&onSelect(undefined);
   }
   render(){
-    const {data} = this.props;
+    const {data,hideTag} = 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||(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||(!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>

+ 73 - 61
src/common/components/EditableSpan/index.jsx

@@ -37,7 +37,6 @@ class EditableSpan extends Component{
     this.handleKeydown = this.handleKeydown.bind(this);
     this.handleKeyup = this.handleKeyup.bind(this);
     this.moveEnd = this.moveEnd.bind(this);
-    this.stopIt = this.stopIt.bind(this);
   }
   handleFocus(e){
     e.stopPropagation();
@@ -98,7 +97,7 @@ class EditableSpan extends Component{
       isEnd = !(newText.indexOf(searchPre)>0);
       search = temp.replace(/[(^\s*)|(\s*$)|(^\,*)|(\,*$)]/g,'');
       // if(!search&&searchPre){
-      if(!temp&&searchPre){
+      if(!temp&&searchPre&&newText){
         search = searchPre;
       }
       //console.log(labelVal,'旧:',searchPre,'新:',newText,'搜索:',search);
@@ -147,8 +146,9 @@ class EditableSpan extends Component{
 
   handleKeydown(e){
     const ev = e||window.event;
+    const {i,setSearchLocation} = this.props;
     const target = ev.target||ev.srcElement;
-    let innerVal = target.innerText;
+    let innerVal = target.innerText || target.innerHTML,ele,boxTop;
     //禁止回车事件
     if(ev.keyCode==13){return false;}
     //backspace事件
@@ -158,68 +158,89 @@ class EditableSpan extends Component{
         preVal:innerVal
       })
     }
-  }
-  stopIt(e){  
-    if(e.returnValue){  
-        e.returnValue = false ;  
-    }  
-    if(e.preventDefault ){  
-        e.preventDefault();  
-    }                 
-    return false;  
+    let range = window.getSelection();
+    let textIndex = range.focusOffset;
+    let textLength = range.anchorNode.length;
+    if(ev.keyCode==37&& i!=0){//向左
+      let preObj = $(this.$span.current).prev();
+      let obj = preObj[0]&&preObj[0].nodeName=="DIV"?preObj.prev():preObj;
+      if(textIndex == 0){
+        if(ev.preventDefault){//阻止默认事件
+          ev.preventDefault();
+        }else{
+          ev.returnValue=false;
+        } 
+        this.moveEnd(obj[0]);
+      }
+    }
+    if(ev.keyCode==39){//向右
+      let nextObj = $(this.$span.current).next();
+      let obj = nextObj[0]&&nextObj[0].nodeName=="DIV"?nextObj.next():nextObj;
+      if(textIndex == textLength || textLength==undefined){
+        if(ev.preventDefault){//阻止默认事件
+          ev.preventDefault();
+        }else{
+          ev.returnValue=false;
+        }
+        obj.focus();
+      }
+    }
+    // 注释掉,放开会影响删除
+    // ele = document.activeElement;
+    // boxTop = target.innerText?getPageCoordinate(e).boxTop:$(ele).offset().top+30;
+    // setSearchLocation(boxTop,ele.offsetLeft)     //搜索框的位置动态获取
   }  
   handleKeyup(e){
     const {boxMark,handleKeydown,i,value,removeId,handleClear,delSingleLable,setSearchLocation} = this.props;
     const {preVal,index} = this.state;
     const ev = e||window.event;
     const target = ev.target||ev.srcElement;
-    let innerVal = target.innerText || target.innerHTML;
-    if(ev.keyCode==8){
-      const elem = ev.srcElement || ev.currentTarget;
-      const nodeN = elem.nodeName;
-      
-      let ele = document.activeElement;
-      let boxTop = getPageCoordinate(e).boxTop;
-      setSearchLocation(boxTop,ele.offsetLeft)     //搜索框的位置动态获取
-      if(nodeN != "SPAN"){//光标没落到span的时候阻止默认事件(backspace回退页面的情况)
-        return this.stopIt(ev);
-      }
+    let innerVal = target.innerText || target.innerHTML,ele,boxTop;
+    if(ev.keyCode==8){     
       // 主诉现病史去重:删除最后一个字的时候移除该数据(将name、id和value替换成空)并移除id
       // 前面是标签,内容为空时再删一次才移除标签;前面是文本,则直接移除;
-      // console.log(77,elem,nodeN);
       let preObj = $(this.$span.current).prev();
       if(index!==0&&preVal.trim().length==1&& !innerVal){
-          removeId && removeId({boxMark,i:index,text:""});
-          handleClear && handleClear({boxMark});//删除最后一个字时清空搜索结果,避免现病史搜索框不立即消失的情况
-          if(preObj[0].nodeName !=="DIV"){
-            this.moveEnd(preObj[0]);
-          }
+        removeId && removeId({boxMark,i:index,text:""});
+        handleClear && handleClear({boxMark});//删除最后一个字时清空搜索结果,避免现病史搜索框不立即消失的情况
+        if(preObj[0].nodeName !=="DIV"){
+          this.moveEnd(preObj[0]);
+        }
+      }
+      
+      if(innerVal !== preVal){
+        
+      }
+      else{
+        // 中英文数字和下划线--单独删除标签
+        /*const reg = new RegExp("([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9_])");
+        if(index!==0 && reg.test(innerVal)){
+          let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
+          delSingleLable && delSingleLable({boxMark,i:index});
+          this.moveEnd(obj[0]);  
+          this.setState({
+            index: null
+          })
+        }*/
+        let data = innerVal.trim();
+        //判断是否为空、中英文:, 。、;,且不是第一位
+        // let pattern = new RegExp(/^\,?$|^\,?$|^\.?$|^\。?$|^\、?$|^\;?$|^\;?$|^\:?$|^\:?$|\s/);
+        // if(index!==0 && pattern.test(data)){
+        if(index!==0 && !config.punctuationReg.test(data)){
+          // let preObj = $(this.$span.current).prev();
+          let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
+          handleKeydown&&handleKeydown({boxMark,i:index,text:data});
+          this.moveEnd(obj[0]);  
+          this.setState({
+            index: null
+          })
         }
-
-      if(innerVal !==preVal){return false}
-      // 中英文数字和下划线--单独删除标签
-      /*const reg = new RegExp("([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9_])");
-      if(index!==0 && reg.test(innerVal)){
-        let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
-        delSingleLable && delSingleLable({boxMark,i:index});
-        this.moveEnd(obj[0]);  
-        this.setState({
-          index: null
-        })
-      }*/
-      let data = innerVal.trim();
-      //判断是否为空、中英文:, 。、;,且不是第一位
-      let pattern = new RegExp(/^\,?$|^\,?$|^\.?$|^\。?$|^\、?$|^\;?$|^\;?$|^\:?$|^\:?$\s/);
-      if(index!==0 && pattern.test(data)){
-        // let preObj = $(this.$span.current).prev();
-        let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
-        handleKeydown&&handleKeydown({boxMark,i:index,text:data});
-        this.moveEnd(obj[0]);  
-        this.setState({
-          index: null
-        })
       }
+      ele = document.activeElement;
+      boxTop = target.innerText?getPageCoordinate(e).boxTop:$(ele).offset().top+30;
+      setSearchLocation(boxTop,ele.offsetLeft)     //搜索框的位置动态获取
     }
+    
   }
   componentWillReceiveProps(next){
     const isRead = this.props.isRead;
@@ -247,15 +268,6 @@ class EditableSpan extends Component{
       }
     }*/
 
-  /*cancelSelect(e){//双击不选中
-    if(document.selection&&document.selection.empty){
-        document.selection.empty();
-      }else if (window.getSelection) {
-        var sel=window.getSelection();
-        sel.removeAllRanges();
-      }
-    }*/
-
   getClass(){
     const {full,value,saveText,i} = this.props;
     const preSelected = saveText[i-1];

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

@@ -28,6 +28,7 @@ class InlineTag extends Component {
     this.handleBlur = this.handleBlur.bind(this);
     this.handleInput = this.handleInput.bind(this);
     this.handleFocus = this.handleFocus.bind(this);
+    this.handleFixClick = this.handleFixClick.bind(this);
   }
   changeToEdit(e){
     const {handledbClick,id} = this.props;
@@ -46,7 +47,7 @@ class InlineTag extends Component {
     });
   }
   handleInput(e){       //输入时保存临时值,在修改灰显为黑色时判断用
-    const text = e.target.innerText || e.target.innerHTML;console.log(text)
+    const text = e.target.innerText || e.target.innerHTML;
     this.setState({
       value:text
     });
@@ -55,15 +56,15 @@ class InlineTag extends Component {
   handleBlur(e){         //鼠标离开是保存值到store中
     const {value} = this.state;
     const {handleInput,ikey,prefix,suffix} = this.props;
-    this.$span.current.innerText='';      //修改生成文字变成输入的2倍bug
+    this.$span.current.innerText?(this.$span.current.innerText=''):(this.$span.current.innerHTML='');      //修改生成文字变成输入的2倍bug
     handleInput&&handleInput({text:value,ikey,prefix,suffix});
   }
   handleFocus(e){
     e.stopPropagation();
-    const text = e.target.innerText;
+    const text = e.target.innerText || e.target.innerHTML;
     const {placeholder} = this.props;
     if(text==placeholder){
-      e.target.innerText = '';
+      e.target.innerText?(e.target.innerText = ''):(e.target.innerHTML='');
     }
   }
   getStyle(){
@@ -80,12 +81,34 @@ class InlineTag extends Component {
     }
     return style['selected-tag'];
   }
- 
+  moveEnd(obj) {
+    if(window.getSelection){//ie11 10 9 ff safari
+      obj.focus(); //解决ff不获取焦点无法定位问题
+      var range = window.getSelection();//创建range
+      range.selectAllChildren(obj);//range 选择obj下所有子内容
+      range.collapseToEnd();//光标移至最后
+    }
+    else if (document.selection) {//ie10 9 8 7 6 5
+      var range = document.selection.createRange();//创建选择对象
+      range.moveToElementText(obj);//range定位到obj
+      range.collapse(false);//光标移至最后
+      range.select();
+    }
+  }
+  handleFixClick(){
+    this.moveEnd(this.$span.current);
+  }
+  componentDidMount(){
+    //设置最小宽度避免输入后宽度跳动
+    const spanWidth = window.getComputedStyle(this.$span.current).width;
+    this.$span.current.style.minWidth=spanWidth;
+  }
   render(){
     const {placeholder,value,prefix,suffix} = this.props;
     const inp = this.state.value;
     return <div className={this.getStyle()}
                  onDoubleClick={this.changeToEdit}
+                  onClick={this.handleFixClick}
                  onkeydown={handleEnter}
                  onBlur={this.changeToClick} ref={this.$box} contentEditable={this.state.editable}>
                 {prefix}
@@ -94,6 +117,7 @@ class InlineTag extends Component {
                       onBlur={this.handleBlur}
                       onInput={this.handleInput}
                       onFocus={this.handleFocus}
+                      onClick={e=>e.stopPropagation()}
                       onkeydown={handleEnter}
                       ref={this.$span}>{value||(inp?'':placeholder)}</span>
                 {suffix}

+ 2 - 0
src/common/components/InlineTag/index.less

@@ -18,6 +18,8 @@
 .free-in{
   display: inline-block;
   min-width: 30px;
+  vertical-align: top;
+  text-align: center;
   /*border-bottom: 1px @placeholder-color solid;*/
   outline: none;
 }

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

@@ -16,7 +16,7 @@ class InspectCommon extends React.Component {
             {children}
             <div className={style.btnWrap}>
                 <span className={style.clear + ' red'} onClick={handleClear}>清空选项</span>
-                <span className={style.sure} onClick={handleConfirm}>确 定</span>
+                <span className={style.sure} onClick={handleConfirm}>确定</span>
             </div>
         </div>
     }

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

@@ -24,10 +24,12 @@
     .sure {
         float: right;
         color: @blue;
-        border: 1px solid @blue;
+        font-weight: bold;
     }
     .clear {
         float: left;
+        // font-weight: bold;
+        bottom: 0;
     }
 }
 

+ 5 - 3
src/common/components/ItemBox/index.jsx

@@ -1,6 +1,6 @@
 import React,{Component} from 'react';
 import style from './index.less';
-import {isIE} from '@utils/tools.js';
+import {isIE,handleEnter} from '@utils/tools.js';
 import $ from 'jquery';
 /***
  * author:zn@2018-11-13
@@ -39,6 +39,8 @@ class ItemBox extends Component {
   }
 
   componentDidMount(){
+    const {setRef} = this.props;
+    setRef&&setRef(this.$div);
     if(isIE()){
       $(this.$div.current).onIe8Input(function(e){
         this.handleInput(e)
@@ -47,10 +49,10 @@ class ItemBox extends Component {
   }
 
   render(){
-    const {title,children,editable,className,handleFocus,onchange,fuzhen,border,handleBlur,titleTop,backgroundColor} = this.props;
+    const {title,children,editable,className,handleFocus,onchange,fuzhen,border,handleBlur,titleTop,backgroundColor,boxId} = this.props;
     return <div className={style["box"]+" "+"clearfix"} >
       <div className={style["title"] + ' '+(className||'')} style={{marginTop:titleTop?'22px':''}}>{title}</div>
-      <div ref={this.$div} className={`${style["content"]} ${border?style["border"]:''} ${backgroundColor?style["noBorder"]:''}`} contentEditable={editable} style={this.getBoxStyle()} onFocus={handleFocus} onInput={this.handleInput} onClick={(e)=>{this.handleClick(e);}} onBlur={handleBlur}>
+      <div ref={this.$div} className={`${style["content"]} ${border?style["border"]:''} ${backgroundColor?style["noBorder"]:''}`} contentEditable={editable} style={this.getBoxStyle()} onFocus={handleFocus} onInput={this.handleInput} onClick={(e)=>{this.handleClick(e);}} onBlur={handleBlur} id={boxId} onkeydown={handleEnter}>
         {fuzhen?children||fuzhen:children}
       </div>
     </div>

+ 2 - 1
src/common/components/ItemBox/index.less

@@ -24,10 +24,11 @@
     padding:5px;
     outline: none;
     border-bottom:1px @part-border-color dashed;
-    border-radius: 4px;
+    /*border-radius: 4px;*/
   }
   .border {
       border:1px @part-border-color dashed !important;
+      border-radius: 4px;
   }
   .noBorder{
     border: none;

+ 1 - 1
src/common/components/Notify/index.less

@@ -27,7 +27,7 @@
 .notify-text {
   min-width: 224px;
   height: 70px;
-  
+  padding:  0 40px 0 0;
   // overflow: hidden;
   position: relative;
   left: 66px;

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

@@ -1,6 +1,7 @@
 import React,{Component} from 'react';
 import style from './index.less';
 import ReactDom from "react-dom";
+import backspace from '../../images/backspace.png'
 
 class NumberPan extends Component{
   constructor(props){
@@ -11,7 +12,7 @@ class NumberPan extends Component{
   }
   handleSelect(e){
     e.stopPropagation();
-    const text = e.target.innerText;
+    const text = e.target.innerText || e.target.innerHTML;
     const value = this.props.toClear?'':this.state.value;     //键盘输入替换已有的值
     const onSelect = this.props.handleSelect;
     this.setState({
@@ -55,7 +56,7 @@ class NumberPan extends Component{
       display:show?'table':'none'        //table onBlur阻止冒泡是为了修复multSpread中数字键盘点击触发最外层数字组件onBlur事件
     }
   }
-  render(){  
+  render(){
     const select = this.handleSelect.bind(this); 
     const domNode = document.getElementById('root');
     return ReactDom.createPortal(
@@ -74,19 +75,19 @@ class NumberPan extends Component{
           <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)}>回退</button></td>
+          <td><button onClick={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)}>清空</button></td>
+          <td><button onClick={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)}>确定</button></td>
+          <td><button onClick={this.handleClose.bind(this)} className={style['confirm']}>确定</button></td>
         </tr>
       </table>
       </div>

+ 20 - 0
src/common/components/NumberPan/index.less

@@ -21,4 +21,24 @@
   button:hover{
     border-color: @blue;
   }
+  .confirm{
+    color: #3B9ED0;
+    font-weight: bold;
+    text-align: center;
+    padding-left: 14px;
+    font-size: 14px;
+    line-height: normal;
+  }
+  .imgN{
+    text-align: right;
+    vertical-align: middle;
+    padding-right: 8px;
+    cursor: pointer;
+  }
+  .clearN{
+    color:#F6514A;
+    text-align: center;
+    padding-left: 8px;
+    font-weight: bold;
+  }
 }

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

@@ -3,6 +3,7 @@ import style from './index.less';
 import config from '@config/index.js';
 import Notify from '../Notify/index.js';
 import ReactDom from "react-dom";
+import backspace from '../../images/backspace.png'
 
 class NumberUnitPan extends Component{
   constructor(props){
@@ -14,7 +15,7 @@ class NumberUnitPan extends Component{
   }
   handleSelect(e){
     e.stopPropagation();
-    const text = e.target.innerText;
+    const text = e.target.innerText || e.target.innerHTML;
     const preValue = this.state.value;
     if(+text==0 && !preValue){//第一位不能是0
       Notify.info("请输入正确时间");
@@ -25,7 +26,7 @@ class NumberUnitPan extends Component{
     this.setState({
       value: value+text
     });
-    onSelect&&onSelect(value+text);
+    onSelect&&onSelect({text:value+text,mark:true});//增加mark参数,清空删除不提示字数限制
   }
   handleClear(e){
     e.stopPropagation();
@@ -33,7 +34,7 @@ class NumberUnitPan extends Component{
     this.setState({
       value: ''
     });
-    onSelect&&onSelect('');
+    onSelect&&onSelect({text:'',mark:false});
   }
   handleClose(e){
     e.stopPropagation();
@@ -54,7 +55,7 @@ class NumberUnitPan extends Component{
     this.setState({
       value:text
     });
-    onSelect&&onSelect(text);
+    onSelect&&onSelect({text,mark:false});
   }
   getStyle(){
     const {left,top,show} = this.props;
@@ -82,36 +83,36 @@ 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>
         <tr>
           <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.handleBack.bind(this)}>回退</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>
           <td><span onClick={this.handleSelect}>7</span></td>
           <td><span onClick={this.handleSelect}>8</span></td>
           <td><span onClick={this.handleSelect}>9</span></td>
-          <td><span onClick={this.handleClear.bind(this)}>清空</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>
           <td><span onClick={this.handleSelect}>.</span></td>
           <td><span onClick={this.handleSelect}>0</span></td>
           <td><span onClick={this.handleSelect}>~</span></td>
-          <td><span onClick={this.handleClose.bind(this)}>确定</span></td>
-        </tr>
-        <tr>
-          <td><span onClick={this.handleSelect}>{config.timeUnit.minute}</span></td>
-          <td><span onClick={this.handleSelect}>{config.timeUnit.hour}</span></td>
-          <td><span onClick={this.handleSelect}>{config.timeUnit.day}</span></td>
-          <td><span onClick={this.handleSelect}>{config.timeUnit.age}</span></td>
+          <td><span onClick={this.handleSelect}>/</span></td>
+          <td colspan="2" className={style['imgN']}><img src={backspace} onClick={this.handleBack.bind(this)} /></td>
         </tr>
         <tr>
-          <td><span onClick={this.handleSelect}>{config.timeUnit.week}</span></td>
-          <td><span onClick={this.handleSelect}>{config.timeUnit.month}</span></td>
-          <td><span onClick={this.handleSelect}>{config.timeUnit.year}</span></td>
+          <td colspan="3"><span onClick={this.handleClear.bind(this)} className={style['clearN']}>清空</span></td>
+          <td colspan="3"><span onClick={this.handleClose.bind(this)} className={style['comf']}>确定</span></td>
         </tr>
       </table>
       </div>

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

@@ -24,4 +24,28 @@
   span:hover{
     border-color: @blue;
   }
+   .imgN{
+    text-align: right;
+    vertical-align: middle;
+    padding-right: 8px;
+    cursor: pointer;
+  } 
+  .clearN{
+    color:#F6514A;
+    text-align: left;
+    padding-left: 8px;
+    font-weight: bold;
+  }
+  .comf{
+    color:#3B9ED0;
+    text-align: right;
+    padding-right: 8px;
+    font-weight: bold;
+  }
+  .comf:hover{
+    border-color: #fff;
+  }
+  .clearN:hover{
+    border-color: #fff;
+  }
 }

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

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

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

@@ -19,8 +19,8 @@ class TailInlineTag extends Component {
 
   handleClick(e){
     // e.stopPropagation(); //冒泡到最顶层关闭其他下拉
-    const {handleTailClick,questionMapping,id} = this.props;
-    handleTailClick && handleTailClick({questionMapping,id});
+    const {handleTailClick,questionMapping,id,relationModule} = this.props;
+    handleTailClick && handleTailClick({questionMapping,id,relationModule});
   }
 
   render(){

+ 19 - 9
src/common/components/Textarea/index.jsx

@@ -18,13 +18,14 @@ class Textarea extends Component {
     this.handleInput = this.handleInput.bind(this);
     this.handleFocus = this.handleFocus.bind(this);
     //this.handleBlur = this.handleBlur.bind(this);
+    this.handleKeydown = this.handleKeydown.bind(this);
   }
   handleFocus(){            //初始显示props中的值,focus已经显示输入的值,避免值更新闪烁
     const {handleFocus,fuzhen,handleInput} = this.props;
     handleFocus&&handleFocus();         //其他史、查体获取数据的方法
-    if(fuzhen&&!this.$dom.current.innerText){
+    if(fuzhen&&!(this.$dom.current.innerText?this.$dom.current.innerText:this.$dom.current.innerHTML)){
       const text = config.currentText.replace("(**)",fuzhen);
-      this.$dom.current.innerText = text;
+      this.$dom.current.innerText?(this.$dom.current.innerText = text):(this.$dom.current.innerHTML = text);
       handleInput&&handleInput({text});
     }
 
@@ -32,14 +33,14 @@ class Textarea extends Component {
   handleInput(e){
     const {handleInput,boxMark,handlePush,hasMain} = this.props;
     const {inpText,overFlag} = this.state;
-    const text = e.target.innerText;
+    const text = e.target.innerText || e.target.innerHTML;
     const stimer = this.state.timer;
     if(boxMark=='1'&&text.length>config.limited){           //主诉字符数限制
-      e.target.innerText = text.substr(0,config.limited); 
+      e.target.innerText?(e.target.innerText = text.substr(0,config.limited)):(e.target.innerHTML = text.substr(0,config.limited));
       e.target.blur();
       Notify.error(config.limitText);
       if(overFlag){
-        e.target.innerText = inpText;
+        e.target.innerText?(e.target.innerText = inpText):(e.target.innerHTML = inpText);
         return
       }
       this.setState({
@@ -69,6 +70,14 @@ class Textarea extends Component {
       timer
     });
   }
+  handleKeydown(e){
+    const {boxMark} = this.props;
+    const ev = e||window.event;
+    if(+boxMark==1){
+      //禁止回车事件
+      if(ev.keyCode==13){return false;}
+    }
+  }
   shouldComponentUpdate(next){
     if(JSON.stringify(next) == JSON.stringify(this.props)){
       return false;
@@ -77,14 +86,14 @@ class Textarea extends Component {
   }
   componentWillReceiveProps(next){
     const isRead = this.props.isRead;
-    if(next.isRead != isRead||next.value!=this.props.value){      //value对比解决复诊不显示bug
-      this.$dom.current.innerText = next.value||'';
+    if(next.isRead != isRead||(next.value!=this.props.value&&next.value&&next.value.indexOf("复诊")!=-1)){    //value对比解决复诊不显示bug,复诊对比解决关标跳到前面bug
+      this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
     }
   }
   componentDidMount(){
     const {value} = this.props;
     if(value){
-      this.$dom.current.innerText = value||'';
+      this.$dom.current.innerText?(this.$dom.current.innerText = value||''):(this.$dom.current.innerText=value||'');
     }
     if(isIE()){
       $(this.$dom.current).onIe8Input(function(e){
@@ -102,7 +111,8 @@ class Textarea extends Component {
              onFocus={this.handleFocus}
              ref={this.$dom}
              contentEditable={true}
-             onInput={this.handleInput}>
+             onInput={this.handleInput}
+             onkeydown={this.handleKeydown}>
         </div>
       </div>
     );

BIN
src/common/images/backspace.png


BIN
src/common/images/slide-down.png


BIN
src/common/images/slide-up.png


+ 20 - 14
src/common/js/func.js

@@ -82,7 +82,8 @@ function notTextLabel(label){
 * 入参:arr源数组,
 *       noPre是否不添加前置文本标签,默认false即添加
 *       noEnd是否不添加后置文本标签,默认false即添加
-*       ifEmpty是否添加空标签,默认true即添加,传false添加逗号,如查体
+*       ifEmpty是否添加空标签,默认true即添加,传false添加逗号,如查体,
+*       showInCheck是否默认在查体中展开
 * */
 export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
   let newArr =[],
@@ -92,19 +93,22 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       notText = true,
       saveText=[],
       tempText = '',
-      value = '';
+      value = '',
+      item={},
+      checkHiddenDefault=false;
   arr.map((it,i)=>{
     notText = notTextLabel(it);
     value = it.value||'';
-    textLabel = JSON.parse(config.textLabel);
-    _textLabel = JSON.parse(config._textLabel);
+    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);
     if(i===0){
       //第一个标签不是文本标签时在前面添加文本标签
       if(!noPre&&notText){
         newArr.push(textLabel);
         saveText.push('');
       }
-      newArr.push(it);
+      item = ifEmpty?it:Object.assign({},it,{showInCheck:true});
+      newArr.push(item);
       if(it.tagType != 3){
         tempText = value?it.labelPrefix+value+it.labelSuffix:'';
         tempText = notText?tempText:it.value||it.name;
@@ -114,23 +118,25 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       saveText.push(tempText);
     }else{
       pre = arr[i-1];
+      item = !ifEmpty&&i<config.showCheckNum?Object.assign({},it,{showInCheck:true}):it;
+      //判断单选项是否有默认选中,位置在隐藏区域时,查体所有标签展示
+      if(!ifEmpty&&!checkHiddenDefault&&i>config.showCheckNum&&+it.tagType===1&&(+it.controlType===0||+it.controlType===1)){
+        if(it.questionDetailList.find((it)=>it.defaultSelect=='1')){
+          checkHiddenDefault=true;
+        }
+      }
       //如果本身不是文本标签且前面一个也不是文本标签,该标签前面添加文本标签
       if(notTextLabel(pre)&&notText){
           // newArr.push(textLabel,it);
-          ifEmpty?newArr.push(textLabel,it):newArr.push(_textLabel,it);
+          ifEmpty?newArr.push(textLabel,it):newArr.push(_textLabel,item);
           if(it.tagType != 3) {
             tempText = value ? it.labelPrefix + value + it.labelSuffix : '';
           }else{
             tempText = getSaveText(it);
           }
-          saveText.push("",tempText); 
-        //最后一个非文本标签,后面添加一个文本标签
-        /*if(!noEnd&&i===arr.length-1){
-          newArr.push(textLabel);
-          saveText.push("");
-        }*/
+          saveText.push("",tempText);
       }else{    //本身是或者前面是文本标签时,前面不添加文本标签
-        newArr.push(it);
+        newArr.push(item);
         if(it.tagType != 3) {
           tempText = value ? it.labelPrefix + value + it.labelSuffix : '';
           // tempText = notText?tempText:it.value||it.name;
@@ -147,7 +153,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       }
     }
   });
-  return {newArr,saveText};
+  return {newArr,saveText,checkHiddenDefault};
 };
 
 

+ 8 - 2
src/common/less/variables.less

@@ -97,6 +97,8 @@
   text-align: center;
   cursor: pointer;
   margin-left: 22px;
+  position: relative;
+  bottom: -10px;
 }
 .confirm{
   width: 120px;
@@ -104,13 +106,17 @@
   line-height: 44px;
   color:@blue;
   font-size: 12px;
-  border: 1px solid @blue;
+  // border: 1px solid @blue;
   background: #fff;
   margin-left: 20px;
   float: right;
   outline: none;
-  text-align: center;
+  text-align: right;
   cursor: pointer;
+  font-weight: bold;
+  position: relative;
+  bottom: -10px;
+  padding-right: 10px;
 }
 :global(.red){
   color: @red;

+ 16 - 12
src/components/AddAssistCheck/Textarea/index.jsx

@@ -10,9 +10,11 @@ class Textarea extends Component {
       timer:null,
       val:'报告描述或意见'
     };
+    this.textInput = React.createRef();
     this.$dom = React.createRef();
     this.$domW = React.createRef();
     this.handleInput = this.handleInput.bind(this);
+    this.handleFocus = this.handleFocus.bind(this);
   }
   handleInput(e){
     const {handleChangeAssistValue,idx,handlePush} = this.props;
@@ -25,13 +27,10 @@ class Textarea extends Component {
       handlePush&&handlePush();
       clearTimeout(stimer);
     },config.delayPushTime);
-
     if(text.trim() != '' && text != '<br>'){
-      e.target.nextSibling.innerText = ''
-      e.target.nextSibling.innerHTML = ''
+      e.target.nextSibling.innerText?(e.target.nextSibling.innerText = ''):(e.target.nextSibling.innerHTML = '')
     }else{
-      e.target.nextSibling.innerText = '报告描述或意见'
-      e.target.nextSibling.innerHTML = '报告描述或意见'
+      e.target.nextSibling.innerText?(e.target.nextSibling.innerText = '报告描述或意见'):(e.target.nextSibling.innerHTML = '报告描述或意见')
     }
     this.setState({
       timer
@@ -47,19 +46,25 @@ class Textarea extends Component {
     const isRead = this.props.isRead;
     if(next.isRead != isRead){
       this.$dom.current.innerText?(this.$dom.current.innerText = next.value||'') : (this.$dom.current.innerHTML = next.value||'')
+      if(next.value && next.value.trim()){
+        this.$dom.current.nextSibling.innerText = ''
+      }else{
+        this.$dom.current.nextSibling.innerHTML = '报告描述或意见'
+      }
     }
   }
   componentDidMount(){
     const {value} = this.props;
     if(value && value.trim()){
       this.$dom.current.innerText?(this.$dom.current.innerText = value) : (this.$dom.current.innerHTML = value)
-      this.$dom.current.nextSibling.innerText = '';
-      this.$dom.current.nextSibling.innerHTML = '';
+      this.$dom.current.nextSibling.innerText?(this.$dom.current.nextSibling.innerText = ''):(this.$dom.current.nextSibling.innerHTML = '')
     }else{
-      this.$dom.current.nextSibling.innerText = '报告描述或意见'
-      this.$dom.current.nextSibling.innerHTML = '报告描述或意见'
+      this.$dom.current.nextSibling.innerText?(this.$dom.current.nextSibling.innerText = '报告描述或意见'):(this.$dom.current.nextSibling.innerHTML = '报告描述或意见')
     }
   }
+  handleFocus(){     //ie8下提示语挡住输入框,导致输入框无法聚焦
+    this.textInput.current.previousSibling.focus();
+  }
   render() {
     const {idx} = this.props;
     return (
@@ -68,12 +73,11 @@ class Textarea extends Component {
             contenteditable={true}
             ref={this.$dom}
             onInput={this.handleInput}
-            onPropertyChange={this.handleInput}
+            onKeyUp={this.handleInput}
         ></div>
-        <p style={{position: "absolute",left: '0',top: '0',color: "#a5a3a3",zIndex: '5'}} className="textareaWarring"></p>
+        <p ref={this.textInput} onClick={this.handleFocus} className={style.textareaWarring}></p>
       </div>
     );
   }
 }
-
 export default Textarea;

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

@@ -107,7 +107,7 @@ class AddAssistCheck extends React.Component {
         const {assistLabel,handleChangeAssistValue,handleChangeDate,isRead,handlePush,winWidth} = this.props;
         return <ul className={styles.labelWrap} id="datePick">
             {
-                assistLabel.map((item,idx) => {
+              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}>
@@ -145,9 +145,9 @@ class AddAssistCheck extends React.Component {
                     cancel={this.handleCancel}
                     okText="删除"
                     cancelText='取消'
-                    okBorderColor={'#3B9ED0'}
-                    okColor={'#fff'}
-                    oKBg={'#3B9ED0'}
+                    // okBorderColor={'#3B9ED0'}
+                    // okColor={'#fff'}
+                    // oKBg={'#3B9ED0'}
                 >
                     <p className={styles['center']}>是否删除该辅检项?</p>
                 </ConfirmModal>

+ 78 - 0
src/components/AddInspect/SlideExcel/index.jsx

@@ -0,0 +1,78 @@
+import React, { Component } from "react";
+import styles from "./index.less";
+import { normalVal,timestampToTime } from '@utils/tools';
+import slideUp from "@common/images/slide-up.png";
+import slideDown from "@common/images/slide-down.png";
+class SlideExcel extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      show:false
+    };
+    this.toTime = this.toTime.bind(this)
+    this.handleSlide = this.handleSlide.bind(this)
+  }
+  toTime(time){
+    let tmpTim = time.split(',').join('')-0
+    if(time && tmpTim.toString() != 'NaN'){
+      let date = new Date('1900-01-01');
+      let dateTim = date.getTime();
+      let times = (tmpTim-2)*24*60*60*1000;
+      let result = timestampToTime(dateTim+times).split(' ')[0]
+      return result;
+    }else{
+      return time;
+    }
+  }
+  handleSlide(){
+    let tmpShow = this.state.show
+    this.setState({
+      show:!tmpShow
+    })
+  }
+  render() {
+    const {items,item,idx,dateTime} = 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>
+          <table className={styles.table}>
+             {  show ? (item.lisExcelItem && item.lisExcelItem.map((value,idx)=>{
+                  return <tr>
+                      <td style={{width:'30%'}}>{value.itemName}</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)}
+                      </td>
+                      <td style={{width:'25%'}}>{value.time == ''?('导入时间: '+dateTime):'化验时间: '+this.toTime(value.time)}</td>
+                  </tr>
+                })):(item.lisExcelItem && item.lisExcelItem.map((value,idx)=>{
+                  if(idx < 4){
+                    return <tr>
+                        <td style={{width:'30%'}}>{value.itemName}</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)}
+                        </td>
+                        <td style={{width:'25%'}}>{value.time == ''?('导入时间: '+dateTime):'化验时间: '+this.toTime(value.time)}</td>
+                    </tr>
+                  }
+                }))
+            }
+        </table>
+        {
+          item.lisExcelItem && item.lisExcelItem.length > 5 ?
+          <div className={styles.slides} onClick={this.handleSlide}>
+              {
+                show ? <span>收起</span> :<span>剩余<span className={styles.num}>{item.lisExcelItem.length-4}</span>项</span>
+              }
+              <img src={show ?slideUp:slideDown} alt=""/>
+          </div>:null
+        }
+      </li>
+    );
+  }
+}
+export default SlideExcel;

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

@@ -0,0 +1,145 @@
+@import "~@less/variables.less";
+.excelDataLis {
+    // cursor: pointer;
+    color: #767676;
+    position: relative;
+    padding-top: 10px;
+    padding-bottom: 10px;
+    border-bottom:1px dashed #989DA3;
+    i {
+        font-style: normal;
+        display: inline-block;
+        vertical-align: top;
+        padding-top: 3px;
+        &:before {
+            content: '\300C';
+        }
+        &:after {
+            content: '\300D';
+        }
+    }  
+    &>p {
+        cursor: pointer;
+        color: #767676;
+        display: inline-block;
+        position: relative;
+        vertical-align: top;
+    } 
+    .partDel {
+        width: 13px;
+        height: 13px;
+        margin-bottom: 11px;
+        cursor: pointer;
+        display: inline-block;
+        position: absolute;
+        right: 0;
+        top: 12px;
+        background-color: #fff;
+    }
+}
+
+
+.table {
+  color: #000;
+  width: 80%;
+  tr {
+      line-height: 18px;
+      height: 18px;
+      width: 100%;
+      td {
+          padding-top: 3px;
+      }
+  }
+}
+
+
+.itemPart {
+    height: 28px;
+    // line-height: 28px;
+    overflow: hidden;
+    padding-top: 0 !important;
+    width: 290px;
+    float: left;
+    padding: 0 15px;
+    box-sizing: border-box;
+    span {
+        display: inline-block;
+    }
+    .itemPartL {
+        max-width: 180px;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+        float: left;
+    }
+    .itemPartR {
+        width: 62px;
+        outline: none;
+        float: right;
+    }
+    .itemPartT {
+        float: right;
+        input {
+            width: 40px;
+            text-align: center;
+        }
+        .unit {
+            display: inline-block;
+        }
+    }
+}
+.itemPartOne {
+    width: 100% !important;
+}
+
+.excelDataLis {
+    padding: 2px 0px;
+    border-bottom: 1px dashed #989DA3;
+    .excelDataTitle {
+        display: inline-block;
+        width: 20%;
+        vertical-align: top;
+        padding-left: 10px;
+        float: left;
+        color: #000;
+    }
+    table {
+        width: 80%;
+        tr {
+            height: 16px;
+            line-height: 16px;
+            width: 100%;
+        }
+        td {
+            text-align: left;
+            padding-top: 6px;
+        }
+        .excelUnit {
+            width: auto;
+            margin-left: 5px;
+        }
+    }
+}
+.center {
+    text-align: center;
+    font-size: 16px;
+    padding-top: 10px;
+    padding-bottom: 50px;
+}
+.slides {
+  background-color: #EDEDED;
+  text-align: center;
+  height: 28px;
+  line-height: 28px;
+  margin: 10px 0 8px 0;
+  cursor: pointer;
+  span {
+    color:#7d7d7d;
+  }
+  img{
+    vertical-align: middle;
+  }
+  .num {
+    color: @blue;
+  }
+}

+ 144 - 0
src/components/AddInspect/SlideSelect/index.jsx

@@ -0,0 +1,144 @@
+import React, { Component } from "react";
+import styles from "./index.less";
+import { normalVal,timestampToTime } from '@utils/tools';
+import { InspectCommon, Calendar} 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,
+    };
+    this.toTime = this.toTime.bind(this)
+    this.handleSlide = this.handleSlide.bind(this)
+  }
+  toTime(time){
+    let tmpTim = time.split(',').join('')-0
+    if(time && tmpTim.toString() != 'NaN'){
+      let date = new Date('1900-01-01');
+      let dateTim = date.getTime();
+      let times = (tmpTim-2)*24*60*60*1000;
+      let result = timestampToTime(dateTim+times).split(' ')[0]
+      return result;
+    }else{
+      return time;
+    }
+  }
+  handleSlide(){
+    let tmpShow = this.state.show
+    this.setState({
+      show:!tmpShow
+    })
+  }
+  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;
+    let numPlus = 0,numPlus1 = 0;
+    return (
+      <li key={item.questionId} className={styles.slideLi}> 
+        {
+            // 标签,血常规。。
+            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>
+            </p>:
+            <p>
+                <i data-flg="current" onClick={(e) => { handleLabelSub(e,item.questionId,idx); handleFillShow(e,idx) }}>{item.name}</i>
+            </p>
+        }
+        
+        {
+          item.details && item.details.map((val)=>{
+            if(val.value && val.value != ''){
+                numPlus = ++numPlus
+              }
+            })
+          }
+        {
+            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>
+                                    {showDetails(val)}
+                                    <td style={{width:'25%'}}>
+                                        {normalVal(val.minValue,val.maxValue)}
+                                    </td>
+                                    <td style={{width:'25%'}}>{'化验时间:'+item.time}</td>
+                                </tr>
+                            }
+                        })):(item.details.map((val,num)=>{
+                          if(val.value && val.value != '' ){
+                              ++numPlus1;
+                              if(numPlus1 < 5){
+                                return <tr>
+                                    <td style={{width:'30%'}}>{val.name}</td>
+                                    {showDetails(val)}
+                                    <td style={{width:'25%'}}>
+                                        {normalVal(val.minValue,val.maxValue)}
+                                    </td>
+                                    <td style={{width:'25%'}}>{'化验时间:'+item.time}</td>
+                                </tr>
+                              }
+                          }
+                      }))
+                    }
+                </table>:null
+        }
+        {
+          numPlus > 4 ?  
+          <div className={styles.slides} onClick={this.handleSlide}>
+              {
+                show ? <span>收起</span> :<span>剩余<span className={styles.num}>{numPlus-4}</span>项</span>
+              }
+              <img src={show ?slideUp:slideDown} alt=""/>
+          </div>:null
+        }
+        <div className={styles.searchResult}>
+            {
+                showFill && fillActive.id == item.id && idx == currentIdx ?
+                    <InspectCommon
+                        showFill={showFill}
+                        handleClear={(e)=>{
+                            changeActivePart('','',true)
+                        }}
+                        handleConfirm={(e)=>{
+                            if(JSON.stringify(currentData) == '{}'){
+                                handleConfirm(e,idx,dateTime,fillActive);
+                            }else{
+                                handleConfirm(e,idx,dateTime,currentData);
+                            }
+                            changeShowFill()
+                            handlePush&&handlePush();     //右侧推送
+                        }}
+                    >
+                    
+                        <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"}}>
+                                {
+                                  dateTime
+                                }
+                            </p>
+                            <div style={{display:date?"block":"none",position:"relative"}}>
+                                {/* 日期组件 */}
+                                <Calendar isShow={true} handleChange={handleChangeDate}></Calendar>
+                            </div>
+                        </div>
+                            {/* 填写单内容显示 */}
+                            { getItemList() }
+                    </InspectCommon>
+                : null
+            }
+        </div>
+        <img className={styles.partDel} src={close} alt="删除项" onClick={()=>{handleDelClick(1,idx)}}/>
+    </li>
+    );
+  }
+}
+export default SlideSelect;

+ 154 - 0
src/components/AddInspect/SlideSelect/index.less

@@ -0,0 +1,154 @@
+@import "~@less/variables.less";
+.slideLi {
+    // cursor: pointer;
+    color: #767676;
+    position: relative;
+    padding-top: 10px;
+    padding-bottom: 10px;
+    border-bottom:1px dashed #989DA3;
+    i {
+        font-style: normal;
+        display: inline-block;
+        vertical-align: top;
+        padding-top: 3px;
+        &:before {
+            content: '\300C';
+        }
+        &:after {
+            content: '\300D';
+        }
+    }  
+    &>p {
+        cursor: pointer;
+        color: #767676;
+        display: inline-block;
+        position: relative;
+        vertical-align: top;
+    } 
+    .partDel {
+        width: 13px;
+        height: 13px;
+        margin-bottom: 11px;
+        cursor: pointer;
+        display: inline-block;
+        position: absolute;
+        right: 0;
+        top: 12px;
+        background-color: #fff;
+    }
+}
+.staticTagActive {
+    cursor: pointer;
+    color: #333;
+    display: inline-block;
+    position: relative;
+    vertical-align: top;
+    padding: 2px 10px;
+    box-sizing: border-box;
+    width: 20%;
+    float: left;
+    span {
+        border-bottom: 1px solid #666666 ;
+    }
+}
+
+.staticTag {
+    cursor: pointer;
+    // color: #767676;
+    color: @blue;
+    padding-top: 10px;
+    display: inline-block;
+    position: relative;
+    /* &:before {
+        content: '\300C';
+    }
+    &:after {
+        content: '\300D';
+    } */
+}
+.table {
+    color: #000;
+    width: 80%;
+    tr {
+        line-height: 18px;
+        height: 18px;
+        width: 100%;
+        td {
+            padding-top: 3px;
+        }
+    }
+}
+
+.searchResult {
+    .searchResultT {
+        img {
+            float: right;
+        }
+    }
+}
+
+.excelDataLists {
+    position: relative;
+    background-color: #f1f1f1;
+    border: 1px solid #ccc;
+    .close {
+        width: 13px;
+        height: 13px;
+        position: absolute;
+        top: -5px;
+        right: -5px;
+        z-index: 30;
+        background-color: #fff;
+        border-radius: 50%;
+    }
+    .excelDataLis {
+        padding: 2px 0px;
+        border-bottom: 1px dashed #989DA3;
+        .excelDataTitle {
+            display: inline-block;
+            width: 20%;
+            vertical-align: top;
+            padding-left: 10px;
+            float: left;
+        }
+        table {
+            width: 80%;
+            tr {
+                height: 16px;
+                line-height: 16px;
+                width: 100%;
+            }
+            td {
+                text-align: left;
+                padding-top: 6px;
+            }
+            .excelUnit {
+                width: auto;
+                margin-left: 5px;
+            }
+        }
+    }
+}
+.center {
+    text-align: center;
+    font-size: 16px;
+    padding-top: 10px;
+    padding-bottom: 50px;
+}
+.slides {
+  background-color: #EDEDED;
+  text-align: center;
+  height: 28px;
+  line-height: 28px;
+  margin: 10px 0 8px 0;
+  cursor: pointer;
+  span {
+    color:#7d7d7d;
+  }
+  img{
+    vertical-align: middle;
+  }
+  .num {
+    color: @blue;
+  }
+}

+ 44 - 111
src/components/AddInspect/index.jsx

@@ -1,10 +1,13 @@
 import React from 'react';
 import { SearchOption, InspectCommon, Calendar ,Notify,ConfirmModal,Add} from '@commonComp';
-import { deepClone,normalVal,timestampToTime,filterDataArr } from '@utils/tools';
+import SlideExcel from './SlideExcel';
+import SlideSelect from './SlideSelect';
+import { deepClone } from '@utils/tools';
 import styles from './index.less';
 import date1 from './img/date1.png';
-import date2 from './img/date2.png';
 import close from './img/close.png';
+import slideUp from "@common/images/slide-up.png";
+import slideDown from "@common/images/slide-down.png";
 import store from '@store';
 import $ from 'jquery';
 class Inspect extends React.Component {
@@ -22,7 +25,8 @@ class Inspect extends React.Component {
             toastText:'',
             visible:false,
             type:null,
-            id:null
+            id:null,
+            tmpIds:[],      //内层外层
         }
         this.handleChangeDate = this.handleChangeDate.bind(this)
         this.handleShowDate = this.handleShowDate.bind(this)
@@ -34,6 +38,9 @@ class Inspect extends React.Component {
         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;
@@ -97,6 +104,9 @@ class Inspect extends React.Component {
             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})
@@ -253,21 +263,9 @@ class Inspect extends React.Component {
             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>
         }
     }
-    toTime(time){
-      let tmpTim = time.split(',').join('')-0
-      if(time && tmpTim.toString() != 'NaN'){
-        let date = new Date('1900-01-01');
-        let dateTim = date.getTime();
-        let times = (tmpTim-2)*24*60*60*1000;
-        let result = timestampToTime(dateTim+times).split(' ')[0]
-        return result;
-      }else{
-        return time;
-      }
-    }
     render() {
         const { handleChangeValue, list, labelList,delPartItem, handleLabelSub, handleClear, handleConfirm, fillActive,getExcelDataList,handleCloseExcel,handlePush } = this.props;
-        const {toastText,visible} = this.state;
+        const {toastText,visible,tmpId,tmpIdx} = this.state;
         return (
             <div className={styles.wrapper}>
                 <div className={styles.check}>
@@ -279,25 +277,12 @@ class Inspect extends React.Component {
                                     <img className={styles.close} src={close} alt="关闭导入excel数据" onClick={()=>{this.handleDelClick(2,id)}}/>
                                     {
                                         items.lisExcelRes.map((item,idx)=>{
-                                            return <li className={styles.excelDataLis} style={{border:items.lisExcelRes.length-1 == idx? 0:''}}>
-                                                <span className={styles.excelDataTitle}>
-                                                    {item.menus}
-                                                </span>
-                                                <table>
-                                                    {
-                                                        item.lisExcelItem && item.lisExcelItem.map((value)=>{
-                                                            return <tr>
-                                                                <td style={{width:'30%'}}>{value.itemName}</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)}
-                                                                </td>
-                                                                <td style={{width:'25%'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+this.toTime(value.time)}</td>
-                                                            </tr>
-                                                        })
-                                                    }
-                                                </table>
-                                            </li>
+                                            return <SlideExcel
+                                              items={items}
+                                              item={item}
+                                              idx={idx}
+                                              dateTime={this.state.dateTime}
+                                            ></SlideExcel>
                                         })
                                     }
                                 </ul>:null
@@ -308,79 +293,27 @@ class Inspect extends React.Component {
                     <ul className={styles.labelWrap} >
                         {
                             labelList && labelList.map((item,idx) => {
-                                return <li key={item.questionId}> 
-                                    {
-                                        // 标签,血常规。。
-                                        item.show ?
-                                        <p className={styles.staticTagActive}>
-                                            <span data-flg="current" style={{color:"#000"}} onClick={(e) => { handleLabelSub(e, item.questionId,idx); this.handleFillShow(e,idx) }}>{item.name}</span>
-                                        </p>:
-                                        <p>
-                                            <i data-flg="current" onClick={(e) => { handleLabelSub(e,item.questionId,idx); this.handleFillShow(e,idx) }}>{item.name}</i>
-                                        </p>
-                                    }
-                                    {
-                                        item.show ? 
-                                            <table className={styles.table}>
-                                                {
-                                                    item.details.map((val)=>{
-                                                        if(val.value && val.value != ''){
-                                                            return <tr>
-                                                                <td style={{width:'30%'}}>{val.name}</td>
-                                                                {this.showDetails(val)}
-                                                                <td style={{width:'25%'}}>
-                                                                    {normalVal(val.minValue,val.maxValue)}
-                                                                </td>
-                                                                <td style={{width:'25%'}}>{'化验时间:'+item.time}</td>
-                                                            </tr>
-                                                        }
-                                                    })
-                                                }
-                                            </table>:null
-                                    }
-                                    <div className={styles.searchResult}>
-                                        {
-                                            this.state.showFill && fillActive.id == item.id && idx == this.state.currentIdx ?
-                                                <InspectCommon
-                                                    showFill={this.state.showFill}
-                                                    handleClear={(e)=>{
-                                                        // handleClear(e,idx)
-                                                        this.changeActivePart('','',true)
-                                                        this.setState({
-                                                          // currentData:fillActive
-                                                        })
-                                                    }}
-                                                    handleConfirm={(e)=>{
-                                                        // handleConfirm(e,idx,this.state.dateTime,fillActive);
-                                                        if(JSON.stringify(this.state.currentData) == '{}'){
-                                                            handleConfirm(e,idx,this.state.dateTime,fillActive);
-                                                        }else{
-                                                            handleConfirm(e,idx,this.state.dateTime,this.state.currentData);
-                                                        }
-                                                        this.setState({showFill:false})
-                                                        handlePush&&handlePush();     //右侧推送
-                                                    }}
-                                                >
-                                                    <div className={styles.searchResultT}>
-                                                        <img style={{"position":"absolute","top":"8px","right":"8px"}} src={date1} alt="" onClick={this.handleShowDate}/>
-                                                        <p style={{position:"absolute",right:"38px",top:"4px",lineHeight:"28px"}}>
-                                                            {
-                                                              this.state.dateTime
-                                                            }
-                                                        </p>
-                                                        <div style={{display:this.state.date?"block":"none",position:"relative"}}>
-                                                            {/* 日期组件 */}
-                                                            <Calendar isShow={true} handleChange={this.handleChangeDate}></Calendar>
-                                                        </div>
-                                                    </div>
-                                                        {/* 填写单内容显示 */}
-                                                        { this.getItemList(idx) }
-                                                </InspectCommon>
-                                            : null
-                                        }
-                                    </div>
-                                    <img className={styles.partDel} src={close} alt="删除项" onClick={()=>{this.handleDelClick(1,idx)}}/>
-                                </li>
+                                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>
@@ -398,9 +331,9 @@ class Inspect extends React.Component {
                     cancel={this.handleCancel}
                     okText="删除"
                     cancelText='取消'
-                    okBorderColor={'#3B9ED0'}
-                    okColor={'#fff'}
-                    oKBg={'#3B9ED0'}
+                    // okBorderColor={'#3B9ED0'}
+                    // okColor={'#fff'}
+                    // oKBg={'#3B9ED0'}
                 >
                     <p className={styles['center']}>{toastText}</p>
                 </ConfirmModal>

+ 17 - 2
src/components/AddInspect/index.less

@@ -118,6 +118,7 @@
     margin-bottom: 5px;
     border-top: 1px solid #EAEDF1;
     overflow: hidden;
+    box-sizing: border-box;
 }
 .itemPart {
     height: 28px;
@@ -159,7 +160,7 @@
 }
 .excelDataLists {
     position: relative;
-    background-color: #f1f1f1;
+    background-color: rgba(237,237,237,0.4);
     border: 1px solid #ccc;
     .close {
         width: 13px;
@@ -190,7 +191,7 @@
             }
             td {
                 text-align: left;
-                padding-top: 3px;
+                padding-top: 6px;
             }
             .excelUnit {
                 width: auto;
@@ -204,4 +205,18 @@
     font-size: 16px;
     padding-top: 10px;
     padding-bottom: 50px;
+}
+.slides {
+  background-color: #ccc;
+  text-align: center;
+  height: 28px;
+  line-height: 28px;
+  margin: 10px 0 8px 0;
+  cursor: pointer;
+  span {
+    color:#7d7d7d;
+  }
+  img{
+    vertical-align: middle;
+  }
 }

+ 67 - 0
src/components/Advice/Textarea/index.jsx

@@ -0,0 +1,67 @@
+import React, { Component } from "react";
+import style from "./index.less";
+import config from '@config/index';
+import $ from 'jquery';
+
+class Textarea extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      timer:null,
+      val:'报告描述或意见'
+    };
+    this.textInput = React.createRef();
+    this.$dom = React.createRef();
+    this.$domW = React.createRef();
+    this.handleInput = this.handleInput.bind(this);
+  }
+  handleInput(e){
+    e.stopPropagation();
+    const {handleChangeAssistValue,idx,handlePush} = this.props;
+    const text = e.target.innerText || e.target.innerHTML;
+    const stimer = this.state.timer;
+    handleChangeAssistValue&&handleChangeAssistValue(text);
+   
+  }
+  shouldComponentUpdate(next){
+    if(JSON.stringify(next) == JSON.stringify(this.props)){
+      return false;
+    }
+    return true;
+  }
+  componentWillReceiveProps(next){
+    const isRead = this.props.isRead;
+    // 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||'');
+    // }
+    if(next.isRead != isRead && next.value || next.isRead != isRead && next.value!=this.props.value){      //value对比解决复诊不显示bug
+      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||'');
+    }
+  }
+  componentDidMount(){
+    const {value} = this.props;
+    if(value && value.trim()){
+      this.$dom.current.innerText = value
+      // this.$dom.current.focus()
+      // this.$dom.current.innerText ? (this.$dom.current.innerText = value) : (this.$dom.current.innerHTML = value)
+    //   this.$dom.current.nextSibling.innerText?(this.$dom.current.nextSibling.innerText = ''):(this.$dom.current.nextSibling.innerHTML = '')
+    }
+  }
+ 
+  render() {
+    return (
+      <div>
+        <div 
+            style={{outline: 'none'}}
+            contenteditable={true}
+            ref={this.$dom}
+            onInput={this.handleInput}
+            onKeyUp={this.handleInput}
+        ></div>
+      </div>
+    );
+  }
+}
+export default Textarea;

+ 0 - 0
src/components/Advice/Textarea/index.less


+ 46 - 22
src/components/Advice/index.jsx

@@ -1,6 +1,7 @@
 import React,{Component} from 'react';
 import style from './index.less';
 import {ItemBox} from '@commonComp';
+import Textarea from './Textarea';
 
 class Advice extends Component{
   constructor(props){
@@ -9,11 +10,26 @@ class Advice extends Component{
     this.treatInput = React.createRef();
     this.assayRef = React.createRef();
     this.checkRef = React.createRef();
+    this.adviceInputRef = React.createRef();
     this.handleTreatInput = this.handleTreatInput.bind(this);
     this.handleAssayInput = this.handleAssayInput.bind(this);
     this.handleCheckInput = this.handleCheckInput.bind(this);
+    this.handleComTreatInput = this.handleComTreatInput.bind(this);
+    this.handleAdviceInput = this.handleAdviceInput.bind(this);
   }
 
+  shouldComponentUpdate(next){
+    if(JSON.stringify(next) == JSON.stringify(this.props)){
+      return false;
+    }
+    return true;
+  }
+  componentWillReceiveProps(next){
+    const isRead = this.props.isRead;
+    // if(next.isRead != isRead||next.value!=this.props.value){      //value对比解决复诊不显示bug
+    //   this.adviceInputRef.current.innerText?(this.adviceInputRef.current.innerText = next.value||''):(this.adviceInputRef.current.innerHTML = next.value||'');
+    // }
+  }
   handleTreatInput(e, index, ii) {
     const {advice} = this.props.pushMessage;
     const changeInput = e.target.value //改变的同类药的值
@@ -22,37 +38,36 @@ class Advice extends Component{
   }
 
   handleAssayInput(e) {
-    console.log(e.target.value)
     const changeInput = e.target.value
     const { setChangeAdviceAssay } = this.props;
     setChangeAdviceAssay && setChangeAdviceAssay(changeInput)
   }
   handleCheckInput(e) {
-    console.log(e.target.value)
     const changeInput = e.target.value
     const { setChangeAdviceCheck } = this.props;
     setChangeAdviceCheck && setChangeAdviceCheck(changeInput)
   }
+  handleComTreatInput(text) {
+    const { comTreatChange } = this.props;
+    comTreatChange && comTreatChange(text)
+
+  }
+  handleAdviceInput(text) {
+    const { adviceInputChange } = this.props;
+    adviceInputChange && adviceInputChange(text)
+
+  }
+  componentDidMount(){
+  //   this.$dom.current.nextSibling.innerText?(this.$dom.current.nextSibling.innerText = ''):(this.$dom.current.nextSibling.innerHTML = '')
+  // const {advice} = this.props.pushMessage.advice
+  
+}
 
   render(){
     const {advice} = this.props.pushMessage;
-    let billing = ''
+    const {isRead} = this.props
 
-    // advice.assay.forEach((item, index) => {
-    //   if(index === advice.assay.length - 1){
-    //     billing = billing + (index + 1) + ':' + item + ';'
-    //   }else{
-    //     billing = billing + (index + 1) + ':' + item + ','
-    //   }
-    // })
-
-    // advice.check.forEach((item, index) => {
-    //   if(index === advice.check.length - 1){
-    //     billing = billing + (index + 1) + ':' + item + ';'
-    //   }else{
-    //     billing = billing + (index + 1) + ':' + item + ','
-    //   }
-    // })
+    
 
     let scheme = advice.scheme && advice.scheme.map((item, index) => {
       return <p>{item.treatment.map((it,ii) =>{
@@ -70,15 +85,24 @@ 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>}
-          {/* {billing} */}
-        </div>
-        <div className={style['scheme']}>
+        </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>}
+        {advice.scheme && advice.scheme.length > 0 &&<div contentEditable='false' className={style['scheme']}>
           {advice.scheme && advice.scheme.length > 0  && <h1>治疗方案</h1>}
           {scheme}
+        </div>}
+        <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>
         </div>
       </ItemBox>
     </div>

+ 3 - 3
src/components/Advice/index.less

@@ -9,13 +9,13 @@
 .billing {
   padding: 0px 10px;
   h1{
-    margin: 10px 0px;
+    margin: 5px 0px;
   }
 }
 .scheme {
-  padding: 10px;
+  padding: 0px 10px;
   h1{
-    margin: 10px 0px;
+    margin: 5px 0px;
   }
   p{
     line-height: 18px;

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

@@ -14,7 +14,7 @@ class AssistCheck extends React.Component {
         return (
             <div className={styles.wrapper}>
                 <div className={styles.top}>
-                    <span>辅检结果数据</span>
+                    <span id="assistResultData">辅检结果数据</span>
                     {/* <button>导入化验结果</button> */}
                 </div>
                 <ItemBox 

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

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

+ 43 - 6
src/components/CheckBody/index.jsx

@@ -3,8 +3,11 @@ import style from './index.less';
 import {Button,InlineTag,ItemBox,EditableSpan,Notify} from '@commonComp';
 import chooseType from '@containers/eleType.js';
 import SearchDrop from '@components/SearchDrop';
-import {getPageCoordinate,windowEventHandler,isIE} from '@utils/tools';
+import {getPageCoordinate,windowEventHandler,isIE,filterDataArr} from '@utils/tools';
 import $ from "jquery";
+import showImg from "../../common/images/show.png";
+import hideImg from "../../common/images/close.png";
+import config from '@config/index';
 
 class CheckBody extends Component{
   constructor(props){
@@ -15,10 +18,12 @@ class CheckBody extends Component{
       boxTop:0,
       tmpScroll:0,
       tmpTop:0,
+      showAll:false
     };
     this.handleClick = this.handleClick.bind(this);
     this.handleSearchSelect = this.handleSearchSelect.bind(this);
     this.getData = this.getData.bind(this);
+    this.showHide = this.showHide.bind(this);
     //this.handleInput = this.handleInput.bind(this);
   }
   componentWillReceiveProps(nextProps){
@@ -26,14 +31,24 @@ class CheckBody extends Component{
   }
   getLabels(){
     const {data,showArr,saveText,selecteds} = this.props;
-    let arr = [],list=[];
-    const {boxMark} = this.state;
-    if(data){
-      list = data;
+    let arr = [],list=[];//console.log(data,saveText)
+    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 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;
+    let showArray = data.filter((it)=>{
+      if(it.showInCheck)
+        return it;
+    });
+    const showData = moreText||showAll?[...data]:showArray;//[...data].splice(0,config.showCheckNum*2+1);
+    if(showData){
+      list = showData;
       arr = list.map((it,i)=>{
         return chooseType({item:it,boxMark,i,showArr,saveText,selecteds});
       });
     }
+    showMoreBtn&&arr.push(more);      //是否显示收起展开按钮
     return arr;
   }
   handleClick(e){//让搜索框跟随鼠标点击移动
@@ -83,13 +98,35 @@ class CheckBody extends Component{
     //有主诉时且本身无数据,第一次点击获取数据,(不论获取成功与否)再点击不获取(直到刷新成空白页或清空)
     if(hasMain&&isEmpty!=false){
       this.props.getInit();
+      //隐藏区域有默认选中项,默认全部展开-有延迟,弃用
+      /*const that = this;
+      setTimeout(function(){
+        that.props.showAll&&that.setState({
+          showAll:true
+        });
+      },900)*/
+
+    }
+  }
+  showHide(){
+    this.setState({
+      showAll:!this.state.showAll
+    });
+  }
+  componentWillUpdate(next){
+    if((this.props.defaultShowAll&&!next.defaultShowAll)||(!this.props.defaultShowAll&&next.defaultShowAll)||(!this.props.isEmpty&&next.isEmpty)){
+      this.setState({
+        showAll:next.defaultShowAll
+      })
     }
   }
   render(){
-    const {searchData,totalHide,data,boxLeft,boxTop} = this.props;
+    const {searchData,totalHide,data,boxLeft,boxTop,saveText} = this.props;
+
     return  <div className={style['container']}>
       <ItemBox title='查体' handleClick={this.handleClick}>
         {this.getLabels()}
+        {/*{showMoreBtn?more:''}*/}
         {searchData && searchData.length>0?<SearchDrop data={searchData} show={!totalHide} left={boxLeft} top={boxTop} onSelect={this.handleSearchSelect}></SearchDrop>:''}
       </ItemBox>
     </div>

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

@@ -0,0 +1,14 @@
+@import "~@less/variables.less";
+.more{
+  color:@blue;
+  font-size: 12px;
+  cursor: pointer;
+  white-space: nowrap;
+  /*float: right;*/
+  position: absolute;
+  right: 0;
+  img{
+    vertical-align: text-top;
+    width: 15px;
+  }
+}

+ 79 - 9
src/components/CommonSymptom/index.jsx

@@ -1,9 +1,9 @@
 import React,{Component} from 'react';
 import classNames from 'classnames';
-
+import $ from 'jquery';
 import style from "./index.less";
 /****
- * 主诉常见症状下拉
+ * 主诉常见症状下拉--修改为横铺多选(3.13)
  * 接收参数:
  * data: json数组
  * show:true/false
@@ -17,7 +17,14 @@ import style from "./index.less";
 class CommonSymptom extends Component{
   constructor(props){
     super(props);
+    this.state={
+      select:[],
+      ids:[],
+      hide:false
+    }
     this.handleSelect = this.handleSelect.bind(this);
+    this.handleClear = this.handleClear.bind(this);
+    this.handleConfirm = this.handleConfirm.bind(this);
   }
   getClass(){
     let name = style['text-list'];
@@ -37,18 +44,81 @@ class CommonSymptom extends Component{
 
   handleSelect(e,item){
     e.stopPropagation();
-    const {onSelect,onShow} = this.props;
-    onSelect&&onSelect(item);
-    // onShow&&onShow(e,false);
+    let {select,ids} = this.state;
+    const id = item.questionId
+    if(ids.includes(id)){
+      ids.splice(ids.indexOf(id),1);
+      let selectData = select;  
+      select.forEach((it,i)=>{
+        if(it.questionId==id){
+         selectData.splice(i,1); 
+        }
+      })
+      select = selectData; 
+    }else{
+      ids.push(id);
+      select.push(item);
+    }
+    this.setState({
+      select,
+      ids
+    })
+  }
+  getStyle(id){
+    const {ids} = this.state;
+    if(ids.includes(id)){
+      return style['selected'];
+    }
+    return '';
+  }
+  handleClear(e){
+    e.stopPropagation();
+    this.setState({
+      select:[],
+      ids:[]
+    })
+  }
+  handleConfirm(e){
+    e.stopPropagation();
+    const {onSelect} = this.props;
+    const {select,ids} = this.state;
+    onSelect&&onSelect({select,ids});
   }
-  render(){  
+
+  componentDidMount(){
+    const {hideSymptom} = this.props;
+    $(document).click((e)=>{     
+      let itemBox = $('#mainSuit')[0];
+      let divBox = $('#symptBox')[0];
+      let listBox = $('#listBox')[0];
+      let operBox = $('#oper')[0];
+      if(e.target != itemBox && e.target.parentNode != divBox && e.target.parentNode != listBox && e.target.parentNode != operBox){
+        this.setState({
+          hide:true,
+          select:[],
+          ids:[]
+        })
+      }else{
+        this.setState({
+          hide:false
+        })
+      }
+    })
+  }
+
+  render(){ 
     const {data} = this.props;
-    return <div className={this.getClass()} contenteditable="false">
-      <ul className={style["listBox"]}>
+    const {hide} = this.state;
+    return <div className={this.getClass()} contenteditable="false" id="symptBox" style={{'display':hide?'none':'block'}}>
+      <ul className={style["listBox"]} id="listBox">
         {data&&data.map((it)=>{
-          return <li onClick={(e)=>this.handleSelect(e,it)}>{it.name}</li>
+          return <li onClick={(e)=>this.handleSelect(e,it)} className={this.getStyle(it.questionId)} title={it.name.length>5?it.name:''}>{it.name.length>5?it.name.slice(0,4)+'...':it.name}</li>
         })}
       </ul>
+      <div className={style['oper']} id="oper">
+        <span className={style['clear']} onClick={this.handleClear}>清空选项</span>
+        <span className={style['confirm']} onClick={this.handleConfirm}>确定</span>
+      </div>
     </div>
   }
 }

+ 40 - 8
src/components/CommonSymptom/index.less

@@ -2,22 +2,54 @@
 .list{
   .pop;
   left: 85px;
-  padding: 0 0 10px;
+  // padding: 0 0 10px;
+  padding: 5px;
+  white-space: pre-wrap;
   .listBox{
-    max-height: 370px;
-    overflow-y: auto;
+    // max-height: 370px;
+    // overflow-y: auto;
+    max-width: 460px;
+    // overflow-x: auto;
+    // display: inline-block;
+    // margin-right: 5px;
   }
   li{
-    width: 200px;
-    line-height: 35px;
-    border:1px #fff solid;
-    padding: 0 20px 0 30px;
-    white-space: nowrap;
+    width: 85px;
+    line-height: 32px;
+    // border:1px #fff solid;
+    // padding: 0 20px 0 30px;
+    // padding:0 20px;
+    // white-space: nowrap;
+    padding-left: 15px;
+    margin-right: 5px;
     cursor: pointer;
+    display: inline-block;
+    // text-align: center;
   }
   li:hover{
     border-color:#3B9ED0;
   }
+  .selected{
+    .select-li;
+    width: 85px;
+    // text-align: center;
+  }
+  .clear{
+    .clear;
+    margin-left: 15px;
+    bottom: 0;
+  }
+  .confirm{
+    .confirm;
+    width: 75px;
+    margin-left: 15px;
+    bottom: 0;
+    padding-right: 20px;
+  }
+  .oper{
+    margin-top: 5px;
+    padding-right: 5px;
+  }
 }
 .hide{
   display: none;

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

@@ -59,7 +59,7 @@ class CopyRight extends Component {
   render() {
     const { number, date, content, copyVisible, disVisible, disContent, hasNewVersion } = this.props.copyRight;
     const { showCopyModal, closeCopyModal, showDisclatmerModal, closeDisclatmerModal } = this;
-    const copyContent = content.map(item => {
+    const copyContent = content&&content.map(item => {
       return (
         <div className={style['message']}>
           {item.title}
@@ -91,7 +91,7 @@ class CopyRight extends Component {
           className={style["copyModal"]}
           style={copyVisible ? { display: "block" } : { display: "none" }}
         >
-          <div className={style["shade"]}/>
+          <div className={style["shade"]}  onClick={closeCopyModal}/>
           <div className={style["copyContent"]}>
             <div className={style["header"]}>版本信息<img src={close} onClick={closeCopyModal} /></div>
             <div className={style["now"]}>
@@ -105,7 +105,7 @@ class CopyRight extends Component {
           className={style["disModal"]}
           style={disVisible ? { display: "block" } : { display: "none" }}
         >
-          <div className={style["shade"]} />
+          <div className={style["shade"]} onClick={closeDisclatmerModal}/>
           <div className={style["disContent"]}>
             <div className={style["header"]}>免责声明<img src={close} onClick={closeDisclatmerModal} /></div>
             <div className={style["content"]}>{this.disclatmerContent()}</div>

+ 17 - 10
src/components/CurrentIll/index.jsx

@@ -22,6 +22,7 @@ class CurrentIll extends Component{
       show:true,
       tmpScroll:0,
       tmpTop:0,
+      setDataTimer:null
     }
     this.toggleEditable = this.toggleEditable.bind(this);
     this.handleFocus = this.handleFocus.bind(this);
@@ -42,8 +43,9 @@ class CurrentIll extends Component{
 
   handleFocus(e){
     // 判断主诉是否为空
-    const {mainData,mainText,setData,moduleNum,mainIds,data,changeEditIll,editClear} = this.props;
+    const {mainData,mainText,setData,moduleNum,mainIds,data,changeEditIll,editClear,symptomFeature} = this.props;
     const that = this;
+    let {setDataTimer} = this.state; 
     let mainFinallyText = filterDataArr(mainText);
     // if(mainData.length == 0 && !mainText[0]){
     if(!mainFinallyText){
@@ -53,12 +55,17 @@ class CurrentIll extends Component{
         forbidInput:true
       })
     }else {
-      // let useEmpty = mainData.length>0?false:true;
       let num = moduleNum.num;//主诉使用了几个模板
       // if(editClear && data.length==0){//第一次聚焦去设置现病史的data
-      if(data.length==0){//第一次聚焦去设置现病史的data
-        // setData && setData({useEmpty,num,mainData,mainIds});//是否使用空模板 及数据处理
-        setData && setData({num,mainData,mainIds});//是否使用空模板 及数据处理
+      if(data.length==0){
+        // setData && setData({useEmpty,num,mainData,mainIds});
+        clearTimeout(setDataTimer);
+        setDataTimer = setTimeout(function(){//延时,等待主诉失焦数据返回
+          setData && setData({num,mainData,mainIds,symptomFeature:symptomFeature.featureData});
+        },200)  
+        this.setState({
+          setDataTimer
+        })
       }
       this.setState({
           showMoudle:true,
@@ -81,7 +88,7 @@ class CurrentIll extends Component{
 
   onchange(e){//监听输入事件,主诉无数据不能输入
     const ev = e || window.event;
-    ev.target.innerText = "";
+    ev.target.innerText?(ev.target.innerText = ""):(ev.target.innerHTML="");
   }
 
   handleClick(e){//让搜索框跟随鼠标点击移动
@@ -98,7 +105,7 @@ class CurrentIll extends Component{
       }
       leftL = ele.offsetLeft+90
     }
-    console.log(getPageCoordinate(e).boxTop)
+    // console.log(getPageCoordinate(e).boxTop)
     getSearchLocation(getPageCoordinate(e).boxTop,leftL)
     this.setState({
       // boxLeft:getPageCoordinate(e).boxLeft,
@@ -121,12 +128,12 @@ class CurrentIll extends Component{
   }
 
   getInlineTag(){  
-    const {data,showArr,selecteds,processModuleName,saveText,insertProcess,symptomIds} = this.props;
+    const {data,showArr,selecteds,processModuleName,saveText,insertProcess,symptomIds,allModules} = this.props;
     const boxMark = '2';
 
     let list = data&&data.map((item,i)=>{
-      if(item.relationModule && item.relationModule==3){
-        return <TailInlineTag {...item} showText={processModuleName} handleTailClick={(obj)=>{insertProcess(obj)}}></TailInlineTag>
+      if(item.flag && item.flag==3){
+        return <TailInlineTag {...item} showText={item.relationModuleName} handleTailClick={(obj)=>{insertProcess(obj,allModules)}}></TailInlineTag>
       }else {
         return chooseType({item,boxMark,i,hideTag:false,showArr,selecteds,saveText,mainIds:symptomIds});
       }

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

@@ -41,7 +41,7 @@ class Diagnosis extends Component {
     render() {
         
         
-        return (<div>
+        return (<div id="diagnosisResult">
             <ItemBox  id="diagnosis" title='诊断'  boxHeight='auto' titleTop='22px' marginTop='9px' backgroundColor='#EAF7FD'>
                 <DiagnosticList></DiagnosticList>
                 <div style={{marginLeft:'10px', position:'relative'}}>

+ 16 - 8
src/components/DiagnosticItem/index.jsx

@@ -33,11 +33,18 @@ class DiagnosticItem extends Component{
             })
         }
     chooseDiagodal(item) {
+        const { diagnosticList,getTips } = this.props;
+        getTips && getTips(item);
+        for (let i = 0; i < diagnosticList.length; i++) {
+            if(diagnosticList[i].id === item.id && diagnosticList[i].name === item.name) {
+                Notify.info('该诊断已存在');
+                return
+            }
+        }
         this.setState({
             visible: true
         })
-        const { getTips } = this.props;
-        getTips && getTips(item);
+       
     }
     addDiagodal(diagType){
         const {item} = this.props;
@@ -47,17 +54,18 @@ class DiagnosticItem extends Component{
         //         visible: false,
         //     },()=>{
                 const { diagnosticList, addDiagnostic, clearInput, hideSearch } = this.props;
-                for (let i = 0; i < diagnosticList.length; i++) {
-                    if(diagnosticList[i].id === item.id && diagnosticList[i].name === item.name) {
-                        Notify.info('该诊断已存在');
-                        return
-                    }
-                }
+                // for (let i = 0; i < diagnosticList.length; i++) {
+                //     if(diagnosticList[i].id === item.id && diagnosticList[i].name === item.name) {
+                //         Notify.info('该诊断已存在');
+                //         return
+                //     }
+                // }
                 addDiagnostic&&addDiagnostic(item);
                 clearInput&&clearInput();
                 hideSearch&&hideSearch()
         //     })
         // }, 0)
+        document.getElementById("diagnosisResult").scrollIntoView(true)
     }
 
     render(){

+ 6 - 4
src/components/DiagnosticList/index.jsx

@@ -62,7 +62,8 @@ class DiagnosticList extends Component {
             delItem: item,
         })
     }
-    showTreat(item) {
+    showTreat(item, index) {
+        // item.treatIndex = index
         const  { showTreat, getTreatResult } = this.props;
         getTreatResult && getTreatResult(item);
         showTreat && showTreat();
@@ -83,7 +84,7 @@ class DiagnosticList extends Component {
         return(
                 <div className={style['diaglist-wrap']}>
                     {list && (list.length > 0) && list.map((item, index) => {
-                        const hasTreat = item.treat && (item.treat.commonTreatment || item.treat.surgeryTreatment || item.treat.treatment.length>0)
+                        const hasTreat = item.treat && (item.treat.commonTreatment.content || item.treat.surgeryTreatment.content || item.treat.treatment.length>0)
                         return (<div draggable={true} className={style['diag-box'] + ' clearfix'}  key={item.id} >
                                     {index === 0 ? '' : <span className={style['diag-up']} onClick={() => {this.upDiagnostic(index)}}><img className={style["diag-up"]} src={diagUp}/></span>}
                                     {list.length === 1 ? '' : index !== 0 ? '' : <span onClick={() => {this.downDiagnostic(index)}} className={style['diag-down']}><img className={style["diag-down"]} src={diagDown}/></span>}
@@ -91,8 +92,9 @@ class DiagnosticList extends Component {
                                     <span className={style['diag-name']} onClick={()=>{this.handleClickDiag(item)}}>{item.name}<span></span></span> 
                                     {item.type === 1 ? <span className={style['diag-first']}>初诊</span> :<span className={style['diag-second']}> 复诊</span>}
                                     <span className={style['treat']}
-                                          style ={{ color: hasTreat ?'' : 'gray', border: hasTreat ?'1px solid #3B9ED0' : '1px solid gray'}}
-                                          onClick={() =>{hasTreat && this.showTreat(item)}}>
+                                        //   style ={{ color: hasTreat ?'' : 'gray', border: hasTreat ?'1px solid #3B9ED0' : '1px solid gray', cursor: hasTreat ? '' : 'text'}}
+                                          style ={hasTreat ? '' : { color: 'gray', border: '1px solid gray', cursor: 'auto'}}
+                                          onClick={() =>{hasTreat && this.showTreat(item, index)}}>
                                           治疗方案
                                     </span>
                                     <img className={style['diag-del']} src={del_icon} onClick={()=>{this.handleDeleteItem(item)}}/>

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

@@ -101,4 +101,5 @@
 .diag-up, .diag-down, .diag-del {
     width: 20px;
     margin-bottom: 4px;
+    cursor: pointer;
 }

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

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

+ 14 - 8
src/components/Inspect/index.jsx

@@ -6,8 +6,8 @@ import { getExcelList } from '@store/actions/inspect';
 import Notify from '@commonComp/Notify';
 import store from '@store';
 import $ from 'jquery';
-import { host } from '@utils/config.js';
-import {isIE} from '@utils/tools.js';
+import { host,prefix } from '@utils/config.js';
+import {isIE,getUrlArgObject} from '@utils/tools.js';
 
 
 (function ($) {
@@ -27,9 +27,9 @@ import {isIE} from '@utils/tools.js';
 import "./dists/FileAPI.js";
 
 const isLocal = window.location.hostname.indexOf('localhost')!=-1;
-const qhost = isLocal?host:'';
+const qhost = isLocal?host+prefix:prefix;
 const api = {
-    upload: qhost+'/api/icss/lisExcelRes/lisExcelAnalysis'
+    upload: qhost+'/lisExcelRes/lisExcelAnalysis'
 };
 
 class Inspect extends React.Component {
@@ -78,13 +78,19 @@ class Inspect extends React.Component {
             },
             function (files, rejected){
                 if( files.length ){
-                    console.log(files[0])
+                    //console.log(files[0])
+                  const securityCode = getUrlArgObject("code");
+                  const appKeyId = getUrlArgObject("appI");
+                  const appKeySecret = getUrlArgObject("appS");
                     FileAPI.upload({
                         // url: '/api/icss/lisExcelRes/lisExcelAnalysis',
                         url: api.upload,
                         data:{ hospitalCode:baseData == '{}'? '' : baseData.hospitalCode },
                         files: { uploadfile: files[0] },
                         headers:{
+                          appKeyId:appKeyId,
+                          appKeySecret:appKeySecret,
+                          securityCode:securityCode
                             // 'Content-Type':'Content-Type: multipart/form-data'
                             // 'Content-Type':'application/json;charset=UTF-8'
                             // 'Content-type': "text/plain"
@@ -97,7 +103,7 @@ class Inspect extends React.Component {
                                 let message = res.data.messages;
                                 store.dispatch(getExcelList(res.data));
                                 fetchPushInfos&&fetchPushInfos();
-                                if (message.length != 0) {
+                                if (message&&message.length != 0) {
                                     that.setState({
                                         visible:true,
                                         dom:message,
@@ -106,6 +112,7 @@ class Inspect extends React.Component {
                                 }
                                 $("#choose").val("");
                             }else{
+                                let res = JSON.parse(xhr.response);
                                 Notify.error(res.msg)
                             }
                         }
@@ -145,9 +152,8 @@ class Inspect extends React.Component {
         return (
             <div className={styles.wrapper} >
                 {/* 导入功能插件,ie8/9权限问题暂未解决,先隐藏 */}
-
                 <div className={styles.top}>
-                    <span>化验结果数据</span>
+                    <span id="inspectResultData">化验结果数据</span>
                     <div className={this.getStyle()} onClick={ieVersion&&ieVersion<=9?null:this.handleImportExcel}>
                        {/* <button disabled={ieVersion&&ieVersion>9?true:false}>导入化验结果</button>*/}
                         <div className={styles.pushButton}>导入化验结果</div>

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

@@ -40,6 +40,7 @@
         line-height: 28px;
         border-radius: 5px;
         color: @template-color;
+        cursor: pointer;
     }
 }
 .title {

+ 41 - 34
src/components/MainSuit/index.jsx

@@ -49,11 +49,12 @@ class MainSuit extends Component{
 
 
   getInlineTag(){
-    const {datas,showArr,handleTailClick,selecteds,saveText,addModuleName,mainIds} = this.props;
+    const {datas,showArr,handleTailClick,selecteds,saveText,addModuleName,mainIds,allModules} = this.props;
     const boxMark = '1';
     let list = datas&&datas.map((item,i)=>{
       if(item.flag && item.flag==3){
-        return <TailInlineTag {...item} showText={addModuleName} handleTailClick={(obj)=>{handleTailClick(obj,saveText)}}></TailInlineTag>
+        /*return <TailInlineTag {...item} showText={addModuleName} handleTailClick={(obj)=>{handleTailClick(obj,saveText)}}></TailInlineTag>*/
+        return <TailInlineTag {...item} showText={item.relationModuleName} handleTailClick={(obj)=>{handleTailClick(obj,saveText,allModules)}}></TailInlineTag>
       }else {
         return chooseType({item,boxMark,i,hideTag:false,showArr,selecteds,saveText,mainIds});
       }
@@ -101,18 +102,23 @@ class MainSuit extends Component{
   }*/
 
   handleSelect(item){//选中的常见症状
-    const {clearCommS,insertMain,getData} = this.props;
-    // 获取主诉模板
-    getData && getData();
-    // 让模板出现
-    this.setState({
-        showModule:true,
-        symptom: false,
-      }) 
-    //选中后清空下拉结果
-    insertMain && insertMain(item);
-    clearCommS && clearCommS();
-    
+    if(item.select.length>0){
+      const {clearCommS,insertMain,getData} = this.props;
+      // 获取主诉模板
+      getData && getData();
+      // 让模板出现
+      this.setState({
+          showModule:true,
+          symptom: false,
+        }) 
+      //选中后清空下拉结果
+      insertMain && insertMain(item);
+      clearCommS && clearCommS();
+    }else{//没有选中点确定-关闭
+      this.setState({
+        symptom: false
+      })
+    } 
   }
 
 
@@ -126,7 +132,7 @@ class MainSuit extends Component{
       clearSearch && clearSearch();
       return
     }
-    clearTimeout(this.state.timer);
+    // clearTimeout(this.state.timer);
     if(datas.length==0){//没有使用模板时点击搜索结构要展开模板
       insertSearch &&insertSearch({item,span});
       this.setState({
@@ -175,7 +181,7 @@ class MainSuit extends Component{
 
   handleChange(e){
     const ev = e || window.event;
-    const data = ev.target.innerText;
+    const data = ev.target.innerText || ev.target.innerHTML;
     const {getSearchData,searchData,datas,pushMessage,reTotalHide,saveText} = this.props;
     const {overFlag,inpText} = this.state;
     reTotalHide && reTotalHide();//重置homePage中的控制项
@@ -183,11 +189,11 @@ class MainSuit extends Component{
     if(data&&data.length > config.limited){
       Notify.info(config.limitText);
       if(overFlag){
-        ev.target.innerText = inpText;
+        ev.target.innerText?(ev.target.innerText = inpText) : (ev.target.innerHTML = inpText);
         ev.target.blur();
         return
       }
-      ev.target.innerText = data.substr(0,config.limited);  //输入法内输入多个字再按enter的情况
+      ev.target.innerText?(ev.target.innerText = data.substr(0,config.limited)):(ev.target.innerHTML = data.substr(0,config.limited));  //输入法内输入多个字再按enter的情况
       ev.target.blur();
       
       this.setState({
@@ -217,7 +223,7 @@ class MainSuit extends Component{
     const timer = setTimeout(function(){
       pushMessage && pushMessage(data);
       //调搜索接口 使用模板走EditableSpan里的搜索方法
-      getSearchData && getSearchData({inpStr:data,boxMark:1});
+      getSearchData && getSearchData({inpStr:data,boxMark:1,itemType:0});
     },config.delayTime);
     this.setState({
       timer
@@ -226,12 +232,14 @@ class MainSuit extends Component{
   }
 
   handleBlur(e){//隐藏常见症状下拉、存自由输入的值
-    const {freeText,saveText,datas,clearSearch} = this.props;
+    const {freeText,saveText,datas,clearSearch,getSymptomFeature,currentData} = this.props;
     const that = this;
     let data = this.state.inpText;
     if(!isIE()){
-      e.target.innerText="";
-      e.target.innerHTML="";//兼容火狐43
+      if(currentData&&currentData.length==0){//现病史没有模板的时候才去获取
+        getSymptomFeature && getSymptomFeature(e.target.innerText);
+      } 
+      e.target.innerText?(e.target.innerText=""):(e.target.innerHTML="")
       freeText && freeText(data.trim());
     }else{
       if(datas.length==0){
@@ -242,17 +250,13 @@ class MainSuit extends Component{
       }
     }
     // 延时关闭常见症状下拉、清空搜索结果,不延时会影响选中
-      clearTimeout(this.state.clearTimer);
       const clearTimer = setTimeout(function(){
         clearSearch && clearSearch();
-        that.setState({
-          symptom:false
-        })
-      },config.delayTime-200);
-      this.setState({
-        clearTimer
-      });
-    
+        clearTimeout(clearTimer);
+        // that.setState({
+        //   symptom:false
+        // })
+      },config.delayTime-200); 
   }
 
 
@@ -261,11 +265,13 @@ class MainSuit extends Component{
     const {showModule,show,symptom,search} = this.state;
     const symptomFlag = CommonSymptoms.length>0 ? true : false;
     const searchFlag = searchData.length>0 ? true : false;
+    const boxTop1 = datas.length>0?boxTop:45;
+    const boxLeft1 = datas.length>0?boxLeft:85;
     if(+type===1){      //文本模式
       return <Textarea title='主诉' boxMark='1' isRead={isRead} value={saveText[0]} handlePush={fetchPushInfos} handleInput={handleInput} />;
     }
     return  <div className={`${'mainsuit-box'} ${style['main-suit']}`} id="mainsuitBox">
-      <ItemBox 
+      <ItemBox
       fuzhen={fuzhen} 
       title='主诉' 
       editable={editClear||datas.length==0?true:false} 
@@ -274,11 +280,12 @@ class MainSuit extends Component{
       onchange={(e)=>{this.handleChange(e)}} 
       handleClick={this.handleClick} 
       handleBlur={this.handleBlur}
-      data={datas}>
+      data={datas}
+      boxId="mainSuit">
         {datas.length>0?<div style={{display:'inline-block'}}>{this.getInlineTag()}</div>:(saveText[0]?saveText[0]:'')}
       </ItemBox>
       {/*没有推送结果就不显示*/}
-      {symptomFlag && !searchFlag ? <CommonSymptom data={CommonSymptoms} show={!totalHide&&symptom} onSelect={this.handleSelect} /> : ( searchFlag ? <SearchDrop data={searchData} show={!commSymHide} onSelect={this.handleSearchSelect} left={boxLeft} top={boxTop} />:"")}
+      {symptomFlag && !searchFlag ? <CommonSymptom data={CommonSymptoms} show={!totalHide&&symptom} onSelect={this.handleSelect} /> : ( searchFlag ? <SearchDrop data={searchData} show={!commSymHide} onSelect={this.handleSearchSelect} left={boxLeft1} top={boxTop1} mainEmpty={datas.length==0?true:false}/>:"")}
     </div>
   }
 }

+ 44 - 10
src/components/MultSpread/index.jsx

@@ -2,7 +2,9 @@ import React,{Component} from 'react';
 import classNames from 'classnames';
 import RadioDrop from "@containers/RadioDrop";
 import NumberDrop from "@containers/NumberDrop";
+import RadioInpDrop from "@containers/RadioInpDrop";
 import InlineTag from '@containers/InlineTag';
+import Multiple from '@containers/Multiple';
 import addIcon from '@images/addItem.png';
 import style from "./index.less";
 import tools from '@utils/tools';
@@ -39,18 +41,20 @@ class MultSpread extends Component{
     return classNames(isSelected,hasAdd);
   }
   getLabels(){
-    const {data,ikey,showArr,copyId} = this.props;
+    const {data,ikey,showArr,copyId,selecteds,boxMark} = this.props;
     const {editable}= this.state;
     let show = false;
     let inx = '';
     const list = data.map((it,i)=>{
       inx=ikey+''+i;
       show = editable?false:showArr&&showArr[inx];
-      switch (+it.controlType){
-        case 0:
-        case 1:
+      switch (true){
+        case +it.tagType===8:
+          return it.name;
+        case +it.controlType===1:
           const list = it.questionDetailList&&it.questionDetailList.length>0?it.questionDetailList:it.questionMapping;
           return <RadioDrop data={list}
+                            boxMark={boxMark}
                             prefix={it.labelPrefix}
                             suffix={it.labelSuffix}
                             placeholder={it.name}
@@ -60,7 +64,22 @@ class MultSpread extends Component{
                             id={it.id}
                             patId = {copyId}
                             hideTag={true}></RadioDrop>;
-        case 5://带单位数字键盘
+        case +it.controlType===2:
+          const dataList = it.questionDetailList&&it.questionDetailList.length>0?it.questionDetailList:it.questionMapping;
+          return <Multiple data={dataList}
+                           ikey={inx}
+                           placeholder={it.name}
+                           value={it.value}
+                           copyType={it.copyType}
+                           selecteds={selecteds ?selecteds[i]:[]}
+                           show={showArr&&showArr[inx]}
+                           order={it.textGenerate}
+                           type={boxMark}
+                           textPrefix={it.labelPrefix}
+                           textSuffix={it.labelSuffix}
+                           id={it.id}
+                           hideTag={true}></Multiple>;
+        case +it.controlType===5://带单位数字键盘
         return <NumberUnitDrop prefix={it.labelPrefix}
                                suffix={it.labelSuffix}
                                placeholder={it.name}
@@ -70,26 +89,41 @@ class MultSpread extends Component{
                                ikey={inx}
                                value={it.value}
                                hideTag={true}></NumberUnitDrop>;
-        case 3:
-        case 6:
+        case +it.controlType===3:
+        case +it.controlType===6:
           return <InlineTag prefix={it.labelPrefix}
                             suffix={it.labelSuffix}
                             placeholder={it.name}
                             value={it.value}
                             id={it.id}
                             ikey={inx} hideTag={true}></InlineTag>;
-        case 7:
+        case +it.controlType===7:
+          const min = data.minValue!=null&&data.minValue!=undefined?data.minValue-1:undefined;
+          const max = data.maxValue!=null&&data.maxValue!=undefined?+data.maxValue+1:undefined;
           return <NumberDrop prefix={it.labelPrefix}
                              suffix={it.labelSuffix}
                              placeholder={it.name}
+                             min={min}
+                             max={max}
                              show={show}
+                             allClick={false}
                              ikey={inx}
                              id={it.id}
                              patId = {copyId}
                              value={it.value}
                              hideTag={true}></NumberDrop>;
+        case +it.controlType===11:
+          return <RadioInpDrop data={it.questionDetailList}
+                             vals={it.vals}
+                             placeholder={it.name}
+                             show={showArr&&showArr[inx]}
+                             value = {it.value}
+                             boxMark={boxMark}
+                             id={it.id}
+                             ikey={inx}
+                             hideTag={true}></RadioInpDrop>;
         default:
-          return '';
+          return it.name;
       }
     });
     return list;
@@ -118,7 +152,7 @@ class MultSpread extends Component{
     this.setState({
       editable: false
     });
-    let totalVal = e.target.innerText;
+    let totalVal = e.target.innerText || e.target.innerHTML;
     saveEditText && saveEditText({ikey,type:'4',totalVal});
   }
   componentDidMount(){

+ 10 - 9
src/components/Multiple/index.jsx

@@ -40,15 +40,16 @@ class Multiple extends react.Component{
   }
 
   getClass(){
-    if(this.props.show){
+    const {show,value,hideTag} = this.props;
+    if(show){
       $(this.$div.current).addClass(style['borderd']);
     }else{
       $(this.$div.current).removeClass(style['borderd']);
     }
-    if(this.props.value){
-      return style['selected-tag'];
+    if(value){
+      return hideTag?style['hide-tag']:style['selected-tag'];
     }
-    return style['tag'];
+    return hideTag?'':style['tag'];
   }
 
   getListClass(){
@@ -99,7 +100,7 @@ class Multiple extends react.Component{
 
   changeToEdit(e){//双击
     const {value,id,placeholder,handleDbclick,handleHide} = this.props;
-    let text = e.target.innerText;
+    let text = e.target.innerText || e.target.innerHTML;
     handleHide&&handleHide();       //展开情况下双击收起
     // clearTimeout(this.state.timer);//取消延时的单击事件
     e.stopPropagation();
@@ -135,11 +136,11 @@ class Multiple extends react.Component{
     const {labelVal,editable} = this.state;
     let mainText = filterDataArr(mainSaveText);//主诉字数
     if(editable){//避免IE中点击标签也会触发
-      let val = e.target.innerText;
+      let val = e.target.innerText || e.target.innerHTML;
       if(+type==1){// 主诉字数达到上限时不允许输入
         if(mainText.length >= config.limited){
           if(val.length > labelVal.length){
-            e.target.innerText = labelVal;
+            e.target.innerText?(e.target.innerText = labelVal):(e.target.innerHTML = labelVal);
             Notify.info(config.limitText);
             return
           }else if(val.length == labelVal.length){
@@ -161,9 +162,9 @@ class Multiple extends react.Component{
     const ev = e || window.event;
     if(editable){
       // 更改标签的value值
-      let changeVal = ev.target.innerText;
+      let changeVal = ev.target.innerText || e.target.innerHTML;
       if(!isIE()){
-        e.target.innerText = '';      //避免出现重复输入值
+        e.target.innerText?(e.target.innerText = ''):(e.target.innerHTML='');      //避免出现重复输入值
       }
       handleLabelChange && handleLabelChange({ikey,changeVal,type});
     }

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

@@ -16,6 +16,11 @@
   border-bottom: 1px @border-color solid;
   line-height: 22px;
 }
+.hide-tag{
+  padding: 0;
+  color: @text-color;
+  line-height: 22px;
+}
 .list{
   .pop;
   padding: 0 0 10px;

+ 136 - 24
src/components/NumberDrop/index.jsx

@@ -1,6 +1,6 @@
 import React,{Component} from 'react';
 import className from 'classnames';
-import {NumberPan} from '@commonComp';
+import {NumberPan,Notify} from '@commonComp';
 import style from './index.less';
 import $ from "jquery";
 import {handleEnter,getPageCoordinate} from '@utils/tools.js';
@@ -11,6 +11,7 @@ import {handleEnter,getPageCoordinate} from '@utils/tools.js';
  * placeholder:灰显文字
  * handleSelect: 选中事件
  * show: 是否显示下拉
+ * allClick:是否前后缀也可唤出数字键盘
  *
  * ***/
 class NumberDrop extends Component{
@@ -19,11 +20,13 @@ class NumberDrop extends Component{
     this.state={
       editable:false,      //标签是否可输入
       timer:null,
+      sltTimer:null,
       hasSelect:false,       //是否点过下拉键盘
       boxLeft:0,
       boxTop:0,
       tmpTop:0,
-      tmpScroll:0
+      tmpScroll:0,
+      placeholder:props.placeholder
     };
     this.$span = React.createRef();
     this.$pre = React.createRef();
@@ -36,18 +39,61 @@ class NumberDrop extends Component{
     this.handleNumFocus = this.handleNumFocus.bind(this);
     this.handleBlur = this.handleBlur.bind(this);
     this.changeToEdit = this.changeToEdit.bind(this);
+    //this.handleKeyDowm = this.handleKeyDowm.bind(this);
+    this.beyondArea = this.beyondArea.bind(this);
   }
   select(text){        //选中键盘上数字事件
+    let timer = null;
+    clearTimeout(this.state.sltTimer);
+    const {handleSelect,ikey,suffix,prefix,mainSaveText,min,max} = this.props;
+    const needCompare=min!=undefined&&max!=undefined;
+    if(!text){
+      this.setState({
+        placeholder:this.props.placeholder
+      });
+    }else{
+      if(needCompare){
+        const that = this;
+        const isFine = this.validSymbols(text,min,max);      //有~或/时是否合理
+        const hasSymbol = /[\/|\~]/g.test(text);           //是否有~或/
+        const singleFine = !isNaN(+text)&&min<text&&text<max;   //无~或/时是否合理
+        timer = setTimeout(function(){
+          clearTimeout(that.state.sltTimer);
+          if(text!=''&&(!hasSymbol&&!singleFine)||(hasSymbol&&!isFine)){
+            that.beyondArea();
+            return;
+          }
+        },1500);
+      }
+      this.setState({
+        hasSelect:true,
+        sltTimer:timer
+      });
+    }
+
+    handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
+  }
+  beyondArea(){
     const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
+    Notify.info("输入数值不符合规范,请重新输入!");
+    handleSelect&&handleSelect({ikey,text:'',suffix,prefix,mainSaveText});
     this.setState({
-      hasSelect:true
+      placeholder:this.props.placeholder,
+      hasSelect:false
     });
-    handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
   }
   handleNumFocus(e){       //数字框可编辑状态下聚集事件,处理是否显示下拉等
+    const {placeholder} = this.state;
+    const val = e.target.innerText.trim();
+    //console.log(33,e.target.innerText,placeholder,e.target.innerText.trim() == placeholder)
+    if(val!=''&&val == placeholder){
+      this.setState({
+        placeholder:''
+      });
+    }
     e.stopPropagation();
   }
-  handleNumClick(e){      //数字框不可编辑的状态时点击事件,点击将数字框变为可输入且下拉不再显示直到失焦后再次聚集
+  handleNumClick(e){     //数字框不可编辑的状态时点击事件,点击将数字框变为可输入且下拉不再显示直到失焦后再次聚集
     const {show,handleShow,ikey,id,patId,handleHide,value} = this.props;
     if(show) {
       handleHide && handleHide();
@@ -61,6 +107,11 @@ class NumberDrop extends Component{
       //双击时不显示下拉
       clearTimeout(that.state.timer);
       const timer = setTimeout(function(){
+        //只有弹窗关闭则点击数字键盘会清空当前数据
+        that.$span.current.focus();
+        that.setState({
+          hasSelect:false
+        });
         handleShow&&handleShow({ikey,id:patId||id});
       },300);
       this.setState({
@@ -79,18 +130,60 @@ class NumberDrop extends Component{
     }
     e.stopPropagation();
   }
+  validSymbols(txt,min,max){
+    //输入只有一个~或/时判断两边是否为合理数字,有多个为不合理
+    const index1 = txt.indexOf('~');
+    const index2 = txt.indexOf('/');
+    const needCompare = min!=undefined&&max!=undefined;
+    let arr1=[],arr2=[];
+    if(index1!=-1&&index1==txt.lastIndexOf('~')&&index1!=txt.length-1){   //有且只有一个~,且不在最后
+      arr1 = txt.split('~');
+      //~的范围在合理范围内为合理值
+      if(!isNaN(+arr1[0])&&!isNaN(+arr1[1])&&((!needCompare)||(needCompare&&min<arr1[0]&&arr1[0]<max&&min<arr1[1]&&arr1[1]<max))){
+        return true
+      }
+      return false;
+    }
+    if(index2!=-1&&index2==txt.lastIndexOf('/')&&index2!=txt.length-1){   //有且只有一个~,且不在最后
+      arr2 = txt.split('/');
+      // /两边的数字分别在合理范围内为合理值
+      if(!isNaN(+arr2[0])&&!isNaN(+arr2[1])&&((!needCompare)||(needCompare&&min<arr2[0]&&arr2[0]<max&&min<arr2[1]&&arr2[1]<max))){
+        return true
+      }
+      return false;
+    }
+    return false;
+  }
   numInpBlur(e){        //数字框失焦,保存值到store中
     e.stopPropagation();
-    if(this.props.show){      //修改清空后第一次点击键盘不触发click事件bug
+    const {handleSelect,ikey,suffix,prefix,mainSaveText,min,max,show} = this.props;
+    if(show){      //修改清空后第一次点击键盘不触发click事件bug
       return;
     }
-    this.setState({
-      hasSelect:false
-    });
-    const val = e.target.innerText.replace(/^\s*/,'');
-    const {handleSelect,ikey,suffix,prefix,mainSaveText,placeholder} = this.props;
-    const text = val===placeholder?'':val;
-    e.target.innerText = '';      //避免出现重复输入值
+    //输入超出合理范围或输入不是数字提示且清空
+    const needCompare=min!=undefined&&max!=undefined;
+    //if(needCompare){
+      const txt = e.target.innerText.trim();
+      const isFine = this.validSymbols(txt,min,max);      //有~或/时是否合理
+      const hasSymbol = /[\/|\~]/g.test(txt);           //是否有~或/
+      const singleFine = (!isNaN(+txt)&&!needCompare)||(!isNaN(+txt)&&needCompare&&min<txt&&txt<max);   //无~或/时是否合理
+      if(txt!=''&&(!hasSymbol&&!singleFine)||(hasSymbol&&!isFine)){
+        this.beyondArea();
+        return;
+      }
+    //}
+
+    //输入为空时显示placeholder
+    if(!e.target.innerText.trim()){
+      this.setState({
+        placeholder:this.props.placeholder
+      });
+    }
+
+    const val = e.target.innerText.trim();
+    const {placeholder} = this.state;
+    let text = val===placeholder?'':val;
+    //e.target.innerText = '';      //避免出现重复输入值
     handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
   }
   handleSpanInp(e){   //数字框输入事件
@@ -98,10 +191,23 @@ class NumberDrop extends Component{
     const {handleHide} = this.props;
     handleHide&&handleHide();
   }
+  /*handleKeyDowm(e){
+    handleEnter();
+    //只能输入数字
+    const key = e.key;
+    const ctrlOn = e.ctrlKey;
+    const isCopyPaste = ctrlOn&&(key=='v'||key=='c');
+    if((!/[0-9|.|~|\/]/.test(key)&&key.length==1&&!isCopyPaste)){
+      e.preventDefault();
+      return false;
+    }
+  }*/
   getClasses(){         //整个标签是否有值的状态
-    const {value,hideTag,placeholder} = this.props;
+    const {hideTag,placeholder,value} = this.props;
+    const $span = this.$span.current;
+    const val = value;//$span&&$span.innerText.trim()||value;
     const blueBorder = this.state.editable?style['blue-border']:'';
-    const isSelected = value&&value!=placeholder?style['selected']:style['container'];
+    const isSelected = val&&val!=placeholder?style['selected']:style['container'];
     const noTag = hideTag?style['no-tag']:'';
     return className(isSelected,noTag,blueBorder);
   }
@@ -129,10 +235,10 @@ class NumberDrop extends Component{
     this.setState({
       editable: false
     });
-    let totalVal = e.target.innerText;
-    let changeVal = this.$span.current.innerText.replace(/^\s*/,'');//数字框值-修改后;去掉前空格避免多空格叠加
-    let prefix = this.$pre.current.innerText.replace(/^\s*/,''); //前缀值-修改后
-    let suffix = this.$suf.current.innerText.replace(/^\s*/,''); //后缀值-修改后
+    let totalVal = e.target.innerText.trim();
+    let changeVal = this.$span.current.innerText.trim();//数字框值-修改后;去掉前空格避免多空格叠加
+    let prefix = this.$pre.current.innerText.trim(); //前缀值-修改后
+    let suffix = this.$suf.current.innerText.trim(); //后缀值-修改后
     //console.log('数字框:'+changeVal,";全部:"+totalVal,";前缀:"+prefix+";后缀:"+suffix);
     handleLabelChange && handleLabelChange({ikey,changeVal,type:boxMark,totalVal,prefix,suffix});
   }
@@ -141,25 +247,31 @@ class NumberDrop extends Component{
     const cls = this.props.show?style['blued']:'';
     return cls;
   }
+  componentDidMount(){
+    //设置最小宽度避免输入后宽度跳动
+    const spanWidth = window.getComputedStyle(this.$span.current).width;
+    this.$span.current.style.minWidth=spanWidth;
+  }
   render(){
-    const {placeholder,prefix,suffix,show,value,handleHide} = this.props;
-    const {numEditable,editable,hasSelect,boxTop,boxLeft} = this.state;
+    const {prefix,suffix,show,value,handleHide,allClick} = this.props;
+    const {numEditable,placeholder,editable,hasSelect,boxTop,boxLeft} = this.state;
     return <div className={this.getClasses()}
                 ref={this.$cont}
                 onDoubleClick={this.changeToEdit}
+                onClick={allClick?this.handleNumClick:null}
                 contentEditable={editable}
                 onBlur={this.handleBlur}
                 onkeydown={handleEnter}>
       <span ref = {this.$pre}>&nbsp;{prefix}</span>
       <span onFocus={this.handleNumFocus}
-            onClick={this.handleNumClick}
+            onClick={allClick?null:this.handleNumClick}
             contentEditable={true}
-            style={{minWidth:'10px',display:'inline-block'}}
+            style={{minWidth:'10px',display:'inline-block',textAlign:'center'}}
             ref = {this.$span}
             onBlur={this.numInpBlur}
             onInput={this.handleSpanInp}
             className={this.getSpanClass()}
-            onkeydown={handleEnter}>&nbsp;{value||placeholder}</span>
+            >&nbsp;{value||placeholder}</span>
       <span ref = {this.$suf}>&nbsp;{suffix}</span>
       <NumberPan handleSelect={(text)=>this.select(text)}
                  onClose={handleHide}

+ 41 - 24
src/components/NumberUnitDrop/index.jsx

@@ -33,6 +33,8 @@ class NumberUnitDrop extends Component{
       tmpScroll:0
     };
     this.$span = React.createRef();
+    this.$pre = React.createRef();
+    this.$suf = React.createRef();
     this.$cont = React.createRef();
     this.select = this.select.bind(this);
     this.numInpBlur = this.numInpBlur.bind(this);
@@ -40,17 +42,17 @@ class NumberUnitDrop extends Component{
     this.handleNumClick = this.handleNumClick.bind(this);
     this.changeToEdit = this.changeToEdit.bind(this);
   }
-  select(text){         //选中键盘上数字事件
-    const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
+  select(obj){         //选中键盘上数字事件
+    const {handleSelect,ikey,suffix,prefix,mainSaveText,formulaCode,mainData} = this.props;
     this.setState({
       hasSelect:true
     });
-    if(!text){
+    if(!obj.text){
       this.setState({
         value:''
       });
     }
-    handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
+    handleSelect&&handleSelect({ikey,text:obj.text,suffix,prefix,mainSaveText,mark:obj.mark,formulaCode,mainData});
   }
   
   handleNumClick(e){ 
@@ -85,13 +87,20 @@ class NumberUnitDrop extends Component{
   //数字框失焦,保存值到store中
   numInpBlur(e){
     e.stopPropagation();
-    const {handleSelect,ikey,suffix,prefix,mainSaveText,handleLabelChange,boxMark} = this.props;
+    // const {handleSelect,ikey,suffix,prefix,mainSaveText,handleLabelChange,boxMark,formulaCode} = this.props;
+    const {handleSelect,ikey,mainSaveText,handleLabelChange,boxMark,formulaCode} = this.props;
     const {editable} = this.state;
     if(editable){
-      const text = e.target.innerText;
+      // const text = e.target.innerText || e.target.innerHTML;
       // this.$span.current.innerText='';      //修改生成文字变成输入的2倍bug 
+      let totalVal = e.target.innerText|| e.target.innerHTML;
+      let changeVal = this.$span.current.innerText.replace(/^\s*/,'');//数字框值-修改后;去掉前空格避免多空格叠加
+      let prefix = this.$pre.current.innerText.replace(/^\s*/,''); //前缀值-修改后
+      let suffix = this.$suf.current.innerText.replace(/^\s*/,''); //后缀值-修改后
+      // console.log('数字框:'+changeVal,";全部:"+totalVal,";前缀:"+prefix+";后缀:"+suffix);
+      handleLabelChange && handleLabelChange({ikey,changeVal,type:boxMark,totalVal,prefix,suffix,formulaCode});
       // handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
-      handleLabelChange&&handleLabelChange({ikey,changeVal:text,suffix,prefix,mainSaveText,type:boxMark});
+      // handleLabelChange&&handleLabelChange({ikey,changeVal:text,suffix,prefix,mainSaveText,type:boxMark,formulaCode});
       
     }
     this.setState({
@@ -110,11 +119,11 @@ class NumberUnitDrop extends Component{
     const {labelVal,editable} = this.state;
     let mainText = filterDataArr(mainSaveText);//主诉字数
     if(editable){//避免IE中点击标签也会触发
-      let val = e.target.innerText;
+      let val = e.target.innerText || e.target.innerHTML;
       if(+boxMark==1){
         if(mainText.length >= config.limited){
           if(val.length > labelVal.length){
-            e.target.innerText = labelVal;
+            e.target.innerText?(e.target.innerText = labelVal):(e.target.innerHTML = labelVal);
             Notify.info(config.limitText);
             return
           }else if(val.length == labelVal.length){
@@ -143,9 +152,13 @@ class NumberUnitDrop extends Component{
   }
   changeToEdit(e){        //整个标签双击编辑状态
     e.stopPropagation();
-    const {value,id,handleDbclick,patId} = this.props;
-    const text = e.target.innerText;
-    // clearTimeout(this.state.timer);//取消延时的单击事件
+    const {value,id,handleDbclick,patId,handleHide,show} = this.props;
+    const text = e.target.innerText || e.target.innerHTML;
+    clearTimeout(this.state.timer);//取消延时的单击事件
+    e.preventDefault();
+    if(show){
+      handleHide&&handleHide();
+    }
     if(value&&value.trim()) {//有选中值的标签才能双击编辑
       this.setState({
         editable: true,
@@ -153,7 +166,8 @@ class NumberUnitDrop extends Component{
       });
       //失焦关闭编辑状态
       setTimeout(()=>{
-        e.target.focus();
+        // e.target.focus();
+        this.$cont.current.focus();
       })
       //双击埋点记录
       handleDbclick && handleDbclick({id:patId||id});
@@ -161,7 +175,8 @@ class NumberUnitDrop extends Component{
   }
   componentDidMount(){
     if(isIE()){
-      $(this.$span.current).onIe8Input(function(e){
+      // $(this.$span.current).onIe8Input(function(e){
+      $(this.$cont.current).onIe8Input(function(e){
         this.handleSpanInp(e)
       },this);
     }
@@ -170,18 +185,20 @@ class NumberUnitDrop extends Component{
   render(){
     const {placeholder,prefix,suffix,show,value,handleHide} = this.props;
     const {numEditable,editable,hasSelect,placeholderFlag,boxLeft,boxTop} = this.state;
-    return <div className={this.getClasses()} ref={this.$cont}>
-      <span>{prefix}</span>
-      <span onClick={this.handleNumClick}
-            contentEditable={editable}
-            ref = {this.$span}
-            onBlur={this.numInpBlur}
-            onInput={this.handleSpanInp}
-            onDoubleClick={this.changeToEdit}
+    return <div className={this.getClasses()}
+                ref={this.$cont}
+                onClick={this.handleNumClick}
+                contentEditable={editable}
+                onBlur={this.numInpBlur}
+                onDoubleClick={this.changeToEdit}
+                onkeydown={handleEnter}
+                onInput={this.handleSpanInp}>
+      <span ref = {this.$pre}>{prefix?prefix+' ':prefix}</span>
+      <span ref = {this.$span}
             onkeydown={handleEnter}
             style={{cursor:editable?'text':'pointer'}}>{value||placeholder}</span>
-      <span>{suffix}</span>
-      <NumberUnitPan handleSelect={(text)=>this.select(text)}
+      <span ref = {this.$suf}>{suffix?' '+suffix:suffix}</span>
+      <NumberUnitPan handleSelect={(obj)=>this.select(obj)}
                  onClose={handleHide}
                  top={boxTop}
                  left={boxLeft}

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

@@ -17,4 +17,4 @@
 .blued{
   background: @blue;
   color: #fff;
-}
+}

+ 45 - 26
src/components/Operation/index.jsx

@@ -84,7 +84,7 @@ class Operation extends Component {
   keepHistory(){
     let baseList = store.getState();
     let jsonStr = getAllDataStringList(baseList);
-    console.log(jsonStr)
+    // console.log(jsonStr)
     if(filterDataArr(JSON.parse(jsonStr.chief)) == ''){
         Notify.info('主诉不能为空');
         return false;
@@ -166,33 +166,52 @@ class Operation extends Component {
       return false
     }
     console.log(jsonStr,'文本')
-    console.log(jsonData.chief,'结构')       //测试需要用到,不要删了
+    console.log(jsonData,'结构')       //测试需要用到,不要删了
     for(let i = 0;i <tmpLis.length;i++){
       let dataStr = tmpLis[i].preview;
       let dataJson = tmpLis[i].dataJson;
-      // console.log(JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')),111)
-      // console.log(JSON.stringify(jsonData.other) )
-      if(
-        jsonStr.chief == JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')) && 
-        jsonStr.present == JSON.stringify(eval('('+JSON.parse(dataStr).present+')')) && 
-        jsonStr.other == JSON.stringify(eval('('+JSON.parse(dataStr).other+')')) && 
-        jsonStr.vital == JSON.stringify(eval('('+JSON.parse(dataStr).vital+')'))  &&
-        JSON.stringify(jsonData.chief) == JSON.stringify(JSON.parse(dataJson).chief) &&    
-        JSON.stringify(jsonData.present) == JSON.stringify(JSON.parse(dataJson).present)  &&     
-        whichSign == 1?true:JSON.stringify(jsonData.other) == JSON.stringify(JSON.parse(dataJson).other) &&      
-        JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(dataJson).vital) && 
-        JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(dataJson).lis) &&  
-        JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(dataJson).pacs) &&     
-        JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
-        JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&    
-        JSON.stringify(jsonData.mainSuitSelecteds) == JSON.stringify(JSON.parse(dataJson).mainSuitSelecteds) &&      
-        JSON.stringify(jsonData.currentIllSelecteds) == JSON.stringify(JSON.parse(dataJson).currentIllSelecteds) &&     
-        JSON.stringify(jsonData.otherHistorySelecteds) == JSON.stringify(JSON.parse(dataJson).otherHistorySelecteds) && 
-        JSON.stringify(jsonData.checkBodySelecteds) == JSON.stringify(JSON.parse(dataJson).checkBodySelecteds) &&     
-        JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
-      ){
-        Notify.info('该模板已保存');
-        return false;
+      // console.log(jsonStr.chief , JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')))
+      // console.log(jsonData.chief , JSON.parse(dataJson).chief)
+      if(whichSign == 0){
+        if(
+          jsonStr.chief == JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')) && 
+          jsonStr.present == JSON.stringify(eval('('+JSON.parse(dataStr).present+')')) && 
+          jsonStr.other == JSON.stringify(eval('('+JSON.parse(dataStr).other+')')) && 
+          jsonStr.vital == JSON.stringify(eval('('+JSON.parse(dataStr).vital+')'))  &&
+          JSON.stringify(jsonData.chief) == JSON.stringify(JSON.parse(dataJson).chief) &&    
+          JSON.stringify(jsonData.present) == JSON.stringify(JSON.parse(dataJson).present)  &&     
+          JSON.stringify(jsonData.other) == JSON.stringify(JSON.parse(dataJson).other) &&
+          JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(dataJson).vital) && 
+          JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(dataJson).lis) &&  
+          JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(dataJson).pacs) &&     
+          JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
+          JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&    
+          JSON.stringify(jsonData.mainSuitSelecteds) == JSON.stringify(JSON.parse(dataJson).mainSuitSelecteds) &&      
+          JSON.stringify(jsonData.currentIllSelecteds) == JSON.stringify(JSON.parse(dataJson).currentIllSelecteds) &&     
+          JSON.stringify(jsonData.otherHistorySelecteds) == JSON.stringify(JSON.parse(dataJson).otherHistorySelecteds) && 
+          JSON.stringify(jsonData.checkBodySelecteds) == JSON.stringify(JSON.parse(dataJson).checkBodySelecteds) &&     
+          JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
+        ){
+          Notify.info('该模板已保存');
+          return false;
+        }
+
+      }else if(whichSign == 1){
+        if(
+          jsonStr.chief == JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')) && 
+          jsonStr.present == JSON.stringify(eval('('+JSON.parse(dataStr).present+')')) && 
+          jsonStr.other == JSON.stringify(eval('('+JSON.parse(dataStr).other+')')) && 
+          jsonStr.vital == JSON.stringify(eval('('+JSON.parse(dataStr).vital+')'))  &&
+          JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(dataJson).vital) && 
+          JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(dataJson).lis) &&  
+          JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(dataJson).pacs) &&     
+          JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
+          JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&        
+          JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
+        ){
+          Notify.info('该模板已保存');
+          return false;
+        }
       }
     }
     return true;
@@ -327,4 +346,4 @@ class Operation extends Component {
   }
 }
 
-export default Operation;
+export default Operation;

+ 0 - 2
src/components/OtherHistory/index.jsx

@@ -40,13 +40,11 @@ class OtherHistory extends Component{
   getData(){
     //第一次聚焦其他史时,主诉有数据则获取最近一次其他史记录(没有的话显示初始模板),主诉无数据则显示提示;其他时间其他史模板数据不调接口
     const {hasMain,type,setInitData,isEmpty} = this.props;
-    console.log(isEmpty)
     //无主诉提示在EditableSpan里
     //智能模式有主诉或者文本模式获取最近历史
     if((+type===0&&hasMain&&isEmpty!=false)||(+type===1&&isEmpty!=false)){
       setInitData();
     }
-
   }
   handleClick(e){//让搜索框跟随鼠标点击移动
     //e.stopPropagation();

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

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

+ 52 - 22
src/components/PreviewBody/index.jsx

@@ -1,8 +1,9 @@
 import React, { Component } from "react";
 import style from "./index.less";
-import { normalVal, filterDataArr } from '@utils/tools';
+import { normalVal, filterDataArr, filterOtherDataArr,timestampToTime } from '@utils/tools';
 import Notify from '@commonComp/Notify';
 import $ from "jquery";
+import { relative } from "path";
 
 (function ($) {
   var opt;
@@ -128,9 +129,22 @@ class PreviewBody extends Component {
       return <td style={{ width: '16%', fontSize: '12px' }}><span style={{ color: (val.value - 0).toString() == 'NaN' ? "red" : (val.maxValue || val.minValue) ? (val.value > val.maxValue || val.value < val.minValue ? "red" : null) : null }}>{val.value}</span> {val.labelSuffix}</td>
     }
   }
+
+  toTime(time){
+    let tmpTim = time.split(',').join('')-0
+    if(time && tmpTim.toString() != 'NaN'){
+      let date = new Date('1900-01-01');
+      let dateTim = date.getTime();
+      let times = (tmpTim-2)*24*60*60*1000;
+      let result = timestampToTime(dateTim+times).split(' ')[0]
+      return result;
+    }else{
+      return time;
+    }
+  }
   render() {
     const { show, preInfo, dataJson, dataStr, baseObj, flg } = this.props;
-
+    const other_yjs = filterOtherDataArr(JSON.parse(dataStr.other),dataJson.other);
     return <div className={style['content']} style={{ width: flg ? '700' : '820' }}>
       <div className={style['contents']} id="content" style={{ margin: "0 auto", maxWidth: "600px" }}>
         <div ref={this.$content} style={{ clear: 'both', fontSize: '24px', margin: '0px 0px 30px 0px', textAlign: 'center' }}>{preInfo.hospitalName}</div>
@@ -151,7 +165,7 @@ class PreviewBody extends Component {
         <table style={{ width: "100%", borderCollapse: 'collapse' }}>
           <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
             <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px',width:'70px' }}>主诉:</td>
-            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px',wordBreak:"break-word" }}>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px',wordBreak:"break-all" }}>
               {
                 filterDataArr(JSON.parse(dataStr.chief))
               }
@@ -159,7 +173,7 @@ class PreviewBody extends Component {
           </tr>
           <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
             <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px',width:'70px' }}>现病史:</td>
-            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px',wordBreak:"break-word" }}>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px',wordBreak:"break-all" }}>
               {
                 filterDataArr(JSON.parse(dataStr.present))
               }
@@ -167,15 +181,29 @@ class PreviewBody extends Component {
           </tr>
           <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
             <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px',width:'70px' }}>其他史:</td>
-            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px',wordBreak:"break-word" }}>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px',wordBreak:"break-all" }}>
               {
-                filterDataArr(JSON.parse(dataStr.other))
+                other_yjs.str1
+              }
+              {dataJson['yjs_1']||dataJson['yjs_2']||dataJson['yjs_3']||dataJson['yjs_4']?<table style={{textAlign:'center',verticalAlign: 'middle',display:'inline-block'}}>
+                <tr>
+                  <td rowSpan='2' style={{verticalAlign: 'middle'}}>月经史:(</td>
+                  <td rowSpan='2' style={{verticalAlign: 'middle'}}>{dataJson['yjs_1']||'初潮年龄'}</td>
+                  <td style={{borderBottom:'1px solid #000'}}>{dataJson['yjs_2']||'行经天数'}</td>
+                  <td rowSpan='2' style={{verticalAlign: 'middle'}}>{dataJson['yjs_4']||'停经时间'})</td>
+                </tr>
+                <tr>
+                  <td style={{textAlign:'center'}}>{dataJson['yjs_3']||'周期'}</td>
+                </tr>
+              </table>:''}
+              {
+                other_yjs.str2
               }
             </td>
           </tr>
           <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
             <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px',width:'70px' }}>查体:</td>
-            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px',wordBreak:"break-word" }}>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px',wordBreak:"break-all" }}>
               {
                 filterDataArr(JSON.parse(dataStr.vital))
               }
@@ -183,7 +211,7 @@ class PreviewBody extends Component {
           </tr>
           <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
             <td style={{ width: 70, textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px',width:'70px' }}>化验:</td>
-            <td style={{ fontSize: '14px', padding: '4px 0px 8px 0px', lineHeight: '20px', maxWidth: '650px',wordBreak:"break-word" }}>
+            <td style={{ fontSize: '14px', padding: '4px 0px 8px 0px', lineHeight: '20px', maxWidth: '650px',wordBreak:"break-all" }}>
               {
                 dataJson.lis.getExcelDataList && dataJson.lis.getExcelDataList.map((items) => {
                   return items.lisExcelRes && items.lisExcelRes.map((item) => {
@@ -197,7 +225,8 @@ class PreviewBody extends Component {
                             <td style={{ width: '24%', fontSize: '12px' }}>
                               {normalVal(value.min, value.max)}
                             </td>
-                            <td style={{ width: '28%', fontSize: '12px' }}>{value.time == '' ? ('导入时间: ' + this.state.dateTime) : '化验时间: ' + value.time}</td>
+                            <td style={{ width: '28%', fontSize: '12px' }}>{value.time == '' ? ('导入时间: ' + this.state.dateTime) : '化验时间: ' + this.toTime(value.time)
+                          }</td>
                           </tr>
                         })
                       }
@@ -207,9 +236,12 @@ class PreviewBody extends Component {
               }
               {
                 dataJson.lis.labelList && dataJson.lis.labelList.map((item, idx) => {
-                  if (item.show) {
+                  // if (item.show) {
                     return <table style={{ margin: '8px 0', width: '100%' }}>
-                      <tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ borderBottom: '1px solid #666666' }}>{item.name}</span></td></tr>
+                      {
+                        item.show?<tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ borderBottom: '1px solid #666666' }}> {item.name} </span></td></tr>:
+                        <tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ position:'relative',left:'-10px' }}>「{item.name}」</span></td></tr>
+                      }
                       {
                         item.details.map((val) => {
                           if (val.value && val.value != '') {
@@ -225,7 +257,7 @@ class PreviewBody extends Component {
                         })
                       }
                     </table>
-                  }
+                  // }
                 })
               }
             </td>
@@ -235,7 +267,7 @@ class PreviewBody extends Component {
             <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
               {
                 dataStr.pacs && dataStr.pacs != '' && dataStr.pacs.split(';').map((item) => {
-                  return <div style={{ fontSize: '14px',wordBreak:"break-word" }}>{item}</div>
+                  return <div style={{ fontSize: '14px',wordBreak:"break-all" }}>{item}</div>
                 })
               }
             </td>
@@ -253,14 +285,9 @@ class PreviewBody extends Component {
           <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
             <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px',width:'70px' }}>医嘱:</td>
             <td style={{ fontSize: '14px', padding: '1px 0px 8px 0px', lineHeight: '20px' }}>
+              {dataJson.advice.commontreatment && dataJson.advice.commontreatment.length > 0 && <p style={{ fontSize: '14px', marginBottom: '8px', marginTop: '8px' }}><span>一般治疗</span></p>}
               {
-                dataJson.advice.assay && dataJson.advice.assay.length > 0 || dataJson.advice.check && dataJson.advice.check.length > 0 ? <p style={{ fontSize: '14px', marginBottom: "8px" }}><span>开单项目</span></p> : ''
-              }
-              {
-                dataJson.advice.assay && <div style={{ padding: '0px 0px 5px 0px' }}>{dataJson.advice.assay}</div>
-              }
-              {
-                dataJson.advice.check && <div style={{ padding: '0px 0px 5px 0px' }}>{dataJson.advice.check}</div>
+                dataJson.advice.commontreatment && <div style={{ padding: '0px 0px 5px 0px',wordBreak:"break-all" }}>{dataJson.advice.commontreatment}</div>
               }
               {dataJson.advice.scheme && dataJson.advice.scheme.length > 0 && <p style={{ fontSize: '14px', marginBottom: '8px', marginTop: '8px' }}><span>治疗方案</span></p>}
               {
@@ -268,8 +295,11 @@ class PreviewBody extends Component {
                   return <p>{item.treatment.map((it, ii) => {
                     return (it.treatmentStr && it.treatmentStr.length > 0 ?
                       <div style={{ padding: '0px 0px 5px 0px' }}>{it.treatmentStr}</div> : '')
-                  })}</p>
-                })
+                    })}</p>
+                  })
+              }
+              {
+                dataJson.advice.adviceInput && <div style={{ padding: '0px 0px 5px 0px',wordBreak:"break-all" }}>{dataJson.advice.adviceInput}</div>
               }
             </td>
           </tr>

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

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

+ 16 - 13
src/components/PushItems/DetailsModal/index.jsx

@@ -3,6 +3,7 @@ import styles from "./index.less";
 import NewPortal from './NewPortal'
 import close from "./../img/close.png";
 import $ from "jquery";
+import { imageUrlPrefix } from '@utils/config.js';
 class DetailsModal extends Component {
     constructor(props) {
         super(props);
@@ -50,7 +51,6 @@ class DetailsModal extends Component {
     render() {
         const {showTipsDetails, tipsDetails} = this.props;
         const { currentIndex } = this.state
-        const imageUrlPrefix = 'http://192.168.2.241:82'; //图片服务器地址
         return (<NewPortal visible={showTipsDetails}>
         <div className={styles['details-wrapper']}>
            <div className={styles['details-content-wrapper']}>
@@ -67,20 +67,23 @@ class DetailsModal extends Component {
                     })}
                     
                 </div>
-                <div className={styles['content-menu']}>
-                    {tipsDetails && tipsDetails.introduceDetailList && tipsDetails.introduceDetailList.map((item, index) => {
-                            return (<div>
-                                <div className={styles['details-menu-title-box']}>
-                                    {index === 0 ? '' : <div className={styles['details-content-menu-line']}></div>}
-                                    <span onClick={this.handleClickMenu.bind(this, index, item, tipsDetails)} className={styles['details-content-menu-name']} style = {index === currentIndex ? {color:'#0089be'} : ''}>
-                                        <span className={styles['details-content-menu-circle']} style = {index === currentIndex ? {background:'#0089be'} : ''}></span>{item.title}
-                                    </span>
-                                </div>
-                            </div>)
-                        })}
+                <div className={styles['content-menu-box']}>
+                    <div className={styles['content-menu']}>
+                        {tipsDetails && tipsDetails.introduceDetailList && tipsDetails.introduceDetailList.map((item, index) => {
+                                return (<div>
+                                    <div className={styles['details-menu-title-box']}>
+                                        {index === 0 ? '' : <div className={styles['details-content-menu-line']}></div>}
+                                        <span onClick={this.handleClickMenu.bind(this, index, item, tipsDetails)} className={styles['details-content-menu-name']} style = {index === currentIndex ? {color:'#0089be'} : ''}>
+                                            <span className={styles['details-content-menu-circle']} style = {index === currentIndex ? {background:'#0089be'} : ''}></span>{item.title}
+                                        </span>
+                                    </div>
+                                </div>)
+                            })}
+                    </div>
                 </div>
+               
            </div>
-           <div className={styles['details-mask']}>
+           <div className={styles['details-mask']} onClick={this.hideTips}>
            </div>
         </div>
     </NewPortal>)

+ 7 - 2
src/components/PushItems/DetailsModal/index.less

@@ -61,10 +61,15 @@
     padding: 0 180px 0 40px;
     overflow-y: auto;
 }
-.content-menu {
+.content-menu-box {
     position: absolute;
     top: 50px;
-    right: 20px;
+    right: -20px;
+    width: 200px;
+    height: 80%;
+    overflow-y: auto;
+}
+.content-menu {
     background: #eee;
     border: 1px solid #eee;
     width: 160px;

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

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

+ 117 - 22
src/components/PushItems/index.jsx

@@ -10,8 +10,10 @@ import hideImg from "../../common/images/close.png";
 import DetailsModal from './DetailsModal';
 import PushDiag from "./PushDiag";
 import DiagnosticItem from "@containers/DiagnosticItem";
-import $ from "jquery";
+import store from "@store";
 import { getWindowInnerHeight } from "@common/js/func";
+import {addLabel} from '@store/actions/inspect';
+import {addAssistLabel} from '@store/actions/assistCheck';
 import {windowEventHandler} from '@utils/tools'
 
 class PushItems extends Component {
@@ -41,19 +43,75 @@ class PushItems extends Component {
     this.setState({ [type]: false });
   }
 
+  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);
+    return date;
+  }
+
   billing() {
     const { assay, check } = this.props.pushMessage;
     const checkedAssay = assay.filter(item => item.checked);
     const checkedCheck = check.filter(item => item.checked);
     this.props.billing(checkedAssay, checkedCheck);
-    if(checkedAssay.length > 0 || checkedCheck.length > 0) {
-      const Height = $(".src-components-BodyContainer-2SgEx").height();
-      const adviceHeight = $(".src-common-components-ItemBox-1Bpz3").height();
-      const winHeight = window.innerHeight;
-      const scrollTop = Height;
-      $('#addScrollEvent').scrollTop(100000)
+    // if(checkedAssay.length > 0 || checkedCheck.length > 0) {
+    //   const Height = $(".src-components-BodyContainer-2SgEx").height();
+    //   const adviceHeight = $(".src-common-components-ItemBox-1Bpz3").height();
+    //   const winHeight = window.innerHeight;
+    //   const scrollTop = Height;
+    //   $('#addScrollEvent').scrollTop(100000)
+    // }
+    let obj = {   //添加化验
+      details: [],
+      name: '',
+      questionId: '',
+      showType: 1,
+    }
+    let obj1 = {  //添加辅检
+      name: '',
+      questionId: '',
+      showType: 1,
+      time:this.getCurrentDate(),
+      value:''
+    }
+    if(checkedAssay.length > 0){
+      let assayArr = [],tmpDetail=[]
+      for(let i = 0;i < checkedAssay.length;i++){
+        let tmpObj = JSON.parse(JSON.stringify(obj));
+        if (checkedAssay[i].controlType == 0) {
+          tmpDetail = checkedAssay[i].questionMapping
+        }else if(checkedAssay[i].controlType == 1 || checkedAssay[i].controlType == 6){
+          tmpDetail.push(checkedAssay[i])
+        }
+        tmpObj.questionId = checkedAssay[i].id
+        tmpObj.name = checkedAssay[i].name
+        tmpObj.details = tmpDetail
+        assayArr.push(tmpObj)
+      }
+      store.dispatch(addLabel(assayArr))
+    }
+    if(checkedCheck.length > 0){
+      let checkArr = []
+      for(let i = 0;i < checkedCheck.length;i++){
+        let tmpObj = JSON.parse(JSON.stringify(obj1));
+        tmpObj.questionId = checkedCheck[i].id
+        tmpObj.name = checkedCheck[i].name
+        checkArr.push(tmpObj)
+      }
+      store.dispatch(addAssistLabel(checkArr))
+    }
+    if(checkedAssay.length > 0){
+      document.getElementById("inspectResultData").scrollIntoView(true)
+    }else{
+      if(checkedCheck.length > 0){
+        document.getElementById("assistResultData").scrollIntoView(true)
+      }else{
+        return;
+      }
     }
-    
   }
 
   changeAssay(item) {
@@ -107,13 +165,31 @@ class PushItems extends Component {
       showTips
     } = this;
     let assayNum = 0;
+    let assayNum2 = 0; 
     let assayHide = assay.map((item, index) => {
       assayNum = assayNum + item.name.length + 2;
-      if (assayNum > 22) {
-        return;
+      if (assayNum > 28) {
+        assayNum2 = assayNum2 + item.name.length + 2; 
+        if(assayNum2 > 21) {
+          return;
+        } else {
+          return (
+            <span>
+              
+              <input
+                id={item.id + item.name}
+                onChange={() => changeAssay(item)}
+                type="checkbox"
+                checked={item.checked}
+              />
+              <label for={item.id + item.name}>{item.name}</label>
+            </span>
+          );
+        }
       } else {
         return (
           <span>
+            
             <input
               id={item.id + item.name}
               onChange={() => changeAssay(item)}
@@ -141,10 +217,29 @@ class PushItems extends Component {
     });
 
     let checkNum = 0;
+    let checkNum2 = 0;
     let checkHide = check.map((item, index) => {
       checkNum = checkNum + item.name.length + 2;
-      if (checkNum > 22) {
-        return;
+      if (checkNum > 28) {
+        checkNum2 = checkNum2 + item.name.length + 2; 
+        if(checkNum2 > 21) {
+          return;
+        }else {
+          return (
+            <span>
+              <input
+                id={item.id + item.name}
+                onChange={() => changeCheck(item)}
+                type="checkbox"
+                checked={item.checked}
+              />
+              <label for={item.id + item.name}>{item.name}</label>
+            </span>
+          );
+        }
+
+
+        
       } else {
         return (
           <span>
@@ -175,7 +270,7 @@ class PushItems extends Component {
     });
 
     const vigilants = vigilant.map((item, index) => {
-      return <DiagnosticItem item={item} />;
+      return <div key={item.id} className={style['push-diag-item']}><DiagnosticItem item={item}/></div>;
     });
 
     return (
@@ -199,7 +294,7 @@ class PushItems extends Component {
                 icon={doubtImg}
                 title="疑似诊断"
                 diagList={doubt}
-                maxShowNum={28}
+                maxShowNum={26}
               />
             )}
             {possible && possible.length > 0 && (
@@ -208,7 +303,7 @@ class PushItems extends Component {
                 icon={possibleImg}
                 title="可能诊断"
                 diagList={possible}
-                maxShowNum={28}
+                maxShowNum={26}
               />
             )}
             <div className={style["diagnose"]}>
@@ -231,25 +326,25 @@ class PushItems extends Component {
                 <img src={recommendImg} />
                 推荐检验检查
                 <div className={style["billing"]} 
-                     style={assay.length === 0 && check.length === 0 ? {color: 'gray', border: '1px solid gray'} : ''} 
+                     style={assay.length === 0 && check.length === 0 ? {color: 'gray', border: '1px solid gray', cursor:'auto'} : ''} 
                      onClick={assay.length === 0 && check.length === 0 ? '' : billing}>
                     开单
                 </div>
               </h1>
               <div>
                 {assay.length === 0 && check.length === 0 ? (
-                  "无"
+                  <span>无</span>
                 ) : (
                   <ul>
                     <li className={style["firstLi"]}>
                       <div className={style["title"]}>化验:</div>
                       <div className={style["content"]}>
                         {assay.length === 0
-                          ? "无"
+                          ?<span >无</span>
                           : moreAssay
                           ? assays
                           : assayHide}
-                        {assayNum > 28 ? (
+                        {assayNum2 > 21 ? (
                           <span
                             style={
                               moreAssay
@@ -287,7 +382,7 @@ class PushItems extends Component {
                           : moreCheck
                           ? checks
                           : checkHide}
-                        {checkNum > 28 ? (
+                        {checkNum2 > 21 ? (
                           <span
                             style={
                               moreCheck
@@ -355,7 +450,7 @@ class PushItems extends Component {
                               />
                               {item.isReason === 1 && (
                                 <div className={style["warn"]}>
-                                  {tipsDiscalimer.data.data[0].description}
+                                  {tipsDiscalimer.data.data[0]&&tipsDiscalimer.data.data[0].description}
                                 </div>
                               )}
                             </div>
@@ -370,7 +465,7 @@ class PushItems extends Component {
             </div>
           </div>
         </div>
-        {tipsDiscalimer.data && <div className={style['disTips']} dangerouslySetInnerHTML={{__html: tipsDiscalimer.data.data[1].description}}></div>}
+        {tipsDiscalimer.data && <div className={style['disTips']} dangerouslySetInnerHTML={{__html: tipsDiscalimer.data.data[1]&&tipsDiscalimer.data.data[1].description}}></div>}
         {showTipsDetails && <DetailsModal  
             showTipsDetails = {showTipsDetails}
             hideTips = {this.hideTips}

+ 17 - 12
src/components/PushItems/index.less

@@ -12,18 +12,15 @@
   .vigilant{
     background: #FF8D54;
     overflow: hidden;
-    margin: 1px;
-    margin-bottom: 15px;
-    line-height: 26px;
-    padding: 20px 0;
+    padding: 10px 0;
     .title{
       color:#fff;
       font-size: 14px;
       float: left;
-      margin: 0 10px 0 0;
+      margin: 10px 10px 0 0;
       img {
         float: left;
-        margin: 4px 2px 0 20px;
+        margin: 1px 2px 0 20px;
         width: 18px;
         height: 17px;
       }
@@ -32,11 +29,17 @@
       float:left;
       width: 340px;
       span {
-        font-size: 16px;
+        font-size: 14px;
         color: #fff;
         display:inline-block;
       }
     }
+    .push-diag-item {
+        display: inline-block;
+        margin-right: 10px;
+        margin-top: 10px;
+        cursor: pointer;
+    }
   }
   .diagnose{
     padding-bottom: 15px;
@@ -56,7 +59,7 @@
       }
       div{
         font-size: 14px;
-        padding:6px 15px;
+        padding:6px  0 6px 15px;
         span{
           cursor: pointer;
         }
@@ -96,7 +99,7 @@
     h1{
       font-size: 14px;
       color: #000;
-      padding: 8px 15px;
+      padding: 8px 6px 8px 15px;
       background: #EAF7FA;
       font-weight: bold;
       img {
@@ -122,7 +125,7 @@
     }
     div{
       font-size: 14px;
-      padding:6px 15px;
+      padding:6px 0px 6px 15px;
       ul{
         .firstLi{
           border-bottom: 1px solid #DFDFDF;
@@ -135,13 +138,15 @@
           overflow: hidden;
           .title{
             float: left;
+            height: 26px;
+            line-height: 26px;
             padding: 0px 0px 0px 0px;
           }
           .content{
             float: left;
-            width: 352px;
+            width: 359px;
+            line-height: 26px;
             padding: 0px 0px 0px 0px;
-            margin-top: -2px;
             span{
               font-size: 14px;
               line-height: 14px;

+ 9 - 9
src/components/RadioDrop/index.jsx

@@ -52,7 +52,7 @@ class RadioDrop extends Component{
     return style['tag'];
   }
   handleSelect(item){
-    const {handleSelect,ikey,mainSaveText} = this.props;
+    const {handleSelect,ikey,mainSaveText,value} = this.props;
     if(!item){      //清空
       handleSelect&&handleSelect({ikey});
       return ;
@@ -70,7 +70,7 @@ class RadioDrop extends Component{
         text = item.name;
         // text = item.questionDetailList&&item.questionDetailList.length>0?item.questionDetailList[0].name: item.name;
     }
-    handleSelect&&handleSelect({ikey,id:item.id,text,mainSaveText});
+    handleSelect&&handleSelect({ikey,id:item.id,text,mainSaveText,value});
   }
   handleShow(e){
     //e.stopPropagation();
@@ -99,14 +99,14 @@ class RadioDrop extends Component{
     },$("#addScrollEvent")[0])
   }
   componentDidMount(){    //默认值选中
-    const {data,ikey,handleSelect} = this.props;
+    const {data,ikey,handleSelect,hideTag,mainSaveText,value} = this.props;
     const selected = data.find((it)=>{
       return it.selected === undefined&&+it.defaultSelect===1;
     });
-    if(selected){
+    if(!hideTag&&selected){
       // const text = selected.labelPrefix+selected.name+selected.labelSuffix;
       const text = selected.name;
-      handleSelect&&handleSelect({ikey,id:selected.id,text});
+      handleSelect&&handleSelect({ikey,id:selected.id,text,mainSaveText,value});
     }
   }
   handleEditLabel(e){
@@ -120,9 +120,9 @@ class RadioDrop extends Component{
     });  
    // 更改标签的value值
     const ev = e || window.event;
-    let changeVal = ev.target.innerText;
+    let changeVal = ev.target.innerText || ev.target.innerHTML;
     if(!this.isIE){
-      ev.target.innerText = '';
+      ev.target.innerText?(ev.target.innerText = ''):(ev.target.innerHTML = '');
     }
     handleLabelEdit && handleLabelEdit({ikey,changeVal,type:boxMark});
   }
@@ -142,7 +142,7 @@ class RadioDrop extends Component{
     handleDbclick&&handleDbclick({id:patId||id});
   }
   render(){
-    const {data,prefix,suffix,placeholder,show,value} = this.props;
+    const {data,prefix,suffix,placeholder,show,value,hideTag} = this.props;
     const {boxLeft,boxTop} = this.state;
     return <div className={style['container']} ref = {this.$cont}>
       {prefix}
@@ -155,7 +155,7 @@ class RadioDrop extends Component{
         {value||placeholder}
       </div>
       {suffix}
-      <DropList onSelect={this.handleSelect} data={data} left={boxLeft} top={boxTop} show={show}/>
+      <DropList onSelect={this.handleSelect} data={data} left={boxLeft} top={boxTop} show={show} hideTag={hideTag}/>
     </div>
   }
 }

+ 223 - 0
src/components/RadioInpDrop/index.jsx

@@ -0,0 +1,223 @@
+import React,{Component} from 'react';
+import {handleEnter,getPageCoordinate,windowEventHandler} from '@utils/tools.js';
+import {DropList} from '@commonComp';
+import config from '@config/index';
+import style from "./index.less";
+import $ from "jquery";
+
+/****
+ * 单选下拉,选项带输入
+ * author:zn@2019-3.18
+ * 接收参数:
+ * placeholder:灰显文字
+ * data:下拉内容数据
+ * handleSelect:选中事件
+ * prefix:前缀
+ * suffix:后缀
+ *
+ * ***/
+
+class RadioInpDrop extends Component{
+  constructor(props){
+    super(props);
+    this.state={
+      editable:false,
+      timer:null,
+      boxLeft:0,
+      boxTop:0,
+      tmpScroll:0,
+      tmpTop:0,
+      texts:props.vals||{0:props.value||props.placeholder}
+    };
+    this.$cont = React.createRef();
+    this.isIE = navigator.appName=="Microsoft Internet Explorer" && navigator.appVersion.split(";")[1].replace(/[ ]/g,"")=="MSIE8.0";
+    this.handleSelect = this.handleSelect.bind(this);
+    this.handleShow = this.handleShow.bind(this);
+    this.handledbClick = this.handledbClick.bind(this);
+    this.handleEditLabel = this.handleEditLabel.bind(this);
+    this.parseInputDom = this.parseInputDom.bind(this);
+    this.handleInnerInp = this.handleInnerInp.bind(this);
+  }
+  getClass(){
+    const {value,hideTag,placeholder,show} = this.props;
+    const blueBorder = this.state.editable?style['blue-border']:'';
+    if(show){
+      $(this.$cont.current).addClass(style['borderd']);
+    }else{
+      $(this.$cont.current).removeClass(style['borderd']);
+    }
+    if(hideTag){
+      return style['no-tag'];
+    }
+    if(value){
+      return blueBorder?style['selected-tag']+' '+blueBorder:style['selected-tag'];
+    }
+    return style['tag'];
+  }
+  handleSelect(item){
+    const {handleSelect,ikey,value,placeholder} = this.props;
+    let vals = {}, inx = 0;
+    if(!item){
+      handleSelect&&handleSelect({ikey});  //清空
+      this.setState({
+        texts:{0:placeholder}
+      });
+      return ;
+    }
+    const arr = item.name.split(config.radioOptionPer);
+    arr.map((it,i)=>{
+      inx = (i+1)*2-2;
+      vals[inx] = it;
+      if(i!=arr.length-1){
+        vals[+inx+1]={value:'',index:+inx+1}
+      };
+    });
+    this.setState({
+      texts:vals
+    });
+    handleSelect&&handleSelect({ikey,id:item.id,values:vals});
+  }
+  handleShow(e){
+    //e.stopPropagation();
+    const {handleShow,ikey,id,patId} = this.props;
+    const that = this;
+    const timer = setTimeout(function(){
+      if (that.state.editable) {//如果处于编辑状态点击不显示下拉框
+        return
+      }else {
+        handleShow && handleShow({ikey,id:patId||id});
+      }
+    },300);
+    
+    this.setState({
+      timer,
+      boxLeft:getPageCoordinate(e).boxLeft,
+      boxTop:getPageCoordinate(e).boxTop,
+      tmpScroll: $("#addScrollEvent")[0].scrollTop,
+      tmpTop:getPageCoordinate(e).boxTop
+    });
+    windowEventHandler('scroll',()=>{      //弹窗跟随滚动条滚动或者关闭弹窗
+      let scrollYs = $("#addScrollEvent")[0].scrollTop;
+      this.setState({
+        boxTop:this.state.tmpTop - scrollYs + this.state.tmpScroll
+      })
+    },$("#addScrollEvent")[0])
+  }
+  /*componentDidMount(){    //默认值选中
+    const {data,ikey,handleSelect} = this.props;
+    const selected = data.find((it)=>{
+      return it.selected === undefined&&+it.defaultSelect===1;
+    });
+    if(selected){
+      // const text = selected.labelPrefix+selected.name+selected.labelSuffix;
+      const text = selected.name;
+      handleSelect&&handleSelect({ikey,id:selected.id,text});
+    }
+  }*/
+  handleEditLabel(e){
+    e.stopPropagation();
+    if(!this.state.editable){     //ie8点开下拉未选值存值bug修改
+      return;
+    }
+    const {ikey,boxMark,handleLabelEdit} = this.props;
+    this.setState({
+      editable:false
+    });  
+   // 更改标签的value值
+    const ev = e || window.event;
+    let changeVal = ev.target.innerText || ev.target.innerHTML;
+    if(!this.isIE){
+      ev.target.innerText?(ev.target.innerText = ''):(ev.target.innerHTML = '');
+    }
+    handleLabelEdit && handleLabelEdit({ikey,changeVal,type:boxMark});
+  }
+  handledbClick(e){
+    const {value,id,handleDbclick,patId} = this.props;
+    clearTimeout(this.state.timer);//取消延时的单击事件
+    //e.preventDefault();
+    if(value&&value.trim()) {//有选中值的标签才能双击编辑
+      this.setState({
+        editable: true
+      });
+    };
+    //失焦关闭编辑状态
+    setTimeout(()=>{
+      e.target.focus();
+    })
+    handleDbclick&&handleDbclick({id:patId||id});
+  }
+  handleInnerInp(i,val){
+    const {ikey,boxMark,handleSaveInp} = this.props;
+    let vals = this.state.texts;
+    vals[i].value=val;
+    this.setState({
+      texts:vals
+    });
+    handleSaveInp({values:vals,ikey,boxMark});
+  }
+  parseInputDom(){
+    const {value,placeholder} = this.props;
+    const {texts} = this.state;
+    let temp='',list=[];
+    for(let i in texts){
+      temp = texts[i];
+      if(typeof temp=='object'){
+        list.push(<InputComp handleInp={this.handleInnerInp} editable={true} index={i} value={temp.value}></InputComp>);
+      }else{
+        list.push(<span>{temp}</span>);
+      }
+    }
+    /*if(value&&value.indexOf(config.radioOptionPer)!=-1){
+      let arr = [],inpIndex='';
+      let list = value.split(config.radioOptionPer);
+      list.map((it,i)=>{
+        arr.push(<InputComp value={it}></InputComp>);
+        inpIndex = (i+1)*2-1;
+        if(i!=list.length-1){
+          arr.push(<InputComp handleInp={this.handleInnerInp} editable={true} index={inpIndex}></InputComp>);
+        }
+      });
+      return arr;
+    }*/
+    return list;
+  }
+  render(){
+    const {data,show,vals,placeholder} = this.props;
+    const {boxLeft,boxTop} = this.state;
+    return <div className={style['container']} ref = {this.$cont}>
+      <div className={this.getClass()}
+           onBlur={this.handleEditLabel}
+           contentEditable={this.state.editable}
+           onDoubleClick={this.handledbClick}
+           onClick={(e)=>this.handleShow(e,true)}
+           onkeydown={handleEnter}>
+        {vals?this.parseInputDom():<span>{placeholder}</span>}
+      </div>
+      <DropList onSelect={this.handleSelect} data={data} left={boxLeft} top={boxTop} show={show}/>
+    </div>
+  }
+}
+
+//单选项中的输入框
+class InputComp extends Component{
+  constructor(props){
+    super(props);
+    this.handleBlur = this.handleBlur.bind(this);
+  }
+  handleBlur(e){
+    e.stopPropagation();
+    const text = e.target.innerText;
+    const {handleInp,index} = this.props;
+    e.target.innerText = '';
+    handleInp(index,text);
+  }
+  render(){
+    const {editable,value} = this.props;
+    return editable?<span contentEditable={true}
+                 className={style['inner-inp']}
+                 onClick={(e)=>{e.stopPropagation()}}
+                 onBlur={this.handleBlur}>{value}</span>:<span>{value}</span>
+  }
+}
+
+export default RadioInpDrop;

+ 29 - 0
src/components/RadioInpDrop/index.less

@@ -0,0 +1,29 @@
+@import "~@less/variables.less";
+.container{
+  display: inline-block;
+  position: relative;
+  /*margin-right: 5px;*/
+}
+.tag,.selected-tag,.no-tag{
+  display: inline-block;
+  cursor: pointer;
+  /*line-height: 20px;*/
+}
+.tag{
+  color:@placeholder-color;
+}
+.tag:before{
+  content: '[';
+}
+.tag:after{
+  content: ']';
+}
+.selected-tag{
+  color: @text-color;
+  border-bottom: 1px @border-color solid;
+}
+.inner-inp{
+  display:inline-block;
+  min-width:30px;
+  text-align:center;
+}

+ 28 - 11
src/components/SearchDrop/index.jsx

@@ -21,6 +21,9 @@ class SearchDrop extends Component{
   constructor(props){
     super(props);
     this.handleSelect = this.handleSelect.bind(this);
+    this.state={
+      data:props.data||[]
+    }
   }
   getClass(){
     let name = style['text-list'];
@@ -54,18 +57,32 @@ class SearchDrop extends Component{
     // onShow&&onShow(e,false);
   }
   render(){
+    const {mainEmpty} = this.props;
     let litext = '';
-    const domNode = document.getElementById('root');
-    return ReactDom.createPortal(
-      <div className={this.getClass()} contenteditable="false" id="searchBox" style={this.getStyle()}>
-        <ul>
-          {this.props.data&&this.props.data.map((it)=>{
-            litext = it.showType==1?it.name:it.name+'('+it.retrievalName+')';
-            return <li onmouseup={(e)=>this.handleSelect(e,it)} title={litext}>{litext}</li>
-          })}
-        </ul>
-      </div>
-    ,domNode)
+    if(mainEmpty){
+      return <div className={this.getClass()} contenteditable="false" id="searchBox" style={this.getStyle()}>
+          <ul>
+            {this.props.data&&this.props.data.map((it)=>{
+              litext = it.showType==1?it.name:it.name+'('+it.retrievalName+')';
+              return <li onClick={(e)=>this.handleSelect(e,it)} title={litext}>{litext}</li>
+            })}
+          </ul>
+        </div>
+    }else{
+      
+      const domNode = document.getElementById('root');
+      return ReactDom.createPortal(
+        <div className={this.getClass()} contenteditable="false" id="searchBox" style={this.getStyle()}>
+          <ul>
+            {this.props.data&&this.props.data.map((it)=>{
+              litext = it.showType==1?it.name:it.name+'('+it.retrievalName+')';
+              return <li onClick={(e)=>this.handleSelect(e,it)} title={litext}>{litext}</li>
+            })}
+          </ul>
+        </div>
+      ,domNode)
+    }
+    
   }
 }
 

+ 16 - 9
src/components/SpreadDrop/index.jsx

@@ -94,7 +94,7 @@ class SpreadDrop extends Component{
 
   changeToEdit(e){//双击
     const {value,id,placeholder,handleDbclick,handleHide} = this.props;
-    let text = e.target.innerText;
+    let text = e.target.innerText || e.target.innerHTML;
     handleHide&&handleHide();       //展开情况下双击收起
     // clearTimeout(this.state.timer);//取消延时的单击事件
     e.stopPropagation();
@@ -117,11 +117,11 @@ class SpreadDrop extends Component{
     const {labelVal,editable} = this.state;
     let mainText = filterDataArr(mainSaveText);//主诉字数
     if(editable){//避免IE中点击标签也会触发
-      let val = e.target.innerText;
+      let val = e.target.innerText || e.target.innerHTML;
       if(+type==1){// 主诉字数达到上限时不允许输入
         if(mainText.length >= config.limited){
           if(val.length > labelVal.length){
-            e.target.innerText = labelVal;
+            e.target.innerText?(e.target.innerText = labelVal):(e.target.innerHTML = labelVal);
             Notify.info(config.limitText);
             return
           }else if(val.length == labelVal.length){
@@ -143,9 +143,9 @@ class SpreadDrop extends Component{
     const ev = e || window.event;
     if(editable){
       // 更改标签的value值
-      let changeVal = ev.target.innerText;
+      let changeVal = ev.target.innerText || ev.target.innerHTML;
       if(!isIE()){
-        e.target.innerText = '';      //避免出现重复输入值
+        e.target.innerText?(e.target.innerText = ''):(e.target.innerHTML = '');      //避免出现重复输入值
       }
       handleLabelChange && handleLabelChange({ikey,changeVal,type});
     }
@@ -224,14 +224,21 @@ class SpreadDrop extends Component{
       return;
     }
     //操作单选项
-    if(selected){
+    if(!noneOn&&selected){
       const tIndex= exists.findIndex((it)=>it.questionId===item.questionId);
+      const bIndex= withs.findIndex((it)=>it.questionId===item.questionId);
       if(tIndex!=-1){
-        exists.splice(tIndex,1,item);
+        exists.splice(tIndex,1,Object.assign({},item,{name}));    //修改单选列连接字符不显示bug
         this.setState({
           exists,
         })
       }
+      if(bIndex!=-1){
+        withs.splice(tIndex,1,item);
+        this.setState({
+          withs,
+        })
+      }
       return;
     }
     if(exclusion!==''){     //互斥项被选中,其他不可操作
@@ -287,7 +294,7 @@ class SpreadDrop extends Component{
         nones += name+'、';
         noneIds.push(id);
       }else if(nowOn=='with'){
-        withs.push({id:id,name:name});
+        withs.push({id:id,name:name,questionId:item.questionId});
       }else{
         exists.push({id:id,name:name,listIndex,questionId:item.questionId});
       }
@@ -421,7 +428,7 @@ class ListItem extends Component{
         return exists.findIndex((i)=>i.questionId===it.id)!==-1||noneIds.includes(it.id)||withs.findIndex((i)=>i.questionId===it.id)!==-1;
       });*/
       if(selected&&selected.id!=item.id){     //该列已有选中项,传回已选中的id,name取消选中
-        handleClick&&handleClick(item,isExclu,joint,index,{id:selected.id,name:selected.name});
+        handleClick&&handleClick(item,isExclu,joint,index,{id:selected.id,name:selected.name,questionId:selected.questionId});
       }else{
         handleClick&&handleClick(item,isExclu,joint,index);
       }

+ 42 - 14
src/components/Treat/DrugTreat/index.jsx

@@ -2,6 +2,8 @@ import React, { Component } from 'react';
 import style from './index.less';
 import info from './../img/info.png';
 import info1 from './../img/info1.png';
+import info2 from './../img/info2.png';
+import info3 from './../img/info3.png';
 import drugIcon from './../img/drug.png';
 import more from '@common/images/addItem1.png';
 import $ from "jquery";
@@ -16,24 +18,39 @@ class DrugTreat extends Component {
         this.setOtherRecommend = this.setOtherRecommend.bind(this);
         this.setDrugInfo = this.setDrugInfo.bind(this);
         this.showTreatDesc = this.showTreatDesc.bind(this);
+        this.handleMouseLeaveDrug = this.handleMouseLeaveDrug.bind(this);
         this.handleMouseLeaveImg = this.handleMouseLeaveImg.bind(this);
+        this.getImg = this.getImg.bind(this);
     }
 
     handleSelect(index,ii) {
         const { selectDrug } = this.props;
         selectDrug && selectDrug(index,ii);
     }
-    handleMouseEnterImg(ii, index) {
+    handleMouseEnterDrug(ii, index, it) {
+        const drugNameWidth = parseInt($('#'+it.medicitionName)[0].offsetWidth)
+        const imgLeft = drugNameWidth/2-10
+        $('#'+it.medicitionName).find('img').css('left', imgLeft)
         this.setState({
             currentIndex: index,
             currentImg: ii
         })
     }
-    handleMouseLeaveImg() {
+    handleMouseLeaveDrug() {
         this.setState({
             currentIndex: -1,
         })
     }
+    handleMouseEnterImg() {
+        this.setState({
+            hasEnterImg: true
+        })
+    }
+    handleMouseLeaveImg() {
+        this.setState({
+            hasEnterImg: false
+        })
+    }
     setOtherRecommend(item, index) {
         this.showTreatDesc();
         const { setOtherRecommend } = this.props;
@@ -43,6 +60,8 @@ class DrugTreat extends Component {
         const { setDrugInfo } = this.props;
         setDrugInfo && setDrugInfo(item);
     }
+    getImg() {
+    }
     //搜索药品说明书(查看数据用)
     handleInputDrug(e) {
         this.setState({
@@ -59,7 +78,7 @@ class DrugTreat extends Component {
     }
     showTreatDesc() {
         $('#treatDescBox').css({'display': 'block'});
-        $('#treatWrapper').animate({'margin-left': '-470px'}, 300);
+        $('#treatWrapper').animate({'margin-left': '-471px','left':'50%'}, 300);
         $('#treatDescBox').animate({'width': '260px'}, 500);
         
     }
@@ -68,7 +87,7 @@ class DrugTreat extends Component {
 
     render(){
         const { treatment,showDrugInfo } = this.props
-        const { currentImg, currentIndex } = this.state
+        const { currentImg, currentIndex, hasEnterImg } = this.state
         return(
             treatment && treatment.length > 0 && <div className={style['drug-box']}>
                 <h3 className={style['drug-title']}><img className={style['drug-icon']} src={drugIcon}/> 常用药物治疗</h3>
@@ -81,18 +100,27 @@ class DrugTreat extends Component {
                             {item.medicitionsList.map((it, ii) => {
                                 return ((it.isShow == 1 || it.selected) && <span >
                                         {ii === 0 ? '' : ', '}
-                                        <span className={style['drug-name']}  
-                                            // onDoubleClick={() =>{this.setDrugInfo(it);showDrugInfo();}}  //药品说明双击显示(现在为点击图标显示)
-                                            onClick={()=>{it.forbidden === '2' ? '' : this.handleSelect(index,ii)}} 
-                                            style={it.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)'} : it.selected ? {color: '#3B9ED0', borderBottom: '1px solid #3B9ED0'}:''}
-                                            >
-                                            {it.medicitionName}
-                                        </span>
-                                        {<img className={style['info-img']}    
-                                              src={currentIndex === index ? (ii === currentImg ? info1 : info) : info} 
+                                        <span onMouseEnter={this.handleMouseEnterDrug.bind(this, ii , index, it)}
+                                              onMouseLeave = {this.handleMouseLeaveDrug}
+                                              id={it.medicitionName}
+                                              className={style['drug-name-wrapper']} 
+                                        >
+                                            <span className={style['drug-name']}  
+                                                // onDoubleClick={() =>{this.setDrugInfo(it);showDrugInfo();}}  //药品说明双击显示(现在为点击图标显示)
+                                                onClick={()=>{it.forbidden === '2' ? '' : this.handleSelect(index,ii)}} 
+                                                style={it.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)'} : it.selected ? {color: '#3B9ED0', borderBottom: '1px solid #3B9ED0'}:''}
+                                                >
+                                                {it.medicitionName}
+                                            </span>
+                                            {<img className={style['info-img']}  
+                                              style ={currentIndex === index ? (ii === currentImg ? {display: "inline-block"} : {display: "none"}) : {display: "none"}}
+                                              src={currentIndex === index ? (ii === currentImg ? (hasEnterImg ? info3 : info2) : info2): info2} 
                                               onMouseEnter={this.handleMouseEnterImg.bind(this, ii, index)}
                                               onMouseLeave = {this.handleMouseLeaveImg}
                                               onClick={() =>{this.setDrugInfo(it);showDrugInfo();}}/>}
+                                        </span>
+                                        
+                                        
                                         {it.forbidden === '1' ? <span className={style['info-flag']} style={{border: '1px solid #F4C051', background: '#F4C051',marginLeft: '5px'}}>慎用</span>: it.forbidden === '2' ? <span className={style['info-flag']} style={{opacity: '0.3',filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)',border: '1px solid #000',marginLeft: '5px'}}>禁用</span> : ''}, 
                                         <span  style={it.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)'} : ''}> 使用率{it.rate}</span>
                                         
@@ -100,7 +128,7 @@ class DrugTreat extends Component {
                             })}
 
                         </div>
-                        {<div className={style['drug-more']} onClick={() =>this.setOtherRecommend(item, index)} ><img className={style['info-img']} src={more} />更多同类药</div> }
+                        {<div className={style['drug-more']} onClick={() =>this.setOtherRecommend(item, index)} ><img className={style['info-img-more']} src={more} />更多同类药</div> }
                         
                     </div>)
                 })}

+ 9 - 1
src/components/Treat/DrugTreat/index.less

@@ -14,17 +14,25 @@
     line-height: 36px;
     border-bottom: 1px dashed #D2D2D2;
 }
+.drug-name-wrapper {
+    position: relative;
+}
 .drug-name {
     border-bottom: 1px solid #666;
     display: inline-block;
     height: 30px;
     cursor: pointer;
 }
-.info-img {
+.info-img, .info-img-more {
     width: 12px;
     margin: 0 3px -1px;
     cursor: pointer;
 }
+.info-img {
+    width: 15px;
+    position: absolute;
+    top: -15px;
+}
 .info-flag {
     display: inline-block;
     width: 34px;

+ 2 - 2
src/components/Treat/GeneralTreat/index.jsx

@@ -9,10 +9,10 @@ class GeneralTreat extends Component {
     render() {
         const { icon, titleStyle,titleBg, filter, title, generalTreat } = this.props
         return(
-            generalTreat && generalTreat.length > 0 && <div className={style['general-wrapper']}>
+            generalTreat.content && generalTreat.content.length > 0 && <div className={style['general-wrapper']}>
                 <div className={style['general-title-box']} style={titleStyle}></div>
                 <div className={style['general-title']} ><img className={style['general-icon']} src={icon}/>{title}</div>
-                <div className={style['general-item']} dangerouslySetInnerHTML={{__html: generalTreat}}>
+                <div className={style['general-item']} dangerouslySetInnerHTML={{__html: generalTreat.content}}>
                 </div>
 
             </div>

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


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


+ 24 - 16
src/components/Treat/index.jsx

@@ -3,6 +3,7 @@ import style from './index.less';
 import GeneralTreat from './GeneralTreat/index.jsx';
 import DrugTreat from './DrugTreat/index.jsx';
 import TreatDesc from '@components/TreatDesc'
+import {dragBox,windowRemoveEventHandler} from '@utils/tools'
 import DrugInfo from '@components/TreatDesc/DrugInfo';
 import Notify from '@commonComp/Notify'
 import close from './img/close.png';
@@ -13,21 +14,30 @@ import $ from "jquery";
 class Treat extends Component {
     constructor(props){
         super(props);
+        this.state = {
+          zIndex:301,
+        }
         this.hideTreat = this.hideTreat.bind(this);
         this.handlePrescription = this.handlePrescription.bind(this);
         this.handleDetermine = this.handleDetermine.bind(this);
+        this.setTreatBox = this.setTreatBox.bind(this);
     }
-
+    componentDidMount(){
+      dragBox('treatWrapper','dragTreatTitle')
+    }
+    
     hideTreat() {
-        const { hideTreat,clearTreat } = this.props;
+        const { hideTreat,clearTreat, hideDrugInfo } = this.props;
         clearTreat && clearTreat();
         hideTreat && hideTreat();
+        hideDrugInfo && hideDrugInfo();
+        // windowRemoveEventHandler('mousemove',handleMove,document)
     }
     handlePrescription() {
         Notify.info('该功能即将上线,敬请期待。', 2000)
     }
     handleDetermine() {
-        const { title, treatment } = this.props
+        const { title, treatment, advice } = this.props
         const { addScheme } = this.props
         addScheme && addScheme(title, treatment);
         this.hideTreat()
@@ -36,18 +46,20 @@ class Treat extends Component {
         const {  showDrugInfo } = this.props;
         showDrugInfo && showDrugInfo();
     }
-
+    setTreatBox(){
+      $('#treatWrapper').css({'z-index': 302});
+      $('#drugWrapper').css({'z-index': 301});
+    }
     render(){
-    
-    
-        const { generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore} = this.props;
-        const { setDrugInfoMore } = this.props
+        const {setDrugInfoMore,treatIndex,treatIndexSet, generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore} = this.props;
+        const { zIndex,show } = this.state
         return(
             <div   className={style['treat-wrapper']}>
-                <div className={style['treat-mask']}>
+                <div className={style['treat-mask']} onClick={this.hideTreat}>
                 </div>
-                <div id='treatWrapper' className={style['treat-box']}>
-                    <div className={style['treat-title']}>治疗方案 ({treatItem.name})<img onClick={this.hideTreat} src={close}/></div>
+                <div id="treatWrapper" className={style['treat-box']}  onselectstart="return false">
+                    <img className={style.close} onClick={this.hideTreat} src={close}/>
+                    <div onMouseDown={this.setTreatBox} id="dragTreatTitle" className={style['treat-title']}>治疗方案 ({treatItem.name})</div>
 
                     <div className={style['treat-inner-box']}>
                         <GeneralTreat icon={generalIcon} title='一般治疗'   generalTreat={generalTreat}></GeneralTreat>
@@ -75,14 +87,10 @@ class Treat extends Component {
                     </TreatDesc>}
                 </div>
                 
-                
-                {showDrug && drugInfo && <DrugInfo drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
+                {showDrug && drugInfo && <DrugInfo setTreatBox={this.setTreatBox} treatIndexSet={treatIndexSet} drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
                 {/* 查询多个药品说明书 (添加数据查看药品说明书用)*/}
                 {/* {showDrug && <DrugInfo drugInfoList = {drugInfoList} hideDrugInfoMore = {hideDrugInfoMore}></DrugInfo>} */}
             </div>
-                
-            
-        
         )
     }
 }

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

@@ -14,6 +14,12 @@
     // z-index: 301;
     z-index: 300;
 }
+.close {
+  position: absolute;
+  z-index:9999;
+  top: 0;
+  right: 0;
+}
 .treat-mask {
     position: fixed;
     width: 100%;
@@ -31,12 +37,13 @@
     background: #fff;
     width: 680px;
     left: 50%;
-    top: 20%;
-    height: 60%;
+    top: 10%;
+    height: 80%;
     margin-left: -340px;
     z-index: 301;
     padding-top: 40px;
     padding-bottom: 80px;
+    box-shadow: 0px 0px 5px -2px #7d7c7c;
 }
 .treat-title {
     width: 100%;
@@ -47,6 +54,14 @@
     line-height: 40px;
     border-bottom: 1px solid #e0e2e4;
     padding-left: 20px;
+    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;
     img{
         float: right;
         cursor: pointer;

+ 70 - 8
src/components/TreatDesc/DrugInfo/index.jsx

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

+ 64 - 9
src/components/TreatDesc/DrugInfo/index.less

@@ -1,14 +1,15 @@
 .drug-info-wrapper {
     position: fixed;
+    overflow: hidden;
     width: 950px;
-    height: 70%;
+    height: 80%;
     left: 50%;
-    top: 15%;
+    top: 10%;
     margin-left: -475px;
     background: #fff;
     z-index: 303;
     padding: 40px 0 60px;
-    
+    box-shadow: 0px 0px 5px -2px #7d7c7c;
 }
 .drug-desc-wrapper {
     height: 100%;
@@ -23,10 +24,20 @@
     line-height: 40px;
     padding: 0 40px;
     border-bottom: 1px solid #979797;
+    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;
 }
 .close-drug-desc {
     position: absolute;
     right: 0;
+    top: 0;
+    z-index: 9999;
     width: 40px;
 }
 .drug-desc-item {
@@ -44,11 +55,11 @@
     display: inline-block;
     font-weight: bold;
     font-size: 14px;
-    height: 100%;
-    float: left;
-    width: 190px;
-    text-align-last:justify;    /*chrome*/
-    text-justify: distribute;   /*ff*/
+    // height: 100%;
+    // float: left;
+    // width: 190px;
+    // text-align-last:justify;    /*chrome*/
+    // text-justify: distribute;   /*ff*/
 }
 .drug-desc-title::before {
     content: '【'
@@ -65,5 +76,49 @@
 }
 .drug-desc-content {
     /*width: 100%;*/
-    margin-left: 210px;
+    margin: 0px 160px 0px 10px;
+}
+
+.content-menu-box {
+    position: absolute;
+    top: 50px;
+    right: 20px;
+    width: 160px;
+    height: 80%;
+    overflow: hidden;
+    
+}
+.content-menu-wrapper {
+    width: 200px;
+    height: 100%;
+    overflow-y: auto;
+}
+.content-menu {
+    
+    background: #eee;
+    border: 1px solid #eee;
+    width: 160px;
+    padding: 15px 18px;
+}
+.details-content-menu-line {
+    height: 15px;
+    width: 0;
+    border: 1px solid #ccc;
+    background-color: #ccc;
+    margin-left: 4px
+}
+.details-content-menu-name {
+    color: #33475f;
+    font-size: 13px;
+    cursor: pointer;
+}
+.details-content-menu-circle {
+    display: inline-block;
+    width: 8px;
+    height: 8px;
+    border-radius: 5px;
+    border: 1px solid #ccc;
+    margin-top: 5px;
+    background-color: #eee;
+    margin-right: 10px;
 }

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


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


+ 44 - 9
src/components/TreatDesc/index.jsx

@@ -4,29 +4,53 @@ import $ from "jquery";
 import close from './img/close.png';
 import info from './img/info.png';
 import info1 from './img/info1.png';
+import info2 from './img/info2.png';
+import info3 from './img/info3.png';
 
 
 class TreatDesc extends Component {
     constructor(props){
         super(props);
         this.state = {
-            currentIndex: -1
+            currentIndex: -1,
+            hasEnterImg: false
         }
         this.hideTreatDesc = this.hideTreatDesc.bind(this);
         this.handleSelect= this.handleSelect.bind(this);
+        this.handleMouseEnterDrug = this.handleMouseEnterDrug.bind(this)
+        this.handleMouseLeaveDrug = this.handleMouseLeaveDrug.bind(this)
+        this.handleMouseEnterImg = this.handleMouseEnterImg.bind(this)
         this.handleMouseLeaveImg = this.handleMouseLeaveImg.bind(this)
+
     }
 
-    handleMouseEnterImg(index) {
+    handleMouseEnterDrug( index, item) {
+        // console.log('item', item)
+        const drugNameWidth = parseInt($('#'+item.medicitionName)[0].offsetWidth)
+        
+        const imgLeft = drugNameWidth/2-10
+        // console.log('imgLeft', imgLeft)
+        $('#'+item.medicitionName).find('img').css('left', imgLeft)
+       
         this.setState({
             currentIndex: index,
         })
     }
-    handleMouseLeaveImg() {
+    handleMouseLeaveDrug() {
         this.setState({
             currentIndex: -1,
         })
     }
+    handleMouseEnterImg() {
+        this.setState({
+            hasEnterImg: true
+        })
+    }
+    handleMouseLeaveImg() {
+        this.setState({
+            hasEnterImg: false
+        })
+    }
     handleSelect(index,ii) {
         const { selectDrug } = this.props;
         selectDrug && selectDrug(index,ii);
@@ -34,13 +58,14 @@ class TreatDesc extends Component {
     hideTreatDesc() {
         $('#treatDescBox').css({'display': 'none'});
         $('#treatDescBox').animate({'display': 'none'}, 500);
-        $('#treatWrapper').animate({'margin-left': '-340px'}, 500);
+        $('#treatWrapper').animate({'margin-left': '-340px','left':'50%'}, 500);
+        
     }
 
     render(){
         const  { treatment, treatDesc, setDrugInfo, showDrugInfo} = this.props
         const { title, basic, otherDrugIndex, drugDesc} = treatDesc
-        const { currentIndex } = this.state
+        const { currentIndex, hasEnterImg } = this.state
         return (treatment && treatment.length >0 && <div  className={style['treat-desc-box']}>
             
             {title && title === '药品推荐' ? <div className={style['similar-drug-box']} id='treatDescBox'>
@@ -57,22 +82,32 @@ class TreatDesc extends Component {
                     {treatment[otherDrugIndex].medicitionsList.map((item, index) =>{
                         return (<span >
                         {index === 0 ? '' : ', '}     
-                        <span className={style['drug-name-box']}>
+                        <span className={style['drug-name-box']}
+                            onMouseEnter={this.handleMouseEnterDrug.bind(this, index, item )}
+                            onMouseLeave = {this.handleMouseLeaveDrug}
+                            id={item.medicitionName}
+                        >
                             <span className={style['drug-name']} 
                                 // onDoubleClick={() =>{setDrugInfo(item);showDrugInfo();}} 
                                 onClick={()=>{item.forbidden === '2' ? '' : this.handleSelect(otherDrugIndex,index)}} 
                                 style={item.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)'} : item.selected ? {color: '#3B9ED0'}:''}
-                              
                                 >
                                 {item.medicitionName}
                             </span>
+                            {<img className={style['info-img']}  
+                                style ={currentIndex === index ? {display: "inline-block"} : {display: "none"}}
+                                src={currentIndex === index ?  (hasEnterImg ? info3 : info2) : info2} 
+                                onMouseEnter={this.handleMouseEnterImg.bind(this, index)}
+                                onMouseLeave = {this.handleMouseLeaveImg}
+                                onClick={() =>{setDrugInfo(item);showDrugInfo();}}
+                                />}
                         </span>              
                         
-                        {<img className={style['info-img']}    
+                        {/* {<img className={style['info-img']}    
                             src={currentIndex === index ? info1 : info} 
                             onMouseEnter={this.handleMouseEnterImg.bind(this, index)}
                             onMouseLeave = {this.handleMouseLeaveImg}
-                            onClick={() =>{setDrugInfo(item);showDrugInfo();}}/>}
+                            onClick={() =>{setDrugInfo(item);showDrugInfo();}}/>} */}
                         {item.forbidden === '1' ? <span className={style['info-flag']} style={{border: '1px solid #F4C051', background: '#F4C051',marginLeft: '5px'}}>慎用</span>: item.forbidden === '2' ? <span className={style['info-flag']} style={{opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)',border: '1px solid #000',marginLeft: '5px'}}>禁用</span> : ''},
                         <span  style={item.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)'} : ''}> 使用率{item.rate}</span>
                         

+ 5 - 1
src/components/TreatDesc/index.less

@@ -45,10 +45,12 @@
     top: 0;
     background: #fff;
     padding: 60px 20px 80px;
+    box-shadow: 2px 0px 5px -2px #7d7c7c;
 }
 .drug-name-box {
     display: inline-block;
     height: 30px;
+    position: relative;
 }
 .drug-name {
     border-bottom: 1px solid #666;
@@ -57,9 +59,11 @@
     
 }
 .info-img {
-    width: 12px;
+    width: 15px;
     margin: 0 3px -1px;
     cursor: pointer;
+    position: absolute;
+    top: -10px;
 }
 .info-flag {
     display: inline-block;

+ 6 - 3
src/config/index.js

@@ -19,14 +19,14 @@ export default {
     },
     textId:'text',        //自由文本标签的id,
     textLabel:'{"tagType":"8","id":"","name":""}',
-    _textLabel:'{"tagType":"8","id":"","name":","}',//查体每个标签后面加逗号(1-29
+    _textLabel:'{"tagType":"8","id":"","name":","}',//查体每个标签后面加逗号(1-29/改成中文逗号3-18
     tagType:"8",
     tongYId:7,      //主诉通用特征描述id
     addSId:8,      //主诉添加症状id
     addOthSId:21,      //现病史 添加其他症状id
     banId:10,       //伴 id
     limited:30,    //主诉限制字数
-    limitText:"已超过30字符,请修改主诉",    //主诉限制提示
+    limitText:"已超过30字符(含标点),请修改主诉",    //主诉限制提示
     delayTime:500,      //延迟搜索的时间
     delayPushTime:1000,    //延迟推送时间
     pushDelay:1000,
@@ -42,5 +42,8 @@ export default {
       year:"年",
       age:"岁",
     },
-    Params
+    showCheckNum:16,        //查体默认展开非自由文本标签的个数
+    radioOptionPer:'()',     //单选项输入占位符
+    textReg:new RegExp("([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9])"), //包含中英文或数字
+  Params
 };

+ 20 - 4
src/containers/AdviceContainer.js

@@ -1,10 +1,14 @@
 import React from 'react';
 import {connect} from 'react-redux';
 import Advice from '../components/Advice'
-import { SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK } from '@store/types/pushMessage';
+import { SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK, SET_COMMONTREATMENT ,SET_ADVICE_INPUT} from '@store/types/pushMessage';
 
-function mapStateToProps({pushMessage}) {
-    return ({pushMessage})
+function mapStateToProps(state) {
+    return ({
+        pushMessage: state.pushMessage,
+        isRead:state.homePage.isRead,
+        adviceInput: state.pushMessage.advice.adviceInput
+    })
 }
 
 function mapDispatchToProps(dispatch) {
@@ -28,7 +32,19 @@ function mapDispatchToProps(dispatch) {
                 type: SET_CHANGE_ADVICE_CHECK,
                 changeInput:changeInput
             })
-        }
+        },
+        comTreatChange: (text) => {
+            dispatch({
+                type: SET_COMMONTREATMENT,
+                commontreatment: text,
+            })
+        },
+        adviceInputChange: (text) => {
+            dispatch({
+                type: SET_ADVICE_INPUT,
+                adviceInput: text,
+            })
+        },
     }
 }
 

+ 5 - 1
src/containers/AssistCheck.js

@@ -5,9 +5,10 @@ import {
 import AssistCheck from '@components/AssistCheck';
 import { assistLable,delAssistLabel,changeAssistVal,changeDate } from '@store/actions/assistCheck';
 import { getSearchList } from '@store/async-actions/assistCheck';
+import {ISREAD} from '@store/types/homePage.js';
 import {billing} from '@store/async-actions/pushMessage';
 
-function mapStateToProps(state) {
+function mapStateToProps(state) {//console.log(state.assistCheck)
     return {
         list:state.assistCheck.list,
         assistLabel:state.assistCheck.assistLabel,
@@ -26,6 +27,9 @@ function mapDispatchToProps(dispatch, store) {
         },
         handleDelAssist(idx){
             dispatch(delAssistLabel(idx))
+            dispatch({
+              type:ISREAD
+            })
         },
         handleChangeAssistValue(val,idx){
             dispatch(changeAssistVal(val,idx))

+ 1 - 0
src/containers/CheckBody.js

@@ -11,6 +11,7 @@ function mapStateToProps(state){
   const hasMain = filterDataArr(mainSuit.saveText);//||mainSuit.data.length;
   return {
     data:checkBody.data,
+    defaultShowAll:checkBody.showAll,
     isEmpty:checkBody.isEmpty,
     update:checkBody.update,   //用于触发更新
     showArr:homePage.showDrop,

+ 5 - 1
src/containers/CurrentIll.js

@@ -26,6 +26,7 @@ function mapStateToProps(state) { //console.log(111,state);
         update:state.currentIll.update,//用于更新
         mainText:state.mainSuit.saveText,//主诉选中的数据
         mainData:state.mainSuit.data,//主诉使用的模板
+        symptomFeature:state.mainSuit.symptomFeature,//主诉分词数据
         moduleNum:state.mainSuit.moduleNum,//主诉使用的模板
         type: state.typeConfig.typeConfig,
         mainIds:state.mainSuit.mainIds,//主诉症状选中的id(去重用)
@@ -40,6 +41,7 @@ function mapStateToProps(state) { //console.log(111,state);
         fuzhen:state.diagnosticList.mainSuitStr,//诊断第一个复诊值
         boxTop:state.homePage.boxTop,
         boxLeft:state.homePage.boxLeft,
+        allModules:state.homePage.allModules,
 
     }
 }
@@ -47,7 +49,7 @@ function mapStateToProps(state) { //console.log(111,state);
 
 function mapDispatchToProps(dispatch) {
     return {
-       insertProcess(obj){//点击病程变化
+       insertProcess(obj,allModules){//点击病程变化
         // 埋点dispatch
         dispatch({
           type:CLICKCOUNT,
@@ -57,6 +59,8 @@ function mapDispatchToProps(dispatch) {
         });
         dispatch({
           type:INSERT_PROCESS,
+          id:obj.relationModule,
+          allModules:allModules
         });
         dispatch({
           type:ISREAD

+ 1 - 1
src/containers/EditableSpan.js

@@ -21,7 +21,7 @@ function mapStateToProps(state){//console.log(state)
 function mainSuitSearch(obj){
   return (dispatch)=>{
     const text = obj.text.replace(/\,/,'');
-    getSearch({boxMark:1,inpStr:text,mainIds:obj.mainIds}).then((res)=>{
+    getSearch({boxMark:1,inpStr:text,mainIds:obj.mainIds,itemType:0}).then((res)=>{
       if(res.data.code=='0'){
         dispatch({
           type:SET_SEARCH,

+ 1 - 1
src/containers/Inspect.js

@@ -4,7 +4,7 @@ import Inspect from '@components/Inspect';
 import {getSearchList,getSublableList} from '@store/async-actions/inspect';
 import {setLabel,fillActived,fillActiveDetail,checkValueIsChange,delExcelLis,clearLabel,delPartItem} from '@store/actions/inspect';
 import {billing} from '@store/async-actions/pushMessage';
-function mapStateToProps(state) {
+function mapStateToProps(state) {//console.log(state)
     return {
         list:state.inspect.list,
         labelList:state.inspect.labelList,

+ 21 - 5
src/containers/MainSuit.js

@@ -1,18 +1,18 @@
 import React from 'react';
 import { connect } from 'react-redux';
 import MainSuit from '@components/MainSuit';
-import {CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,CLEAR_SEARCH,SET_SEARCH,SAVE_FREE,SET_DATA,INSERT_SEARCH,SETTEXTMODEVALUE} from '@store/types/mainSuit';
+import {CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,CLEAR_SEARCH,SET_SEARCH,SAVE_FREE,SET_DATA,INSERT_SEARCH,SETTEXTMODEVALUE,SET_FEATURE} from '@store/types/mainSuit';
 import {RESET,CLICKCOUNT,ISREAD,SEARCH_DROP_LOCATION} from '@store/types/homePage.js';
 import {getCommSymptoms,getCommSymptomPush} from '@store/async-actions/mainSuit.js'
 import {SET_MAIN_SUIT} from '@store/types/fillInfo';
 import {CLEAR_DIAGNOSE} from '@store/types/diagnosticList';
-import {getSearch} from '@store/async-actions/fetchModules';
+import {getSearch,getFeature} from '@store/async-actions/fetchModules';
 import {billing} from '@store/async-actions/pushMessage';
 import {filterArr,didPushParamChange,filterDataArr} from '@utils/tools.js';
 import config from '@config/index.js';
 import {Notify} from '@commonComp';
 
-function mapStateToProps(state) {
+function mapStateToProps(state) {//console.log(11,state);
   return {
     showDrop:state.mainSuit.showDrop,//用于更新
     update:state.mainSuit.update,
@@ -30,11 +30,14 @@ function mapStateToProps(state) {
     span:state.mainSuit.span,
     addModuleName:state.mainSuit.addModuleName,//添加病情变化模板名称
     editClear:state.mainSuit.editClear,
+    clearAction:state.mainSuit.clearAction,//清除
     mainIds:state.mainSuit.mainIds,//选中症状的id,搜索去重用
     isRead:state.homePage.isRead,
     commSymHide:state.homePage.commSymHide,
     boxTop:state.homePage.boxTop,
     boxLeft:state.homePage.boxLeft,
+    currentData:state.currentIll.data,
+    allModules:state.homePage.allModules,
   }
 }
 
@@ -53,7 +56,7 @@ function mapDispatchToProps(dispatch) {
             type: CLEAR_COMSYMPTOMS
           })
         },
-        handleTailClick:(obj,saveText)=>{//点击带尾巴的标签,如添加病程变化
+        handleTailClick:(obj,saveText,allModules)=>{//点击带尾巴的标签,如添加病程变化
           let text = filterDataArr(saveText);
           if(text.length >= config.limited){
             Notify.info(config.limitText);
@@ -68,7 +71,9 @@ function mapDispatchToProps(dispatch) {
           });
           dispatch({
             type: SHOW_TAIL,
-            info:obj.questionMapping
+            info:obj.questionMapping,
+            id:obj.relationModule,
+            allModules:allModules
           })
           dispatch({
             type:ISREAD
@@ -166,6 +171,17 @@ function mapDispatchToProps(dispatch) {
           left:left,
           dis:0
         })
+      },
+      async getSymptomFeature(item){
+        const it = item&&item.trim();
+        const symptomFeature = await getFeature(it);
+        if(symptomFeature.data.code==0){
+          const data = symptomFeature.data.data;
+          dispatch({
+            type:SET_FEATURE,
+            data:data
+          })
+        }
       }
     }
 }

+ 5 - 1
src/containers/MultSpread.js

@@ -5,7 +5,7 @@ import {SETSELECTED,CLEARSELECTED,CONFIRMSELECTED,CHANGEOTHERTEXTLABEL,OTHERADDL
 import {CHANGECHECKTEXTLABEL,ADDLABELITEM} from '@types/checkBody.js';
 import {CHANGE_LABELVAL,MAINADDLABELITEM} from '@store/types/mainSuit.js';
 import {CURRENTADDLABELITEM} from '@store/types/currentIll.js';
-import {HIDE,RESET,CLICKCOUNT,SETADDITEMINIT} from '@store/types/homePage.js';
+import {HIDE,RESET,CLICKCOUNT,SETADDITEMINIT,ISREAD} from '@store/types/homePage.js';
 
 function mapStateToProps(state){
   return {}
@@ -27,6 +27,10 @@ const getCopyData = (copyId,inx,boxMark)=>{
       data:JSON.stringify(copy),
       i:inx
     });
+    //自由文本组件更新
+    dispatch({
+      type:ISREAD
+    })
   }
 };
 

+ 3 - 3
src/containers/Multiple.js

@@ -32,7 +32,7 @@ function handleCurrent(dispatch,params){
   const index = getLabelIndex(ikey);
   dispatch({
     type:CURRENT_MUL,
-    data:{seleData,seleId,ikey:index}
+    data:{seleData,seleId,ikey:index,fullIkey:ikey}
   })
 }
 
@@ -41,7 +41,7 @@ function handleOtherHis(dispatch,params){
   const index = getLabelIndex(ikey);
   dispatch({
     type:OTHERHIS_MUL,
-    data:{seleData,seleId,ikey:index}
+    data:{seleData,seleId,ikey:index,fullIkey:ikey}
   })
 }
 
@@ -50,7 +50,7 @@ function handleCheckBody(dispatch,params){
   const index = getLabelIndex(ikey);
   dispatch({
     type:CHECKBODY_MUL,
-    data:{seleData,seleId,ikey:index}
+    data:{seleData,seleId,ikey:index,fullIkey:ikey}
   })
 }
 

+ 4 - 1
src/containers/NumberDrop.js

@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
 import NumberDrop from "@components/NumberDrop";
 import {SETNUMBER,CHANGEOTHERTEXTLABEL,CHANGEOTHERTEXTLABEL_NUMBER} from '@types/otherHistory';
 import {SETNUMBER4,CHANGECHECKTEXTLABEL,CHANGECHECKTEXTLABEL_NUMBER} from '@types/checkBody.js';
-import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP} from '@types/homePage.js';
+import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP,ISREAD} from '@types/homePage.js';
 import {NUMBER_SELECT,CHANGE_LABELVAL,CHANGE_LABELVAL_NUMBER} from '@store/types/mainSuit.js';
 import {getLabelIndex} from '@common/js/func.js';
 import {CURRENT_NUMBER,CURRENT_TEXT_LABEL,CURRENT_TEXT_LABEL_NUMBER} from '@store/types/currentIll.js';
@@ -90,6 +90,9 @@ function currentLabel(dispatch,params){
     // type:CURRENT_TEXT_LABEL,
     type:CURRENT_TEXT_LABEL_NUMBER,
     data:Object.assign({},params,{ikey})
+  });
+  dispatch({
+    type:ISREAD
   })
 }
 

+ 29 - 11
src/containers/NumberUnitDrop.js

@@ -15,6 +15,7 @@ import config from '@config/index.js';
 function mapStateToProps(state){
   return {
     mainSaveText:state.mainSuit.saveText,
+    mainData:state.mainSuit.data,
   }
 }
 //查体数字键盘选中
@@ -47,15 +48,26 @@ function currentSelect(dispatch,params){
 }
 
 function handleModuleDiff(dispatch,params){
-  const {mainSaveText} = params;
+  const {mainSaveText,mark,mainData} = params;
   const type = params.ikey.substr(0,1);    //当前所在的项目
+  let ikey = getLabelIndex(params.ikey);
   switch (+type){
     case 1:
-      let text = filterDataArr(mainSaveText);
-      if(text.length >= config.limited){
-        Notify.info(config.limitText);
-        return
-      }
+      if(mark){//选中才限制,清空和回退无需验证
+        // let text = filterDataArr(mainSaveText);
+        let text = filterArr(mainSaveText);
+        const item = mainData[+ikey];
+        const nextItem = mainData[+ikey+1];
+        let lengths = text.length;
+        if(nextItem&&nextItem.tagType==8 && nextItem.tagName==',' && item.value){
+          lengths = text.length + 1;
+        }
+        // console.log(999,mainSaveText,lengths);
+        if(lengths >= config.limited){
+          Notify.info(config.limitText);
+          return
+        }
+      } 
       mainSelect(dispatch,params);
       break;
     case 2:
@@ -78,7 +90,8 @@ function mainSuitLabel(dispatch,params){
   const {changeVal,totalVal} = params;
   dispatch({
     type:CHANGE_LABELVAL,
-    data:{changeVal:changeVal,ikey:ikey,totalVal}
+    // data:{changeVal:changeVal,ikey:ikey,totalVal}
+    data:Object.assign({},params,{ikey})
   })
 }
 // 现病史
@@ -87,7 +100,8 @@ function currentLabel(dispatch,params){
   let ikey = getLabelIndex(index);
   dispatch({
     type:CURRENT_TEXT_LABEL,
-    data:{changeVal:params.changeVal,ikey:ikey}
+    // data:{changeVal:params.changeVal,ikey:ikey}
+    data:Object.assign({},params,{ikey})
   })
 }
 
@@ -98,7 +112,8 @@ function otherHisLabelEdit(dispatch,params){
   let ikey = getLabelIndex(index);
   dispatch({
     type:CHANGEOTHERTEXTLABEL,
-    data:{changeVal:changeVal,ikey:ikey,totalVal}
+    // data:{changeVal:changeVal,ikey:ikey,totalVal}
+    data:Object.assign({},params,{ikey})
   })
 }
 
@@ -109,7 +124,8 @@ function checkBodyLabelEdit(dispatch,params){
   const {changeVal,totalVal} = params;
   dispatch({
     type:CHANGECHECKTEXTLABEL,
-    data:{changeVal:changeVal,ikey:ikey,totalVal}
+    // data:{changeVal:changeVal,ikey:ikey,totalVal}
+    data:Object.assign({},params,{ikey})
   })
 }
 function mapDispatchToProps(dispatch,store){
@@ -129,7 +145,9 @@ function mapDispatchToProps(dispatch,store){
           type:ISREAD
         })
       }
-      
+      dispatch({
+        type: ISREAD
+      });
     },
     handleDbclick(obj){
       dispatch({

+ 11 - 7
src/containers/OtherHistory.js

@@ -38,17 +38,21 @@ function mapDispatchToProps(dispatch,store){
     setInitData(){
       //先获取最近记录,没有的话显示模板
       dispatch((dispatch,getStore)=>{
-        const initData = getStore().homePage.initData;
-        const model = JSON.parse(JSON.stringify(initData.otherHisModel));
-        const arr = JSON.parse(JSON.stringify(initData.otherHis||null));
-        const arrSave = JSON.parse(JSON.stringify(initData.otherHisSave||null));
-        const selects = JSON.parse(JSON.stringify(initData.otherSelecteds||null));
-        const isHis = initData.otherIsHis;
-        const listObj = isHis?{newArr:arr,saveText:arrSave||[]}:fullfillText(model);
+        const state = getStore();
+        const initData = state.homePage.initData;
+        const mode = state.typeConfig.typeConfig;
+        const model = JSON.parse(JSON.stringify(initData.otherHisModel));     //查体模板
+        const arr = JSON.parse(JSON.stringify(initData.otherHis||null));        //最近其他史数据
+        const arrSave = JSON.parse(JSON.stringify(initData.otherHisSave||null));    //最近其他史saveText
+        const selects = JSON.parse(JSON.stringify(initData.otherSelecteds||null));  //其他史杂音类选中项
+        const isHis = initData.otherIsHis;     //是否是历史数据
+        const onlyOneText = arr&&arr.length==1&&arr[0].tagType==8&&!(arr[0].name||arr[0].value);    //是否只有一个自由文本标签
+        const listObj = isHis&&(mode==1||(!onlyOneText&&mode==0))?{newArr:arr,saveText:arrSave||[]}:fullfillText(model);
         dispatch({
           type:SETDATA,
           data:listObj.newArr,
           selecteds:selects,
+          period:initData.period,
           save:listObj.saveText,
           isEmpty:false
         });

+ 8 - 5
src/containers/RadioDrop.js

@@ -64,14 +64,17 @@ function checkSelect(dispatch,params){
 }
 //在不同模块(主诉、现病史等)下拉选中调用不同事件
 function handleModuleDiff(dispatch,store,params){
-  const {mainSaveText} = params;
+  const {mainSaveText,value,text} = params;
   const type = params.ikey.substr(0,1);    //当前所在的项目
   switch (+type){
     case 1:
-      let text = filterDataArr(mainSaveText);
-      if(text.length >= config.limited){
-        Notify.info(config.limitText);
-        return
+      if(text){//有选值才需要判断,清空不需要处理
+        let mainText = filterDataArr(mainSaveText);
+        let lengths = value?mainText.length - value.length + text.length:mainText.length + text.length;
+        if(lengths >= config.limited){
+          Notify.info(config.limitText);
+          return
+        }
       }
       mainSelect(dispatch,params);
       break;

+ 190 - 0
src/containers/RadioInpDrop.js

@@ -0,0 +1,190 @@
+import React from 'react';
+import {connect} from 'react-redux';
+import RadioInpDrop from "@components/RadioInpDrop";
+import {SETRADIO,CLEARSELECTED,CONFIRMSELECTED,CHANGEOTHERTEXTLABEL,SET_OT_RADIO_INPUT_VAL} from '@types/otherHistory';
+import {SETSELECTED4,CHANGECHECKTEXTLABEL,SET_CK_RADIO_INPUT_VAL} from '@types/checkBody';
+import {SETDROPSHOW,HIDE,RESET,HIDEDROP,CLICKCOUNT,ISREAD} from '@types/homePage.js';
+import {RADIO_SELECT,CHANGE_LABELVAL,SET_MS_RADIO_INPUT_VAL} from '@store/types/mainSuit.js';
+import {CURRENT_RADIO,CURRENT_TEXT_LABEL,SET_RADIO_INPUT_VALUE} from '@store/types/currentIll.js';
+import {Notify} from '@commonComp';
+import {filterArr,didPushParamChange,filterDataArr} from '@utils/tools.js';
+import {billing} from '@store/async-actions/pushMessage';
+import {getLabelIndex,fullfillText} from '@common/js/func.js';
+import config from '@config/index.js';
+
+function mapStateToProps(state){
+  return {
+    //mainSaveText:state.mainSuit.saveText,
+  }
+}
+
+
+// 主诉选中事件
+function mainSelect(dispatch,params){
+  const {ikey,id,values} = params;
+  let index = getLabelIndex(ikey);
+  dispatch({
+    type:SET_MS_RADIO_INPUT_VAL,
+    data:{
+      ikey:index,
+      id,
+      values
+    }
+  });
+}
+
+// 现病史选中事件
+function currentSelect(dispatch,params){
+  const {ikey,id,values} = params;
+  let index = getLabelIndex(ikey);
+  dispatch({
+    type:SET_RADIO_INPUT_VALUE,
+    data:{
+      ikey:index,
+      id,
+      values
+    }
+  });
+}
+
+
+//其他史选中事件
+function otherSelect(dispatch,params){
+  const {ikey,id,values} = params;
+  let index = getLabelIndex(ikey);
+  dispatch({
+    type:SET_OT_RADIO_INPUT_VAL,
+    data:{
+      ikey:index,
+      id,
+      values
+    }
+  });
+}
+//查体单选下拉选中事件
+function checkSelect(dispatch,params){
+  const {ikey,id,values} = params;
+  dispatch({
+    type:SET_CK_RADIO_INPUT_VAL,
+    data:{
+      ikey,
+      id,
+      values
+    }
+  });
+}
+//在不同模块(主诉、现病史等)下拉选中调用不同事件
+function handleModuleDiff(dispatch,store,params){
+  const {mainSaveText,value,text} = params;
+  const type = params.ikey.substr(0,1);    //当前所在的项目
+  switch (+type){
+    case 1:
+      if(text){//有选值才需要判断,清空不需要处理
+        let mainText = filterDataArr(mainSaveText);
+        let lengths = value?mainText.length - value.length + text.length:mainText.length + text.length;
+        if(lengths >= config.limited){
+          Notify.info(config.limitText);
+          return
+        }
+      }
+      mainSelect(dispatch,params);
+      break;
+    case 2:
+      currentSelect(dispatch,params);
+      break;
+    case 3:
+      otherSelect(dispatch,params);
+      break;
+    case 4:
+      checkSelect(dispatch,params);
+      break;
+    default:
+  }
+}
+/**************标签双击输入action types**************/
+//对应模块单选双击编辑事件
+const dbEditActions = {
+  1:CHANGE_LABELVAL,
+  2:CURRENT_TEXT_LABEL,
+  3:CHANGEOTHERTEXTLABEL,
+  4:CHANGECHECKTEXTLABEL
+};
+//对应模块单选带输入存值事件
+const InputActions = {
+  1:SET_MS_RADIO_INPUT_VAL,
+  2:SET_RADIO_INPUT_VALUE,
+  3:SET_OT_RADIO_INPUT_VAL,
+  4:SET_CK_RADIO_INPUT_VAL
+};
+
+function mapDispatchToProps(dispatch,store){
+  return {
+    handleSelect(params) {
+      handleModuleDiff(dispatch, store, params);
+      //单选选中隐藏弹窗
+      dispatch({
+        type: HIDEDROP
+      });
+
+      //右侧推送
+      setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
+        if(didPushParamChange()){     //操作后内容有变化才推送
+          dispatch(billing());
+        }
+      },500);
+    },
+    handleDbclick(obj){//双击统计
+      dispatch({
+        type:CLICKCOUNT,
+        data:obj,
+        clickType:'双击',
+        num:1
+      });
+    },
+    handleSaveInp(params){
+      const {boxMark} = params;
+      const index = params.ikey;
+      let ikey = getLabelIndex(index);
+      dispatch({
+        type:InputActions[+boxMark],
+        data:{values:params.values,ikey:boxMark==4?params.ikey:ikey}
+      });
+      dispatch(billing());
+      dispatch({
+        type:ISREAD
+      })
+    },
+    handleLabelEdit(params){
+      const {type} = params;
+      const index = params.ikey;
+      let ikey = getLabelIndex(index);
+      dispatch({
+        type:dbEditActions[+type],
+        data:{changeVal:params.changeVal,ikey:ikey}
+      });
+      dispatch(billing());
+      dispatch({
+        type:ISREAD
+      })
+    },
+    handleShow(obj) {
+      dispatch({
+        type:CLICKCOUNT,
+        data:obj,
+        clickType:'单击',
+        num:1
+      });
+      dispatch({
+        type:SETDROPSHOW,
+        data:obj
+      });
+      dispatch({
+        type: RESET
+      });
+    }
+  }
+}
+
+const RadioInpDropCont = connect(mapStateToProps,mapDispatchToProps)(RadioInpDrop);
+
+export default RadioInpDropCont;

+ 0 - 0
src/containers/SpreadDrop.js


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است