소스 검색

Merge branch 'dev/new1' into ChronicMag

Luolei 6 년 전
부모
커밋
eceda46862
100개의 변경된 파일2838개의 추가작업 그리고 686개의 파일을 삭제
  1. 1 1
      src/common/components/ConfirmModal/index.jsx
  2. 72 61
      src/common/components/EditableSpan/index.jsx
  3. 25 1
      src/common/components/InlineTag/index.jsx
  4. 2 0
      src/common/components/InlineTag/index.less
  5. 1 1
      src/common/components/InspectCommon/index.jsx
  6. 3 1
      src/common/components/InspectCommon/index.less
  7. 5 3
      src/common/components/ItemBox/index.jsx
  8. 1 1
      src/common/components/NumberPan/index.jsx
  9. 17 16
      src/common/components/NumberUnitPan/index.jsx
  10. 24 0
      src/common/components/NumberUnitPan/index.less
  11. 21 15
      src/common/components/SearchOption/index.jsx
  12. 11 4
      src/common/components/Textarea/index.jsx
  13. BIN
      src/common/images/backspace.png
  14. BIN
      src/common/images/slide-down.png
  15. BIN
      src/common/images/slide-up.png
  16. 8 2
      src/common/less/variables.less
  17. 5 2
      src/components/AddAssistCheck/Textarea/index.jsx
  18. 1 1
      src/components/AddAssistCheck/index.jsx
  19. 78 0
      src/components/AddInspect/SlideExcel/index.jsx
  20. 145 0
      src/components/AddInspect/SlideExcel/index.less
  21. 144 0
      src/components/AddInspect/SlideSelect/index.jsx
  22. 154 0
      src/components/AddInspect/SlideSelect/index.less
  23. 41 108
      src/components/AddInspect/index.jsx
  24. 17 2
      src/components/AddInspect/index.less
  25. 67 0
      src/components/Advice/Textarea/index.jsx
  26. 0 0
      src/components/Advice/Textarea/index.less
  27. 46 22
      src/components/Advice/index.jsx
  28. 3 3
      src/components/Advice/index.less
  29. 1 1
      src/components/AssistCheck/index.jsx
  30. 1 1
      src/components/Banner/index.jsx
  31. 29 5
      src/components/CheckBody/index.jsx
  32. 14 0
      src/components/CheckBody/index.less
  33. 79 9
      src/components/CommonSymptom/index.jsx
  34. 40 8
      src/components/CommonSymptom/index.less
  35. 2 2
      src/components/CopyRight/index.jsx
  36. 13 6
      src/components/CurrentIll/index.jsx
  37. 15 8
      src/components/DiagnosticItem/index.jsx
  38. 4 3
      src/components/DiagnosticList/index.jsx
  39. 1 1
      src/components/HistoryCaseContainer/index.jsx
  40. 2 2
      src/components/Inspect/index.jsx
  41. 34 27
      src/components/MainSuit/index.jsx
  42. 40 9
      src/components/MultSpread/index.jsx
  43. 5 4
      src/components/Multiple/index.jsx
  44. 5 0
      src/components/Multiple/index.less
  45. 111 23
      src/components/NumberDrop/index.jsx
  46. 38 21
      src/components/NumberUnitDrop/index.jsx
  47. 1 1
      src/components/NumberUnitDrop/index.less
  48. 0 2
      src/components/OtherHistory/index.jsx
  49. 1 1
      src/components/Preview/index.jsx
  50. 38 22
      src/components/PreviewBody/index.jsx
  51. 1 1
      src/components/PrintPreview/index.jsx
  52. 15 12
      src/components/PushItems/DetailsModal/index.jsx
  53. 7 2
      src/components/PushItems/DetailsModal/index.less
  54. 2 2
      src/components/PushItems/PushDiag/index.jsx
  55. 114 19
      src/components/PushItems/index.jsx
  56. 17 12
      src/components/PushItems/index.less
  57. 4 4
      src/components/RadioDrop/index.jsx
  58. 223 0
      src/components/RadioInpDrop/index.jsx
  59. 29 0
      src/components/RadioInpDrop/index.less
  60. 28 11
      src/components/SearchDrop/index.jsx
  61. 10 3
      src/components/SpreadDrop/index.jsx
  62. 41 13
      src/components/Treat/DrugTreat/index.jsx
  63. 9 1
      src/components/Treat/DrugTreat/index.less
  64. 2 2
      src/components/Treat/GeneralTreat/index.jsx
  65. BIN
      src/components/Treat/img/info2.png
  66. BIN
      src/components/Treat/img/info3.png
  67. 21 13
      src/components/Treat/index.jsx
  68. 10 2
      src/components/Treat/index.less
  69. 70 8
      src/components/TreatDesc/DrugInfo/index.jsx
  70. 50 2
      src/components/TreatDesc/DrugInfo/index.less
  71. BIN
      src/components/TreatDesc/img/info2.png
  72. BIN
      src/components/TreatDesc/img/info3.png
  73. 42 8
      src/components/TreatDesc/index.jsx
  74. 4 1
      src/components/TreatDesc/index.less
  75. 4 2
      src/config/index.js
  76. 20 4
      src/containers/AdviceContainer.js
  77. 5 1
      src/containers/AssistCheck.js
  78. 1 0
      src/containers/CurrentIll.js
  79. 1 1
      src/containers/EditableSpan.js
  80. 16 3
      src/containers/MainSuit.js
  81. 1 1
      src/containers/Multiple.js
  82. 29 11
      src/containers/NumberUnitDrop.js
  83. 11 7
      src/containers/OtherHistory.js
  84. 8 5
      src/containers/RadioDrop.js
  85. 190 0
      src/containers/RadioInpDrop.js
  86. 2 2
      src/containers/SpreadDrop.js
  87. 3 1
      src/containers/Treat.js
  88. 17 3
      src/containers/eleType.js
  89. 12 1
      src/modules/HomePage/index.jsx
  90. 5 1
      src/store/actions/assistCheck.js
  91. 82 2
      src/store/actions/checkBody.js
  92. 195 92
      src/store/actions/currentIll.js
  93. 5 0
      src/store/actions/diagnosticList.js
  94. 1 1
      src/store/actions/diagnosticSearch.js
  95. 1 0
      src/store/actions/homePage.js
  96. 5 1
      src/store/actions/inspect.js
  97. 91 23
      src/store/actions/mainSuit.js
  98. 63 3
      src/store/actions/otherHistory.js
  99. 5 5
      src/store/actions/patInfo.js
  100. 0 0
      src/store/actions/pushMessage.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',

+ 72 - 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,88 @@ 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 = target.innerText?getPageCoordinate(e).boxTop:NaN;
-      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)){
+          // 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 +267,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];

+ 25 - 1
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;
@@ -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>

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

@@ -55,7 +55,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(

+ 17 - 16
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){
@@ -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() != ''){

+ 11 - 4
src/common/components/Textarea/index.jsx

@@ -17,7 +17,7 @@ class Textarea extends Component {
     this.$dom = React.createRef();
     this.handleInput = this.handleInput.bind(this);
     this.handleFocus = this.handleFocus.bind(this);
-    //this.handleBlur = this.handleBlur.bind(this);
+    this.handleBlur = this.handleBlur.bind(this);
   }
   handleFocus(){            //初始显示props中的值,focus已经显示输入的值,避免值更新闪烁
     const {handleFocus,fuzhen,handleInput} = this.props;
@@ -58,7 +58,7 @@ class Textarea extends Component {
     })
 
     //存值到store
-    handleInput&&handleInput({text});
+    // handleInput&&handleInput({text});
     //右侧推送--延时推送
     clearTimeout(stimer);
     let timer = setTimeout(function(){
@@ -84,7 +84,7 @@ class Textarea extends Component {
   componentDidMount(){
     const {value} = this.props;
     if(value){
-      this.$dom.current.innerText?(this.$dom.current.innerText = value||''):(this.$dom.current.innerText=value||'');
+      this.$dom.current.innerText?(this.$dom.current.innerText = value||''):(this.$dom.current.innerHTML=value||'');
     }
     if(isIE()){
       $(this.$dom.current).onIe8Input(function(e){
@@ -92,6 +92,12 @@ class Textarea extends Component {
       },this);
     }
   }
+  handleBlur(){
+    const {handleInput} = this.props;
+    const text = this.$dom.current.innerText||this.$dom.current.innerHTML;
+    //存值到store
+    handleInput&&handleInput({text});
+  }
   render() {
     const { title } = this.props;
     return (
@@ -102,7 +108,8 @@ class Textarea extends Component {
              onFocus={this.handleFocus}
              ref={this.$dom}
              contentEditable={true}
-             onInput={this.handleInput}>
+             onInput={this.handleInput}
+             onBlur={this.handleBlur}>
         </div>
       </div>
     );

BIN
src/common/images/backspace.png


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


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


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

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

@@ -28,7 +28,6 @@ class Textarea extends Component {
       clearTimeout(stimer);
     },config.delayPushTime);
     if(text.trim() != '' && text != '<br>'){
-      console.log(e.target.nextSibling)
       e.target.nextSibling.innerText?(e.target.nextSibling.innerText = ''):(e.target.nextSibling.innerHTML = '')
     }else{
       e.target.nextSibling.innerText?(e.target.nextSibling.innerText = '报告描述或意见'):(e.target.nextSibling.innerHTML = '报告描述或意见')
@@ -47,6 +46,11 @@ 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(){
@@ -76,5 +80,4 @@ class Textarea extends Component {
     );
   }
 }
-
 export default Textarea;

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

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

+ 41 - 108
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>

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

+ 29 - 5
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){
@@ -27,9 +32,10 @@ class CheckBody extends Component{
   getLabels(){
     const {data,showArr,saveText,selecteds} = this.props;
     let arr = [],list=[];
-    const {boxMark} = this.state;
-    if(data){
-      list = data;
+    const {boxMark,showAll} = this.state;
+    const showData = showAll?[...data]:[...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});
       });
@@ -85,11 +91,29 @@ class CheckBody extends Component{
       this.props.getInit();
     }
   }
+  showHide(){
+    this.setState({
+      showAll:!this.state.showAll
+    });
+  }
+  componentWillUpdate(next){
+    if(!this.props.isEmpty&&next.isEmpty){
+      this.setState({
+        showAll:false
+      })
+    }
+  }
   render(){
-    const {searchData,totalHide,data,boxLeft,boxTop} = this.props;
+    const {searchData,totalHide,data,boxLeft,boxTop,saveText} = this.props;
+    const {showAll} = this.state;
+    const moreNum =config.showCheckNum*2+1;
+    const moreText = filterDataArr([...saveText].splice(moreNum));
+    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;
     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;

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

@@ -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>

+ 13 - 6
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,
@@ -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,

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

@@ -35,11 +35,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, isChronicMag} = this.props;
@@ -49,12 +56,12 @@ 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
+                //     }
+                // }
                 isChronicMag(item);
                 // 从缓存取慢病列表
                 let chronicList = JSON.parse(storageLocal.get('chronic'));

+ 4 - 3
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>}
@@ -92,7 +93,7 @@ class DiagnosticList extends Component {
                                     {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)}}>
+                                          onClick={() =>{hasTreat && this.showTreat(item, index)}}>
                                           治疗方案
                                     </span>
                                     <img className={style['diag-del']} src={del_icon} onClick={()=>{this.handleDeleteItem(item)}}/>

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

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

@@ -106,6 +106,7 @@ class Inspect extends React.Component {
                                 }
                                 $("#choose").val("");
                             }else{
+                                let res = JSON.parse(xhr.response);
                                 Notify.error(res.msg)
                             }
                         }
@@ -145,9 +146,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>

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

@@ -101,18 +101,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 +131,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({
@@ -217,7 +222,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,10 +231,13 @@ 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()){
+      if(currentData&&currentData.length==0){//现病史没有模板的时候才去获取
+        getSymptomFeature && getSymptomFeature(e.target.innerText);
+      } 
       e.target.innerText?(e.target.innerText=""):(e.target.innerHTML="")
       freeText && freeText(data.trim());
     }else{
@@ -241,17 +249,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); 
   }
 
 
@@ -260,11 +264,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} 
@@ -273,11 +279,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>
   }
 }

+ 40 - 9
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,16 +41,17 @@ 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}
                             prefix={it.labelPrefix}
@@ -60,7 +63,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 +88,39 @@ 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:
           return <NumberDrop prefix={it.labelPrefix}
                              suffix={it.labelSuffix}
                              placeholder={it.name}
+                             min={it.minValue}
+                             max={it.maxValue}
                              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;

+ 5 - 4
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(){

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

+ 111 - 23
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,19 +39,65 @@ 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{
+      //console.log(text,isNaN(+text),max<+text)
+      if(needCompare){
+        if(!isNaN(+text)&&max<+text){     //数值过大
+          this.beyondArea();
+          return;
+        }
+        const that = this;
+        timer = setTimeout(function(){
+          clearTimeout(that.state.sltTimer);
+          if(!that.props.show&&!isNaN(+text)&&min>+text){
+            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;
+    this.$span.current.focus();
     if(show) {
       handleHide && handleHide();
       return;
@@ -61,6 +110,10 @@ class NumberDrop extends Component{
       //双击时不显示下拉
       clearTimeout(that.state.timer);
       const timer = setTimeout(function(){
+        //只有弹窗关闭则点击数字键盘会清空当前数据
+        that.setState({
+          hasSelect:false
+        });
         handleShow&&handleShow({ikey,id:patId||id});
       },300);
       this.setState({
@@ -81,27 +134,56 @@ class NumberDrop extends Component{
   }
   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({
+    const txt = e.target.innerText.replace(/^\s*/,'');
+    if(max!=undefined&&!isNaN(+txt)&&(min>+txt||max<+txt)){
+      this.beyondArea();
+      return;
+    }
+    //输入为空时显示placeholder
+    if(!e.target.innerText.trim()){
+      this.setState({
+        placeholder:this.props.placeholder
+      });
+    }
+
+    /*this.setState({
       hasSelect:false
-    });
-    const val = e.target.innerText?e.target.innerText.replace(/^\s*/,''):e.target.innerHTML.replace(/^\s*/,'');
-    const {handleSelect,ikey,suffix,prefix,mainSaveText,placeholder} = this.props;
-    const text = val===placeholder?'':val;
-    e.target.innerText? (e.target.innerText = ''):(e.target.innerHTML='');      //避免出现重复输入值
+    });*/
+    const val = e.target.innerText.replace(/^\s*/,'');
+    const {placeholder} = this.state;
+    let text = val===placeholder?'':val.replace(/[\u4e00-\u9fa5]/g,'');
+    e.target.innerText = '';      //避免出现重复输入值
     handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
   }
   handleSpanInp(e){   //数字框输入事件
     e.stopPropagation();
     const {handleHide} = this.props;
+    /*this.setState({     //再键盘点击数字要清空
+      hasSelect:false
+    });*/
     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 +211,10 @@ class NumberDrop extends Component{
     this.setState({
       editable: false
     });
-    let totalVal = e.target.innerText || e.target.innerHTML;
-    let changeVal = this.$span.current.innerText?this.$span.current.innerText.replace(/^\s*/,''):this.$span.current.innerHTML.replace(/^\s*/,'');//数字框值-修改后;去掉前空格避免多空格叠加
-    let prefix = this.$pre.current.innerText?this.$pre.current.innerText.replace(/^\s*/,''):this.$pre.current.innerHTML.replace(/^\s*/,''); //前缀值-修改后
-    let suffix = this.$suf.current.innerText?this.$suf.current.innerText.replace(/^\s*/,''):this.$suf.current.innerHTML.replace(/^\s*/,''); //后缀值-修改后
+    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*/,''); //后缀值-修改后
     //console.log('数字框:'+changeVal,";全部:"+totalVal,";前缀:"+prefix+";后缀:"+suffix);
     handleLabelChange && handleLabelChange({ikey,changeVal,type:boxMark,totalVal,prefix,suffix});
   }
@@ -141,25 +223,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>
+            onkeydown={this.handleKeyDowm}>&nbsp;{value||placeholder}</span>
       <span ref = {this.$suf}>&nbsp;{suffix}</span>
       <NumberPan handleSelect={(text)=>this.select(text)}
                  onClose={handleHide}

+ 38 - 21
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 || e.target.innerHTML;
+      // 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({
@@ -143,9 +152,13 @@ class NumberUnitDrop extends Component{
   }
   changeToEdit(e){        //整个标签双击编辑状态
     e.stopPropagation();
-    const {value,id,handleDbclick,patId} = this.props;
+    const {value,id,handleDbclick,patId,handleHide,show} = this.props;
     const text = e.target.innerText || e.target.innerHTML;
-    // clearTimeout(this.state.timer);//取消延时的单击事件
+    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;
-}
+}

+ 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

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

@@ -1,8 +1,9 @@
 import React, { Component } from "react";
 import style from "./index.less";
-import { normalVal, filterDataArr,timestampToTime } 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,7 +129,7 @@ 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'){
@@ -143,7 +144,7 @@ class PreviewBody extends Component {
   }
   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>
@@ -164,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))
               }
@@ -172,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))
               }
@@ -180,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" }}>
+              {
+                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>:''}
               {
-                filterDataArr(JSON.parse(dataStr.other))
+                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))
               }
@@ -196,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) => {
@@ -221,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={{ color: '#767676',position:'relative',left:'-10px' }}>「{item.name}」</span></td></tr>
+                      }
                       {
                         item.details.map((val) => {
                           if (val.value && val.value != '') {
@@ -239,7 +257,7 @@ class PreviewBody extends Component {
                         })
                       }
                     </table>
-                  }
+                  // }
                 })
               }
             </td>
@@ -249,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>
@@ -267,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>}
               {
@@ -282,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"> */}

+ 15 - 12
src/components/PushItems/DetailsModal/index.jsx

@@ -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>
             

+ 114 - 19
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 > 23) {
+          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 > 23) {
+          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"]}>
@@ -238,18 +333,18 @@ class PushItems extends Component {
               </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 > 23 ? (
                           <span
                             style={
                               moreAssay
@@ -287,7 +382,7 @@ class PushItems extends Component {
                           : moreCheck
                           ? checks
                           : checkHide}
-                        {checkNum > 28 ? (
+                        {checkNum2 > 23 ? (
                           <span
                             style={
                               moreCheck

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

+ 4 - 4
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,11 +99,11 @@ class RadioDrop extends Component{
     },$("#addScrollEvent")[0])
   }
   componentDidMount(){    //默认值选中
-    const {data,ikey,handleSelect} = this.props;
+    const {data,ikey,handleSelect,hideTag} = 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});

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

+ 10 - 3
src/components/SpreadDrop/index.jsx

@@ -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);
         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);
       }

+ 41 - 13
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({
@@ -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


+ 21 - 13
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,29 @@ 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;
         clearTreat && clearTreat();
         hideTreat && hideTreat();
+        // 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 +45,21 @@ class Treat extends Component {
         const {  showDrugInfo } = this.props;
         showDrugInfo && showDrugInfo();
     }
-
+    setTreatBox(idx){
+      this.setState({
+        zIndex:idx == 300?300 : 500
+      })
+    }
     render(){
-    
-    
         const { generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore} = this.props;
         const { setDrugInfoMore } = this.props
+        const { zIndex } = 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" style={{zIndex:zIndex}}>
+                    <div onMouseDown={this.setTreatBox} id="dragTreatTitle" className={style['treat-title']}>治疗方案 ({treatItem.name})<img onClick={this.hideTreat} src={close}/></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} drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
                 {/* 查询多个药品说明书 (添加数据查看药品说明书用)*/}
                 {/* {showDrug && <DrugInfo drugInfoList = {drugInfoList} hideDrugInfoMore = {hideDrugInfoMore}></DrugInfo>} */}
             </div>
-                
-            
-        
         )
     }
 }

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

@@ -31,8 +31,8 @@
     background: #fff;
     width: 680px;
     left: 50%;
-    top: 20%;
-    height: 60%;
+    top: 10%;
+    height: 80%;
     margin-left: -340px;
     z-index: 301;
     padding-top: 40px;
@@ -47,6 +47,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:301
+        }
+        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(){
+      const {zIndex,setTreatBox} = this.props
+      setTreatBox(300)
+      this.setState({
+        zIndex:zIndex+10
+      })
     }
-
     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,zIndex } = this.state
+        return (<div className={style['drug-info-wrapper']} id="drugWrapper" style={{zIndex:zIndex}}>
+                <h3 onMouseDown={this.setDragBox} id="drugTitle" 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']} 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()}>
+                            <span className={style['drug-desc-title']} >{item.title.trim()}</span> 
+                            <div className={style['drug-desc-content']} dangerouslySetInnerHTML ={{__html: item.content}}></div> 
+                        </div>
                     })}
+                    <div className={style['content-menu-box']}>
+                        <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> }
                 { !drugInfo || (drugInfo && drugInfo.drugDesc.length === 0) && <div className={style['drug-desc-wrapper']}>
                     <div>
                         该药品暂无说明
                     </div>
-                    
                 </div> }
-
         </div>)
 
 

+ 50 - 2
src/components/TreatDesc/DrugInfo/index.less

@@ -1,9 +1,10 @@
 .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;
@@ -23,6 +24,14 @@
     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;
@@ -66,4 +75,43 @@
 .drug-desc-content {
     /*width: 100%;*/
     margin-left: 210px;
+    margin-right: 160px;
+}
+
+.content-menu-box {
+    position: absolute;
+    top: 50px;
+    right: -20px;
+    width: 200px;
+    height: 80%;
+    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


+ 42 - 8
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);
@@ -40,7 +64,7 @@ class TreatDesc extends Component {
     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 +81,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>
                         

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

@@ -49,6 +49,7 @@
 .drug-name-box {
     display: inline-block;
     height: 30px;
+    position: relative;
 }
 .drug-name {
     border-bottom: 1px solid #666;
@@ -57,9 +58,11 @@
     
 }
 .info-img {
-    width: 12px;
+    width: 15px;
     margin: 0 3px -1px;
     cursor: pointer;
+    position: absolute;
+    top: -10px;
 }
 .info-flag {
     display: inline-block;

+ 4 - 2
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,7 @@ export default {
       year:"年",
       age:"岁",
     },
+    showCheckNum:16,        //查体默认展开非自由文本标签的个数
+    radioOptionPer:'()',     //单选项输入占位符
     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/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(去重用)

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

+ 16 - 3
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,13 @@ 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,
   }
 }
 
@@ -166,6 +168,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
+          })
+        }
       }
     }
 }

+ 1 - 1
src/containers/Multiple.js

@@ -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}
   })
 }
 

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

+ 2 - 2
src/containers/SpreadDrop.js

@@ -295,10 +295,10 @@ function mainSuitCheck(dispatch,store,params){
   const {nones,exists,withs,order,mainSaveText,value} = params;
   let existsName = getNames(exists,order);
   let text = filterDataArr(mainSaveText);
-  if(text.length >= config.limited){
+  /*if(text.length >= config.limited){
     Notify.info(config.limitText);
     return
-  }
+  }*/
   // let lengths = text.length + existsName.length;
   let lengths = value?(text.length - value.length + existsName.length):(text.length + existsName.length);
   if(lengths > config.limited){

+ 3 - 1
src/containers/Treat.js

@@ -2,7 +2,7 @@ import React from 'react';
 import { connect } from 'react-redux';
 import Treat from '@components/Treat';
 import { SELECT_DRUG, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO } from '@store/types/treat.js';
-import { getInstroduce, getRecommendBasic, getInstroduceMore } from '@store/async-actions/treat';
+import { getInstroduce, getRecommendBasic, getInstroduceMore, commonTreatAddToAdvice } from '@store/async-actions/treat';
 import { ADD_SCHEME } from '@store/types/pushMessage.js'
 import { showDrugInfo } from '../store/actions/treat';
 
@@ -18,6 +18,7 @@ function mapStateToProps(state){
         showDrug: treat.showDrugInfo,
         treatItem: treat.treatItem,
         drugInfoList: treat.drugInfoList,   //药品说明书列表(查询多个药品说明书)
+
     }
 }
  
@@ -71,6 +72,7 @@ function mapDispatchToProps(dispatch) {
                 title: title,
                 treatment: treatment
             })
+            dispatch(commonTreatAddToAdvice())
         },
         //查询多条药品说明数据(添加数据用)
         setDrugInfoMore:(drugIdList) => {

+ 17 - 3
src/containers/eleType.js

@@ -1,5 +1,6 @@
 import MixCheckBox from '@containers/MixCheckBox';
 import RadioDrop from "@containers/RadioDrop";
+import RadioInpDrop from "@containers/RadioInpDrop";
 import NumberDrop from "@containers/NumberDrop";
 import MultSpread from "@containers/MultSpread";
 import SpreadDrop from "@containers/SpreadDrop";
@@ -34,8 +35,6 @@ export function singleRadio(params){
                         boxMark={boxMark}
                         id={data.id}
                         ikey={showInx}
-                        boxTop={boxTop}
-                        boxLeft={boxLeft}
                         hideTag={hideTag}></RadioDrop>;
     case 2:
       const dataList = data.questionDetailList&&data.questionDetailList.length>0?data.questionDetailList:data.questionMapping;
@@ -57,6 +56,7 @@ export function singleRadio(params){
       return <NumberUnitDrop prefix={data.labelPrefix}
                          suffix={data.labelSuffix}
                          placeholder={data.name}
+                         formulaCode={data.formulaCode}
                          boxMark={boxMark}
                          id={data.id}
                          show={showArr&&showArr[showInx]}
@@ -73,13 +73,25 @@ export function singleRadio(params){
     case 7:
       return <NumberDrop prefix={data.labelPrefix}
                          suffix={data.labelSuffix}
+                         min={data.minValue}
+                         max={data.maxValue}
                          placeholder={data.name}
                          boxMark={boxMark}
                          id={data.id}
+                         allClick={true}
                          show={showArr&&showArr[showInx]}
                          ikey={showInx}
                          value={data.value}
                          hideTag={hideTag}></NumberDrop>;
+    case 11:
+      return <RadioInpDrop data={data.questionDetailList}
+                           vals={data.vals}
+                        placeholder={data.name}
+                        show={showArr&&showArr[showInx]}
+                        value = {data.value}
+                        boxMark={boxMark}
+                        id={data.id}
+                        ikey={showInx}></RadioInpDrop>;
     default:
       return '';
   }
@@ -88,14 +100,16 @@ export function singleRadio(params){
 //多标签组合型
 function multLabels(params){
   const data = params.item;
-  const {i,boxMark,showArr,saveText} = params;
+  const {i,boxMark,showArr,saveText,selecteds} = params;
   return <MultSpread data={data.questionMapping}
                      showAdd = {+data.showAdd===1}
                      copyId={data.id}
                      fullData = {data}
                      showArr={showArr||{}}
                      update={Math.random()}
+                     boxMark={boxMark}
                      ikey={boxMark+i}
+                     selecteds={selecteds&&selecteds[i]}
                      saveText={saveText}
                      name={data.name||data.tagName}
                      textPrefix={data.prefix}

+ 12 - 1
src/modules/HomePage/index.jsx

@@ -39,8 +39,19 @@ class HomePage extends Component {
             let reHeight = $(window).height();  
             setWindow && setWindow({width:reWidth,height:reHeight});
         })    
-
+        //光标没落到元素上继续backspace防止页面回退
+        $(window).on("keydown",(e)=>{   
+            let ev = e || window.event;  
+            if(ev.keyCode==8){
+                const elem = ev.srcElement || ev.target;
+                const nodeN = elem.nodeName;
+                if(nodeN != "SPAN" && nodeN != "DIV" && nodeN != "INPUT"){
+                    return false;
+                }
+            } 
+        })
     }
+
     render() {
         const {flag} = this.props;
         return <div className={style['home-page']} onClick={this.props.hideAllDrop}>

+ 5 - 1
src/store/actions/assistCheck.js

@@ -1,4 +1,4 @@
-import {GET_ASSIST_SEARCH_LIST,GET_ASSIST_LABEL,DEL_ASSIST_LABEL,CHANGE_ASSIST_VAL,CHANGE_DATE,CLEAR_ASSIST_DATA} from '../types/assistCheck';
+import {GET_ASSIST_SEARCH_LIST,GET_ASSIST_LABEL,DEL_ASSIST_LABEL,CHANGE_ASSIST_VAL,CHANGE_DATE,CLEAR_ASSIST_DATA,ADD_ASSIST_LABEL} from '../types/assistCheck';
 
 export const searchList = (list) => ({         //获取搜索数据
     type:GET_ASSIST_SEARCH_LIST,
@@ -9,6 +9,10 @@ export const assistLable = (id,idx) => ({         //添加数据
     id,
     idx
 })
+export const addAssistLabel = (lis) => ({         //右侧推送交到左侧
+    type:ADD_ASSIST_LABEL,
+    lis
+})
 export const delAssistLabel = (idx) => ({         //删除数据
     type:DEL_ASSIST_LABEL,
     idx

+ 82 - 2
src/store/actions/checkBody.js

@@ -134,6 +134,71 @@ export function setRadioValue(state,action){
   res.update = Math.random();
   return res;
 }
+//单选带输入值保存
+export const setRadioInputValue = (state,action)=>{
+  const res = Object.assign({},state);
+  const {ikey,values,id} = action.data;
+  let index = getLabelIndex(ikey);
+  let innerInx = ikey.substr(ikey.length-1);
+  let item = res.data[index];
+  if(item.tagType==3){      //在组合项中
+    item = res.data[index].questionMapping[innerInx];
+  }
+  let str='',temp='',obj=item.questionDetailList;
+  if(!values){    //清空
+    let sld=obj.find((item)=>{
+      return item.selected==true;
+    });
+    sld?sld.selected=false:'';
+    item.vals = null;
+    item.value = '';
+    if(res.data[index].tagType==3){
+      let hasValue = false;
+      const sub = res.data[index].questionMapping.map((it)=>{
+        if(it.value){     //至少有一个子值才黑显
+          hasValue = true;
+        }
+        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      });
+      res.saveText[index] = hasValue?sub.join(''):'';
+    }else{
+      res.saveText[index] = '';
+    }
+    res.update = Math.random();
+    return res;
+  }
+  for(let i in values){
+    temp = values[i];
+    if(typeof temp=='object'){
+      str+=temp.value;
+    }else{
+      str+=temp;
+    }
+  }
+  //选中状态
+  if(id){
+    obj.map((its)=>{
+      if(its.id === id){
+        its.selected = true;
+      }else{
+        its.selected = false;
+      }
+    });
+  }
+  item.vals = values;
+  item.value = str;
+  if(res.data[index].tagType==3){
+    let hasValue = false;
+    const sub = res.data[index].questionMapping.map((it)=>{
+      return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+    });
+    res.saveText[index] = sub.join('');
+  }else {
+    res.saveText[ikey] = str;
+  }
+  res.update = Math.random();
+  return res;
+}
 //复制标签(如血压)事件
 export function addLabelItem(state,action){
   let res = Object.assign({},state);
@@ -343,8 +408,23 @@ export function backspaceText(state,action){
 // 单列多选
 export function multipleComfirn(state,action){
   let res = Object.assign({},state);
-  const {ikey,seleData} = action.data;
-  let data = res.data;
+  const {ikey,seleData,fullIkey} = action.data;
+  let data = res.data;//console.log(action,data[ikey])
+  let index = fullIkey.substr(fullIkey.length-1,1);
+  if(data[ikey].tagType==3){    //在组合项中
+    let item = data[ikey].questionMapping;
+    let arr=[];
+    item[index].value = seleData;
+    item.map((it)=>{
+      if(it.value){
+        arr.push(it.labelPrefix+it.value+it.labelSuffix);
+      }
+    });
+    res.saveText[ikey] = arr.join("");
+    res.update = Math.random();
+    res.selecteds[ikey] = {[index]:action.data};
+    return res;
+  }
   data[ikey].value = seleData;
   res.saveText[ikey] = seleData;
   res.selecteds[ikey] = action.data;

+ 195 - 92
src/store/actions/currentIll.js

@@ -62,6 +62,7 @@ export const setData = (state,action) =>{
   const mainIds = action.info.mainIds;
   res.symptomIds = JSON.parse(JSON.stringify(mainIds));
   const num = action.info.num;//点击了几次添加病情变化
+  const symptomFeature = action.info.symptomFeature;//分词
   // const useEmpty = action.info.useEmpty;
   let useEmpty,mainData;
   // let mainData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
@@ -84,10 +85,9 @@ export const setData = (state,action) =>{
   /*let mainLabelModuleArr = objToArr.filter((item)=>{
     return item.questionMapping.length>0;
   })*/
-
   // 是否使用空模板:num=0时判断mainIds,num>=1,截取第一病程遍历是否有症状exist
   if(num==0){
-    useEmpty = mainIds.length>0?false:true;
+    useEmpty = mainIds.length>0 ? false:true;
     mainData = mainModleData;
   }else{
     let sliceIdx;
@@ -102,36 +102,37 @@ export const setData = (state,action) =>{
     })
     useEmpty = existData&&existData.length>0?false:true;
   }
-  
+  // console.log(888,useEmpty);
   if (useEmpty) {
     // res.data = res.emptyData;
     res.data = JSON.parse(JSON.stringify(res.emptyData));
   } else {
-    // 目前只需要将第一个主诉病程移植到现病史
-    let tongYong = "";
-    let main = [];//主症状
-    let withs = [];//伴随
-    let firstT = 0;
-    for(let i=0; i<mainData.length; i++){
-        if(mainData[i].id==config.tongYId && !mainData[i].pos){//第一个通用特征描述
-          if(mainData[i].value){
-            tongYong = mainData[i].value;
-          }
-        }       
-        else if(mainData[i].exist){
-          mainData[i].exist==1?main.push(mainData[i]):withs.push(mainData[i])
-        }
-        
-        // 处理时间和主诉通用症状--现病史模板无“主诉通用症状” 1-7
-        for(let j=0; j<current.length; j++){
-          if(mainData[i].id==current[j].id && mainData[i].controlType==5){//处理时间,避免手动输入的值
-            firstT++
-            if(mainData[i].value && firstT==1){
-              current[j] = {id:mainData[i].id,name:mainData[i].value,value:mainData[i].value,tagType:config.tagType}
+    if(mainData&&mainData.length>0){//主诉使用模板
+      // 目前只需要将第一个主诉病程移植到现病史
+      let tongYong = "";
+      let main = [];//主症状
+      let withs = [];//伴随
+      let firstT = 0;
+      for(let i=0; i<mainData.length; i++){
+          if(mainData[i].id==config.tongYId && !mainData[i].pos){//第一个通用特征描述
+            if(mainData[i].value){
+              tongYong = mainData[i].value;
             }
-          }  
+          }       
+          else if(mainData[i].exist){
+            mainData[i].exist==1?main.push(mainData[i]):withs.push(mainData[i])
+          }
+          
+          // 处理时间和主诉通用症状--现病史模板无“主诉通用症状” 1-7
+          for(let j=0; j<current.length; j++){
+            if(mainData[i].id==current[j].id && mainData[i].controlType==5){//处理时间,避免手动输入的值
+              firstT++
+              if(mainData[i].value && firstT==1){
+                current[j] = {id:mainData[i].id,name:mainData[i].value,value:mainData[i].value,tagType:config.tagType}
+              }
+            }  
+          }
         }
-      }
       
       // 主症状添加tongYong标签选中文字
       let tongYText = tongYong?{name:tongYong,value:tongYong,tagType:config.tagType}:'';
@@ -173,7 +174,8 @@ export const setData = (state,action) =>{
               if(items.length==0){//没有尾巴时给症状后加逗号(3.5)
                 for(let j=0; j<newMainCopy.length; j++){
                   if(newMainCopy[j].id==mainCopy[k].id){
-                    newMainCopy[j].value = newMainCopy[j].name = mainCopy[k].value+',';
+                    // newMainCopy[j].value = newMainCopy[j].name = mainCopy[k].value+',';
+                    newMainCopy[j].value = newMainCopy[j].name = mainCopy[k].value||mainCopy[k].name+',';
                   }
                 }
               }       
@@ -220,8 +222,9 @@ export const setData = (state,action) =>{
               withLengArr[d] = items.length;
               if(items.length==0){//没有尾巴时给症状后加逗号(3.5)
                 for(let j=0; j<newWiths.length; j++){
-                  if(newWiths[j].id==mainCopy[d].id){
-                    newWiths[j].value = newWiths[j].name = withs[d].value+',';
+                  if(newWiths[j].id==withs[d].id){
+                    // newWiths[j].value = newWiths[j].name = withs[d].value+',';
+                    newWiths[j].value = newWiths[j].name = withs[d].value||withs[d].name+',';
                   }
                 }
               }
@@ -250,7 +253,52 @@ export const setData = (state,action) =>{
       }
       let currentData = JSON.parse(JSON.stringify(current));
       res.data = fullfillText(currentData).newArr;
-
+    }else{//分词
+      if(symptomFeature&&symptomFeature.length>0){
+        let featureData = JSON.parse(JSON.stringify(symptomFeature));
+        let ind = 0;
+        let insertInd = 0;
+        let lengArr=[];
+        for(let k=0; k <symptomFeature.length;k++){        
+          mainLabelModuleArr.map((v,i)=>{
+            if(symptomFeature[k].id==v.id){
+              ind++;
+              let items = v.questionMapping.filter((item)=>{
+                              return item.symptomType==0||item.symptomType==1;
+                            })          
+              lengArr[k] = items.length;  //每一个主诉尾巴长度 
+              
+              if(items.length==0){//没有尾巴时给症状后加逗号(3.5)
+                for(let j=0; j<featureData.length; j++){
+                  if(featureData[j].id==symptomFeature[k].id){
+                    featureData[j].value = featureData[j].name = symptomFeature[k].value||symptomFeature[k].name+',';
+                  }
+                }
+              }
+              if(ind>1){
+                insertInd += lengArr[k-1];
+              }
+              featureData.splice(k+insertInd+1,0,...items);
+            }
+          })
+        }
+        //组装好的主症状和伴随症状插入现病史模板(flag=4前)
+        let endFeatureData = JSON.parse(JSON.stringify(featureData));
+        let insertIdx = null;
+        for(let j=0; j<current.length; j++){
+            if(current[j].flag && current[j].flag==4){
+              insertIdx = j;  
+            }
+          }
+     
+        for(let k=0; k<endFeatureData.length; k++){
+          let pos = insertIdx+k;
+          current.splice(pos,0,endFeatureData[k]);
+        }
+        let currentData = JSON.parse(JSON.stringify(current));
+        res.data = fullfillText(currentData).newArr;
+      }
+    }
   }
   let resData = JSON.parse(JSON.stringify(res.data));
   res.saveText = fullfillText(resData).saveText;
@@ -414,6 +462,47 @@ export function setRadioValue(state,action){
   res.update = Math.random();
   return res;
 }
+//单选带输入值保存
+export const setRadioInputValue = (state,action)=>{
+  const res = Object.assign({},state);
+  const {ikey,values,id} = action.data;
+  const item = res.data[ikey];
+  let str='',temp='',obj=res.data[ikey].questionDetailList;
+  if(!values){    //清空
+    let sld=obj.find((item)=>{
+      return item.selected==true;
+    });
+    sld?sld.selected=false:'';
+    item.vals = null;
+    item.value = '';
+    res.saveText[ikey] = '';
+    res.update = Math.random();
+    return res;
+  }
+  for(let i in values){
+    temp = values[i];
+    if(typeof temp=='object'){
+      str+=temp.value;
+    }else{
+      str+=temp;
+    }
+  }
+  //选中状态
+  if(id){
+    obj.map((its)=>{
+      if(its.id === id){
+        its.selected = true;
+      }else{
+        its.selected = false;
+      }
+    });
+  }
+  item.vals = values;
+  item.value = str;
+  res.saveText[ikey] = str;
+  res.update = Math.random();
+  return res;
+}
 
 //双击标签输入改变值
 export const changeLabelVal = (state,action)=>{
@@ -538,8 +627,9 @@ export function insertLabelData(state,action){
   const {index,data,isReplace,span}=action;
   let id = data.id;
   let searchData = action.name;
-  res.symptomIds.push(id);
+  // res.symptomIds.push(id);
   const text = Object.assign(JSON.parse(config.textLabel),{name:searchData},{id:id});
+  const textEmpty = Object.assign({},JSON.parse(config.textLabel));
   let focusIndex = res.focusIndex;
   let saveText = res.saveText;
   let banIdx = saveText.indexOf("伴");
@@ -556,82 +646,95 @@ export function insertLabelData(state,action){
     res.saveText[focusIndex] = searchData;
   }else{
     let resData;
-    // res.data.splice(index,0,data);
     const searchStr = res.searchStr;
     let innerText = span.current.innerText || span.current.innerHTML;
     let strIndex = innerText.indexOf(searchStr);
     const value = innerText.replace(searchStr,"");
-    // 没有伴展开主诉symptomType=0/1的尾巴,有伴一>第一个点选上去的伴为依据,伴前展开主诉,伴后展开伴随;多余的伴以及手动输入的伴不做处理(2-25)
-    if(banIdx==-1){
-      // if(strIndex <= 1){//前
-      if(strIndex < 1){//前
-        res.data.splice(focusIndex,0,text);
-        res.saveText.splice(focusIndex,0,searchData);
-        res.data[focusIndex+1].value = value;
-        res.saveText[focusIndex+1] = value;
-        resData = JSON.parse(JSON.stringify(res.data));
-        resData.splice(focusIndex+1,0,...(data.questionMapping.filter((item)=>{
-                                return item.symptomType==0||item.symptomType==1;
-                              })));
-      }else{
-        res.data.splice(focusIndex+1,0,text);
-        res.saveText.splice(focusIndex+1,0,searchData);
-        res.data[focusIndex].value = value;
-        resData = JSON.parse(JSON.stringify(res.data));
-        // +2是因为插入一个文本标签  
-        resData.splice(focusIndex+2,0,...(data.questionMapping.filter((item)=>{
-                                return item.symptomType==0||item.symptomType==1;
-                              })));
-      }
-    }else{
-      if(focusIndex > banIdx){//伴后
+    const pText = Object.assign({},textEmpty,{value:value});
+    if(data.itemType==0){//症状
+      res.symptomIds.push(id);
+      // 没有伴展开主诉symptomType=0/1的尾巴,有伴一>第一个点选上去的伴为依据,伴前展开主诉,伴后展开伴随;多余的伴以及手动输入的伴不做处理(2-25)
+      if(banIdx==-1){
+        // if(strIndex <= 1){//前
         if(strIndex < 1){//前
-          res.data.splice(focusIndex,0,text);
-          res.saveText.splice(focusIndex,0,searchData);
-          res.data[focusIndex+1].value = value;
-          res.saveText[focusIndex+1] = value;
-          resData = JSON.parse(JSON.stringify(res.data));
-          resData.splice(focusIndex+1,0,...(data.questionMapping.filter((item)=>{
-                                  return item.symptomType==0||item.symptomType==2;
-                                })));
+          res.data.splice(index,1,text,...(data.questionMapping.filter((item)=>{
+                                   return item.symptomType==0||item.symptomType==1;
+                                })),pText);
+          res.saveText = fullfillText(res.data).saveText;
+          res.selecteds.splice(index,1,null,...new Array(data.questionMapping.length).fill(null),null);
         }else{
-          res.data.splice(focusIndex+1,0,text);
-          res.saveText.splice(focusIndex+1,0,searchData);
-          res.data[focusIndex].value = value;
-          resData = JSON.parse(JSON.stringify(res.data));
-          // +2是因为插入一个文本标签  
-          resData.splice(focusIndex+2,0,...(data.questionMapping.filter((item)=>{
-                                  return item.symptomType==0||item.symptomType==2;
+          res.data.splice(index,1,pText,text,...(data.questionMapping.filter((item)=>{
+                                   return item.symptomType==0||item.symptomType==1;
                                 })));
+          res.saveText = fullfillText(res.data).saveText;
+          res.selecteds.splice(index,1,null,null,...new Array(data.questionMapping.length).fill(null));
         }
-      }else{//伴前
-        if(strIndex < 1){//前
-          res.data.splice(focusIndex,0,text);
-          res.saveText.splice(focusIndex,0,searchData);
-          res.data[focusIndex+1].value = value;
-          res.saveText[focusIndex+1] = value;
-          resData = JSON.parse(JSON.stringify(res.data));
-          resData.splice(focusIndex+1,0,...(data.questionMapping.filter((item)=>{
-                                  return item.symptomType==0||item.symptomType==1;
+      }else{
+        if(focusIndex > banIdx){//伴后
+          if(strIndex < 1){//前
+            res.data.splice(index,1,text,...(data.questionMapping.filter((item)=>{
+                                   return item.symptomType==0||item.symptomType==2;
+                                })),pText);
+            res.saveText = fullfillText(res.data).saveText;
+            res.selecteds.splice(index,1,null,...new Array(data.questionMapping.length).fill(null),null);
+          }else{
+            res.data.splice(index,1,pText,text,...(data.questionMapping.filter((item)=>{
+                                   return item.symptomType==0||item.symptomType==2;
                                 })));
-        }else{
-          res.data.splice(focusIndex+1,0,text);
-          res.saveText.splice(focusIndex+1,0,searchData);
-          res.data[focusIndex].value = value;
-          resData = JSON.parse(JSON.stringify(res.data));
-          // +2是因为插入一个文本标签  
-          resData.splice(focusIndex+2,0,...(data.questionMapping.filter((item)=>{
-                                  return item.symptomType==0||item.symptomType==1;
+            res.saveText = fullfillText(res.data).saveText;
+            res.selecteds.splice(index,1,null,null,...new Array(data.questionMapping.length).fill(null));
+          }
+        }else{//伴前
+          if(strIndex < 1){//前
+            res.data.splice(index,1,text,...(data.questionMapping.filter((item)=>{
+                                   return item.symptomType==0||item.symptomType==1;
+                                })),pText);
+            res.saveText = fullfillText(res.data).saveText;
+            res.selecteds.splice(index,1,null,...new Array(data.questionMapping.length).fill(null),null);
+          }else{
+            res.data.splice(index,1,pText,text,...(data.questionMapping.filter((item)=>{
+                                   return item.symptomType==0||item.symptomType==1;
                                 })));
+            res.saveText = fullfillText(res.data).saveText;
+            res.selecteds.splice(index,1,null,null,...new Array(data.questionMapping.length).fill(null));
+          }
         }
       }
+      res.data = fullfillText(res.data).newArr;
+      res.saveText = fullfillText(res.data).saveText;
+    }else{//标签
+      const spreadLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
+      if(strIndex < 1){//前
+        // 判断前一个是否为文本标签,是直接插入标签,不是则在前面插入一个空文本标签
+        const preItem = res.data[index-1];
+        if(preItem&&preItem.tagType==8){
+          res.data.splice(index,1,...spreadLabels,pText);
+          res.saveText = fullfillText(res.data).saveText;
+          res.selecteds.splice(index,1,...new Array(spreadLabels.length).fill(null),null);
+        }else{
+          res.data.splice(index,1,textEmpty,...spreadLabels,pText);
+          res.saveText = fullfillText(res.data).saveText;
+          res.selecteds.splice(index,1,null,...new Array(spreadLabels.length).fill(null),null);
+        }
+        // res.data.splice(focusIndex,0,data,textEmpty);
+        
+      }else{
+        // 后面插入 :判断后一个标签是否为文本标签,不是则插入一个空标签
+        const afterItem = res.data[index+1];
+        if(afterItem&&afterItem.tagType==8){
+          res.data.splice(index,1,pText,...spreadLabels);
+          res.saveText = fullfillText(res.data).saveText;
+          res.selecteds.splice(index,1,null,...new Array(spreadLabels.length).fill(null));
+        }else{
+          res.data.splice(index,1,pText,...spreadLabels,textEmpty);
+          res.saveText = fullfillText(res.data).saveText;
+          res.selecteds.splice(index,1,null,...new Array(spreadLabels.length).fill(null),null);
+        }   
+      }
     }
-    span.current.innerText?(span.current.innerText = value):(span.current.innerHTML = value);
-    res.data = fullfillText(resData).newArr;
-    res.saveText = fullfillText(resData).saveText;
   }
   res.searchData = [];    //选中清空搜索内容(即关闭搜索弹窗)
-  res.update = Math.random();//console.log(899,res,action);
+  res.update = Math.random();//console.log('现病史',res);
   return res;
 }
 

+ 5 - 0
src/store/actions/diagnosticList.js

@@ -52,9 +52,12 @@ export const getDiagnosticStr = (state, action) => {
     const res = Object.assign({}, state)
     const diagnosticList = res.diagnosticList
     let diagnosticStr= '';
+    let diagnosticStrNoType = ''
     for (let i = 0; i < diagnosticList.length; i++) {
         diagnosticStr = diagnosticStr + diagnosticList[i].name + '(' + getDiagType(diagnosticList[i].type) + '); '
+        diagnosticStrNoType = diagnosticStrNoType + diagnosticList[i].name + ','
     }
+    res.diagnosticStrNoType = diagnosticStrNoType
     res.diagnosticStr = diagnosticStr
     return res;
 }
@@ -64,11 +67,13 @@ export const setDiagToMainSuit = (state, action) => {
     res.mainSuitStr = action.data;
     return res;
 }
+
 export const clearAllDiag = (state, action) => {
     const res = Object.assign({}, state);
     res.diagnosticList = action.data
     res.diagnosticStr = action.saveText
     res.mainSuitStr = action.mainSuitStr
+    res.diagnosticStrNoType = action.saveText
     return res;
 }
 

+ 1 - 1
src/store/actions/diagnosticSearch.js

@@ -19,7 +19,7 @@ export const setSearchValue = (state,action) => {
 export const getSearchResult= (state, action) => {
     const res = Object.assign({},state);
     let searchResult = []
-    action.searchResult.map((item, index) =>{
+    action.searchResult && action.searchResult.map((item, index) =>{
         let searchResultItem = {}
         searchResultItem.id = item.questionId
         searchResultItem.name = item.name

+ 1 - 0
src/store/actions/homePage.js

@@ -95,6 +95,7 @@ export const setLabelToEdit = (state,action)=>{
 //编辑状态
 export const searchDropLocation = (state,action)=>{
   let res = Object.assign({},state);
+  // console.log(action,'dir')
   res.boxTop = action.top?action.top:res.boxTop;
   res.boxLeft = action.left?action.left+action.dis:res.left;
   return res;

+ 5 - 1
src/store/actions/inspect.js

@@ -1,4 +1,4 @@
-import {SEARCH_LIST,SET_LABEL,FILL_ACTIVE,FILL_ACTIVE_DETAIL,GET_EXCEL,CHECK_VALUE_IS_CHANGE,CLEAR_LABEL,RESET_LABEL,CLEAR_ALL_LABEL,DEL_PART_ITEM,DEL_EXCEL_LIST} from '../types/inspect';
+import {ADD_LABEL,SEARCH_LIST,SET_LABEL,FILL_ACTIVE,FILL_ACTIVE_DETAIL,GET_EXCEL,CHECK_VALUE_IS_CHANGE,CLEAR_LABEL,RESET_LABEL,CLEAR_ALL_LABEL,DEL_PART_ITEM,DEL_EXCEL_LIST} from '../types/inspect';
 
 export const searchList = (list) => ({         //初始化数据
     type:SEARCH_LIST,
@@ -9,6 +9,10 @@ export const setLabel = (idx) => ({          //搜索后点击选中的结果
     type:SET_LABEL,
     idx
 })
+export const addLabel = (lis) => ({          //右侧开单
+    type:ADD_LABEL,
+    lis
+})
 export const resetLabel = (list) => ({          //搜索后点击选中的结果重组
     type:RESET_LABEL,
     list

+ 91 - 23
src/store/actions/mainSuit.js

@@ -92,24 +92,33 @@ export const handleTailClick = (state,action)=>{
 //将选择的常见症状插入
 export const insertMain = (state,action) => {
   const res = Object.assign({},state);
-  const item = action.item.name;
-  const id = action.item.questionId;
-  // 将选中的id存起,现病史时获取模板
+  const items = action.item.select;
+  const id = action.item.ids;
   let data = JSON.parse(JSON.stringify(res.moduleData));
-  const text = {id:id,name:item,value:item,tagType:config.tagType,exist:1};
+  if(items.length>1){
+    for(let i=1; i<items.length; i++){
+      items[i].name = '、'+items[i].name;
+      items[i].value = '、'+items[i].value;
+    } 
+  }
+  let obj = [];
+  for(let i=0; i<items.length; i++){
+    obj.push({id:items[i].questionId,name:items[i].name,value:items[i].name,tagType:config.tagType,exist:1});
+  }
   let inserIndx = null;
   data.map((it,i)=>{
-    if(it.flag == 1){//在此处插入主诉数据
-      inserIndx = i;
-    }
-  })
-  data.splice(inserIndx-1,1,text);
+      if(it.flag == 1){//在此处插入主诉数据
+        inserIndx = i;
+      }
+    })
+  data.splice(inserIndx-1,1,...obj);
   // data[inserIndx-1] = text;//替换空标签
   res.data = data;
   res.saveText = [];//将手动输入的值清掉
   // res.saveText[inserIndx] = text.name;
   res.saveText = fullfillText(res.data).saveText;
-  res.mainIds.push(id);
+  // res.mainIds.push(id);
+  res.mainIds = res.mainIds.concat(id);
   res.editClear = false;//主诉框编辑状态
   res.update=Math.random();
   return res;
@@ -311,6 +320,7 @@ export const insertSearch = (state,action)=>{
     res.data = moduleData;
     // res.saveText[inserIndx] = searchData;
     res.saveText = fullfillText(res.data).saveText;
+    // res.saveText[inserIndx] = searchData;
     res.mainIds.push(id);
     res.editClear = false;//主诉框编辑状态
   }else{
@@ -467,31 +477,73 @@ export function setRadioValue(state,action){
   return res;
 }
 
+//单选带输入值保存
+export const setRadioInputValue = (state,action)=>{
+  const res = Object.assign({},state);
+  const {ikey,values,id} = action.data;
+  const item = res.data[ikey];
+  let str='',temp='',obj=res.data[ikey].questionDetailList;
+  if(!values){    //清空
+    let sld=obj.find((item)=>{
+      return item.selected==true;
+    });
+    sld?sld.selected=false:'';
+    item.vals = null;
+    item.value = '';
+    res.saveText[ikey] = '';
+    res.update = Math.random();
+    return res;
+  }
+  for(let i in values){
+    temp = values[i];
+    if(typeof temp=='object'){
+      str+=temp.value;
+    }else{
+      str+=temp;
+    }
+  }
+  //选中状态
+  if(id){
+    obj.map((its)=>{
+      if(its.id === id){
+        its.selected = true;
+      }else{
+        its.selected = false;
+      }
+    });
+  }
+  item.vals = values;
+  item.value = str;
+  res.saveText[ikey] = str;
+  res.update = Math.random();
+  return res;
+}
 //双击标签输入改变值
 export const changeLabelVal = (state,action)=>{
   const res = Object.assign({},state);
-  const index = parseInt(action.data.ikey);
-  const newVal = action.data.changeVal;
-  let data = res.data;
-  let item = data[index];
+  const {changeVal,totalVal,ikey,prefix,suffix} = action.data;
+  const index = ikey;
+  const newVal = changeVal;
+  let item = res.data[index];
   const next = res.data[+index+1];
   const nextVal = next.value||next.name;
   //标签后是不是标点符号标签,是的话删除本标签时一起删除
   let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
-  if(newVal&&newVal.trim()){
+  let labText = totalVal?totalVal:newVal;
+  if(labText.trim()){
     if(item){
       item.value = newVal;
-      res.saveText[index] = newVal;
+      item.labelPrefix = prefix||'';
+      item.labelSuffix = suffix||'';
+      res.saveText[index] = labText;
     }
   }else{//删除完标签内容则删除该标签
     const num = nextIsDot?2:1;
-    data.splice(index,num);
-    // data[index].value = "";
-    // res.data.splice(index,1);
-    res.saveText.splice(index,1);
-    // res.saveText[index] = "";
-  } 
-  res.update = Math.random();
+    res.data.splice(index,num);
+    res.selecteds.splice(index,num);//杂音类样式选中状态对应
+    res.saveText = fullfillText(res.data).saveText;
+  }
+  res.update = Math.random();//console.log(222,res);
   return res;
 }
 
@@ -681,3 +733,19 @@ export function delSingleLable(state,action){
   res.update = Math.random();
   return res;
 }
+
+
+export function getSymptomFeature(state,action){
+  let res = Object.assign({},state);
+  const {data} = action;
+  if(data && data.length>0){
+    for(let i=0; i<data.length; i++){
+      data[i].tagType = '8';
+      res.mainIds.push(data[i].id);
+    }
+    res.symptomFeature.featureData = data;
+    res.symptomFeature.refresh = !res.symptomFeature.refresh;
+  }
+  res.update = Math.random();
+  return res;
+}

+ 63 - 3
src/store/actions/otherHistory.js

@@ -100,11 +100,53 @@ export function setRadioValue(state,action){
   return res;
 }
 
+//单选带输入值保存
+export const setRadioInputValue = (state,action)=>{
+  const res = Object.assign({},state);
+  const {ikey,values,id} = action.data;
+  const item = res.data[ikey];
+  let str='',temp='',obj=res.data[ikey].questionDetailList;
+  if(!values){    //清空
+    let sld=obj.find((item)=>{
+      return item.selected==true;
+    });
+    sld?sld.selected=false:'';
+    item.vals = null;
+    item.value = '';
+    res.saveText[ikey] = '';
+    res.update = Math.random();
+    return res;
+  }
+  for(let i in values){
+    temp = values[i];
+    if(typeof temp=='object'){
+      str+=temp.value;
+    }else{
+      str+=temp;
+    }
+  }
+  //选中状态
+  if(id){
+    obj.map((its)=>{
+      if(its.id === id){
+        its.selected = true;
+      }else{
+        its.selected = false;
+      }
+    });
+  }
+  item.vals = values;
+  item.value = str;
+  res.saveText[ikey] = str;
+  res.update = Math.random();
+  return res;
+}
 //数字键盘选中事件
 export function setNumberValue(state,action){
   let res = Object.assign({},state);
   const param = action.params;
   const ikey = param.ikey;
+  const code = param.formulaCode;
   let labelInx = getLabelIndex(ikey);
   const subInx = ikey.substr(ikey.length-1);
   let item = res.data[labelInx];
@@ -122,6 +164,7 @@ export function setNumberValue(state,action){
     });
     res.saveText[labelInx] = hasValue?sub.join(''):'';
   }
+  res[code] = param.text;
   res.update = Math.random();
   return res;
 }
@@ -231,17 +274,25 @@ export function changeTextLabel(state,action) {
   if(labText.trim()){
     if(item){
       item.value = newVal;
+      //月经史特殊处理
+      if(item.formulaCode){
+        res[item.formulaCode] = newVal;
+      }
       item.labelPrefix = prefix||'';
       item.labelSuffix = suffix||'';
       res.saveText[index] = labText;
     }
   }else{//删除完标签内容则删除该标签
     const num = nextIsDot?2:1;
+    //月经史特殊处理
+    if(res.data[index].formulaCode){
+      res[res.data[index].formulaCode]=undefined;
+    }
     res.data.splice(index,num);
     res.selecteds.splice(index,num);//杂音类样式选中状态对应
     res.saveText = fullfillText(res.data).saveText;
   }
-  res.update = Math.random();
+  res.update = Math.random();//console.log(888,res,action);
   return res;
 }
 
@@ -276,11 +327,16 @@ export const changeNumLabelVal = (state,action)=>{
 
 export function clearOtherHistory(state,action){       //清空数据
   let res = Object.assign({},state);
-  res.data = action.data;
+  for(let it in action){
+    if(it!='type'){
+      res[it] = action[it];
+    }
+  }
+  /*res.data = action.data;
   res.saveText = action.saveText;
   res.selecteds = action.selecteds;
   res.editClear = action.editClear;
-  res.isEmpty = action.isEmpty;
+  res.isEmpty = action.isEmpty;*/
   return res;
 }
 //文本模式下值保存
@@ -320,6 +376,10 @@ export function backspaceText(state,action){
     res.saveText.splice(delIndex,1);
   }
   else{
+    //月经史删除处理
+    if(data[delIndex-1].formulaCode){
+      res[data[delIndex-1].formulaCode]=undefined;
+    }
     data.splice(delIndex-1,2);
     res.saveText.splice(delIndex-1,2);
   }

+ 5 - 5
src/store/actions/patInfo.js

@@ -1,6 +1,6 @@
 export const updatePatientMessage=(state,action)=>{
     const res=Object.assign({},state);
-    const mock = {
+    // const mock = {
       // doctorCode: "YS001",
       // doctorId: 1,
       // doctorName: "付",
@@ -24,10 +24,10 @@ export const updatePatientMessage=(state,action)=>{
       // idNo: "9696969",
       // name: "沈强",
       // sex: 2
-    };
+    // };
     res.message = action.data;
-    if(!action.data.selfDeptId){
-        res.message = mock;
-    }
+    /*if(!action.data.selfDeptId){    //selfDeptId这个参数是跟外部对接用的
+        res.message = {};
+    }*/
     return res;
 };

+ 0 - 0
src/store/actions/pushMessage.js


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.