소스 검색

Merge branch 'dev/new1' into dev/byll

Luolei 6 년 전
부모
커밋
5fdbd2cda6
77개의 변경된 파일2032개의 추가작업 그리고 725개의 파일을 삭제
  1. 1 1
      src/common/components/ConfirmModal/index.jsx
  2. 57 58
      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. 9 3
      src/common/components/ItemBox/index.jsx
  6. 17 16
      src/common/components/NumberUnitPan/index.jsx
  7. 24 0
      src/common/components/NumberUnitPan/index.less
  8. 21 15
      src/common/components/SearchOption/index.jsx
  9. BIN
      src/common/images/backspace.png
  10. 8 2
      src/common/less/variables.less
  11. 1 1
      src/components/Banner/index.jsx
  12. 29 5
      src/components/CheckBody/index.jsx
  13. 14 0
      src/components/CheckBody/index.less
  14. 79 9
      src/components/CommonSymptom/index.jsx
  15. 40 8
      src/components/CommonSymptom/index.less
  16. 2 2
      src/components/CopyRight/index.jsx
  17. 13 6
      src/components/CurrentIll/index.jsx
  18. 9 2
      src/components/DiagnosticItem/index.jsx
  19. 1 1
      src/components/HistoryCaseContainer/index.jsx
  20. 31 23
      src/components/MainSuit/index.jsx
  21. 10 8
      src/components/MultSpread/index.jsx
  22. 51 15
      src/components/NumberDrop/index.jsx
  23. 4 4
      src/components/NumberUnitDrop/index.jsx
  24. 1 1
      src/components/NumberUnitDrop/index.less
  25. 0 2
      src/components/OtherHistory/index.jsx
  26. 1 1
      src/components/Preview/index.jsx
  27. 18 4
      src/components/PreviewBody/index.jsx
  28. 1 1
      src/components/PrintPreview/index.jsx
  29. 15 12
      src/components/PushItems/DetailsModal/index.jsx
  30. 7 2
      src/components/PushItems/DetailsModal/index.less
  31. 2 2
      src/components/PushItems/PushDiag/index.jsx
  32. 48 11
      src/components/PushItems/index.jsx
  33. 17 12
      src/components/PushItems/index.less
  34. 4 4
      src/components/RadioDrop/index.jsx
  35. 223 0
      src/components/RadioInpDrop/index.jsx
  36. 29 0
      src/components/RadioInpDrop/index.less
  37. 1 1
      src/components/SearchDrop/index.jsx
  38. 10 3
      src/components/SpreadDrop/index.jsx
  39. 41 13
      src/components/Treat/DrugTreat/index.jsx
  40. 9 1
      src/components/Treat/DrugTreat/index.less
  41. BIN
      src/components/Treat/img/info2.png
  42. BIN
      src/components/Treat/img/info3.png
  43. 1 1
      src/components/Treat/index.jsx
  44. 2 2
      src/components/Treat/index.less
  45. 58 3
      src/components/TreatDesc/DrugInfo/index.jsx
  46. 42 2
      src/components/TreatDesc/DrugInfo/index.less
  47. 3 1
      src/config/index.js
  48. 1 0
      src/containers/CurrentIll.js
  49. 1 1
      src/containers/EditableSpan.js
  50. 15 3
      src/containers/MainSuit.js
  51. 8 6
      src/containers/NumberUnitDrop.js
  52. 10 7
      src/containers/OtherHistory.js
  53. 8 5
      src/containers/RadioDrop.js
  54. 191 0
      src/containers/RadioInpDrop.js
  55. 2 2
      src/containers/SpreadDrop.js
  56. 12 2
      src/containers/eleType.js
  57. 12 1
      src/modules/HomePage/index.jsx
  58. 41 0
      src/store/actions/checkBody.js
  59. 192 91
      src/store/actions/currentIll.js
  60. 3 0
      src/store/actions/diagnosticList.js
  61. 1 1
      src/store/actions/diagnosticSearch.js
  62. 83 13
      src/store/actions/mainSuit.js
  63. 50 2
      src/store/actions/otherHistory.js
  64. 27 9
      src/store/async-actions/fetchModules.js
  65. 1 1
      src/store/async-actions/treat.js
  66. 5 2
      src/store/reducers/checkBody.js
  67. 6 2
      src/store/reducers/currentIll.js
  68. 13 2
      src/store/reducers/mainSuit.js
  69. 7 2
      src/store/reducers/otherHistory.js
  70. 0 2
      src/store/reducers/pushMessage.js
  71. 2 1
      src/store/types/checkBody.js
  72. 1 0
      src/store/types/currentIll.js
  73. 2 0
      src/store/types/mainSuit.js
  74. 2 1
      src/store/types/otherHistory.js
  75. 70 12
      src/utils/tools.js
  76. 138 80
      static/pages/diag_push.html
  77. 147 218
      static/pages/hisLib/diag_push.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',

+ 57 - 58
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} = this.props;
     const target = ev.target||ev.srcElement;
-    let innerVal = target.innerText || target.innerHTML;
+    let innerVal = target.innerText;
     //禁止回车事件
     if(ev.keyCode==13){return false;}
     //backspace事件
@@ -158,15 +158,33 @@ 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();
+      }
+    }
   }  
   handleKeyup(e){
     const {boxMark,handleKeydown,i,value,removeId,handleClear,delSingleLable,setSearchLocation} = this.props;
@@ -174,16 +192,9 @@ class EditableSpan extends Component{
     const ev = e||window.event;
     const target = ev.target||ev.srcElement;
     let innerVal = target.innerText || target.innerHTML,ele,boxTop;
-    if(ev.keyCode==8){
-      const elem = ev.srcElement || ev.currentTarget;
-      const nodeN = elem.nodeName;
-      
-      if(nodeN != "SPAN"){//光标没落到span的时候阻止默认事件(backspace回退页面的情况)
-        return this.stopIt(ev);
-      }
+    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:""});
@@ -192,42 +203,39 @@ class EditableSpan extends Component{
           this.moveEnd(preObj[0]);
         }
       }
+      
       if(innerVal !== preVal){
-        ele = document.activeElement;
-        boxTop = target.innerText?getPageCoordinate(e).boxTop:$(ele).offset().top+30;
-        if(filterDataArr(innerVal.split(''))){
-          setSearchLocation(boxTop,ele.offsetLeft)     //搜索框的位置动态获取
-        }
-        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
-        })
+      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
+          })
+        }
       }
-      
       ele = document.activeElement;
-      // console.log($(ele).offset().top)
       boxTop = target.innerText?getPageCoordinate(e).boxTop:$(ele).offset().top+30;
       setSearchLocation(boxTop,ele.offsetLeft)     //搜索框的位置动态获取
     }
+    
   }
   componentWillReceiveProps(next){
     const isRead = this.props.isRead;
@@ -255,15 +263,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;
 }

+ 9 - 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
@@ -38,6 +38,12 @@ class ItemBox extends Component {
     }
   }
 
+  /*componentWillReceiveProps(next){
+    if(this.props.value && next.value!=this.props.value){
+      this.$div.current.innerText?(this.$div.current.innerText = next.value||''):(this.$div.current.innerHTML = next.value||'');
+    }
+  }*/
+
   componentDidMount(){
     if(isIE()){
       $(this.$div.current).onIe8Input(function(e){
@@ -47,10 +53,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>

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

BIN
src/common/images/backspace.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;

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

+ 9 - 2
src/components/DiagnosticItem/index.jsx

@@ -33,11 +33,18 @@ class DiagnosticItem extends Component{
             })
         }
     chooseDiagodal(item) {
+        const { diagnosticList,getTips } = this.props;
+        getTips && getTips(item);
+        for (let i = 0; i < diagnosticList.length; i++) {
+            if(diagnosticList[i].id === item.id && diagnosticList[i].name === item.name) {
+                Notify.info('该诊断已存在');
+                return
+            }
+        }
         this.setState({
             visible: true
         })
-        const { getTips } = this.props;
-        getTips && getTips(item);
+       
     }
     addDiagodal(diagType){
         const {item} = this.props;

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

+ 31 - 23
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,15 +231,18 @@ 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;
+    const ev = e || window.event;
     let data = this.state.inpText;
     if(!isIE()){
-      e.target.innerText?(e.target.innerText=""):(e.target.innerHTML="")
+      if(currentData&&currentData.length==0){//现病史没有模板的时候才去获取
+        getSymptomFeature && getSymptomFeature(ev.target.innerText);
+      } 
+      ev.target.innerText?(ev.target.innerText=""):(ev.target.innerHTML="")
       freeText && freeText(data.trim());
     }else{
       if(datas.length==0){
-        const ev = e || window.event;
         const data = ev.target.innerText;
         // freeText && freeText(data.trim());
         freeText && freeText(data);
@@ -244,14 +252,13 @@ class MainSuit extends Component{
       clearTimeout(this.state.clearTimer);
       const clearTimer = setTimeout(function(){
         clearSearch && clearSearch();
-        that.setState({
-          symptom:false
-        })
+        // that.setState({
+        //   symptom:false
+        // })
       },config.delayTime-200);
       this.setState({
         clearTimer
-      });
-    
+      });  
   }
 
 
@@ -273,7 +280,8 @@ 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>
       {/*没有推送结果就不显示*/}

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

@@ -46,9 +46,10 @@ class MultSpread extends Component{
     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 +61,7 @@ class MultSpread extends Component{
                             id={it.id}
                             patId = {copyId}
                             hideTag={true}></RadioDrop>;
-        case 5://带单位数字键盘
+        case +it.controlType===5://带单位数字键盘
         return <NumberUnitDrop prefix={it.labelPrefix}
                                suffix={it.labelSuffix}
                                placeholder={it.name}
@@ -70,26 +71,27 @@ 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}
                              show={show}
+                             allClick={false}
                              ikey={inx}
                              id={it.id}
                              patId = {copyId}
                              value={it.value}
                              hideTag={true}></NumberDrop>;
         default:
-          return '';
+          return it.name;
       }
     });
     return list;

+ 51 - 15
src/components/NumberDrop/index.jsx

@@ -11,6 +11,7 @@ import {handleEnter,getPageCoordinate} from '@utils/tools.js';
  * placeholder:灰显文字
  * handleSelect: 选中事件
  * show: 是否显示下拉
+ * allClick:是否前后缀也可唤出数字键盘
  *
  * ***/
 class NumberDrop extends Component{
@@ -23,7 +24,8 @@ class NumberDrop extends Component{
       boxLeft:0,
       boxTop:0,
       tmpTop:0,
-      tmpScroll:0
+      tmpScroll:0,
+      placeholder:props.placeholder
     };
     this.$span = React.createRef();
     this.$pre = React.createRef();
@@ -36,6 +38,7 @@ 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);
   }
   select(text){        //选中键盘上数字事件
     const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
@@ -45,10 +48,19 @@ class NumberDrop extends Component{
     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;
@@ -81,16 +93,22 @@ class NumberDrop extends Component{
   }
   numInpBlur(e){        //数字框失焦,保存值到store中
     e.stopPropagation();
+    if(!e.target.innerText.trim()){
+      this.setState({
+        placeholder:this.props.placeholder
+      });
+    }
     if(this.props.show){      //修改清空后第一次点击键盘不触发click事件bug
       return;
     }
     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 val = e.target.innerText.replace(/^\s*/,'');
+    const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
+    const {placeholder} = this.state;
     const text = val===placeholder?'':val;
-    e.target.innerText? (e.target.innerText = ''):(e.target.innerHTML='');      //避免出现重复输入值
+    e.target.innerText = '';      //避免出现重复输入值
     handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
   }
   handleSpanInp(e){   //数字框输入事件
@@ -98,10 +116,22 @@ class NumberDrop extends Component{
     const {handleHide} = this.props;
     handleHide&&handleHide();
   }
+  handleKeyDowm(e){
+    handleEnter();
+    //只能输入数字
+    const key = e.key;
+    const ctrlOn = e.ctrlKey;
+    const isCopyPaste = ctrlOn&&(key=='v'||key=='c');
+    if(!/[0-9|.|~|\/]/.test(key)&&key.length==1&&!isCopyPaste){
+      e.preventDefault();
+      return false;
+    }
+  }
   getClasses(){         //整个标签是否有值的状态
-    const {value,hideTag,placeholder} = this.props;
+    const {hideTag,placeholder,value} = this.props;
+    const val = this.$span.current&&this.$span.current.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 +159,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 +171,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'}}
             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}

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

@@ -40,17 +40,17 @@ class NumberUnitDrop extends Component{
     this.handleNumClick = this.handleNumClick.bind(this);
     this.changeToEdit = this.changeToEdit.bind(this);
   }
-  select(text){         //选中键盘上数字事件
+  select(obj){         //选中键盘上数字事件
     const {handleSelect,ikey,suffix,prefix,mainSaveText} = 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});
   }
   
   handleNumClick(e){ 
@@ -181,7 +181,7 @@ class NumberUnitDrop extends Component{
             onkeydown={handleEnter}
             style={{cursor:editable?'text':'pointer'}}>{value||placeholder}</span>
       <span>{suffix}</span>
-      <NumberUnitPan handleSelect={(text)=>this.select(text)}
+      <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

+ 18 - 4
src/components/PreviewBody/index.jsx

@@ -1,6 +1,6 @@
 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";
 
@@ -128,7 +128,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 +143,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>
@@ -182,7 +182,21 @@ class PreviewBody extends Component {
             <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-all" }}>
               {
-                filterDataArr(JSON.parse(dataStr.other))
+                other_yjs.str1
+              }
+              {dataJson['yjs_1']||dataJson['yjs_2']||dataJson['yjs_3']||dataJson['yjs_4']?<table style={{textAlign:'center',verticalAlign: 'middle',display:'inline-block'}}>
+                <tr>
+                  <td rowSpan='2' style={{verticalAlign: 'middle'}}>月经史:(</td>
+                  <td rowSpan='2' style={{verticalAlign: 'middle'}}>{dataJson['yjs_1']||'初潮年龄'}</td>
+                  <td style={{borderBottom:'1px solid #000'}}>{dataJson['yjs_2']||'行经天数'}</td>
+                  <td rowSpan='2' style={{verticalAlign: 'middle'}}>{dataJson['yjs_4']||'停经时间'})</td>
+                </tr>
+                <tr>
+                  <td style={{textAlign:'center'}}>{dataJson['yjs_3']||'周期'}</td>
+                </tr>
+              </table>:''}
+              {
+                other_yjs.str2
               }
             </td>
           </tr>

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

+ 48 - 11
src/components/PushItems/index.jsx

@@ -151,13 +151,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)}
@@ -185,10 +203,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>
@@ -219,7 +256,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 (
@@ -243,7 +280,7 @@ class PushItems extends Component {
                 icon={doubtImg}
                 title="疑似诊断"
                 diagList={doubt}
-                maxShowNum={28}
+                maxShowNum={26}
               />
             )}
             {possible && possible.length > 0 && (
@@ -252,7 +289,7 @@ class PushItems extends Component {
                 icon={possibleImg}
                 title="可能诊断"
                 diagList={possible}
-                maxShowNum={28}
+                maxShowNum={26}
               />
             )}
             <div className={style["diagnose"]}>
@@ -282,18 +319,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
@@ -331,7 +368,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,mainSaveText,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,mainSaveText});
+  }
+  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} = 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}>
+        {this.parseInputDom()}
+      </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;
+}

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

@@ -61,7 +61,7 @@ class SearchDrop extends Component{
         <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>
+            return <li onClick={(e)=>this.handleSelect(e,it)} title={litext}>{litext}</li>
           })}
         </ul>
       </div>

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

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


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


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

@@ -44,7 +44,7 @@ class Treat extends Component {
         const { setDrugInfoMore } = this.props
         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>

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

+ 58 - 3
src/components/TreatDesc/DrugInfo/index.jsx

@@ -1,21 +1,76 @@
 import React, { Component } from 'react';
 import style from './index.less';
 import close from './../img/close.png';
+import $ from "jquery";
+
 
 class DrugInfo extends Component {
     constructor(props) {
         super(props);
+        this.state = {
+            currentIndex: 0
+        }
+    }
+    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
+            }
+        }
     }
 
     render() {
         const { drugInfo, hideDrugInfo, drugInfoList,hideDrugInfoMore } = this.props
+        const { currentIndex } = this.state
         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>
+                { 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>

+ 42 - 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;
@@ -66,4 +67,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;
 }

+ 3 - 1
src/config/index.js

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

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

+ 15 - 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,
@@ -35,6 +35,7 @@ function mapStateToProps(state) {
     commSymHide:state.homePage.commSymHide,
     boxTop:state.homePage.boxTop,
     boxLeft:state.homePage.boxLeft,
+    currentData:state.currentIll.data,
   }
 }
 
@@ -166,6 +167,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
+          })
+        }
       }
     }
 }

+ 8 - 6
src/containers/NumberUnitDrop.js

@@ -47,15 +47,17 @@ function currentSelect(dispatch,params){
 }
 
 function handleModuleDiff(dispatch,params){
-  const {mainSaveText} = params;
+  const {mainSaveText,mark} = 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(mark){//选中才限制,清空和回退无需验证
+        let text = filterDataArr(mainSaveText);
+        if(text.length >= config.limited){
+          Notify.info(config.limitText);
+          return
+        }
+      } 
       mainSelect(dispatch,params);
       break;
     case 2:

+ 10 - 7
src/containers/OtherHistory.js

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

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

+ 191 - 0
src/containers/RadioInpDrop.js

@@ -0,0 +1,191 @@
+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;
+  let index = getLabelIndex(ikey);
+  dispatch({
+    type:SET_CK_RADIO_INPUT_VAL,
+    data:{
+      ikey:index,
+      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: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){

+ 12 - 2
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]}
@@ -76,10 +76,20 @@ export function singleRadio(params){
                          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 '';
   }

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

@@ -38,8 +38,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}>

+ 41 - 0
src/store/actions/checkBody.js

@@ -134,6 +134,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 function addLabelItem(state,action){
   let res = Object.assign({},state);

+ 192 - 91
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,7 @@ 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+'';
                   }
                 }
               }       
@@ -221,7 +222,7 @@ export const setData = (state,action) =>{
               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+',';
+                    newWiths[j].value = newWiths[j].name = withs[d].value+'';
                   }
                 }
               }
@@ -250,7 +251,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+',';
+                  }
+                }
+              }
+              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 +460,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 +625,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 +644,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;
 }
 

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

+ 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

+ 83 - 13
src/store/actions/mainSuit.js

@@ -92,24 +92,34 @@ 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?'、'+items[i].value:items[i].name;
+    } 
+  }
+  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);
+  // 防止没有flag的情况下报错,找不到flag就插到最后
+  inserIndx?data.splice(inserIndx-1,1,...obj):data.splice(-1,0,...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 = res.mainIds.concat(id);
   res.editClear = false;//主诉框编辑状态
   res.update=Math.random();
   return res;
@@ -300,7 +310,7 @@ export const insertSearch = (state,action)=>{
       }
     })
     // flag=1前是文本标签就替换,否则插入
-    const iftext = moduleData[inserIndx-1].tagType;
+    const iftext = inserIndx?moduleData[inserIndx-1].tagType:null;
     if(iftext==config.tagType){
        moduleData.splice(inserIndx-1,1,{id:id,name:searchData,value:searchData,tagType:config.tagType,exist:1});
      }else{
@@ -311,6 +321,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,6 +478,47 @@ 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);
@@ -478,7 +530,8 @@ export const changeLabelVal = (state,action)=>{
   const nextVal = next.value||next.name;
   //标签后是不是标点符号标签,是的话删除本标签时一起删除
   let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
-  if(newVal&&newVal.trim()){
+  // if(newVal&&newVal.trim()){//时间单位传空--键盘输入
+  if(newVal){
     if(item){
       item.value = newVal;
       res.saveText[index] = newVal;
@@ -533,7 +586,8 @@ export const saveFreeVal = (state,action)=>{
   }else{
     res.saveText = [];
   }*/
-  res.update = Math.random();
+  // res.update = Math.random();
+  // console.log(666,action,res);
   return res;
 }
 
@@ -681,3 +735,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;
+}

+ 50 - 2
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;
 }
@@ -276,11 +319,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;
 }
 //文本模式下值保存

+ 27 - 9
src/store/async-actions/fetchModules.js

@@ -15,8 +15,14 @@ const api={
   getOtherHisRecord: '/api/icss/inquiryInfo/getLastOther',
   getBigPush:'/api/icss/push/pushInner',
   saveMode:'/api/icss/doctorPageMode/saveDoctorPageModes',
+  getSymptomFeature:'/api/icss/feature/getSymptomFeature'
 };
 
+export const getFeature = (item)=>{
+  const datas = json(api.getSymptomFeature+'?text='+item,{});
+  return datas;
+}
+
 //获取模板,多个
 export const getModules = (ids)=>{
   const {patInfo} = store.getState();
@@ -41,15 +47,27 @@ export const getModule = (id)=>{
 //搜索接口
 export const getSearch = (param)=>{
   const {patInfo} = store.getState();
-    const {inpStr,boxMark,mainIds} = param;
-    const params = {
-      "age": patInfo.message.patientAge,
-      "inputIds":mainIds&&mainIds.length>0?mainIds:[],//主诉去重
-      "inputStr": inpStr.trim(),
-      // "inputStr": inpStr,
-      "sexType": patInfo.message.sex,
-      "type": boxMark //1为搜症状
-    };
+    const {inpStr,boxMark,mainIds,itemType} = param;
+    let params = {};
+    if(itemType==0){//主诉,仅限症状
+      params = {
+        "age": patInfo.message.patientAge,
+        "inputIds":mainIds&&mainIds.length>0?mainIds:[],//主诉去重
+        "inputStr": inpStr.trim(),
+        "sexType": patInfo.message.sex,
+        "type": boxMark, //1为主诉现病史
+        "itemType":itemType
+      };
+    }else{
+      params = {
+        "age": patInfo.message.patientAge,
+        "inputIds":mainIds&&mainIds.length>0?mainIds:[],//主诉去重
+        "inputStr": inpStr.trim(),
+        // "inputStr": inpStr,
+        "sexType": patInfo.message.sex,
+        "type": boxMark //1为搜症状
+      };
+    }
     return json(api.searchURL,params);
 };
 

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

@@ -103,7 +103,7 @@ export const getTreatResult = (item) =>{
         let diag = '';
         if(diagnosticList) {
             for (let i = 0; i < diagnosticList.length; i++ ) {
-                if(i ===0 ) {
+                if(i === 0 ) {
                     diag = diag + diagnosticList[i].name;
                 } else {
                     diag = diag + ',' + diagnosticList[i].name;

+ 5 - 2
src/store/reducers/checkBody.js

@@ -1,9 +1,10 @@
 import {SET,SETNUMBER4,SETSELECTED4,SETCHECKBOX,ADDLABELITEM,SETCHECKTEXT,SETSEARCHDATA,
   SELECTSEARCHDATA,CHANGECHECKTEXTLABEL,CLEARCHECKBODY,CHECK_FOCUS_INDEX,CHECKBODY_CLEAR,
-  SETCHECKINPUT,DEL_CHECKBODY,CHANGECHECKTEXTLABEL_NUMBER,CHECKCONFIRMSELECTED,CHECKBODY_MUL,DEL_CHECKBODY_LABLE} from '../types/checkBody.js';
+  SETCHECKINPUT,DEL_CHECKBODY,CHANGECHECKTEXTLABEL_NUMBER,CHECKCONFIRMSELECTED,
+  CHECKBODY_MUL,DEL_CHECKBODY_LABLE,SET_CK_RADIO_INPUT_VAL} from '../types/checkBody.js';
 import {set,setNumberValue,setRadioValue,setCheckBoxValue,addLabelItem,setCheckText,
   setSearchData,insertLabelData,changeLabelVal,clearCheckBody,setInputLabel,backspaceText,
-  changeNumLabelVal,confirm,multipleComfirn,delSingleLable} from '../actions/checkBody.js';
+  changeNumLabelVal,confirm,multipleComfirn,delSingleLable,setRadioInputValue} from '../actions/checkBody.js';
 import config from '@config/index.js';
 
 const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
@@ -57,6 +58,8 @@ export default function(state=initState,action){
       return multipleComfirn(state,action);
     case DEL_CHECKBODY_LABLE:
       return delSingleLable(state,action);
+    case SET_CK_RADIO_INPUT_VAL:
+      return setRadioInputValue(state,action);
     default:
       return res;
   }

+ 6 - 2
src/store/reducers/currentIll.js

@@ -1,9 +1,11 @@
 // 现病史
 import {SET_CURRENT,CURRENT_CONFIRM,INSERT_PROCESS,SET_CURRENT_DATA,SET_LABEL_MODULE,SETMAINCHECKBOX,
   CURRENT_RADIO,CURRENT_NUMBER,CURRENT_TEXT_LABEL,CLEAR_CURRENT_ILL,SETTEXTMODEVALUE,CURRENT_GET_BIGDATAPUSH,CURRENT_CLEAR,
-  SET_CURRENT_SEARCH,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,SELECT_SEARCHDATA,CLEAR_CURRENT_EDIT,CURRENTADDLABELITEM,SETCURRENTINPUT,DEL_CURRENT,CURRENT_TEXT_LABEL_NUMBER,REMOVE_CURR_ID,CURRENT_MUL,DEL_CURRENT_LABLE} from '../types/currentIll';
+  SET_CURRENT_SEARCH,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,SELECT_SEARCHDATA,CLEAR_CURRENT_EDIT,CURRENTADDLABELITEM,
+  SETCURRENTINPUT,DEL_CURRENT,CURRENT_TEXT_LABEL_NUMBER,REMOVE_CURR_ID,CURRENT_MUL,DEL_CURRENT_LABLE,SET_RADIO_INPUT_VALUE} from '../types/currentIll';
 import {confirm,insertProcess,setData,setCheckBox,setRadioValue,setNumberValue,changeLabelVal,clearCurrentIll,
-  setTextModeValue,setModule,bigDataSymptom,setCheckText,insertLabelData,clearCurrentEdit,addLabelItem,setInputLabel,backspaceText,changeNumLabelVal,removeId,multipleComfirn,delSingleLable} from '../actions/currentIll';
+  setTextModeValue,setModule,bigDataSymptom,setCheckText,insertLabelData,clearCurrentEdit,addLabelItem,setInputLabel,
+  backspaceText,changeNumLabelVal,removeId,multipleComfirn,delSingleLable,setRadioInputValue} from '../actions/currentIll';
 
 const initState = {
   moduleData:[],
@@ -75,6 +77,8 @@ export default function(state=initState,action){
       return multipleComfirn(state,action);
     case DEL_CURRENT_LABLE:
       return delSingleLable(state,action);
+    case SET_RADIO_INPUT_VALUE:
+      return setRadioInputValue(state,action);
     default:
       return state;
   }

+ 13 - 2
src/store/reducers/mainSuit.js

@@ -1,9 +1,12 @@
 import {COMM_SYMPTOMS,CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,
   SET_SEARCH,CLEAR_SEARCH,GET_BIGDATAPUSH,SET_MAINSUIT,MIX_CONFIRM,NUMBER_SELECT,
   RADIO_SELECT,COMM_CONFIRM,CHANGE_LABELVAL,SAVE_FREE,CLEAR_MAIN_SUIT,SET_DATA,
-  INSERT_SEARCH,MAIN_FOCUS_INDEX,SETTEXTMODEVALUE,SETMAINTEXT,MAINADDLABELITEM,SETMAININPUT,DEL_MAIN,CHANGE_LABELVAL_NUMBER,REMOVE_MAIN_ID,MAINSUIT_MUL,DEL_MAIN_LABLE} from '../types/mainSuit'
+  INSERT_SEARCH,MAIN_FOCUS_INDEX,SETTEXTMODEVALUE,SETMAINTEXT,MAINADDLABELITEM,SETMAININPUT,DEL_MAIN,CHANGE_LABELVAL_NUMBER,
+  REMOVE_MAIN_ID,MAINSUIT_MUL,DEL_MAIN_LABLE,SET_FEATURE,SET_MS_RADIO_INPUT_VAL} from '../types/mainSuit'
 import {getCommSymptoms,handleTailClick,insertMain,setSearch,getBigSymptom,setMainMoudle,confirm,
-  setNumberValue,setRadioValue,commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,changeEditClear,addLabelItem,setInputLabel,backspaceText,changeNumLabelVal,removeId,multipleComfirn,delSingleLable} from '../actions/mainSuit'
+  setNumberValue,setRadioValue,commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,
+  addLabelItem,setInputLabel,backspaceText,changeNumLabelVal,removeId,multipleComfirn,delSingleLable,
+  getSymptomFeature,setRadioInputValue} from '../actions/mainSuit'
 
 
 const initState = {
@@ -20,6 +23,10 @@ const initState = {
   focusIndex:'',
   mainIds:[], //选中的主症状和伴随的id(搜索去重)
   editClear:true,
+  symptomFeature:{//分词
+    featureData:[],
+    refresh:false //用于数据更新
+  }
 }
 
 export default function(state=initState,action){
@@ -88,6 +95,10 @@ export default function(state=initState,action){
       return multipleComfirn(state,action);
     case DEL_MAIN_LABLE://单独删除标签
       return delSingleLable(state,action);
+    case SET_FEATURE://主诉分词
+      return getSymptomFeature(state,action);
+    case SET_MS_RADIO_INPUT_VAL:
+      return setRadioInputValue(state,action);
     default:
       return state;
   }

+ 7 - 2
src/store/reducers/otherHistory.js

@@ -1,6 +1,9 @@
 import {SETDATA,CONFIRMSELECTED,SETRADIO,SETNUMBER,SETOTHERCHECKBOX,SETOTHERTEXT,SETOTHERSEARCHDATA,
-  SELECTOTHERSEARCHDATA,CLEAROTHERHISTORY,CHANGEOTHERTEXTLABEL,SETOTHERINPUT,SETTEXTMODEVALUE,OTHER_FOCUS_INDEX,OTHERHIS_CLEAR,OTHERADDLABELITEM,OTHEREDICLEAR,DEL_OTHERHIS,CHANGEOTHERTEXTLABEL_NUMBER,OTHERHIS_MUL,REMOVE_OTHER_ID,DEL_OTHERHIS_LABLE} from '../types/otherHistory';
-import {confirm,setRadioValue,setNumberValue,setCheckBoxValue,setCheckText,setSearchData,insertLabelData,clearOtherHistory,changeTextLabel,setOtherInput,setTextModeValue,addLabelItem,otherEditClear,backspaceText,changeNumLabelVal,multipleComfirn,removeId,delSingleLable} from '../actions/otherHistory';
+  SELECTOTHERSEARCHDATA,CLEAROTHERHISTORY,CHANGEOTHERTEXTLABEL,SETOTHERINPUT,SETTEXTMODEVALUE,OTHER_FOCUS_INDEX,OTHERHIS_CLEAR,
+  OTHERADDLABELITEM,OTHEREDICLEAR,DEL_OTHERHIS,CHANGEOTHERTEXTLABEL_NUMBER,OTHERHIS_MUL,REMOVE_OTHER_ID,DEL_OTHERHIS_LABLE,SET_OT_RADIO_INPUT_VAL} from '../types/otherHistory';
+import {confirm,setRadioValue,setNumberValue,setCheckBoxValue,setCheckText,setSearchData,insertLabelData,clearOtherHistory,
+  changeTextLabel,setOtherInput,setTextModeValue,addLabelItem,otherEditClear,backspaceText,changeNumLabelVal,multipleComfirn,
+  removeId,delSingleLable,setRadioInputValue} from '../actions/otherHistory';
 import config from '@config/index.js';
 
 const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
@@ -63,6 +66,8 @@ export default function(state=initState,action){//console.log(state)
         return removeId(state,action);
     case DEL_OTHERHIS_LABLE:
         return delSingleLable(state,action);
+    case SET_OT_RADIO_INPUT_VAL:
+      return setRadioInputValue(state,action);
     default:
       return res;
   }

+ 0 - 2
src/store/reducers/pushMessage.js

@@ -8,8 +8,6 @@ const initState = {
   assay: [],
   determine: [],
   check: [ //辅检
-    // {name: '胸部CT', id: 7, checked: false},
-    // {name: '心肌酶谱', id: 8, checked: false},
   ],
   tips: {},
   advice: {

+ 2 - 1
src/store/types/checkBody.js

@@ -16,4 +16,5 @@ export const DEL_CHECKBODY = 'DEL_CHECKBODY';//backspace
 export const CHANGECHECKTEXTLABEL_NUMBER = 'CHANGECHECKTEXTLABEL_NUMBER';//数字键盘
 export const CHECKCONFIRMSELECTED = 'spread_check_body_labels';
 export const CHECKBODY_MUL = 'CHECKBODY_MUL';//单列多选
-export const DEL_CHECKBODY_LABLE = 'DEL_CHECKBODY_LABLE';
+export const DEL_CHECKBODY_LABLE = 'DEL_CHECKBODY_LABLE';
+export const SET_CK_RADIO_INPUT_VAL = 'SET_CK_RADIO_INPUT_VAL';

+ 1 - 0
src/store/types/currentIll.js

@@ -25,4 +25,5 @@ export const CURRENT_TEXT_LABEL_NUMBER = 'CURRENT_TEXT_LABEL_NUMBER';     //数
 export const REMOVE_CURR_ID = 'REMOVE_CURR_ID';     //删除后移除id
 export const CURRENT_MUL = 'CURRENT_MUL';     //单列多选
 export const DEL_CURRENT_LABLE = 'DEL_CURRENT_LABLE';     //
+export const SET_RADIO_INPUT_VALUE = 'SET_RADIO_INPUT_VALUE';
 

+ 2 - 0
src/store/types/mainSuit.js

@@ -26,3 +26,5 @@ export const CHANGE_LABELVAL_NUMBER = 'CHANGE_LABELVAL_NUMBER';     //数字键
 export const REMOVE_MAIN_ID = 'REMOVE_MAIN_ID';     //移除id
 export const MAINSUIT_MUL = 'MAINSUIT_MUL';     //单列多选
 export const DEL_MAIN_LABLE = 'DEL_MAIN_LABLE';     
+export const SET_FEATURE = 'SET_FEATURE';  //主诉分词
+export const SET_MS_RADIO_INPUT_VAL = 'SET_MS_RADIO_INPUT_VAL'

+ 2 - 1
src/store/types/otherHistory.js

@@ -20,4 +20,5 @@ export const DEL_OTHERHIS = 'DEL_OTHERHIS';    //backspace
 export const CHANGEOTHERTEXTLABEL_NUMBER = 'CHANGEOTHERTEXTLABEL_NUMBER';    //数字键盘
 export const OTHERHIS_MUL = 'OTHERHIS_MUL';    //单列多选
 export const REMOVE_OTHER_ID = 'REMOVE_OTHER_ID';    
-export const DEL_OTHERHIS_LABLE = 'DEL_OTHERHIS_LABLE';    
+export const DEL_OTHERHIS_LABLE = 'DEL_OTHERHIS_LABLE';
+export const SET_OT_RADIO_INPUT_VAL = 'SET_OT_RADIO_INPUT_VAL'

+ 70 - 12
src/utils/tools.js

@@ -8,6 +8,7 @@ import {clearAllLabel} from '@store/actions/inspect';
 import {CLEAR_ALL_DIAG} from '@store/types/diagnosticList';
 import {CLEAR_ALL_PUSH_MESSAGE, SET_TIPS} from '@store/types/pushMessage';
 import {ISREAD, SETREADDITEMS} from "../store/types/homePage";
+import {tabChange} from '@store/actions/tabTemplate';
 import config from '@config/index.js';
 
 /***
@@ -161,11 +162,17 @@ const getUrlArgObject = (parm) => {
 } 
 const getAllDataList =(baseList) =>{           //获取所有模块结构化的数据
     let jsonData = {};
+    //月经史公式
+    const other = baseList.otherHistory;
     jsonData.lis = {};
     jsonData.chief = baseList.mainSuit.data;      //主诉
     jsonData.present = baseList.currentIll.data;    //现病史
-    jsonData.other = baseList.otherHistory.data;      //其他史
-    jsonData.otherHistoryIsEmpty = baseList.otherHistory.isEmpty;
+    jsonData.other = other.data;      //其他史
+    jsonData.otherHistoryIsEmpty = other.isEmpty;
+    jsonData['yjs_1'] = other['yjs_1'];
+    jsonData['yjs_2'] = other['yjs_2'];
+    jsonData['yjs_3'] = other['yjs_3'];
+    jsonData['yjs_4'] = other['yjs_4'];
     jsonData.vital = baseList.checkBody.data;    //查体
     jsonData.checkBodyIsEmpty = baseList.checkBody.isEmpty;
     jsonData.lis.labelList = baseList.inspect.labelList;      //化验
@@ -234,7 +241,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
       const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
       store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[]});
         store.dispatch({type: CLEAR_CURRENT_ILL,data:[],saveText:[],selecteds:[],editClear:true,symptomIds:[]});
-        store.dispatch({type: CLEAROTHERHISTORY,data:[block],isEmpty:true,saveText:[],selecteds:[],editClear:true});
+        store.dispatch({type: CLEAROTHERHISTORY,data:[block],isEmpty:true,saveText:[],selecteds:[],editClear:true,yjs_1:'',yjs_2:'',yjs_3:'',yjs_4:''});
         store.dispatch({type: CLEARCHECKBODY,data:[block],isEmpty:true,saveText:[],selecteds:[]});
         store.dispatch(clearAssistData([],''));
         store.dispatch(clearAllLabel([],[],''));
@@ -257,9 +264,12 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
        // Notify.success('页面已清空')
     }else{
         if (whichSign == 0) {
+          let dataJson = JSON.parse(reData.dataJson);
+          //其他史data
+          const oData = dataJson.other;
+          const onlyOneText = oData.length==1&&oData[0].tagType==8&&!(oData[0].name||oData[0].value);
             if(type == 'template'){        //结构化模板回读
-                let dataJson = JSON.parse(reData.dataJson);
-                let dataJsonStr = JSON.parse(reData.preview);
+              let dataJsonStr = JSON.parse(reData.preview);
                 // console.log(dataJson,dataJsonStr,'结构化模板引用')
                 store.dispatch({
                     type: CLEAR_MAIN_SUIT,
@@ -278,8 +288,12 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                 store.dispatch({
                     type: CLEAROTHERHISTORY,
                     data:dataJson.other,
+                    yjs_1:dataJson.yjs_1,
+                    yjs_2:dataJson.yjs_2,
+                    yjs_3:dataJson.yjs_3,
+                    yjs_4:dataJson.yjs_4,
                     selecteds:dataJson.otherHistorySelecteds?dataJson.otherHistorySelecteds:[],
-                    isEmpty:dataJson.otherHistoryIsEmpty,
+                    isEmpty:onlyOneText?true:false,//dataJson.otherHistoryIsEmpty,
                     saveText:JSON.parse(dataJsonStr.other),
                     editClear:dataJson.other.length>0?false:true
                 });
@@ -311,10 +325,12 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                   type:SETREADDITEMS,
                   data:dataJson.addItems
                 });
+              //tab跳回辅助信息
+              store.dispatch(tabChange('0'));
             }else{    //结构化历史病历回读
-                let dataJson = JSON.parse(reData.dataJson);
+                /*let dataJson = JSON.parse(reData.dataJson);*/
                 let dataJsonStr = reData.detailList;
-                // console.log(dataJson.chief,dataJsonStr[0].content,'结构化历史病历回读')
+              // console.log(dataJson,dataJsonStr,'结构化历史病历回读')
                 // console.log(dataJson.mainSuitSelecteds,7887)
                 store.dispatch({
                     type: CLEAR_MAIN_SUIT,
@@ -333,9 +349,13 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                 store.dispatch({
                     type: CLEAROTHERHISTORY,
                     data:dataJson.other,
+                    yjs_1:dataJson.yjs_1,
+                    yjs_2:dataJson.yjs_2,
+                    yjs_3:dataJson.yjs_3,
+                    yjs_4:dataJson.yjs_4,
                     selecteds:dataJson.otherHistorySelecteds?dataJson.otherHistorySelecteds:[],
                     saveText:dataJsonStr[2].content ? JSON.parse(dataJsonStr[2].content):[],
-                    isEmpty:dataJson.otherHistoryIsEmpty,
+                    isEmpty:onlyOneText?true:false,//dataJson.otherHistoryIsEmpty,回读回来后判断是否只有一个空标签,是的话要使用模板
                     editClear:dataJson.other.length>0?false:true
                 });
                 store.dispatch({
@@ -418,6 +438,8 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                 type:SETREADDITEMS,
                 data:dataJson.addItems
               });
+              //tab跳回辅助信息
+              store.dispatch(tabChange('0'));
             }else{  //纯文本历史病历回读
                 let dataJson = JSON.parse(reData.dataJson);
                 let dataJsonStr = reData.detailList;
@@ -499,10 +521,45 @@ function filterDataArr(arrTmp){   //数据处理
       });
     });
 
-    return tmpArr.join('').replace(config.punReg,function(word){
+    return trimDots(tmpArr.join(''));      //去掉开头的标点符号,最后的标点保留第一个,中间连续的保留第一个
+}
+//其他史预览数据处理-月经史
+function filterOtherDataArr(arrTmp,jsonArr){
+  let tmpArr = [];
+  let index1 = jsonArr.findIndex((item)=>{
+    return item.formulaCode=='yjs_1';
+  });
+  let index2 = jsonArr.findIndex((item)=>{
+    return item.formulaCode=='yjs_2';
+  });
+  let index3 = jsonArr.findIndex((item)=>{
+    return item.formulaCode=='yjs_3';
+  });
+  let index4 = jsonArr.findIndex((item)=>{
+    return item.formulaCode=='yjs_4';
+  });
+  if(index1==-1&&index2==-1&&index3==-1&&index4==-1){//无月经史
+    return {str1:filterDataArr(arrTmp),str2:''};
+  }
+  tmpArr = arrTmp.map((it,i)=>{     //连续的标点符号保留第一个
+    if(!it.match(config.punctuationReg)&&!arrTmp[i-1]||[index1,index2,index3,index4].includes(i)){        //只有标点符号或者前一个标签无值是(说明本标点灰显,不显示在预览中)
+      return '';
+    }
+    return it.replace(config.punReg,function(word){
       return word.substr(0,1);
-    }).replace(/^[,,.。::"“??”;;、!!]+/,'');      //去掉开头的标点符号,最后的标点保留第一个,中间连续的保留第一个
+    });
+  });
+  const str1 = [...tmpArr].splice(0,index1).join("");
+  const str2 = [...tmpArr].splice(index1).join("");
+  return {str1:trimDots(str1),str2:trimDots(str2),index:index1};
 }
+//去掉开头的标点符号,最后的标点保留第一个,中间连续的保留第一个
+function trimDots(str){
+  return str.replace(config.punReg,function(word){
+    return word.substr(0,1);
+  }).replace(/^[,,.。::"“??”;;、!!]+/,'');
+}
+
 // 取消默认行为
 function preventDefault(event) {
     if (event.preventDefault) {
@@ -548,7 +605,7 @@ function getEMRParams(){
     vital = filterDataArr(checkBody.saveText)||'',
     lis = inspect.pushItem,    //化验推送所需数据
     pacs = assistCheck.dataString||'',
-    dis=diagnosticList.diagnosticStr||'',
+    dis=diagnosticList.diagnosticStrNoType||'',
     advice = '',
     diseaeId = [];
   const age = message.patientAge;
@@ -653,6 +710,7 @@ module.exports = {
     pushAllDataList,
     filterArr,
     filterDataArr,
+    filterOtherDataArr,
     preventDefault,
     handleEnter,
     didPushParamChange,

+ 138 - 80
static/pages/diag_push.html

@@ -30,20 +30,24 @@
             font-family: 'Microsoft YaHei', arial, tahoma, sans-serif;
         }
         tr{
-            height: 30px;
+            line-height: 30px;
+        }
+        td{
+            vertical-align: top;
         }
         .container label{
             display: inline-block;
             width: 80px;
             margin-left: 5px;
         }
-        .container a{
-            margin-right: 10px;
+        a{
             color: blue;
             cursor: default;
+            cursor: pointer;
             text-decoration: underline;
         }
         a.info{
+            margin-right: 10px;
             display: inline-block;
             width:14px;
             height: 14px;
@@ -55,29 +59,6 @@
             text-decoration: none;
             margin-left: 3px;
         }
-
-        .origin td[rowspan="5"]{
-            width: 45px;
-            /*background: #deecfd;*/
-        }
-        .origin td:first-child{
-            border-right: 1px #828790 solid;
-            word-break: break-all;
-        }
-        .origin span{
-            float: left;
-        }
-        td:last-child{
-           /* width:560px;*/
-        }
-        .origin span:first-child{
-            margin-left:5px;
-        }
-        .origin .little{
-            font-size: 10px;
-            line-height: 12px;
-            margin-left: 5px;
-        }
         .hide{
             display: none!important;
         }
@@ -93,7 +74,6 @@
             border-radius: 3px;
             cursor: pointer;
         }
-
         .clearfix{
             zoom: 1;
         }
@@ -104,60 +84,138 @@
             overflow: hidden;
             visibility: hidden;
         }
+        .vertical,.horizontal{
+             display: none;
+         }
+        .item-title{
+            font-weight: bold;
+            font-size: 14px;
+            line-height: 30px;
+            border-bottom: 1px #ccc solid;
+        }
+        .item-content{
+            font-size: 13px;
+            line-height: 30px;
+        }
+        .little{
+            float: left;
+        }
+        .info-item .title,.info-item .content{
+            float: left;
+        }
+        .box7,.box8,.box9{
+            display: none;
+        }
+        .item-content .inner-item{
+            display: inline-block;
+           white-space:nowrap;
+        }
     </style>
 </head>
 <body>
-    <table class="container" cellspacing="0">
-        <tbody>
-        <tr class="origin">
-            <td rowspan="5">
-                <div class="clearfix">
-                    <span>智<br/>能<br/>推<br/>送</span>
-                    <span class="little">︵<br/>仅<br/>供<br/>参<br/>考<br/>︶</span>
-                </div>
-            </td>
-            <td>
-                <label>>初步诊断:</label>
-            </td>
-            <td class="main-suit">
-            </td>
-        </tr>
-        <tr class="test">
-            <td>
-                <label>>建议化验:</label>
-            </td>
-            <td>
-                <div class="test-item item">
-                </div>
-            </td>
-        </tr>
-        <tr class="suggest">
-            <td>
-                <label>>建议辅检:</label>
-            </td>
-            <td>
-                <div class="sug-item item">
-                </div>
-            </td>
-        </tr>
-        <tr class="treat">
-            <td>
-                <label>>治疗建议:</label>
-            </td>
-            <td>
-                <div class="treatment item">
-                </div>
-            </td>
-        </tr>
-        <tr>
-            <td></td>
-            <td>
-                <p></p>
-            </td>
-        </tr>
-        </tbody>
-    </table>
-
-    <script src="./hisLib/jquery-1.9.1.min.js"></script>
-    <script  src="./hisLib/diag_push.js"></script>
+<table class="container horizontal" cellspacing="0">
+    <tbody>
+    <tr class="item-box box7">
+        <!--<td rowspan="5">
+            <div class="clearfix">
+                <span class="little" style="margin-top: 17px;">智<br/>能<br/>推<br/>送</span>
+                <span class="little">︵<br/>仅<br/>供<br/>参<br/>考<br/>︶</span>
+            </div>
+        </td>-->
+        <td>
+            <label>>初步诊断:</label>
+        </td>
+        <td class="item-content">
+        </td>
+    </tr>
+    <tr class="item-box box8">
+        <td>
+            <label>>疑似诊断:</label>
+        </td>
+        <td>
+            <div class="item-content">
+            </div>
+        </td>
+    </tr>
+    <tr class="item-box box9">
+        <td>
+            <label>>警惕:</label>
+        </td>
+        <td>
+            <div class="item-content">
+            </div>
+        </td>
+    </tr>
+    <tr class="item-box box5">
+        <td>
+            <label>>建议化验:</label>
+        </td>
+        <td>
+            <div class="item-content">
+            </div>
+        </td>
+    </tr>
+    <tr class="item-box box6">
+        <td>
+            <label>>建议辅检:</label>
+        </td>
+        <td>
+            <div class="item-content">
+            </div>
+        </td>
+    </tr>
+    <tr class="item-box box">
+        <td style="vertical-align: text-bottom;">
+            <label>>治疗建议:</label>
+        </td>
+        <td>
+            <div class="item-content box">
+                无
+            </div>
+        </td>
+    </tr>
+    <tr class="item-box box0">
+        <td style="vertical-align: text-bottom;">
+            <label>>提示信息:</label>
+        </td>
+        <td>
+            <div class="item-content box0">
+            </div>
+        </td>
+    </tr>
+    </tbody>
+</table>
+<div class="container vertical">
+    <div class="title">智能推送(仅供参考)</div>
+    <div class="item-box box7">
+        <div class="item-title">初步诊断</div>
+        <div class="item-content"></div>
+    </div>
+    <div class="item-box box8">
+        <div class="item-title">疑似诊断</div>
+        <div class="item-content"></div>
+    </div>
+    <div class="item-box box9">
+        <div class="item-title">警惕</div>
+        <div class="item-content"></div>
+    </div>
+    <div class="item-box box5">
+        <div class="item-title">建议化验</div>
+        <div class="item-content"></div>
+    </div>
+    <div class="item-box box6">
+        <div class="item-title">建议辅检</div>
+        <div class="item-content"></div>
+    </div>
+    <div class="item-box box">
+        <div class="item-title">治疗建议</div>
+        <div class="item-content">无</div>
+    </div>
+    <div class="item-box box0">
+        <div class="item-title">提示信息</div>
+        <div class="item-content"></div>
+    </div>
+</div>
+<script src="./hisLib/jquery-1.3.1.js"></script>
+<script  src="./hisLib/diag_push.js"></script>
 </body>

+ 147 - 218
static/pages/hisLib/diag_push.js

@@ -1,228 +1,157 @@
 (function ($) {
-        var urls = {
-            url:{
-                'host':"/icss-web",
-                'start_drug': '/rule_controller/start_drug_title',
-                //His推送接口
-                'get_push_data':'/kl/diseaseinfo/get_data',
-                'recovery_index': '/at/inquiry_info/recover',
-                'get_patient_from_his': '/at/patientinfo/get_patient_from_his'
-            }
-        };
-        var urlSearch = parseUrl();
-        var isRecover = urlSearch.recover;
-        if(isRecover){
-            getRecover();
-        }else{
-            getPushData();
-        }
-        function parseUrl() {
-            var r = window.location.search.substr(1).split("&"),
-                obj = {};
-            $.each(r, function (i, v) {
-                if (v) {
-                    var arr = v.split("=");
-                    obj[arr[0]] = encodeURI(arr[1]);
-                }
-            });
-            return obj;
-        };
-        function getPushData(){
-            var url = urls.url.host + urls.url.get_push_data;
-            var code = urlSearch.diagnosis;
-            var hospitalCode = urlSearch.hospitalCode;
-            ajaxJsonGet(url,{code:code,hospitalCode:hospitalCode},function(response){
-                var data = response.data;
-                if(response.status=='OK'){
-                    fillPushData(data);
-                }
-            });
-        }
-        //获取历史数据
-        function getRecover(){
-            var patientNo = urlSearch.patientId;
-            var recordId = urlSearch.recordId;
-            var hospitalCode = urlSearch.hospitalId;//urls.url.host
-            var url =  urls.url.host + urls.url.recovery_index;
-            var pUrl = urls.url.host + urls.url.get_patient_from_his;
-            ajaxJsonGet(pUrl,{hospitalCode:hospitalCode,hisCode:patientNo},function(response){
-                var data = response.data;
-                if(data){
-                    $.get(url,{patientId:data.id,hospitalCode:hospitalCode,hisCode:recordId},function(response){
-                        var data = response.data;
-                        if(response.status=='OK'){
-                            parseRecoverData(data);
-                        }
-                    });
-                }else{
-                    console.warn("获取患者信息为空");
-                }
-            });
+  var urls = {
+    //His推送接口
+    'get_push':'http://192.168.2.236/api/icss/emr/pushEMR',
+    'get_info':'http://192.168.2.236/api/icss/emr/getIntroduceByEMR'
+  };
+  $.support.cors = true;
+  var config = {
+    width:'560px',      //推送内容显示的宽度
+    num:'11',         //每行显示的最大个数
+    mode:'horizontal',  //布局模式水平horizontal,垂直vertical,
+    models:[5,6,7]       //需要显示的推送模块,主诉-诊断1-7
+  };
+  var urlSearch = parseUrl();
+  handleConfig();
+  //getPushData();
 
-        }
+  function parseUrl() {
+    var r = window.location.search.substr(1).split("&"),
+      obj = {};
+    $.each(r, function (i, v) {
+      if (v) {
+        var arr = v.split("=");
+        obj[arr[0]] = arr[1]?decodeURI(arr[1]):'';
+      }
+    });
+    return obj;
+  };
 
-        //解析recover数据
-        function parseTextRecoverData(data){
-            var json = JSON.parse(data[0].dataJson);
-            var items = json.structuredText.items;
-            var test = items[5].symptoms&&items[5].symptoms.split(",");
-            var sug = items[6].symptoms&&items[6].symptoms.split(",");
-            var treat = items[7].symptoms.split(",");
-            var drug = items[8].symptoms.split(",");
-            var treatStr='';
-            if(test.length==0){
-                test = json.hisPush.test.map((it) =>{
-                   return it.name;
-                });
-            }
-            if(sug.length==0){
-                sug = json.hisPush.assist.map((it) =>{
-                    return it.name;
-                });
-            }
-            for(var i=0; i<treat.length;i++){
-                if(i>3){
-                    treatStr += '<b class="hide">'+treat[i]+'</b>';
-                }else{
-                    treatStr += '<b>'+treat[i]+'</b>';
-                }
-            }
-            $(".main-suit").html(treatStr);
-            mapRecoverData(".test-item",test,true);
-            mapRecoverData(".sug-item",sug,true);
-            mapRecoverData(".treatment",drug,true);
-            var hide = $(".main-suit .hide")[0];
-            if(hide){
-                $("<a class='more'>...</a>").insertBefore(hide);
-                $(".more").click(function(e){
-                    $(e.target).siblings(".hide").removeClass("hide");
-                    $(e.target).hide();
-                })
-            }
-        }
-        function parseRecoverData(data){
-            if(!data[0]){
-                console.warn("获取的recover数据为空");
-                return ;
-            }
-            var json = JSON.parse(data[0].dataJson);
-            if(json.mode==2){
-                parseTextRecoverData(data);
-                return;
-            }
-            var items = json.structured.originalItems;
-            var test = items[5][''];
-            var sug = items[6][''];
-            var treat = items[7][''];
-            var drug = items[8][''];
-            var treatStr='',infoUrl;
-            test = test.length==0?json.hisPush.test:test;
-            sug = sug.length==0?json.hisPush.assist:sug;
-            //console.log(json)
-            for(var i=0; i<treat.length;i++){
-                infoUrl = "./case_info.html?diseaseId="+treat[i].id;   //文本模式保存的没有id
-                if(i>3){
-                    treatStr += '<b class="hide">'+treat[i].title+'</b><a class="info hide" href="'+infoUrl+'" target="_blank">i</a>';
-                }else{
-                    treatStr += '<b>'+treat[i].title+'</b><a class="info" href="'+infoUrl+'" target="_blank">i</a>';
-                }
-            }
-            $(".main-suit").html(treatStr);
-            mapRecoverData(".test-item",test);
-            mapRecoverData(".sug-item",sug);
-            mapRecoverData(".treatment",drug);
-            var hide = $(".main-suit .hide")[0];
-            if(hide){
-                $("<a class='more'>...</a>").insertBefore(hide);
-                $(".more").click(function(e){
-                    $(e.target).siblings(".hide").removeClass("hide");
-                    $(e.target).hide();
-                })
-            }
+  function handleConfig(){
+    $(".container").css({'width':'560px'});
+    getPushData();
+    $('.'+config.mode).show();
 
-        }
+  }
+  function getPushData(){
+    var url = urls.get_push;
+    var myParam = {
+      symptom: urlSearch.symptomJson||"",
+      past: urlSearch.pastJson||"",
+      other: urlSearch.otherJson||"",
+      vital: urlSearch.vitalsJson||"",
+      lis: JSON.parse(urlSearch.labsJson||null),
+      pacs: urlSearch.pacsJson||"",
+      diag: urlSearch.disJson||"",
+      featureType: config.models.join(","),
+      hosCode:'A001',
+      age:urlSearch.age,
+      sex:urlSearch.sexType
+    };
 
-        function mapRecoverData(dom,data,isText){
-            var itemDom = "",item = data,temp;
-            if(!data.length>0){
-                console.warn("获取数据失败");
-                return ;
-            }
-            for(var i=0;i<item.length;i++){
-                if(isText){
-                    temp = item[i];
-                }else{
-                    temp = item[i].title||item[i].name;
-                }
-                if(i>7){
-                    itemDom += '<a href="##" class="hide">'+temp+'</a>';
-                }else{
-                    itemDom += '<a href="##">'+temp+'</a>';
-                }
-            }
-            $(dom).html(itemDom||"无");
-            var hide = $(dom).find(".hide")[0];
-            if(hide){
-                $("<a class='more'>...</a>").insertBefore(hide);
-                $(".more").click(function(e){
-                    $(e.target).siblings(".hide").removeClass("hide");
-                    $(e.target).hide();
-                })
-            }
+    $.ajax({
+      url: url,
+      type:'post',
+      dataType: "json",
+      cache:false,
+      contentType:"application/json",
+      data:JSON.stringify(myParam),
+      success:function(response){
+        var data = response.data;
+        if(response.code=='0'){
+          fillPushData(data);
         }
-        //填入推送信息
-        function fillPushData(data){
-            if(!data||JSON.stringify(data)=='{}'){
-                console.warn("获取推送数据为空!");
-                return ;
-            }
-            var lis = data.lis;
-            var pacs = data.pacs;
-            var drug = data.drug;
-            var disease = data.disease;
-            var infoUrl,str='';
+      },
+      error:function(error){
+        console.log("error:"+error);
+      },
+      complete:function(){
+        console.log("complete")
+      }
+    });
+  }
 
-            for(var i=0;i<disease.length;i++){
-                infoUrl="./case_info.html?diseaseId="+disease[i].id;
-                str += '<b>'+disease[i].name+'</b><a class="info" href="'+infoUrl+'" target="_blank">i</a>';
-            }
-            $(".main-suit").html(str);
-            mapItem(".test-item", lis);
-            mapItem(".sug-item", pacs);
-            mapItem(".drug-item", drug);
+  function getTreatInfo(type,name,detailName){
+    var url = urls.get_info;
+    var myParam = {
+      icdCode:urlSearch.icd,
+      type:type,
+      name:name,
+      detailName:detailName,
+      hosCode:'A001',
+      age:urlSearch.age,
+      sex:urlSearch.sexType
+    };
 
+    $.ajax({
+      url: url,
+      type:'post',
+      dataType: "json",
+      cache:false,
+      contentType:"application/json",
+      data:JSON.stringify(myParam),
+      success:function(response){
+        var data = response.data;
+        if(response.code=='0'){
+          fillInfomation(data);
         }
-        //遍历数据
-        function mapItem(dom,item){
-            var itemDom = '';
-            for(var i=0;i<item.length;i++){
-                if(i>5){
-                    itemDom += '<a href="##" class="hide">'+item[i]+'</a>';
-                }else{
-                    itemDom += '<a href="##">'+item[i]+'</a>';
-                }
-            }
-            $(dom).html(itemDom||"无");
-            var hide = $(dom).find(".hide")[0];
-            if(hide){
-                $("<a class='more'>...</a>").insertBefore(hide);
-                $(".more").click(function(e){
-                    $(e.target).siblings(".hide").removeClass("hide");
-                    $(e.target).hide();
-                })
-            }
-        }
-        function ajaxJsonGet(url, param, callback){
-            $.ajax({
-                url: url,
-                data:param,
-                contentType: 'application/json',
-                type:'get',
-                cache:false,
-                success:function(response){
-                    callback(response);
-                }
-            });
-        }
+      },
+      error:function(error){
+        console.log("error:"+error);
+      },
+      complete:function(){
+        console.log("complete")
+      }
+    });
+  }
+
+  //填入提示信息
+  function fillInfomation(data){
+    var dom='';
+    for(var i=0;i<data.length;i++){
+      dom+='<div class="info-item clearfix"><span class="title">'+data[i].title+':</span><p class="content">'+data[i].text+'</p></div>';
+    }
+    $(".box0 .item-content").html(dom);
+  }
+
+  //填入推送信息
+  function fillPushData(data){
+    if(!data||JSON.stringify(data)=='{}'){
+      console.warn("获取推送数据为空!");
+      return ;
+    }
+    var key='',modeClass='.'+config.mode;
+    mapItem(modeClass+" .box5", data['lisList'],5);   //化验
+    mapItem(modeClass+" .box6", data['pacsList'],6);   //辅捡
+    data['dis']['可能诊断'].length>0&&mapItem(modeClass+" .box7", data['dis']['可能诊断'],7);   //初步诊断
+    data['dis']['确诊'].length>0&&mapItem(modeClass+" .box8", data['dis']['确诊'],7);   //疑似诊断
+    data['dis']['警惕'].length>0&&mapItem(modeClass+" .box9", data['dis']['警惕'],7);   //警惕
+
+    $("a.info").click(function(e){
+      getTreatInfo($(e.target).attr('type'),$(e.target).attr('name'),$(e.target).attr('detailName'))
+    });
 
-    })(jQuery);
+    //$(modeClass+" .box .item-content").html(str);         //治疗建议
+  }
+  //遍历数据
+  function mapItem(dom,item,type){
+    var itemDom = '';
+    for(var i=0;i<item.length;i++){
+      if(i>config.num-1){
+        itemDom += '<p class="inner-item"><a href="##" class="hide">'+(item[i].name||item[i].uniqueName)+'</a><a class="info hide" target="_blank name="'+item[i].name+'" type='+type+' detail="'+item[i].detailName+'>i</a></p>';
+      }else{
+        itemDom += '<p class="inner-item"><a href="##">'+(item[i].name||item[i].uniqueName)+'</a><a class="info" target="_blank" name='+item[i].name+' type="'+type+'" detail="'+item[i].detailName+'">i</a></p>';
+      }
+    }
+    $(dom+" .item-content").html(itemDom||"无");
+    $(dom).show();
+    var hide = $(dom).find(".hide")[0];
+    if(hide){
+      $("<a class='more'>...</a>").insertBefore(hide);
+      $(".more").click(function(e){
+        $(e.target).siblings(".hide").removeClass("hide");
+        $(e.target).hide();
+      });
+    }
+  }
+})(jQuery);