浏览代码

Merge branch 'dev/new1' into dev/zhangxc1

zhangxc 6 年之前
父节点
当前提交
7a78823008
共有 88 个文件被更改,包括 852 次插入461 次删除
  1. 15 11
      src/common/components/EditableSpan/index.jsx
  2. 1 1
      src/common/components/EditableSpan/index.less
  3. 1 1
      src/common/components/InspectCommon/index.less
  4. 19 2
      src/common/components/ItemBox/index.jsx
  5. 3 1
      src/common/components/NumberPan/index.jsx
  6. 4 1
      src/common/components/NumberPan/index.less
  7. 12 1
      src/common/components/NumberUnitPan/index.jsx
  8. 5 2
      src/common/components/NumberUnitPan/index.less
  9. 6 3
      src/common/components/SearchOption/index.jsx
  10. 1 1
      src/common/components/SearchOption/index.less
  11. 1 1
      src/common/components/Textarea/index.jsx
  12. 7 2
      src/common/js/func.js
  13. 2 1
      src/common/js/util.js
  14. 10 7
      src/common/less/variables.less
  15. 1 1
      src/components/AddAssistCheck/Textarea/index.jsx
  16. 7 0
      src/components/AddAssistCheck/Textarea/index.less
  17. 3 2
      src/components/AddAssistCheck/index.jsx
  18. 6 0
      src/components/AddAssistCheck/index.less
  19. 8 7
      src/components/AddInspect/index.jsx
  20. 3 2
      src/components/AddInspect/index.less
  21. 1 1
      src/components/CheckBody/index.jsx
  22. 2 2
      src/components/CommonSymptom/index.jsx
  23. 2 2
      src/components/CopyRight/index.less
  24. 1 1
      src/components/EMRContainer/index.less
  25. 6 1
      src/components/HistoryCaseContainer/HistoryList/index.jsx
  26. 14 12
      src/components/HistoryCaseContainer/HistoryList/index.less
  27. 20 5
      src/components/Inspect/index.jsx
  28. 1 0
      src/components/Inspect/index.less
  29. 46 28
      src/components/MainSuit/index.jsx
  30. 4 3
      src/components/MultSpread/index.jsx
  31. 5 4
      src/components/NumberDrop/index.jsx
  32. 35 19
      src/components/NumberUnitDrop/index.jsx
  33. 52 30
      src/components/Operation/index.jsx
  34. 2 1
      src/components/Operation/index.less
  35. 1 1
      src/components/OtherHistory/index.jsx
  36. 22 76
      src/components/PreviewBody/index.jsx
  37. 5 1
      src/components/PreviewBody/index.less
  38. 8 7
      src/components/PushContainer/index.jsx
  39. 3 3
      src/components/PushItems/index.less
  40. 8 2
      src/components/RadioDrop/index.jsx
  41. 57 26
      src/components/SpreadDrop/index.jsx
  42. 1 1
      src/components/SpreadDrop/index.less
  43. 1 0
      src/components/TemplateItems/TemplateItem/index.jsx
  44. 1 1
      src/components/TemplateItems/index.jsx
  45. 1 1
      src/components/TemplateItems/index.less
  46. 2 0
      src/config/index.js
  47. 5 2
      src/containers/CheckBody.js
  48. 1 1
      src/containers/CurrentIll.js
  49. 3 2
      src/containers/EditableSpan.js
  50. 2 1
      src/containers/HistoryCases.js
  51. 6 0
      src/containers/MainSuit.js
  52. 12 8
      src/containers/NumberDrop.js
  53. 10 1
      src/containers/NumberUnitDrop.js
  54. 10 5
      src/containers/OperationContainer.js
  55. 6 4
      src/containers/OtherHistory.js
  56. 5 1
      src/containers/RadioDrop.js
  57. 9 6
      src/containers/SpreadDrop.js
  58. 4 2
      src/containers/eleType.js
  59. 1 1
      src/main.js
  60. 46 7
      src/store/actions/checkBody.js
  61. 75 34
      src/store/actions/currentIll.js
  62. 18 6
      src/store/actions/homePage.js
  63. 72 33
      src/store/actions/mainSuit.js
  64. 41 13
      src/store/actions/otherHistory.js
  65. 7 0
      src/store/actions/print.js
  66. 1 1
      src/store/actions/tabTemplate.js
  67. 0 1
      src/store/async-actions/assistCheck.js
  68. 2 2
      src/store/async-actions/fetchModules.js
  69. 4 5
      src/store/async-actions/homePage.js
  70. 0 1
      src/store/async-actions/inspect.js
  71. 10 7
      src/store/async-actions/patInfo.js
  72. 19 2
      src/store/async-actions/tabTemplate.js
  73. 5 6
      src/store/async-actions/treat.js
  74. 10 10
      src/store/reducers/assistCheck.js
  75. 4 2
      src/store/reducers/checkBody.js
  76. 4 2
      src/store/reducers/currentIll.js
  77. 1 1
      src/store/reducers/getInfoByUuid.js
  78. 4 2
      src/store/reducers/mainSuit.js
  79. 4 2
      src/store/reducers/otherHistory.js
  80. 6 3
      src/store/reducers/print.js
  81. 1 1
      src/store/reducers/tabTemplate.js
  82. 2 1
      src/store/types/checkBody.js
  83. 1 0
      src/store/types/currentIll.js
  84. 2 1
      src/store/types/mainSuit.js
  85. 2 1
      src/store/types/otherHistory.js
  86. 2 1
      src/store/types/print.js
  87. 1 1
      src/utils/ajax.js
  88. 18 6
      src/utils/tools.js

+ 15 - 11
src/common/components/EditableSpan/index.jsx

@@ -1,7 +1,7 @@
 import React,{Component} from 'react';
 import style from './index.less';
 import config from "@config/index";
-import {filterArr,handleEnter,isIE} from '@utils/tools.js';
+import {filterArr,isIE} from '@utils/tools.js';
 import Notify from '../Notify/index.js';
 
 import $ from 'jquery';
@@ -111,11 +111,13 @@ class EditableSpan extends Component{
   }
 
   handleKeydown(e){
-    let innerVal = e.target.innerText;
+    const ev = e||window.event;
+    const target = ev.target||ev.srcElement;
+    let innerVal = target.innerText;
     //禁止回车事件
-    if(e.keyCode==13){return false;}
+    if(ev.keyCode==13){return false;}
     //backspace事件
-    if(e.keyCode==8){
+    if(ev.keyCode==8){
       //用于对比backspace前后的值
       this.setState({
         preVal:innerVal
@@ -125,22 +127,24 @@ class EditableSpan extends Component{
   }
   handleKeyup(e){
      const {boxMark,handleKeydown,i,value} = this.props;
-     const {preVal,index} = this.state;console.log(22,i,index);
-    let innerVal = e.target.innerText;
-    if(e.keyCode==8){
-      if(innerVal !==preVal){return}
+     const {preVal,index} = this.state;
+    const ev = e||window.event;
+    const target = ev.target||ev.srcElement;
+    let innerVal = target.innerText;
+    if(ev.keyCode==8){
+      if(innerVal !==preVal){return false}
       let data = innerVal.trim();
       //判断是否为空、中英文:, 。、;,且不是第一位
       let pattern = new RegExp(/^\,?$|^\,?$|^\.?$|^\。?$|^\、?$|^\;?$|^\;?$|^\:?$|^\:?$\s/);
       // if(i!==0 &&data==""||data==","||data==","||data==":"||data==":"||data=="."||data=="。"||data=="、"||data==";"||data==";"){
       if(index!==0 && pattern.test(data)){
-        handleKeydown&&handleKeydown({boxMark,i:index});
+        handleKeydown&&handleKeydown({boxMark,i:index,text:data});
         this.setState({
-          index:index-1
+          // index:index-1 //连续往前删除,体验不佳
+          index: null
         })
       }
     }
-    
   }
   /*shouldComponentUpdate(next){
     if(JSON.stringify(next) == JSON.stringify(this.props)){

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

@@ -7,7 +7,7 @@
   /*height: 20px;*/
   line-height: 16px;
   /*vertical-align: middle;*/
-  text-align: center;
+  text-align: left;
 }
 .full{
   width: 100%;

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

@@ -2,7 +2,7 @@
 .wrapper {
     position: absolute;
     top: 40px;
-    z-index: 20;
+    z-index: 99;
     background-color: #fff;
     padding:28px 8px 8px 8px;
     min-width: 300px;

+ 19 - 2
src/common/components/ItemBox/index.jsx

@@ -1,5 +1,7 @@
 import React,{Component} from 'react';
 import style from './index.less';
+import {isIE} from '@utils/tools.js';
+import $ from 'jquery';
 /***
  * author:zn@2018-11-13
  * 电子病历项内容框
@@ -16,7 +18,9 @@ import style from './index.less';
 class ItemBox extends Component {
   constructor(props){
     super(props);
+    this.$div = React.createRef();
     this.handleClick = this.handleClick.bind(this);
+    this.handleInput = this.handleInput.bind(this);
   }
   getBoxStyle(){
     const {boxHeight,boxWidth,boxLineHeight,marginTop,backgroundColor} = this.props;
@@ -27,13 +31,26 @@ class ItemBox extends Component {
     const {handleClick} = this.props;
     handleClick && handleClick(e);//为了获取鼠标位置,显示搜索结果框;
   }
+  handleInput(e){
+    const {onchange,data} = this.props;
+    if(data&&data.length==0){//避免结构化下触发onchange,导致下拉要点两下
+      onchange&&onchange(e)
+    }
+  }
+
+  componentDidMount(){
+    if(isIE()){
+      $(this.$div.current).onIe8Input(function(e){
+        this.handleInput(e)
+      },this);
+    }
+  }
 
   render(){
     const {title,children,editable,className,handleFocus,onchange,fuzhen,border,handleBlur,titleTop,backgroundColor} = this.props;
-    // console.log(title,editable)
     return <div className={style["box"]+" "+"clearfix"} >
       <div className={style["title"] + ' ' + className} style={{marginTop:titleTop?'22px':''}}>{title}</div>
-      <div className={`${style["content"]} ${border?style["border"]:''} ${backgroundColor?style["noBorder"]:''}`} contentEditable={editable} style={this.getBoxStyle()} onFocus={handleFocus} onInput={onchange} 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}>
         {fuzhen?children||fuzhen:children}
       </div>
     </div>

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

@@ -49,7 +49,8 @@ class NumberPan extends Component{
   render(){
     const select = this.handleSelect.bind(this);
     const {show} = this.props;      //table onBlur阻止冒泡是为了修复multSpread中数字键盘点击触发最外层数字组件onBlur事件
-    return <table className={style['pan']} onBlur={(e)=>e.stopPropagation()} style={{display:show?'table':'none'}}>
+    return <div className={style['panBox']} onBlur={(e)=>e.stopPropagation()} style={{display:show?'table':'none'}}>
+    <table className={style['pan']} >
       <tr>
         <td><button onClick={select}>1</button></td>
         <td><button onClick={select}>2</button></td>
@@ -75,6 +76,7 @@ class NumberPan extends Component{
         <td><button onClick={this.handleClose.bind(this)}>确定</button></td>
       </tr>
     </table>
+    </div>
   }
 }
 

+ 4 - 1
src/common/components/NumberPan/index.less

@@ -1,7 +1,10 @@
 @import "~@less/variables.less";
+.panBox{
+  .pop;
+}
 .pan{
   width: 280px;
-  .pop;
+  
   td{
     width: 68px;
     height:44px;

+ 12 - 1
src/common/components/NumberUnitPan/index.jsx

@@ -55,10 +55,19 @@ class NumberUnitPan extends Component{
     });
     onSelect&&onSelect(text);
   }
+  componentWillReceiveProps(nextProps){
+    //重新选择的值替换 不追加
+     if(!nextProps.show){
+      this.setState({
+        value:''
+      });
+     }
+  }
   render(){
     // const select = this.handleSelect.bind(this);
     const {show} = this.props;      //table onBlur阻止冒泡是为了修复multSpread中数字键盘点击触发最外层数字组件onBlur事件
-    return <table className={style['pan']} onBlur={(e)=>e.stopPropagation()} style={{display:show?'table':'none'}}>
+    return <div className={style['panBox']} onBlur={(e)=>e.stopPropagation()} style={{display:show?'table':'none'}}>
+      <table className={style['pan']} >
       <tr>
         <td><span onClick={this.handleSelect}>1</span></td>
         <td><span onClick={this.handleSelect}>2</span></td>
@@ -87,6 +96,7 @@ class NumberUnitPan extends Component{
         <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>
       </tr>
       <tr>
         <td><span onClick={this.handleSelect}>{config.timeUnit.week}</span></td>
@@ -94,6 +104,7 @@ class NumberUnitPan extends Component{
         <td><span onClick={this.handleSelect}>{config.timeUnit.year}</span></td>
       </tr>
     </table>
+    </div>
   }
 }
 

+ 5 - 2
src/common/components/NumberUnitPan/index.less

@@ -1,7 +1,10 @@
 @import "~@less/variables.less";
+.panBox{
+  .pop;
+}
 .pan{
   width: 280px;
-  .pop;
+  
   td{
     width: 68px;
     height:44px;
@@ -15,7 +18,7 @@
     height: 100%;
     text-align: center;
     line-height: 44px;
-    color: #666;
+    color: #333;
     cursor: pointer;
   }
   span:hover{

+ 6 - 3
src/common/components/SearchOption/index.jsx

@@ -20,8 +20,8 @@ class SearchOption extends React.Component {
         this.handleClearVal = this.handleClearVal.bind(this);
     }
     
-    componentWillReceiveProps(nextProps){
-        if(nextProps.visible !== this.props.visible) {
+    /*componentWillReceiveProps(nextProps){
+        if(nextProps.visible != this.props.visible) {
             if(!nextProps.visible) {
                 this.props.handleChangeValue('');
                 this.textInput.current.value = '';
@@ -31,8 +31,11 @@ class SearchOption extends React.Component {
                 this.textInput.current.focus();
             }, 0);
         }
+    }*/
+    componentDidMount(){
+      this.props.handleChangeValue('');
+      this.textInput.current.focus();
     }
-    
     handleClearVal(){
         const { handleChangeValue } = this.props;
         this.textInput.current.value = '';

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

@@ -6,7 +6,7 @@
     box-sizing: border-box;
     position: absolute;
     top: 40px;
-    z-index: 20;
+    z-index: 99;
     background-color: #fff;
     box-shadow: 0 6px 20px 0 #989DA3;
     margin-bottom: 80px;

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

@@ -77,7 +77,7 @@ class Textarea extends Component {
   }
   componentWillReceiveProps(next){
     const isRead = this.props.isRead;
-    if(next.isRead != isRead){
+    if(next.isRead != isRead||next.value!=this.props.value){      //value对比解决复诊不显示bug
       this.$dom.current.innerText = next.value||'';
     }
   }

+ 7 - 2
src/common/js/func.js

@@ -79,11 +79,13 @@ function notTextLabel(label){
 * 入参:arr源数组,
 *       noPre是否不添加前置文本标签,默认false即添加
 *       noEnd是否不添加后置文本标签,默认false即添加
+*       ifEmpty是否添加空标签,默认true即添加,传false添加逗号,如查体
 * */
-export const fullfillText = (arr,noPre=false,noEnd=false)=>{
+export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
   let newArr =[],
       pre={},
       textLabel={},
+      _textLabel={},
       notText = true,
       saveText=[],
       tempText = '',
@@ -92,6 +94,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false)=>{
     notText = notTextLabel(it);
     value = it.value||'';
     textLabel = JSON.parse(config.textLabel);
+    _textLabel = JSON.parse(config._textLabel);
     if(i===0){
       //第一个标签不是文本标签时在前面添加文本标签
       if(!noPre&&notText){
@@ -106,7 +109,8 @@ export const fullfillText = (arr,noPre=false,noEnd=false)=>{
       pre = arr[i-1];
       //如果本身不是文本标签且前面一个也不是文本标签,该标签前面添加文本标签
       if(notTextLabel(pre)&&notText){
-          newArr.push(textLabel,it);
+          // newArr.push(textLabel,it);
+          ifEmpty?newArr.push(textLabel,it):newArr.push(_textLabel,it);
           tempText = value?it.labelPrefix+value+it.labelSuffix:'';
           saveText.push("",tempText); 
         //最后一个非文本标签,后面添加一个文本标签
@@ -130,6 +134,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false)=>{
   return {newArr,saveText};
 };
 
+
 //获取标签index,入参:病例项index+标签index+标签内index
 export const getLabelIndex = (index)=>{
   let ikey = '';

+ 2 - 1
src/common/js/util.js

@@ -32,4 +32,5 @@ export const setLastPosition=(dom)=>{
 //         range.collapse(false);//光标移至最后
 //         range.select();
 //     }
-// }
+// }
+

+ 10 - 7
src/common/less/variables.less

@@ -46,29 +46,32 @@
 @selected-bg:#fff;
 
 /*********推送内容容器宽度*************/
-@push-width: 460px;
+@push-width: 450px;
 /****电子病历容器宽度*****/
 @EMR-width: calc(~"100% - "@push-width);
 
 /*******下拉框公用样式**********/
 .pop{
   position: absolute;
-  top:40px;
+  // top:40px;
+  top:30px;
   background: #fff;
   box-shadow: 0 10px 20px 0 #989DA3;
+  filter:progid:DXImageTransform.Microsoft.Shadow(color='#989DA3',Direction=125,Strength=6);
+  border: 1px solid #f3f0f0;
   z-index: 203;
   padding: 20px;
   white-space: nowrap;
 }
 .mult-li{
   // width: 200px;
-  height: 44px;
-  line-height: 44px;
+  height: 32px;
+  line-height: 32px;
   padding-right: 8px;
 }
 .select-li{
-  height: 44px;
-  line-height: 44px;
+  height: 32px;
+  line-height: 32px;
   width: 100%;
   font-size: 14px;
   text-align: left;
@@ -79,7 +82,7 @@
   background: rgba(59,158,208,0.1);
   background-image: url(../images/first.png);
   background-repeat: no-repeat;
-  background-position: 20px 15px;
+  background-position: 20px 10px;
 }
 .clear{
   width: 88px;

+ 1 - 1
src/components/AddAssistCheck/Textarea/index.jsx

@@ -50,7 +50,7 @@ class Textarea extends Component {
       <div className={style.divTextarea}
           contenteditable={true}
           ref={this.$dom}
-          onInput={this.handleInput}
+          onChange={this.handleInput}
       ></div>
     );
   }

+ 7 - 0
src/components/AddAssistCheck/Textarea/index.less

@@ -10,4 +10,11 @@
   line-height: 20px;
   resize: none;
   font-family: inherit;
+}
+.divTextarea:empty:before{ 
+  content: '报告描述或意见'; 
+  color: gray; 
+} 
+.divTextarea:focus:before{
+  content:none;
 }

+ 3 - 2
src/components/AddAssistCheck/index.jsx

@@ -111,6 +111,7 @@ class AddAssistCheck extends React.Component {
                     return (<li key={item.id}> 
                         <span style={{float:"left"}}>{item.name}:</span>
                         <p style={{float:"none",overflow:"hidden",marginRight:"215px",paddingLeft:'8px'}}>
+                        {/* <p className={styles.textareaWrap}> */}
                             {/* <textarea
                                 className={styles.divTextarea}
                                 onChange={(e)=>{
@@ -153,9 +154,9 @@ class AddAssistCheck extends React.Component {
                 {this.getAssistLabel()}
                 <div id="searchWrapAssist" style={{position:"relative"}}>
                     <Add showText="添加辅检项" handleClick={(e) => this.handleSearchShow(e)} id="assistCheck"/>
-                    <SearchOption handleChangeValue={handleChangeValue} visible={this.state.show}>
+                  {this.state.show?<SearchOption handleChangeValue={handleChangeValue} visible={true}>
                         {this.getSearchList(list)}
-                    </SearchOption>
+                    </SearchOption>:''}
                 </div>
                 <ConfirmModal 
                     visible={visible}

+ 6 - 0
src/components/AddAssistCheck/index.less

@@ -114,6 +114,12 @@
             font-family: inherit;
         }
     }
+    .textareaWrap {
+      float: none;
+      overflow: hidden;
+      margin-right: 215px;
+      padding-left: 8px;
+    }
 }
 .center {
     text-align: center;

+ 8 - 7
src/components/AddInspect/index.jsx

@@ -110,12 +110,11 @@ class Inspect extends React.Component {
     handleFillShow(e,idx) {
         let tmpShow = this.state.showFill;
         let baseList = store.getState().inspect.fillActive;
-        const tmpTime = this.state.dateTime
         this.setState({
             showFill: !tmpShow, 
             currentIdx:idx,
             currentData:baseList,
-            dateTime:baseList.time?baseList.time:tmpTime
+            dateTime:baseList.time?baseList.time:this.getCurrentDate()
         })
         e.stopPropagation();
     }
@@ -131,7 +130,7 @@ class Inspect extends React.Component {
         let day = myDate.getDate();            //获取当前日(1-31)
         let date = year+'-'+(mon<10?'0'+mon:mon)+'-'+(day<10?'0'+day:day);
         this.setState({dateTime:date})
-        
+        return date;
     }
     changeActivePart(idx,val){
         let nums = this.state.num;
@@ -341,7 +340,7 @@ class Inspect extends React.Component {
                                                     handleClear={(e)=>{
                                                         handleClear(e,idx)
                                                         this.setState({
-                                                            showFill:false
+                                                          currentData:fillActive
                                                         })
                                                     }}
                                                     handleConfirm={(e)=>{
@@ -358,7 +357,9 @@ class Inspect extends React.Component {
                                                     <div className={styles.searchResultT}>
                                                         <img style={{"position":"absolute","top":"8px","right":"8px"}} src={date1} alt="" onClick={this.handleShowDate}/>
                                                         <p style={{position:"absolute",right:"38px",top:"4px",lineHeight:"28px"}}>
-                                                            {this.state.dateTime}
+                                                            {
+                                                              this.state.dateTime
+                                                            }
                                                         </p>
                                                         <div style={{display:this.state.date?"block":"none",position:"relative"}}>
                                                             {/* 日期组件 */}
@@ -379,9 +380,9 @@ class Inspect extends React.Component {
                 </div>
                 <div style={{position:"relative"}}>
                     <Add showText="添加化验项" handleClick={(e) => this.handleSearchShow(e)} id="searchWrap"/>
-                    <SearchOption handleChangeValue={handleChangeValue} visible={this.state.show}>
+                  {this.state.show?<SearchOption handleChangeValue={handleChangeValue} visible={true}>
                         {this.getSearchList(list)}
-                    </SearchOption>
+                    </SearchOption>:''}
                 </div>
                 <ConfirmModal 
                     visible={visible}

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

@@ -119,10 +119,11 @@
 }
 .itemPart {
     height: 28px;
-    line-height: 28px;
+    // line-height: 28px;
     overflow: hidden;
     padding-top: 0 !important;
-    width: 292px;
+    // width: 292px;
+    width: 290px;
     float: left;
     padding: 0 15px;
     box-sizing: border-box;

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

@@ -76,7 +76,7 @@ class CheckBody extends Component{
     return  <div className={style['container']}>
       <ItemBox title='查体' editable={!data.length}  handleClick={this.handleClick} onchange={this.handleInput}>
         {this.getLabels()}
-        <SearchDrop data={searchData} show={!totalHide} left={boxLeft} top={boxTop} onSelect={this.handleSearchSelect}></SearchDrop>
+        {searchData && searchData.length>0?<SearchDrop data={searchData} show={!totalHide} left={boxLeft} top={boxTop} onSelect={this.handleSearchSelect}></SearchDrop>:''}
       </ItemBox>
     </div>
   }

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

@@ -35,7 +35,6 @@ class CommonSymptom extends Component{
     return classNames(style['list'],name,isHide);
   }
 
-
   handleSelect(e,item){
     e.stopPropagation();
     const {onSelect,onShow} = this.props;
@@ -43,9 +42,10 @@ class CommonSymptom extends Component{
     // onShow&&onShow(e,false);
   }
   render(){  
+    const {data} = this.props;
     return <div className={this.getClass()} contenteditable="false">
       <ul>
-        {this.props.data&&this.props.data.map((it)=>{
+        {data&&data.map((it)=>{
           return <li onClick={(e)=>this.handleSelect(e,it)}>{it.name}</li>
         })}
       </ul>

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

@@ -30,7 +30,7 @@
     
     .disclaimer{
       font-size: 12px;
-      color: #000000;
+      color: #00e;
       float: right;
       cursor: pointer;
     }
@@ -153,7 +153,7 @@
     }
     .message{
       font-size: 12px;
-      line-height: 20 px;
+      line-height: 20px;
       div{
         font-size: 12px;
         line-height: 20px;

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

@@ -6,7 +6,7 @@
   padding: 0px 0 10px 0 ;
   box-sizing: border-box;
   position: relative;
-  min-width: 720px;
+  min-width: 700px;
 }
 .inner{
 //   overflow-y: auto;

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

@@ -49,11 +49,16 @@ class HistoryCaseContainer extends React.Component {
                                 items && items.length > 0? items.map((val,idx)=>{
                                     return <li key={val.id} className={val.id == activeHistory.id?styles.bgc:''} onClick={(e)=>{handleCaseClick(e,idx)}}>
                                         <span title={val.diagnose}>{val.diagnose}</span>
-                                        <span className={val.id == activeHistory.id?`${styles.time} ${styles.quoteHide}`:styles.time}>{val.inquiryDate}</span>
+                                        {/* <span className={val.id == activeHistory.id?`${styles.time} ${styles.quoteHide}`:styles.time}>{val.inquiryDate}</span>
                                         <button 
                                             className={val.id == activeHistory.id?`${styles.quote} ${styles.quoteShow}`:styles.quote} 
                                             onClick={(e)=>{handleQuoteClick(e,val)}}
+                                        >引 用</button> */}
+                                        <button 
+                                            className={styles.quote} 
+                                            onClick={(e)=>{handleQuoteClick(e,val,idx)}}
                                         >引 用</button>
+                                        <span className={styles.time}>{val.inquiryDate}</span>
                                     </li>
                                 }):<Empty message={'无历史病历'}></Empty>
                             }

+ 14 - 12
src/components/HistoryCaseContainer/HistoryList/index.less

@@ -6,7 +6,7 @@
     right: 0;
     bottom:0;
     margin: auto;
-    width: 1080px;
+    width: 1120px;
     top: 70px;
     bottom: 70px;
     background-color: #fff;
@@ -17,9 +17,9 @@
         right: 0;
     }
     .mainHistoryLeft {
-        width: 260px;
+        width: 300px;
         height: 100%;
-        background: #F1F1F1;
+        background: #d2d1d1;
         position: relative;
         .title {
             height: 80px;
@@ -29,7 +29,7 @@
             top: 0;
             left: 0;
             width: 100%;
-            background: #F1F1F1;
+            background: #d2d1d1;
         }
         .his {
             font-size: 18px;
@@ -50,7 +50,7 @@
             height: 100%;
             span {
                 display: inline-block;
-                max-width: 150px;
+                max-width: 130px;
                 overflow: hidden;
                 text-overflow: ellipsis;
                 white-space: nowrap;
@@ -58,7 +58,7 @@
             li {
                 height: 54px;
                 line-height: 54px;
-                padding: 0 20px;
+                padding: 0 10px;
                 font-size: 14px;
                 cursor: pointer;
                 border: 1px solid transparent;
@@ -73,17 +73,19 @@
                 background-color: #fff;
             }
             .quote {
-                width: 60px;
-                height: 30px;
-                line-height: 30px;
+                width: 50px;
+                height: 22px;
+                line-height: 22px;
                 border-radius: 15px;
                 border: 0 none;
                 color: #fff;
                 background-color: @template-color;
                 float: right;
-                margin-top: 12px;
-                display: none;
+                margin-top: 16px;
+                font-size: 12px;
+                // display: none;
                 outline: none;
+                margin-left: 10px;
             }
             .quoteShow {
                 display: block;
@@ -94,6 +96,6 @@
         }
     }
     .mainHistoryRight {
-        margin-left: 260px;
+        margin-left: 300px;
     }
 }

+ 20 - 5
src/components/Inspect/index.jsx

@@ -39,13 +39,23 @@ class Inspect extends React.Component {
             val: '',
             visible:false,
             dom:[],
-            isIE:isIE()
+            isIE:isIE(),
+            ieVersion:null,
+            height:'-1'
         }
         this.handleImportExcel = this.handleImportExcel.bind(this)
         this.cancel = this.cancel.bind(this)
         this.getWarings = this.getWarings.bind(this)
     }
     componentDidMount(){
+        var ua = navigator.userAgent;
+        var _isIE = ua.indexOf("MSIE")>-1;
+        if(_isIE){
+            let version =  ua.match(/MSIE ([\d.]+)/)[1];
+            this.setState({
+                ieVersion:version
+            })
+        }
         $('iframe').bind( 'load', function(){} )
       const {fetchPushInfos} = this.props;
         // FileAPI.debug = true
@@ -90,7 +100,8 @@ class Inspect extends React.Component {
                                 if (message.length != 0) {
                                     that.setState({
                                         visible:true,
-                                        dom:message
+                                        dom:message,
+                                        height:message.length
                                     })
                                 }
                                 $("#choose").val("");
@@ -110,7 +121,8 @@ class Inspect extends React.Component {
         this.setState({visible:false})
     }
   getStyle(){
-        if(this.state.isIE){
+    const {ieVersion} = this.state;
+        if(ieVersion&&ieVersion<=9){
             return styles.disabledBtn;
         }else{
             return styles.button;
@@ -129,14 +141,16 @@ class Inspect extends React.Component {
     }
     render() {
         const {fetchPushInfos, handleCloseExcel, handleChangeValue, labelListActive, list, handleSign, labelList, handleLabelSub, handleClear, handleConfirm, fillActive, changeActivePart, getExcelDataList,delPartItem } = this.props;
+        const {ieVersion,isIE} = this.state;
         return (
             <div className={styles.wrapper} >
                 {/* 导入功能插件,ie8/9权限问题暂未解决,先隐藏 */}
 
                 <div className={styles.top}>
                     <span>化验结果数据</span>
-                    <div className={this.getStyle()} onClick={this.state.isIE?null:this.handleImportExcel}>
-                        <button disabled={this.state.isIE?true:false}>导入化验结果</button>
+                    <div className={this.getStyle()} onClick={ieVersion&&ieVersion<=9?null:this.handleImportExcel}>
+                       {/* <button disabled={ieVersion&&ieVersion>9?true:false}>导入化验结果</button>*/}
+                        <button>导入化验结果</button>
                         <input type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} />
                     </div>
                 </div>
@@ -171,6 +185,7 @@ class Inspect extends React.Component {
                     okText='删除' 
                     cancelText='确定' 
                     width="450"
+                    height={(this.state.height > 2 && this.state.height < 8)?((this.state.height * 30 + 120)+'px') : this.state.height > 8 ? '350px' : '200px'}
                     noFooter= {true}
                     close={this.cancel}>
                     <ul className={styles.excelList}>

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

@@ -65,5 +65,6 @@
     text-align: center;
     color: #fff;
     margin-bottom: 20px;
+    cursor: pointer;
 }
 

+ 46 - 28
src/components/MainSuit/index.jsx

@@ -6,6 +6,7 @@ import SearchDrop from '@components/SearchDrop';
 import CommonSymptom from '@components/CommonSymptom';
 import chooseType from '@containers/eleType.js';
 import config from "@config/index";
+import {isIE} from "@utils/tools.js"
 
 class MainSuit extends Component{
   constructor(props){
@@ -58,29 +59,38 @@ class MainSuit extends Component{
 
   handleFocus(e){
     e.stopPropagation();
-    const {getCommonSymptoms} = this.props;
+    const {getCommonSymptoms,datas} = this.props;
     let innerText = e.target.innerText;
-    if(!innerText.trim()){//有内容就走搜索接口
-      getCommonSymptoms && getCommonSymptoms();
-      this.setState({
-        symptom:true
-      })    
+    if(!isIE()){//IE会触发onfocus和onblur事件
+      if(!innerText.trim()){//有内容就走搜索接口
+        getCommonSymptoms && getCommonSymptoms();
+        this.setState({
+          symptom:true
+        })    
+      }else{
+        this.setState({
+          symptom:false,
+          inpText:innerText
+        }) 
+      }
     }else{
-      this.setState({
-        symptom:false,
-        inpText:innerText
-      }) 
+      if(datas.length==0 && !innerText.trim()){
+        getCommonSymptoms && getCommonSymptoms();
+        this.setState({
+          symptom:true
+        })  
+      }
     }
-
+    
   }
 
 
-  handleShow(e,show){
+  /*handleShow(e,show){
     e.stopPropagation();
     if(e.target.tagName=="INPUT"){
       return ;
     }
-  }
+  }*/
 
   handleSelect(item){//选中的常见症状
     const {clearCommS,insertMain,getData} = this.props;
@@ -186,18 +196,25 @@ class MainSuit extends Component{
     const {freeText,saveText,datas} = this.props;
     const that = this;
     let data = this.state.inpText;
-    e.target.innerText="";
-    freeText && freeText(data.trim());
-    // 延时关闭常见症状下拉,不延时会影响选中
-    clearTimeout(this.state.clearTimer);
-    const clearTimer = setTimeout(function(){
-      that.setState({
-        symptom:false
-      })
-    },config.delayTime-200);
-    this.setState({
-      clearTimer
-    });
+    if(!isIE()){
+      e.target.innerText="";
+      freeText && freeText(data.trim());
+      // 延时关闭常见症状下拉,不延时会影响选中
+      clearTimeout(this.state.clearTimer);
+      const clearTimer = setTimeout(function(){
+        that.setState({
+          symptom:false
+        })
+      },config.delayTime-200);
+      this.setState({
+        clearTimer
+      });
+    }else{
+      if(datas.length==0){
+        freeText && freeText(data.trim());
+      }
+    }
+    
   }
 
 
@@ -206,7 +223,7 @@ class MainSuit extends Component{
     const {showModule,boxLeft,boxTop,show,symptom,search} = this.state;
     const symptomFlag = CommonSymptoms.length>0 ? true : false;
     const searchFlag = searchData.length>0 ? true : false;
-
+    
     if(+type===1){      //文本模式
       return <Textarea title='主诉' boxMark='1' isRead={isRead} value={saveText[0]} handlePush={fetchPushInfos} handleInput={handleInput} />;
     }
@@ -219,11 +236,12 @@ class MainSuit extends Component{
       handleFocus={this.handleFocus} 
       onchange={(e)=>{this.handleChange(e)}} 
       handleClick={this.handleClick} 
-      handleBlur={this.handleBlur}>
+      handleBlur={this.handleBlur}
+      data={datas}>
         {datas.length>0?<div style={{display:'inline-block'}}>{this.getInlineTag()}</div>:(saveText[0]?saveText[0]:'')}
       </ItemBox>
       {/*没有推送结果就不显示*/}
-      {symptomFlag && !searchFlag ? <CommonSymptom data={CommonSymptoms} show={!totalHide&&symptom} onShow={(e)=>this.handleShow(e)} onSelect={this.handleSelect} /> : ( searchFlag ? <SearchDrop data={searchData} show={!commSymHide} onShow={(e)=>this.handleShow(e)} onSelect={this.handleSearchSelect} left={boxLeft} top={boxTop} />:"")}
+      {symptomFlag && !searchFlag ? <CommonSymptom data={CommonSymptoms} show={!totalHide&&symptom} onSelect={this.handleSelect} /> : ( searchFlag ? <SearchDrop data={searchData} show={!commSymHide} onSelect={this.handleSearchSelect} left={boxLeft} top={boxTop} />:"")}
     </div>
   }
 }

+ 4 - 3
src/components/MultSpread/index.jsx

@@ -127,15 +127,16 @@ class MultSpread extends Component{
     return (<div style={{display:'inline-block'}}
                  onDoubleClick={this.changeToEdit}
                  contentEditable={this.state.editable}
-                 onBlur={this.handleEdit}>
+                 onBlur={this.handleEdit}
+                 onkeydown={tools.handleEnter}>
       {textPrefix?<span>{textPrefix}</span>:''}
       <div className={this.getClass()}>
-      {this.getLabels()} 
+      {this.getLabels()}
+      {textSuffix?<span>{textSuffix}</span>:''}
       {showAdd?<img src={addIcon} alt="添加血压项"
                     className={style['add-icon']}
                     onClick={()=>addLabelItem({ikey,copyId})}/>:''}
     </div>
-    {textSuffix?<span>{textSuffix}</span>:''}
     </div>)
   }
 }

+ 5 - 4
src/components/NumberDrop/index.jsx

@@ -38,7 +38,7 @@ class NumberDrop extends Component{
     });
     handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
   }
-  handleNumFocus(e){        //数字框可编辑状态下聚集事件,处理是否显示下拉等
+  handleNumFocus(e){       //数字框可编辑状态下聚集事件,处理是否显示下拉等
     e.stopPropagation();
     const {show,handleShow,ikey,id,patId,handleHide,value} = this.props;
     const that = this;
@@ -83,9 +83,10 @@ class NumberDrop extends Component{
     });
     const {handleSelect,ikey,suffix,prefix,mainSaveText,placeholder} = this.props;
     const text = e.target.innerText===placeholder?'':e.target.innerText;
+    e.target.innerText = '';      //避免出现重复输入值
     handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
   }
-  handleSpanInp(e){      //数字框输入事件
+  handleSpanInp(e){    //数字框输入事件
     e.stopPropagation();
     //const {value} = this.props;
   }
@@ -130,7 +131,7 @@ class NumberDrop extends Component{
                 onDoubleClick={this.changeToEdit}
                 onBlur={this.handleBlur} contentEditable={editable}
                 onkeydown={handleEnter}>
-      <span>{prefix}</span>
+      <span>&nbsp;{prefix}</span>
       <span onFocus={this.handleNumFocus}
             onClick={this.handleNumClick}
             contentEditable={numEditable}
@@ -140,7 +141,7 @@ class NumberDrop extends Component{
             onInput={this.handleSpanInp}
             className={this.getSpanClass()}
             onkeydown={handleEnter}>{value||placeholder}</span>
-      <span>{suffix}</span>
+      <span>&nbsp;{suffix}</span>
       <NumberPan handleSelect={(text)=>this.select(text)}
                  onClose={handleHide}
                  show={show} toClear={!hasSelect}/>

+ 35 - 19
src/components/NumberUnitDrop/index.jsx

@@ -3,8 +3,9 @@ import className from 'classnames';
 import {NumberUnitPan} from '@commonComp';
 import style from './index.less';
 import config from '@config/index.js';
-import {filterArr,handleEnter} from '@utils/tools.js';
+import {filterArr,handleEnter,isIE} from '@utils/tools.js';
 import {Notify} from '@commonComp';
+import $ from 'jquery';
 /***
  * 带单位数字组件
  * 接收参数:
@@ -69,37 +70,45 @@ class NumberUnitDrop extends Component{
   //数字框失焦,保存值到store中
   numInpBlur(e){
     e.stopPropagation();
+    const {handleSelect,ikey,suffix,prefix,mainSaveText,handleLabelChange,boxMark} = this.props;
+    const {editable} = this.state;
+    if(editable){
+      const text = e.target.innerText;
+      // this.$span.current.innerText='';      //修改生成文字变成输入的2倍bug 
+      // handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
+      handleLabelChange&&handleLabelChange({ikey,changeVal:text,suffix,prefix,mainSaveText,type:boxMark});
+      
+    }
     this.setState({
       isClosed:false,
       numEditable:true,
       hasSelect:false,
       editable:false
     });
-    const text = e.target.innerText;
-    this.$span.current.innerText='';      //修改生成文字变成输入的2倍bug
-    const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
-    handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
+    
   }
 
   handleSpanInp(e){ //数字框输入事件
     e.stopPropagation();
     // 主诉字数达到上限时不允许输入
     const {mainSaveText,ikey,type,handleSelect,suffix,prefix,boxMark} = this.props;
-    const {labelVal} = this.state;
+    const {labelVal,editable} = this.state;
     let mainText = filterArr(mainSaveText);//主诉字数
-    let val = e.target.innerText;
-    if(+boxMark==1){
-      if(mainText.length >= config.limited){
-        if(val.length > labelVal.length){
-          e.target.innerText = labelVal;
-          Notify.info(config.limitText);
-          return
-        }else if(val.length == labelVal.length){
-          this.setState({
-            labelVal:val
-          });
-        }else{
-          handleSelect&&handleSelect({ikey,text:val,suffix,prefix,mainSaveText});
+    if(editable){//避免IE中点击标签也会触发
+      let val = e.target.innerText;
+      if(+boxMark==1){
+        if(mainText.length >= config.limited){
+          if(val.length > labelVal.length){
+            e.target.innerText = labelVal;
+            Notify.info(config.limitText);
+            return
+          }else if(val.length == labelVal.length){
+            this.setState({
+              labelVal:val
+            });
+          }else{
+            handleSelect&&handleSelect({ikey,text:val,suffix,prefix,mainSaveText});
+          }
         }
       }
     }
@@ -126,6 +135,13 @@ class NumberUnitDrop extends Component{
       handleDbclick && handleDbclick({id:patId||id});
     }
   }
+  componentDidMount(){
+    if(isIE()){
+      $(this.$span.current).onIe8Input(function(e){
+        this.handleSpanInp(e)
+      },this);
+    }
+  }
 
   render(){
     const {placeholder,prefix,suffix,show,value,handleHide} = this.props;

+ 52 - 30
src/components/Operation/index.jsx

@@ -6,7 +6,6 @@ import saveHistory from '@common/images/saveHistory.png';
 import PrintPreviewContainer from '@containers/PrintPreviewContainer';
 import PreviewContainer from '@containers/PreviewContainer';
 import { ConfirmModal, Notify } from '@commonComp';
-import { changeVisible } from '@store/actions/tabTemplate';
 import {getAllDataList,getAllDataStringList} from '@utils/tools';
 import store from '@store';
 
@@ -16,7 +15,6 @@ class Operation extends Component {
     super(props)
     this.state = {
       title: '',
-      visible: false,
       okText: '',
       borderColor: '',
       okColor: '',
@@ -69,13 +67,14 @@ class Operation extends Component {
     if(flg){
       this.setState({
         type: type,
-        visible: true,
         okText: '保存',
         borderColor: '#3B9ED0',
         okColor: '#fff',
         oKBg: '#3B9ED0',
         msg: <p className={style['msg']}>是否保存该病历?</p>
       })
+      
+      this.props.diagShowTmp(true)
     }
   }
   keepHistory(){
@@ -99,13 +98,14 @@ class Operation extends Component {
     if(flg){
       this.setState({
         type: type,
-        visible: true,
         okText: '清除',
         borderColor: 'red',
         okColor: 'red',
         oKBg: '#fff',
         msg: <p className={style['msg']}>是否清空所有内容?</p>
       })
+      
+      this.props.diagShowTmp(true)
     }
   }
   isClear(){
@@ -143,17 +143,18 @@ class Operation extends Component {
       title: val
     })
   }
-  keypress(e) {
+  keypress(event) {
+    let e = event?event:window.event;
     if (e.keyCode == 13) {
-      this.makeSure()
-      store.dispatch(changeVisible(false))
+      // this.makeSure()
+      // store.dispatch(changeVisible(false))
     }
   }
   saveHis(type) {
-    let flg = this.getAllData()
+    const { diagShowTmp } = this.props;
+    let flg = this.getAllData();
     if(flg){
       this.setState({
-        visible: true,
         title: '',
         type: type,
         okText: '保存',
@@ -162,6 +163,7 @@ class Operation extends Component {
         oKBg: '#3B9ED0',
         msg: this.changeTitle()
       })
+      diagShowTmp(true)
     }
   }
   getAllData(){
@@ -169,16 +171,18 @@ class Operation extends Component {
     let jsonData = getAllDataList(baseList);
     let jsonStr = getAllDataStringList(baseList);
     let whichSign = baseList.typeConfig.typeConfig;
-    let activeItemData = baseList.tabTemplate.activeItem;
-    // let preview = (activeItemData.preview).split('-').join('');
-
+    let tmpLis = baseList.tabTemplate.items;
     if (whichSign == 0) {
-      if (activeItemData && JSON.stringify(activeItemData) != '{}' && (activeItemData.dataJson == JSON.stringify(jsonData)) && (JSON.stringify(jsonStr) == JSON.stringify(JSON.parse(activeItemData.preview)))) {
-        Notify.info('该模板已保存');
-        return false;
-      }else if (
+      for(let i = 0;i <tmpLis.length;i++){
+        let dataStr = tmpLis[i].dataJson;
+        if(dataStr == JSON.stringify(jsonData)){
+          Notify.info('该模板已保存');
+          return false;
+        }
+      }
+      if (
         JSON.stringify(jsonData.advice) == '{}' &&
-        jsonData.chief.length < 1 &&
+        (jsonData.chief.length < 1 && jsonStr.chief == '[]') &&
         jsonData.diag.length < 1 &&
         jsonData.vital.length < 1 &&
         jsonData.other.length < 1 &&
@@ -193,10 +197,16 @@ class Operation extends Component {
         return true;
       }
     } else if(whichSign == 1) {
-      if (activeItemData && JSON.stringify(activeItemData) != '{}' && (JSON.stringify(jsonStr) == JSON.stringify(JSON.parse(activeItemData.preview)))) {
-        Notify.info('该模板已保存');
-        return false;
-      }else if (JSON.stringify(jsonData.advice) == '{}' && 
+      for(let i = 0;i <tmpLis.length;i++){
+        let dataStr = tmpLis[i].preview;
+        let jsStr = tmpLis[i].dataJson;
+        console.log(dataStr == JSON.stringify(jsonStr))
+        if(JSON.stringify(JSON.parse(dataStr)) == JSON.stringify(jsonStr) && jsStr == JSON.stringify(jsonData)){
+          Notify.info('该模板已保存');
+          return false;
+        }
+      }
+      if (JSON.stringify(jsonData.advice) == '{}' && 
           jsonStr.chief == '[]' && 
           jsonStr.present == '[]' && 
           jsonStr.other == '[]' && 
@@ -236,28 +246,40 @@ class Operation extends Component {
     </div>
   }
   makeSure() {
-    const { save, clear, saveDataAll } = this.props;
+    const { save, clear, saveDataAll,diagShowTmp } = this.props;
     const { type } = this.state;
     if (type == 1) {
-      this.setState({ visible: false, title: '' })
+      diagShowTmp(false)
+      this.setState({ title: '' })
       save();
     } else if (type == 2) {
-      this.setState({ visible: false, title: '' })
+      diagShowTmp(false)
+      this.setState({ title: '' })
       clear();
     } else if (type == 3) {
       if (this.state.title.trim() == '') {
         Notify.error('请输入模板名称')
         return;
       }
+      // diagShowTmp(false)
       saveDataAll(this.state.title);
-      this.setState({ visible: false, title: '' });
+    }
+  }
+  closeDiagBox(){
+    const { diagShowTmp } = this.props;
+    const { type } = this.state;
+    if (type == 3){
+      diagShowTmp(false)
+      this.setState({ title: '' })
+    }else{
+      diagShowTmp(false)
+      this.setState({ title: '' }) 
     }
   }
   render() {
     const { showPrint, closePrint, showPreview, closePreview } = this;
-    const { visible, preVisible } = this.props.print;
+    const { visible, preVisible,diagShow } = this.props.print;
     const {zIndex} = this.state;
-
     return <div className={style['container']} style={{zIndex:zIndex}}>
       <button className={style['button']} onClick={showPrint}><img src={printImg} /> 打印病历</button>
       <button className={style['preButton']} onClick={showPreview}><img src={preview} /> 预览</button>
@@ -267,10 +289,10 @@ class Operation extends Component {
       <PrintPreviewContainer visible={visible} onClose={closePrint} />
       <PreviewContainer visible={preVisible} onClose={closePreview} />
       <ConfirmModal
-        visible={this.state.visible}
+        visible={diagShow}        //改为全局控制
         confirm={() => { this.makeSure() }}
-        close={() => { this.setState({ visible: false, title: '' }) }}
-        cancel={() => { this.setState({ visible: false, title: '' }) }}
+        close={() => { this.closeDiagBox()}}
+        cancel={() => {this.closeDiagBox()}}
         okText={this.state.okText}
         okBorderColor={this.state.borderColor}
         okColor={this.state.okColor}

+ 2 - 1
src/components/Operation/index.less

@@ -5,7 +5,8 @@
     position: fixed;
     bottom: 0;
     left: 10px;
-    right: 480px;
+    right: 470px;
+    min-width: 720px;
     background-color: #fff;
     // z-index: 240;
     padding-bottom: 10px;

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

@@ -104,7 +104,7 @@ class OtherHistory extends Component{
     return  <div>
       <ItemBox title='其他史' editable={hasData?false:true} isRead={isRead} handleClick={this.handleClick} handleFocus={this.getData} onchange={this.handleInput}>
         {this.getLabels()}
-        <SearchDrop data={searchData} show={!totalHide} left={boxLeft} top={boxTop} onSelect={this.handleSearchSelect}></SearchDrop>
+        {searchData && searchData.length>0?<SearchDrop data={searchData} show={!totalHide} left={boxLeft} top={boxTop} onSelect={this.handleSearchSelect}></SearchDrop>:''}
       </ItemBox>
     </div>
   }

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

@@ -2,75 +2,22 @@ import React, { Component } from "react";
 import style from "./index.less";
 import $ from "jquery";
 import {filterDataArr} from '@utils/tools'
-(function ($) {
-    var opt;
-
-    $.fn.jqprint = function (options) {
-        opt = $.extend({}, $.fn.jqprint.defaults, options);
-
-        var $element = (this instanceof $) ? this : $(this);
-
-        if (opt.operaSupport && $.browser.opera) {
-            var tab = window.open("", "jqPrint-preview");
-            tab.document.open();
-
-            var doc = tab.document;
-        }
-        else {
-            var $iframe = $("<iframe  />");
-
-            if (!opt.debug) { $iframe.css({ position: "absolute", width: "200px", height: "0px", left: "-300px", top: "-300px" }); }
-
-            $iframe.appendTo("body");
-            var doc = $iframe[0].contentWindow.document;
-        }
-
-        if (opt.importCSS) {
-            if ($("link[media=print]").length > 0) {
-                $("link[media=print]").each(function () {
-                    doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' media='print' />");
-                });
-            }
-            else {
-                $("link").each(function () {
-                    doc.write("<link type='text/css' rel='stylesheet' href='" + $(this).attr("href") + "' />");
-                });
-            }
-        }
-
-        if (opt.printContainer) { doc.write($element.outer()); }
-        else { $element.each(function () { doc.write($(this).html()); }); }
-
-        doc.close();
-
-        (opt.operaSupport && $.browser.opera ? tab : $iframe[0].contentWindow).focus();
-        setTimeout(function () { (opt.operaSupport && $.browser.opera ? tab : $iframe[0].contentWindow).print(); if (tab) { tab.close(); } }, 1000);
-    }
-
-    $.fn.jqprint.defaults = {
-        debug: false,
-        importCSS: true,
-        printContainer: true,
-        operaSupport: true
-    };
-
-    $.fn.outer = function () {
-        return $($('<div></div>').html(this.clone())).html();
-    }
-})($);
 class PreviewBody extends Component {
     constructor(props) {
         super(props)
         this.state={
             dateTime:"",
         }
-        this.onPrint = this.onPrint.bind(this);
+        this.$content = React.createRef();
         this.normalVal = this.normalVal.bind(this);
         this.getCurrentDate = this.getCurrentDate.bind(this);
     }
     componentDidMount(){
         this.getCurrentDate();
     }
+    componentWillReceiveProps(){
+        $(this.$content.current)[0].scrollIntoView(true);
+    }
     getCurrentDate(){
         let myDate = new Date();
         let year = myDate.getFullYear();       //获取完整的年份(4位,1970-????)
@@ -79,15 +26,6 @@ class PreviewBody extends Component {
         let date = year+'-'+(mon<10?'0'+mon:mon)+'-'+(day<10?'0'+day:day);
         this.setState({dateTime:date})
     }
-    onPrint() {
-        $("#content").jqprint({
-            debug: false,
-            importCSS: true,
-            printContainer: true,
-            operaSupport: false
-        });
-        this.props.onClose()
-    }
     normalVal(min,max){
         if((min-0) && (max-0)){
             return `正常值: (${min}~${max})`
@@ -116,8 +54,9 @@ class PreviewBody extends Component {
     }
     render() {
         const { show, preInfo, dataJson, dataStr,baseObj } = this.props;
+
         return <div className={style['content']}>
-            <div style={{ clear: 'both', fontSize: '24px', margin: '0px 0px 30px 0px',textAlign:'center' }}>{preInfo.hospitalName}</div>
+            <div ref={this.$content} style={{ clear: 'both', fontSize: '24px', margin: '0px 0px 30px 0px',textAlign:'center' }}>{preInfo.hospitalName}</div>
             <table className={style['patInfo']} style={{ margin: '0px 15px 30px 0px', borderCollapse: 'collapse', width: "100%",fontSize:'12px' }}>
                 <tr>
                     <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>卡号:{baseObj?baseObj.patientIdNo:JSON.stringify(preInfo) == '{}'?'':preInfo.patientIdNo}</td>
@@ -177,12 +116,12 @@ class PreviewBody extends Component {
                                             {
                                                 item.lisExcelItem && item.lisExcelItem.map((value)=>{
                                                     return <tr style={{lineHeight:'1.5',width:'650px'}}>
-                                                        <td style={{width:'23%',fontSize:'12px'}}>{value.itemName}</td>
+                                                        <td style={{width:'25%',fontSize:'12px'}}>{value.itemName}</td>
                                                         <td style={{width:'23%',fontSize:'12px'}}><span className={value.type == 1?'red':null} style={{fontSize:'12px'}}>{value.value}</span> {value.unit}</td>
                                                         <td style={{width:'24%',fontSize:'12px'}}>
                                                             {this.normalVal(value.min,value.max)}
                                                         </td>
-                                                        <td style={{width:'30%',fontSize:'12px'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+value.time}</td>
+                                                        <td style={{width:'28%',fontSize:'12px'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+value.time}</td>
                                                     </tr>
                                                 })
                                             }
@@ -199,14 +138,14 @@ class PreviewBody extends Component {
                                                 item.details.map((val)=>{
                                                     if(val.value && val.value != ''){
                                                         return <tr style={{lineHeight:'1.5',width:'100%',fontSize:'12px'}}>
-                                                            <td style={{width:'23%'}}>{val.name}</td>
+                                                            <td style={{width:'25%'}}>{val.name}</td>
                                                             {/* <td style={{width:'23%'}} className={item.abnormal != '0' ?"red":'' }>{val.value} { val.labelSuffix}</td> */}
                                                             {this.showDetails(val)}
                                                             
                                                             <td style={{width:'24%'}}>
                                                                 {this.normalVal(val.minValue,val.maxValue)}
                                                             </td>
-                                                            <td style={{width:'30%'}}>{'化验时间:'+item.time}</td>
+                                                            <td style={{width:'28%'}}>{'化验时间:'+item.time}</td>
                                                         </tr>
                                                     }
                                                 })
@@ -262,10 +201,11 @@ class PreviewBody extends Component {
                     </td>
                 </tr>
             </table>
-            <table className={style.partTtable} style={{ marginTop: '10px',display: show ? 'block' : 'none' }}>
-                <tr className={style.verticalT}>
-                    <td style={{ width: 70, textAlign: 'right',verticalAlign:'top', padding: '0px 5px 16px 0px', fontSize: '14px' }}>签名:</td>
-                    <td style={{ width: '220px',
+            <table className={style.partTtable} style={{ marginTop: '10px',marginBottom:'30px',display: show ? 'block' : 'none' }}>
+                <tr className={`${style.verticalT} ${style.siginNature}`}>
+                    <td style={{ width: 80, textAlign: 'right',verticalAlign:'top', padding: '0px 5px 0 0px', fontSize: '14px' }}>医生签名:</td>
+                    {/* <td style={{ 
+                        width: '220px',
                         height: '60px',
                         textAlign: 'center',
                         lineHeight: '60px',
@@ -273,7 +213,13 @@ class PreviewBody extends Component {
                         color: '#cbc7c7',
                         border: '1px solid #cbc7c7',
                         paddingBottom: '0'
-                    }}>此处签名</td>
+                    }}>此处签名</td> */}
+                    <td style={{
+                      minWidth:'50px',
+                      padding:'0 5px 2px 5px',
+                      borderBottom:'1px solid #333',
+                    }}
+                    >{baseObj?baseObj.doctorName:(JSON.stringify(preInfo) == '{}'?'':preInfo.doctorName)}</td>
                 </tr>
             </table>
         </div>

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

@@ -4,7 +4,7 @@
       overflow: auto;
       top:120px;
       width: 820px;
-      padding: 0 40px 20px 40px;
+      padding: 0 40px 60px 40px;
     }
 
     .foot{
@@ -78,6 +78,10 @@
       .verticalT {
           vertical-align: top;
       }
+      .siginNature {
+        vertical-align: bottom;
+        float: right;
+      }
       .partTtableList {
           width: 70px;
           text-align: right;

+ 8 - 7
src/components/PushContainer/index.jsx

@@ -27,11 +27,11 @@ class PushContainer extends Component {
             }],
             visible:false,
             message:'',                 //提示的内容
-            type:'',                   //1:删除模板 2:批量删除   3.修改标题   4.引用  
+            type:'',                    //1:删除模板 2:批量删除   3.修改标题   4.引用  
             id:'',                      //单个删除
-            obj:{},                       //修改模板标题      
+            obj:{},                     //修改模板标题      
             title:'',                   //修改后的标题
-            okText:'确定',                  //确认按钮
+            okText:'确定',              //确认按钮
             okBorderColor:'red',
             oKBg:'',
             okColor:'red',
@@ -110,10 +110,11 @@ class PushContainer extends Component {
             })
         })
     }
-    keypress(e){
+    keypress(event){
+        let e = event?event:window.event;
         if(e.keyCode == 13) {
-            this.makeSure()
-            store.dispatch(changeVisible(false))
+            // this.makeSure()
+            // store.dispatch(changeVisible(false))
         }
     }
     changeTitle(){
@@ -192,7 +193,7 @@ class PushContainer extends Component {
         }else if(this.state.type == 3){
             if(this.state.title == this.state.obj.text){
                 store.dispatch(changeVisible(false))
-                Notify.info('该模板名已存在');
+                Notify.success('标题修改成功');
                 return;
             }
             let tempObj = {

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

@@ -1,12 +1,12 @@
 @import "~@less/variables.less";
 .push-content-wrapper{
   // padding-top: 50px;
-  padding: 0px 20px;
+  padding: 0px 15px;
   line-height: 20px; 
-  width: 460px;
+  width: @push-width;
   overflow: hidden;
   .push-content {
-    width: 480px;
+    width: 467px;
     overflow-y: scroll;
   }
   .vigilant{

+ 8 - 2
src/components/RadioDrop/index.jsx

@@ -88,10 +88,16 @@ class RadioDrop extends Component{
   handleEditLabel(e){
     e.stopPropagation();
     const {ikey,boxMark,handleLabelEdit} = this.props;
+    /*const {editable} = this.state;
+    if(editable){
+      // 更改标签的value值
+      let changeVal = e.target.innerText;
+      handleLabelEdit && handleLabelEdit({ikey,changeVal,type:boxMark});
+    }*/
     this.setState({
       editable:false
-    });
-    // 更改标签的value值
+    });  
+   // 更改标签的value值
     let changeVal = e.target.innerText;
     handleLabelEdit && handleLabelEdit({ikey,changeVal,type:boxMark});
   }

+ 57 - 26
src/components/SpreadDrop/index.jsx

@@ -2,9 +2,10 @@ import React,{Component} from 'react';
 import classNames from 'classnames';
 import config from '@config/index.js';
 import style from './index.less';
-import {deepClone,filterArr,handleEnter} from '@utils/tools.js';
+import {deepClone,filterArr,handleEnter,isIE} from '@utils/tools.js';
 import {Notify} from '@commonComp';
 import {getIds} from '@common/js/func.js';
+import $ from 'jquery';
 /****
  * 标签组合下拉,选中的项目展开
  * author:zn@2018-11-21
@@ -34,7 +35,10 @@ class SpreadDrop extends Component{
       ban:{},  //放'伴'字段
       editable:false,      //双击编辑
       labelVal:'',  //存放标签原有的值--主诉字数限制用
+      boxLeft:null,
+      boxTop:null
     };
+    this.$div = React.createRef();
     this.handleSelect = this.handleSelect.bind(this);
     this.clearState = this.clearState.bind(this);
     this.handleClear = this.handleClear.bind(this);
@@ -49,8 +53,15 @@ class SpreadDrop extends Component{
   }
   handleShow(e){//单击
     e&&e.stopPropagation();
+    let boxLeft = e.pageX -175 + 'px';
+    let offsetTop = e.target.offsetTop;
+    let boxTop = offsetTop + 29 + 'px';
+    this.setState({
+      boxLeft:boxLeft,
+      boxTop:boxTop
+    })
     // window.event? window.event.cancelBubble = true : e.stopPropagation();
-    this.setStateInit();      //恢复初始选中状态
+     this.setStateInit();      //恢复初始选中状态
     const {ikey,handleShow,placeholder,flag,id,value,tagType,type} = this.props;
     const that = this;
     this.btnClickFlag = false;
@@ -66,8 +77,9 @@ class SpreadDrop extends Component{
   }
 
   changeToEdit(e){//双击
-    const {value,id,placeholder,handleDbclick} = this.props;
+    const {value,id,placeholder,handleDbclick,handleHide} = this.props;
     let text = e.target.innerText;
+    handleHide&&handleHide();       //展开情况下双击收起
     // clearTimeout(this.state.timer);//取消延时的单击事件
     e.stopPropagation();
     // e.preventDefault();
@@ -81,23 +93,25 @@ class SpreadDrop extends Component{
     }
   }
 
-  onChange(e){  
+  onChange(e){
     const {mainSaveText,ikey,type,handleLabelChange} = this.props;
-    const {labelVal} = this.state;
+    const {labelVal,editable} = this.state;
     let mainText = filterArr(mainSaveText);//主诉字数
-    let val = e.target.innerText;
-    if(+type==1){// 主诉字数达到上限时不允许输入
-      if(mainText.length >= config.limited){
-        if(val.length > labelVal.length){
-          e.target.innerText = labelVal;
-          Notify.info(config.limitText);
-          return
-        }else if(val.length == labelVal.length){
-          this.setState({
-            labelVal:val
-          });
-        }else{
-          handleLabelChange && handleLabelChange({ikey,changeVal:val,type});
+    if(editable){//避免IE中点击标签也会触发
+      let val = e.target.innerText;
+      if(+type==1){// 主诉字数达到上限时不允许输入
+        if(mainText.length >= config.limited){
+          if(val.length > labelVal.length){
+            e.target.innerText = labelVal;
+            Notify.info(config.limitText);
+            return
+          }else if(val.length == labelVal.length){
+            this.setState({
+              labelVal:val
+            });
+          }else{
+            handleLabelChange && handleLabelChange({ikey,changeVal:val,type});
+          }
         }
       }
     }
@@ -106,12 +120,16 @@ class SpreadDrop extends Component{
   handleBlur(e){
     e.stopPropagation();
     const {ikey,type,handleLabelChange} = this.props;
+    const {editable} = this.state;
+    if(editable){
+      // 更改标签的value值
+      let changeVal = e.target.innerText;
+      handleLabelChange && handleLabelChange({ikey,changeVal,type});
+    }
     this.setState({
       editable:false
     });
-    // 更改标签的value值
-    let changeVal = e.target.innerText;
-    handleLabelChange && handleLabelChange({ikey,changeVal,type});
+
 
   }
   setStateInit(){
@@ -293,19 +311,32 @@ class SpreadDrop extends Component{
     });
     return list;
   }
+  componentDidMount(){
+    if(isIE()){
+      $(this.$div.current).onIe8Input(function(e){
+        this.onChange(e)
+      },this);
+    }
+  }
+
   render(){
     const {placeholder,value,show} = this.props;
-    const {editable} = this.state;
-    return <div className={style['container']}>
+    const {editable,boxLeft,boxTop} = this.state;
+    return <div className={style['container']}
+            onFocus={(e)=>e.stopPropagation()}
+            onBlur={(e)=>e.stopPropagation()}
+            onInput={(e)=>e.stopPropagation()}>
       <div
+      ref={this.$div}
       onClick={this.handleShow}
       className={this.getClass()}
       contentEditable={editable}
       onDoubleClick={this.changeToEdit}
       onBlur={this.handleBlur}
       onInput={this.onChange}
-      onkeydown={handleEnter}>{value||placeholder}</div>
-      <div className={style["drop-list"]} style={{display:show?'block':'none'}} contentEditable="false" onClick={(e)=>{e.stopPropagation();}}>
+      onkeydown={handleEnter}
+      >{value||placeholder}</div>
+      <div className={style["drop-list"]} style={{display:show?'block':'none',top:boxTop,left:boxLeft}} contentEditable="false" onClick={(e)=>{e.stopPropagation();}}>
         {this.getLabels()}
         <div className="oper">
           <span className={style['clear']} onClick={this.handleClear}>清空选项</span>
@@ -367,7 +398,7 @@ class ListItem extends Component{
   render(){
     const {data,isSpecialPos} = this.props;
     const pos = isSpecialPos?style['independent']:'';
-    return <ul className={classNames(style['row'],pos)}>
+    return <ul className={classNames(style['row'],pos)} onBlur={(e)=>e.stopPropagation()}>
       {data&&data.map((it,i)=>{
         return <li onClick={(e)=>this.handleClick(e,it,i)}
                    className={this.getClass(it.id)}>{it.labelPrefix}{it.name}{it.labelSuffix}</li>

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

@@ -12,7 +12,7 @@
     // width: 200px;
     vertical-align: top;
     margin-left: 8px;
-    max-height: 220px;
+    max-height: 326px;
     overflow-y: auto;
   }
   .independent{

+ 1 - 0
src/components/TemplateItems/TemplateItem/index.jsx

@@ -74,6 +74,7 @@ class TemplateItem extends React.Component {
                     isOpen: false
                 });
             });
+            console.log($(this.content).parent().siblings().find('.content'))
             return;
         }
         $(this.content).slideDown(() => {

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

@@ -68,7 +68,7 @@ class TemplateItems extends React.Component {
                             <span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplate}>管理</span>
                     </div>) : null
                 }
-                <div style={{width:'460px',overflow:'hidden'}}>
+                <div style={{width:'450px',overflow:'hidden'}}>
                     <div className={style.tempLists} ref={this.$cont}>
                         {
                             this.genItems().length > 0?this.genItems():

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

@@ -7,7 +7,7 @@
     .tempLists {
         overflow-y: scroll;
         background-color: #fff;
-        width: 475px;
+        width: 466px;
         // &::-webkit-scrollbar {
         //     display: none;
         // }

+ 2 - 0
src/config/index.js

@@ -19,6 +19,7 @@ export default {
     },
     textId:'text',        //自由文本标签的id,
     textLabel:'{"tagType":"8","id":"","name":""}',
+    _textLabel:'{"tagType":"8","id":"","name":","}',//查体每个标签后面加逗号(1-29)
     tagType:"8",
     tongYId:7,      //主诉通用特征描述id
     addSId:8,      //主诉添加症状id
@@ -37,6 +38,7 @@ export default {
       week:"周",
       month:"月",
       year:"年",
+      age:"岁",
     },
     Params
 };

+ 5 - 2
src/containers/CheckBody.js

@@ -1,13 +1,13 @@
 import {connect} from 'react-redux';
 import CheckBody from '@components/CheckBody';
 import {getModule,getInitData} from '@store/async-actions/fetchModules.js';
-import {HIDE,RESET,SETDROPSHOW} from '@store/types/homePage.js';
+import {HIDE,RESET,SETDROPSHOW,ISREAD} from '@store/types/homePage.js';
 import {SELECTSEARCHDATA} from "@store/types/checkBody";
 import {billing} from '@store/async-actions/pushMessage';
 
 function mapStateToProps(state){ 
   const {homePage,mainSuit,checkBody} = state;
-  const hasMain = mainSuit.saveText.join('')||mainSuit.data.length;
+  const hasMain = mainSuit.saveText.join('');//||mainSuit.data.length;
   return {
     data:checkBody.data,
     update:checkBody.update,   //用于触发更新
@@ -39,6 +39,9 @@ function mapDispatchToProps(dispatch,state){
             span,
             isReplace:false
           })
+          dispatch({
+            type:ISREAD
+          })
         }
       });
     },

+ 1 - 1
src/containers/CurrentIll.js

@@ -12,7 +12,7 @@ import {getModule} from '@store/async-actions/fetchModules.js';
 import {didPushParamChange} from '@utils/tools.js';
 
 
-function mapStateToProps(state) {//console.log(11,state);
+function mapStateToProps(state) {
   const {homePage} = state;
     return {
         data:state.currentIll.data,//主诉模板

+ 3 - 2
src/containers/EditableSpan.js

@@ -210,12 +210,13 @@ function mapDispatchToProps(dispatch,state) {
       }
     },
     handleKeydown(obj){//backspace删除
+      if(obj.i==null){return}
       switch (+obj.boxMark){
         case 1:
-          dispatch({type:DEL_MAIN,delIndex:obj.i});
+          dispatch({type:DEL_MAIN,delIndex:obj.i,text:obj.text});
           break;
         case 2:
-          dispatch({type:DEL_CURRENT,delIndex:obj.i});
+          dispatch({type:DEL_CURRENT,delIndex:obj.i,text:obj.text});
           break;
         case 3:
           dispatch({type:DEL_OTHERHIS,delIndex:obj.i});

+ 2 - 1
src/containers/HistoryCases.js

@@ -24,9 +24,10 @@ function mapDispatchToProps(dispatch) {
             e.stopPropagation();
             dispatch(activeHistory(val))
         },
-        handleQuoteClick(e,data){
+        handleQuoteClick(e,data,idx){
             e.stopPropagation();
             dispatch(keepPushData(data,'his'))      //历史病历引用
+            dispatch(activeHistory(idx))
             dispatch(visibleHistory(true))
         },
         handleSortClick(){

+ 6 - 0
src/containers/MainSuit.js

@@ -126,6 +126,12 @@ function mapDispatchToProps(dispatch) {
           type: SAVE_FREE,
           data:item
         })
+        //右侧推送
+          setTimeout(function(){ 
+            if(didPushParamChange()){
+              dispatch(billing);
+            }
+          },500);
       },
       fetchPushInfos(){//文本模式下推送
         //调右侧推送

+ 12 - 8
src/containers/NumberDrop.js

@@ -1,12 +1,12 @@
 import React from 'react';
 import {connect} from 'react-redux';
 import NumberDrop from "@components/NumberDrop";
-import {SETNUMBER,CHANGEOTHERTEXTLABEL} from '@types/otherHistory';
-import {SETNUMBER4,CHANGECHECKTEXTLABEL} from '@types/checkBody.js';
+import {SETNUMBER,CHANGEOTHERTEXTLABEL,CHANGEOTHERTEXTLABEL_NUMBER} from '@types/otherHistory';
+import {SETNUMBER4,CHANGECHECKTEXTLABEL,CHANGECHECKTEXTLABEL_NUMBER} from '@types/checkBody.js';
 import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP} from '@types/homePage.js';
-import {NUMBER_SELECT,CHANGE_LABELVAL} from '@store/types/mainSuit.js';
+import {NUMBER_SELECT,CHANGE_LABELVAL,CHANGE_LABELVAL_NUMBER} from '@store/types/mainSuit.js';
 import {getLabelIndex} from '@common/js/func.js';
-import {CURRENT_NUMBER,CURRENT_TEXT_LABEL} from '@store/types/currentIll.js';
+import {CURRENT_NUMBER,CURRENT_TEXT_LABEL,CURRENT_TEXT_LABEL_NUMBER} from '@store/types/currentIll.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {Notify} from '@commonComp';
 import {filterArr,didPushParamChange} from '@utils/tools.js';
@@ -77,7 +77,8 @@ function mainSuitLabel(dispatch,params){
   let ikey = getLabelIndex(index);
   const {changeVal,totalVal} = params;
   dispatch({
-    type:CHANGE_LABELVAL,
+    // type:CHANGE_LABELVAL,
+    type:CHANGE_LABELVAL_NUMBER,
     data:{changeVal:changeVal,ikey:ikey,totalVal}
   })
 }
@@ -86,7 +87,8 @@ function currentLabel(dispatch,params){
   const index = params.ikey;
   let ikey = getLabelIndex(index);
   dispatch({
-    type:CURRENT_TEXT_LABEL,
+    // type:CURRENT_TEXT_LABEL,
+    type:CURRENT_TEXT_LABEL_NUMBER,
     data:{changeVal:params.changeVal,ikey:ikey}
   })
 }
@@ -97,7 +99,8 @@ function otherHisLabelEdit(dispatch,params){
   const {changeVal,totalVal} = params;
   let ikey = getLabelIndex(index);
   dispatch({
-    type:CHANGEOTHERTEXTLABEL,
+    // type:CHANGEOTHERTEXTLABEL,
+    type:CHANGEOTHERTEXTLABEL_NUMBER,
     data:{changeVal:changeVal,ikey:ikey,totalVal}
   })
 }
@@ -108,7 +111,8 @@ function checkBodyLabelEdit(dispatch,params){
   let ikey = getLabelIndex(index);
   const {changeVal,totalVal} = params;
   dispatch({
-    type:CHANGECHECKTEXTLABEL,
+    // type:CHANGECHECKTEXTLABEL,
+    type:CHANGECHECKTEXTLABEL_NUMBER,
     data:{changeVal:changeVal,ikey:ikey,totalVal}
   })
 }

+ 10 - 1
src/containers/NumberUnitDrop.js

@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
 import NumberUnitDrop from "@components/NumberUnitDrop";
 import {SETNUMBER,CHANGEOTHERTEXTLABEL} from '@types/otherHistory';
 import {SETNUMBER4,CHANGECHECKTEXTLABEL} from '@types/checkBody.js';
-import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP} from '@types/homePage.js';
+import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP,ISREAD} from '@types/homePage.js';
 import {NUMBER_SELECT,CHANGE_LABELVAL} from '@store/types/mainSuit.js';
 import {getLabelIndex} from '@common/js/func.js';
 import {CURRENT_NUMBER,CURRENT_TEXT_LABEL} from '@store/types/currentIll.js';
@@ -124,6 +124,12 @@ function mapDispatchToProps(dispatch,store){
           clearTimeout(timer);
         }
       },config.delayPushTime);
+      if(!params.text.trim()){
+        dispatch({
+          type:ISREAD
+        })
+      }
+      
     },
     handleDbclick(obj){
       dispatch({
@@ -170,6 +176,9 @@ function mapDispatchToProps(dispatch,store){
           break;
         default:
       }
+      dispatch({
+        type: ISREAD
+      });
     }
   }
 }

+ 10 - 5
src/containers/OperationContainer.js

@@ -5,15 +5,14 @@ import {
     SHOW_PRINT_PREVIEW,
     CLOSE_PRINT_PREVIEW,
     SHOW_PREVIEW,
-    CLOSE_PREVIEW
+    CLOSE_PREVIEW,
+    DIAG_SHOW
 } from "../store/types/print";
 import {saveMessage,clearMessages} from "../store/async-actions/print";
 import {saveTemplateDetail} from '@store/async-actions/tabTemplate';
 import {saveClickNum} from '@store/async-actions/homePage';
 
-function mapStateToProps({
-    print
-}) {
+function mapStateToProps({print}) {
     return ({
         print
     });
@@ -49,8 +48,14 @@ function mapDispatchToProps(dispatch) {
             clearMessages()
         },
         saveDataAll(val){
-            dispatch(saveTemplateDetail(val))
+          dispatch(saveTemplateDetail(val))
         },
+        diagShowTmp(bool){
+          dispatch({
+            type: DIAG_SHOW,
+            data:bool
+          });
+        }
     };
 }
 

+ 6 - 4
src/containers/OtherHistory.js

@@ -2,16 +2,15 @@ import React from 'react';
 import {connect} from 'react-redux';
 import OtherHistory from "../components/OtherHistory";
 import {SETSELECTED,CLEARSELECTED,CONFIRMSELECTED,SELECTOTHERSEARCHDATA,SETDATA,SETTEXTMODEVALUE,OTHEREDICLEAR} from '@types/otherHistory';
-import {HIDE,RESET} from '@store/types/homePage.js';
+import {HIDE,RESET,ISREAD} from '@store/types/homePage.js';
 import {getModule} from '@store/async-actions/fetchModules.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {fullfillText} from '@common/js/func';
 import {didPushParamChange} from '@utils/tools.js';
-import {ISREAD} from "../store/types/homePage";
 
 function mapStateToProps(state){
   const {otherHistory,homePage,typeConfig,mainSuit} = state;
-  const hasMain = mainSuit.saveText.join('')||mainSuit.data.length;
+  const hasMain = mainSuit.saveText.join('');//||mainSuit.data.length;
   return {
     data: otherHistory.data,
     //initData:state.homePage.initData.otherHis,
@@ -67,7 +66,10 @@ function mapDispatchToProps(dispatch,store){
             data: res.data.data,
             span,
             isReplace:false
-          })
+          });
+          dispatch({
+            type:ISREAD
+          });
         }
       });
     },

+ 5 - 1
src/containers/RadioDrop.js

@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
 import RadioDrop from "@components/RadioDrop";
 import {SETRADIO,CLEARSELECTED,CONFIRMSELECTED,CHANGEOTHERTEXTLABEL} from '@types/otherHistory';
 import {SETSELECTED4,CHANGECHECKTEXTLABEL} from '@types/checkBody';
-import {SETDROPSHOW,HIDE,RESET,HIDEDROP,CLICKCOUNT} from '@types/homePage.js';
+import {SETDROPSHOW,HIDE,RESET,HIDEDROP,CLICKCOUNT,ISREAD} from '@types/homePage.js';
 import {RADIO_SELECT,CHANGE_LABELVAL} from '@store/types/mainSuit.js';
 import {CURRENT_RADIO,CURRENT_TEXT_LABEL} from '@store/types/currentIll.js';
 import {Notify} from '@commonComp';
@@ -127,6 +127,10 @@ function mapDispatchToProps(dispatch,store){
         type:dbEditActions[+type],
         data:{changeVal:params.changeVal,ikey:ikey}
       });
+      dispatch(billing);
+      dispatch({
+        type:ISREAD
+      })
     },
     handleShow(obj) {
       dispatch({

+ 9 - 6
src/containers/SpreadDrop.js

@@ -77,10 +77,12 @@ function currentIll(dispatch,store,params){
   // const ikey = params.ikey.substr(1,1);
   const index = params.ikey;
   let ikey = getLabelIndex(index);
-  let existsId = getIds(exists);
-  let withsId = getIds(withs);
+  // let existsId = getIds(exists);
+  // let withsId = getIds(withs);
+  let existsId = exists && exists.length>0?getIds(exists):[];
+  let withsId = withs && withs.length>0?getIds(withs):[];
   // const ids = existsId.join(",")+withsId.join(",");
-  const ids = (existsId.concat(withsId)).join(",");
+  const ids = (existsId.concat(withsId)).join(",");console.log("点击的下标是:",index,"选中的id是:",ids)
   let has = [],wes=[];
   //获取选中项目模板
   fetchModules(ids).then((res)=>{
@@ -154,9 +156,6 @@ function otherHisConfirm(dispatch,store,params){
       dispatch({
         type:ISREAD
       });
-      dispatch({
-        type:ISREAD
-      });
     }
   });
 }
@@ -333,6 +332,10 @@ function handleLabel(dispatch,params){
       break;
     default:
   }
+  dispatch(billing);
+  dispatch({
+    type:ISREAD
+  })
 }
 
 function mapDispatchToProps(dispatch,store){

+ 4 - 2
src/containers/eleType.js

@@ -35,7 +35,7 @@ export function singleRadio(params){
                         ikey={showInx}
                         hideTag={hideTag}></RadioDrop>;
     case 3:
-      return <EditableSpan {...params} value={data.value||data.name} update={Math.random()}/>;
+      return <EditableSpan {...params} value={data.value||data.value==''?data.value:data.name} update={Math.random()}/>;
     case 5://带单位数字键盘
       return <NumberUnitDrop prefix={data.labelPrefix}
                          suffix={data.labelSuffix}
@@ -122,7 +122,9 @@ export default function(params){
     case 6:
       return multCheckLabels(params,data.tagType);
     case 8:
-      return <EditableSpan {...params} value={data.value||data.name} update={Math.random()}/>;
+      // return <EditableSpan {...params} value={data.value||data.name} update={Math.random()}/>;
+      // 删除后value为空,应展示空而不是name
+      return <EditableSpan {...params} value={data.value||data.value==''?data.value:data.name} update={Math.random()}/>;
     case 11://推送类型
       return multCheckLabels(params,data.tagType);
     default:

+ 1 - 1
src/main.js

@@ -27,7 +27,7 @@ const render = (Component) => {
         }
       })
     })
-  };
+  };          
     ReactDOM.render(
         <AppContainer>
             <Provider store={store}>

+ 46 - 7
src/store/actions/checkBody.js

@@ -5,6 +5,7 @@ export function set(state,action){
   let res = Object.assign({},state);
   const {data} = action;
   res.data = [...data];
+  res.saveText = fullfillText(res.data).saveText;//存逗号
   res.update = Math.random();
   return res;
 }
@@ -30,6 +31,7 @@ export function setNumberValue(state,action){
     });
     res.saveText[labelInx] = hasValue?sub.join(''):'';
   }
+  // res.saveText = fullfillText(res.data).saveText;
   res.update = Math.random();
   return res;
 }
@@ -75,6 +77,7 @@ export function setRadioValue(state,action){console.log(221)
     });
     res.saveText[labelInx] = hasValue?sub.join(''):'';
   }
+  // res.saveText = fullfillText(res.data).saveText;
   res.update = Math.random();
   return res;
 }
@@ -108,9 +111,16 @@ export function setCheckText(state,action) {
 export function setCheckBoxValue(state,action) {
   let res = Object.assign({},state);
   const {labelInx,excluName,existsName,nones,withsName} = action.data;
-  res.data[labelInx].value = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
-  res.saveText[labelInx] = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
+  let showText = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
+  // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
+  let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
+  if(pattern.test(showText)){
+    showText = showText.substr(0,showText.length-1);
+  }
+  res.data[labelInx].value = showText;
+  res.saveText[labelInx] = showText;
   res.selecteds[labelInx] = action.data;
+  res.saveText = fullfillText(res.data).saveText;
   res.update = Math.random();
   return res;
 }
@@ -133,7 +143,7 @@ export function insertLabelData(state,action){
   const spreadLabels = data;
   const toEnd = showText.indexOf(searchStr)>0;    //替换前或后的搜索词(中间不可搜)
   let reg = toEnd?new RegExp(searchStr+"$"):new RegExp("^"+searchStr);
-  const newText=showText.replace(reg,'')||' ';
+  const newText=showText.replace(reg,'')||'';
   if(!isReplace){
     span.current.innerText = newText;
     const pText = Object.assign({},text,{value:newText});
@@ -156,11 +166,40 @@ export const changeLabelVal = (state,action)=>{//双击标签输入改变值
   const index = action.data.ikey;
   const newVal = action.data.changeVal;     //下拉修改的内容
   const totalVal = action.data.totalVal;    //包含前后缀修改的内容
+  let labText = totalVal?totalVal:newVal;
   let item = res.data[index];
-  if(item){
-    item.value = newVal;
-  }
-  res.saveText[index] = totalVal;
+  // if(newVal && newVal.trim()){
+  if(labText && labText.trim()){
+    if(item){
+      item.value = newVal;
+      // res.saveText[index] = totalVal;
+      res.saveText[index] = labText;
+    }
+  }else{//删除完标签内容则删除该标签
+    res.data.splice(index,1);
+    res.saveText = fullfillText(res.data).saveText;
+  } 
+  
+  res.update = Math.random();
+  return res;
+}
+
+// 数字键盘较特殊,有直接输入
+export const changeNumLabelVal = (state,action)=>{
+  const res = Object.assign({},state);
+  const index = action.data.ikey;
+  const newVal = action.data.changeVal;
+  let item = res.data[index];
+  if(newVal.trim()){
+    if(item){
+      item.value = newVal;
+    }
+    res.saveText[index] = newVal;
+  }else{//删除完标签内容则删除该标签
+    res.data.splice(index,1);
+    res.saveText = fullfillText(res.data).saveText;
+  } 
+  
   res.update = Math.random();
   return res;
 }

+ 75 - 34
src/store/actions/currentIll.js

@@ -38,7 +38,7 @@ export const setModule = (state,action)=>{
 //插入病程变化
 export const insertProcess = (state,action)=>{
   const res = Object.assign({},state);
-  const processModule = res.processModule;
+  const processModule = JSON.parse(JSON.stringify(res.processModule));
   let data = res.data;
   res.data = insertPro(data,processModule);
   res.saveText = fullfillText(res.data).saveText;
@@ -69,9 +69,13 @@ export const setData = (state,action) =>{
   let newMain = [];
   let mainLabelModule = res.mainLabelModule;//主诉选中的症状id获取到的模板
   let objToArr = [];
-  for(let m in mainLabelModule){
-    objToArr.push(mainLabelModule[m]);
+  let keyArr = Object.keys(mainLabelModule); 
+  for(let i=0; i<keyArr.length; i++){
+    objToArr.push(mainLabelModule[JSON.parse(keyArr[i])]);
   }
+  /*for(let m in mainLabelModule){
+    objToArr.push(mainLabelModule[m]);
+  }*/
   // 过滤掉没有mapping的数据
   let mainLabelModuleArr = objToArr;
   /*let mainLabelModuleArr = objToArr.filter((item)=>{
@@ -85,6 +89,7 @@ export const setData = (state,action) =>{
     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){
@@ -98,7 +103,8 @@ export const setData = (state,action) =>{
         // 处理时间和主诉通用症状--现病史模板无“主诉通用症状” 1-7
         for(let j=0; j<current.length; j++){
           if(mainData[i].id==current[j].id && mainData[i].controlType==5){//处理时间,避免手动输入的值
-            if(mainData[i].value){
+            firstT++
+            if(mainData[i].value && firstT==1){
               current[j] = {id:mainData[i].id,name:mainData[i].value,value:mainData[i].value,tagType:config.tagType}
             }
           }  
@@ -205,32 +211,34 @@ function getLabel(lid,lname){
 // 多选展开确定事件--主、伴、无
 export const confirm = (state,action) =>{
   let res = Object.assign({},state);
-  let length1 = res.data.length;
+  let length1 = res.data.length;console.log(123,action);
   let arr = JSON.parse(JSON.stringify(res.data));
   const {nones,exists,withs,ikey,exclusion,excluName,ban,noneIds} = action.data;
-  let existsId = getIds(exists);
-  let withsId = getIds(withs);
+  let existsId = exists && exists.length>0?getIds(exists):[];
+  let withsId = withs && withs.length>0?getIds(withs):[];
   res.symptomIds = res.symptomIds.concat(existsId,withsId,noneIds);//搜索去重
   // 伴 标签
   const banText = JSON.stringify(ban)=='{}'?'':{id:ban.id,name:ban.name,value:ban.name,tagType:config.tagType};
-  
+
   // 处理主症状标签及尾巴展开symptomType=1
-  if(exists.length>0){
-    for(let i in exists){
-      arr.splice(ikey,0,getLabel(exists[i].id,exists[i].questionMapping.length==0?exists[i].name+',':exists[i].name),...(exists[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==1;})));
+  if(exists && exists.length>0){
+    // for(let i in exists){//ie8不支持for in循环
+     for(let i=0;i<exists.length; i++){
+      arr.splice(ikey,0,getLabel(exists[i].id,exists[i].questionMapping && exists[i].questionMapping.length==0?exists[i].name+',':exists[i].name),...(exists[i].questionMapping && exists[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==1;})));
     }
   }
 
   let length = arr.length - length1;
   let withsArr = JSON.parse(JSON.stringify(arr));
   // 伴 伴随症状标签及尾巴展开symptomType=2
-  if(withs.length>0){
-    for(let i in withs){
+  if(withs && withs.length>0){
+    // for(let i in withs){
+    for(let i=0;i<withs.length; i++){
       // withsArr.splice(parseInt(ikey)+length,0,banText,getLabel(withs[i].id,withs[i].name),...(withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));
-      withsArr.splice(parseInt(ikey)+length,0,getLabel(withs[i].id,withs[i].questionMapping.length==0?(ban.name+withs[i].name+','):(ban.name+withs[i].name)),...(withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));
+      withsArr.splice(parseInt(ikey)+length,0,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(ban.name+withs[i].name+','):(ban.name+withs[i].name)),...(withs[i].questionMapping && withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));
     }
   }
-  
+
   // 无 不用展开
   let lengthN = withsArr.length - length1;
   let noneArr = JSON.parse(JSON.stringify(withsArr));  
@@ -245,7 +253,7 @@ export const confirm = (state,action) =>{
   // res.data = resData;
   res.data = fullfillText(resData).newArr;
   res.saveText = fullfillText(resData).saveText;
-  res.update=Math.random(); 
+  res.update=Math.random();
   return res;
 };
 
@@ -254,9 +262,15 @@ export const confirm = (state,action) =>{
 export const setCheckBox = (state,action)=>{
   const res = Object.assign({},state);
   const {exists,labelInx,existsName} = action.data;
+  // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
+  let names=existsName;
+  let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
+  if(pattern.test(existsName)){
+    names = existsName.substr(0,existsName.length-1);
+  }
   let arr = res.data;
-  arr[labelInx].value = existsName;
-  res.saveText[labelInx] = existsName;
+  arr[labelInx].value = names;
+  res.saveText[labelInx] = names;
   res.selecteds[labelInx] = action.data;
   res.update=Math.random();
   return res;
@@ -271,20 +285,27 @@ export function setNumberValue(state,action){
   let labelInx = getLabelIndex(index);
   const subInx = index.substr(index.length-1);
   let item = res.data[labelInx];
-  if(+item.tagType===1){
-    item.value = param.text;
-    res.saveText[labelInx] = param.text?item.labelPrefix+param.text+item.labelSuffix:'';
-  }else{
-    item.questionMapping[subInx].value = param.text;
-    let hasValue = false;
-    const sub = item.questionMapping.map((it)=>{
-      if(it.value){     //至少有一个子值才黑显
-        hasValue = true;
-      }
-      return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
-    });
-    res.saveText[labelInx] = hasValue?sub.join(''):'';
-  }
+  // if(param.text.trim()){
+    if(+item.tagType===1){
+      item.value = param.text;
+      res.saveText[labelInx] = param.text?item.labelPrefix+param.text+item.labelSuffix:'';
+    }else{
+      item.questionMapping[subInx].value = param.text;
+      let hasValue = false;
+      const sub = item.questionMapping.map((it)=>{
+        if(it.value){     //至少有一个子值才黑显
+          hasValue = true;
+        }
+        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      });
+      // res.saveText[labelInx] = sub.join(',');
+      res.saveText[labelInx] = hasValue?sub.join(''):'';
+      item.value = sub.join('');
+    }
+  /*}else{//删除完标签内容则删除该标签
+    res.data.splice(labelInx,1);
+    res.saveText = fullfillText(res.data).saveText;
+  }*/
   res.update = Math.random();
   return res;
 }
@@ -342,6 +363,25 @@ export function setRadioValue(state,action){
 
 //双击标签输入改变值
 export const changeLabelVal = (state,action)=>{
+  const res = Object.assign({},state);
+  const index = action.data.ikey;
+  const newVal = action.data.changeVal;
+  let item = res.data[index];
+  if(newVal.trim()){
+    if(item){
+      item.value = newVal;
+      res.saveText[index] = newVal;
+    }
+  }else{//删除完标签内容则删除该标签
+    res.data.splice(index,1);
+    res.saveText = fullfillText(res.data).saveText;
+  } 
+  res.update = Math.random();
+  return res;
+}
+
+// 数字键盘较特殊,有直接输入
+export const changeNumLabelVal = (state,action)=>{
   const res = Object.assign({},state);
   const index = action.data.ikey;
   const newVal = action.data.changeVal;
@@ -503,10 +543,11 @@ export function setInputLabel(state,action){
 // backspace删除
 export function backspaceText(state,action){
   let res = Object.assign({},state);
-  const {delIndex} = action;
+  const {delIndex,text} = action;
   const data = res.data;
   if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
-    // 前一个是文本标签或者子模板 不做处理
+    // 前一个是文本标签或者子模板,只改变值
+    // data[delIndex].value = text;
   }else{
     data.splice(delIndex-1,2);
   }

+ 18 - 6
src/store/actions/homePage.js

@@ -14,9 +14,13 @@ export const showDrop=(state,action)=>{
   const {ikey} = action.data;
   let obj = res.showDrop||{};
   let temp = Object.assign({},obj);
-  for(let i in obj){
+  let keyArr = Object.keys(obj); 
+  for(let i=0; i<keyArr.length; i++){
+    temp[JSON.parse(keyArr[i])] = false;
+  }
+  /*for(let i in obj){
     temp[i] = false;
-  };
+  };*/
   res.showDrop = Object.assign(temp,{[ikey]:action.show!==undefined?action.show:true});
   res.update=Math.random();
 
@@ -28,9 +32,13 @@ export const confirmHide=(state,action)=>{
   let res = Object.assign({},state);
   let obj = res.showDrop||{};
   let temp = Object.assign({},obj);
-  for(let i in obj){
+  let keyArr = Object.keys(obj); 
+  for(let i=0; i<keyArr.length; i++){
+    temp[JSON.parse(keyArr[i])] = false;
+  }
+  /*for(let i in obj){
     temp[i] = false;
-  };
+  };*/
   res.showDrop = temp;
   res.commSymHide = true;
   res.update=Math.random();
@@ -73,9 +81,13 @@ export const setLabelToEdit = (state,action)=>{
   const {ikey} = action.data;
   let obj = res.editState||{};
   let temp = Object.assign({},obj);
-  for(let i in obj){
+  let keyArr = Object.keys(obj); 
+  for(let i=0; i<keyArr.length; i++){
+    temp[JSON.parse(keyArr[i])] = false;
+  }
+  /*for(let i in obj){
     temp[i] = false;
-  };
+  };*/
   res.editState = Object.assign(temp,{[ikey]:action.edit!==undefined?action.edit:true});
   res.update=Math.random();
   return res;

+ 72 - 33
src/store/actions/mainSuit.js

@@ -92,24 +92,19 @@ export const handleTailClick = (state,action)=>{
 //将选择的常见症状插入
 export const insertMain = (state,action) => {
   const res = Object.assign({},state);
-  res.showDrop = !res.showDrop;//防止不更新
   const item = action.item.name;
   const id = action.item.questionId;
   // 将选中的id存起,现病史时获取模板
-  // let data = res.data;
   let data = JSON.parse(JSON.stringify(res.moduleData));
-  // const text = {id:id,name:item,tagType:config.tagType,controlType:3,exist:1};
   const text = {id:id,name:item,value:item,tagType:config.tagType,exist:1};
-  const emptySpan = JSON.parse(config.textLabel);
   let inserIndx = null;
   data.map((it,i)=>{
     if(it.flag == 1){//在此处插入主诉数据
       inserIndx = i;
     }
   })
-  // data.splice(inserIndx,0,text,emptySpan);
-  // data.splice(inserIndx,0,text);
-  data[inserIndx-1] = text;//替换空标签
+  data.splice(inserIndx-1,1,text);
+  // data[inserIndx-1] = text;//替换空标签
   res.data = data;
   res.saveText = [];//将手动输入的值清掉
   // res.saveText[inserIndx] = text.name;
@@ -132,12 +127,18 @@ export const confirm = (state,action) =>{
   let arr = res.data;
   let saveText = JSON.parse(JSON.stringify(res.saveText));
   const {exists,withs,ikey,withsName,existsName,ban} = action.data;
-  let existsId = getIds(exists);
-  let withsId = getIds(withs);
+  // let existsId = getIds(exists);
+  // let withsId = getIds(withs);
   let banText = JSON.stringify(ban) == "{}" ? '':{id:ban.id,name:ban.name,value:ban.name,tagType:config.tagType};
-  res.mainIds = res.mainIds?res.mainIds.concat(existsId,withsId):[];
+  // res.mainIds = res.mainIds?res.mainIds.concat(existsId,withsId):[];
   let length = exists.length;
   let labelIndx = parseInt(ikey);//当前点击标签的index
+  // 取第一个添加症状的主症状和伴随
+  if(!arr[labelIndx].pos){
+    let existsId = getIds(exists);
+    let withsId = getIds(withs);
+    res.mainIds = res.mainIds?res.mainIds.concat(existsId,withsId):[];
+  }
 
   let text = saveText.slice(0,labelIndx);
   let index = text.indexOf('伴');
@@ -190,9 +191,15 @@ export const confirm = (state,action) =>{
 export const commConfirm=(state,action)=>{
   const res = Object.assign({},state);
   const {exists,ikey,existsName} = action.data;
+  // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
+  let names=existsName;
+  let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
+  if(pattern.test(existsName)){
+    names = existsName.substr(0,existsName.length-1);
+  }
   let arr = res.data;
-  arr[ikey].value = existsName;
-  res.saveText[ikey] = existsName;
+  arr[ikey].value = names;
+  res.saveText[ikey] = names;
   res.selecteds[ikey] = action.data;
   res.update=Math.random();
   return res;
@@ -279,22 +286,27 @@ export function setNumberValue(state,action){
   let labelInx = getLabelIndex(index);
   const subInx = index.substr(index.length-1);
   let item = res.data[labelInx];
-  if(+item.tagType===1){
-    item.value = param.text;
-    res.saveText[labelInx] = param.text?item.labelPrefix+param.text+item.labelSuffix:'';
-  }else{
-    item.questionMapping[subInx].value = param.text;
-    let hasValue = false;
-    const sub = item.questionMapping.map((it)=>{
-      if(it.value){     //至少有一个子值才黑显
-        hasValue = true;
-      }
-      return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
-    });
-    // res.saveText[labelInx] = sub.join(',');
-    res.saveText[labelInx] = hasValue?sub.join(''):'';
-    item.value = sub.join('');
-  }
+  // if(param.text.trim()){
+    if(+item.tagType===1){
+      item.value = param.text;
+      res.saveText[labelInx] = param.text?item.labelPrefix+param.text+item.labelSuffix:'';
+    }else{
+      item.questionMapping[subInx].value = param.text;
+      let hasValue = false;
+      const sub = item.questionMapping.map((it)=>{
+        if(it.value){     //至少有一个子值才黑显
+          hasValue = true;
+        }
+        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      });
+      // res.saveText[labelInx] = sub.join(',');
+      res.saveText[labelInx] = hasValue?sub.join(''):'';
+      item.value = sub.join('');
+    }
+  /*}else{//删除完标签内容则删除该标签
+    res.data.splice(labelInx,1);
+    res.saveText = fullfillText(res.data).saveText;
+  }*/
   res.update = Math.random();
   return res;
 }
@@ -352,15 +364,42 @@ export const changeLabelVal = (state,action)=>{
   const res = Object.assign({},state);
   const index = action.data.ikey;
   const newVal = action.data.changeVal;
-  let item = res.data[index];
-  if(item){
-    item.value = newVal;
-  }
-  res.saveText[index] = newVal;
+  let data = res.data;
+  let item = data[index];
+  if(newVal.trim()){
+    if(item){
+      item.value = newVal;
+      res.saveText[index] = newVal;
+    }
+  }else{//删除完标签内容则删除该标签
+    
+    data.splice(index,1);
+    // res.data.splice(index,1);
+    // res.saveText = fullfillText(res.data).saveText;
+    res.saveText.splice(index,1);
+  } 
   res.update = Math.random();
   return res;
 }
 
+// 数字键盘较特殊,有直接输入
+export const changeNumLabelVal = (state,action)=>{
+  const res = Object.assign({},state);
+  const index = action.data.ikey;
+  const newVal = action.data.changeVal;
+  let item = res.data[index];
+  if(newVal.trim()){
+    if(item){
+      item.value = newVal;
+      res.saveText[index] = newVal;
+    }
+  }else{//删除完标签内容则删除该标签
+    res.data.splice(index,1);
+    res.saveText = fullfillText(res.data).saveText;
+  }  
+  res.update = Math.random();//console.log(44,action,res);
+  return res;
+}
 
 // 保存自由输入文本--无模板
 export const saveFreeVal = (state,action)=>{

+ 41 - 13
src/store/actions/otherHistory.js

@@ -6,7 +6,8 @@ export const confirm = (state,action) =>{
   let res = Object.assign({},state);
   let arr = res.data;
   const {nones,exists,withs,ikey,exclusion,excluName,copyType} = action.data;
-  if((!exists||!withs||[...exists,...withs].length==0)&&!nones&&!exclusion){       //取消无殊的选中,空白提交
+  const items = [...exists||[],...withs||[]];
+  if((!exists||!withs||items.length==0)&&!nones&&!exclusion){       //取消无殊的选中,空白提交
     arr[ikey].value = '';
     res.saveText[ikey] = '';
     res.selecteds.splice(ikey,1);
@@ -26,25 +27,28 @@ export const confirm = (state,action) =>{
     arr.splice(ikey,1);
   }
   if(arr[ikey].value)  arr[ikey].value= '';
-  let newPreText = (arr[ikey-1].value||arr[ikey-1].name||'')+nones;//console.log(arr[ikey-1],newPreText)
-  if([...exists,...withs].length==0&&nones){
+  let preText = arr[ikey-1].value!==undefined?arr[ikey-1].value:arr[ikey-1].name||'';
+  let newPreText =preText +nones;//console.log(arr[ikey-1],newPreText)
+  if(items.length==0&&nones){
     arr[ikey-1].value = newPreText;
     res.saveText[ikey-1] = newPreText;
     res.update=Math.random();
     return res;
   }
-  //有,无,伴随配
-    arr.splice(ikey-1,1);
-    let flabel = [...exists,...withs][0];         //要插入的第一个标签
-    let text = newPreText;
-    //要插入的第一个标签为自由文本,则和前一个文本标签文字合并
+  //有,伴,无随配
+    //arr.splice(ikey-1,1);
+    let flabel = items[items.length-1];         //要插入的最后一个标签
+    let labelText = flabel.value!==undefined?flabel.value:flabel.name;
+    let text = labelText;
+    //要插入的最后一个标签为自由文本,则和后面的文本标签文字合并
     if(flabel.tagType==8){
-      flabel.value = newPreText+(flabel.value||flabel.name);
+      flabel.value = labelText+nones;
       text = flabel.value;
     }
-    arr.splice(ikey-1,0,...exists,...withs);
-    arr[ikey-1].value = text;
-    res.saveText[ikey-1] = text;
+    arr.splice(ikey,0,...exists,...withs);
+    //arr[ikey-1].value = text;
+    //res.saveText[ikey+items.length] = text;
+    res.saveText = fullfillText(arr).saveText;
     res.update=Math.random();         //用于触发组件更新(data变化了因在对象中无法被组件检测到)
     return res;
 };
@@ -150,7 +154,12 @@ export function setOtherInput(state,action){
 export function setCheckBoxValue(state,action) {
   let res = Object.assign({},state);
   const {labelInx,excluName,existsName,nones,withsName} = action.data;
-  const showText = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
+  let showText = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
+  // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
+  let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
+  if(pattern.test(showText)){
+    showText = showText.substr(0,showText.length-1);
+  }
   res.data[labelInx].value = showText;
   res.saveText[labelInx] = showText;
   res.selecteds[labelInx] = action.data;
@@ -192,6 +201,25 @@ export function insertLabelData(state,action){
 }
 
 export function changeTextLabel(state,action) {
+  const res = Object.assign({},state);
+  const index = action.data.ikey;
+  const newVal = action.data.changeVal;
+  let item = res.data[index];
+  if(newVal.trim()){
+    if(item){
+      item.value = newVal;
+      res.saveText[index] = newVal;
+    }
+  }else{//删除完标签内容则删除该标签
+    res.data.splice(index,1);
+    res.saveText = fullfillText(res.data).saveText;
+  }
+  res.update = Math.random();
+  return res;
+}
+
+// 数字键盘较特殊,有直接输入
+export const changeNumLabelVal = (state,action)=>{
   const res = Object.assign({},state);
   const index = action.data.ikey;
   const newVal = action.data.changeVal;

+ 7 - 0
src/store/actions/print.js

@@ -27,3 +27,10 @@ export const saveMessage=(state,action)=>{
   res.saveMessage = action.data
   return res;
 };
+
+export const diagShow=(state,action)=>{
+  const res=Object.assign({},state);
+  console.log(action)
+  res.diagShow = action.data
+  return res;
+};

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

@@ -9,7 +9,7 @@ import {
     CHANGE_VISIBLE,
     SHOW_MESSAGE,
     KEEP_PUSH_DATA,
-    ALL_CHECKED_SHOW
+    ALL_CHECKED_SHOW,
 } from '@store/types/tabTemplate';
 
 export const delItems = (id) => ({ //删除模板

+ 0 - 1
src/store/async-actions/assistCheck.js

@@ -18,7 +18,6 @@ export const getSearchList = (val) => {
             sexType: sex == '男'?'1' : sex == '女'?'2':'3'
         })
         .then((res)=>{
-            console.log(res.data.data)
             const data = res.data.data;
             dispatch(searchList(data));
         })

+ 2 - 2
src/store/async-actions/fetchModules.js

@@ -1,6 +1,6 @@
 import {json} from '@utils/ajax.js';
 import {SET} from '@types/checkBody.js';
-import {fullfillText} from '@common/js/func';
+import {fullfillText,_fullfillText} from '@common/js/func';
 import {SETDATA} from '@store/types/otherHistory';
 import store from '@store';
 import {getEMRParams} from '@utils/tools.js';
@@ -103,7 +103,7 @@ export function getInitData(){
       if(+res.data.code === 0){
         const data = res.data.data&&res.data.data.vital;
         const str = JSON.stringify(data);
-        const arr = fullfillText(JSON.parse(str)).newArr;
+        const arr = fullfillText(JSON.parse(str),false,false,false).newArr;
         dispatch({
           type:SET,
           data:[...arr]

+ 4 - 5
src/store/async-actions/homePage.js

@@ -68,11 +68,10 @@ export const getInitModules= (dispatch,getStore)=>{
 
 export const initHis = (dispatch)=> {
     let timer = setInterval(()=>{
-        let baseDate = store.getState().patInfo.message;
-        //console.log(baseDate)
-        if(JSON.stringify(baseDate) != '{}') {
-            dispatch(initHistoryDetails(baseDate));
-            clearInterval(timer)
+        let baseDate = store.getState();
+        if(JSON.stringify(baseDate.patInfo.message) != '{}') {
+          dispatch(initHistoryDetails(baseDate.patInfo.message));
+          clearInterval(timer)
         }
     },500)
 }

+ 0 - 1
src/store/async-actions/inspect.js

@@ -19,7 +19,6 @@ export const getSearchList = (val) => {
             sexType:sex == '男'?'1' : sex == '女'?'2':'3'
         })
         .then((res)=>{
-            console.log(res.data.data)
             const data = res.data.data;
             dispatch(searchList(data));
         })

+ 10 - 7
src/store/async-actions/patInfo.js

@@ -6,6 +6,7 @@ import {getUrlArgObject,pushAllDataList} from '@utils/tools';
 import {getInitModules} from '@store/async-actions/homePage.js';
 import store from '@store'
 import {ISREAD} from "../types/homePage";
+import { initItemList } from '@store/async-actions/tabTemplate';
 
 const api = {
     getPatInfo: '/api/icss/patientInfo/getTopPatientInfo',
@@ -20,6 +21,7 @@ export const initPersonInfo = (dispatch, getState) => {
         const data = res.data;
         if (data.code == 0) {
             dispatch(getInfos(data.data));
+            console.log(data.data)
             getPatientMessage(dispatch, getState);
         } else {
             console.log(res)
@@ -47,16 +49,14 @@ export const initHistoryDetails = (dispatch) => {
                   type:ISREAD
                 });
                 // 设置初始模式
-                if(detail.sign == 1){
+                if(detail.sign == 1 || detail.sign == 0){
                     dispatch({
                         type: CONFIRM_TYPE,
-                        confirmType: 1
-                    })
-                }else if(detail.sign == 0){
-                    dispatch({
-                        type: CONFIRM_TYPE,
-                        confirmType: 0
+                        confirmType: detail.sign
                     })
+                    if(baseList.tabTemplate.items.length == 0){
+                      dispatch(initItemList());        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
+                    }
                 }
             } else {
                 console.log(res)
@@ -94,5 +94,8 @@ export const getPatientMessage = (dispatch, getState) => {
         type: CONFIRM_TYPE,
         confirmType:data1.modeValue
       });
+      if(state.tabTemplate.items.length == 0){
+        dispatch(initItemList(data1.modeValue));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
+      }
     })
 };

+ 19 - 2
src/store/async-actions/tabTemplate.js

@@ -4,8 +4,9 @@ import {
   delItems,
   batchDelItems,
   changeTitle,
-  keepPushData
+  keepPushData,
 } from '@store/actions/tabTemplate';
+import {DIAG_SHOW} from "@store/types/print";
 import Notify from '@commonComp/Notify';
 import store from '@store';
 import {
@@ -17,6 +18,7 @@ export const initItemList = (type) => { //初始化数据
   let baseList = store.getState();
   let whichSign = baseList.typeConfig.typeConfig;
   let state = baseList.patInfo.message;
+
   return (dispatch) => {
     axios.json('/api/icss/templateInfo/getByDoctorIdTemplates', {
       "doctorId": state.doctorId,
@@ -34,7 +36,7 @@ export const initItemList = (type) => { //初始化数据
   }
 };
 
-export const saveTemplateDetail = (val) => { //保存为模板(先判断是否引入模板,是的话需要判断是否改变了值)
+export const saveTemplateDetail = (val) => { //保存为模板
   let baseList = store.getState();
   let jsonData = getAllDataList(baseList);
   let jsonStr = getAllDataStringList(baseList);
@@ -69,7 +71,22 @@ export const saveTemplateDetail = (val) => { //保存为模板(先判断是否
         Notify.success('模板保存成功');
         dispatch(initItemList());
         dispatch(keepPushData(getdata(1),'part'));
+        dispatch({
+          type: DIAG_SHOW,
+          data:false
+        });
       } else {
+        if(data.msg == '该模板名存在'){         //存在不关闭弹窗
+          dispatch({
+            type: DIAG_SHOW,
+            data:true
+          });
+        }else{
+          dispatch({
+            type: DIAG_SHOW,
+            data:false
+          });
+        }
         Notify.error(data.msg);
       }
     })

+ 5 - 6
src/store/async-actions/treat.js

@@ -1,6 +1,6 @@
 import { json } from "@utils/ajax";
 import { SET_TREAT } from '@store/types/diagnosticList';
-import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR} from '@store/types/diagnosticList'; 
+import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR} from '@store/types/diagnosticList';
 import { SET_DRUG_INFO, SET_TREATMENT, SET_TREAT_INFO, SET_RECOMMEND_BASIC } from '@store/types/treat';
 import {storageLocal,getEMRParams} from '@utils/tools';
 import { isAddMainSuit } from '@store/async-actions/diagnosticList';
@@ -27,7 +27,7 @@ export const addDiagnostic = (item) => {
                     } else {
                         diag = diag + ',' + diagnosticList[i].name;
                     }
-                    
+
                 }
             }
             if (item.type === 1) {
@@ -47,7 +47,7 @@ export const addDiagnostic = (item) => {
                 "symptom": emrData.current + emrData.main,
                 "vital": emrData.vital
             };
-            
+
             json(url, params).then((data) =>{
                 if (data.data.data) {
                     item.treat = data.data.data.treat
@@ -120,7 +120,7 @@ export const getTreatResult = (item) =>{
             "other": emrData.other,
             "pacs": emrData.pacs,
             "sex": emrData.sex,
-            "symptom": emrData.current||emrData.main,
+            "symptom": emrData.current + emrData.main,
             "vital": emrData.vital
         };
         
@@ -137,7 +137,7 @@ export const getTreatResult = (item) =>{
                         surgeryTreat: treat.surgeryTreatment,
                     })
                 }
-                
+
         }).catch((e) =>{
             console.log(e)
         })
@@ -216,7 +216,6 @@ export const getTreatResult = (item) =>{
     
 } 
 export const getInstroduce = (item)=>{
-    // const instroduce = '<p>药品说明1</p><p>药品说明2</p><p>药品说明3</p>'
 
     return (dispatch, getState) =>{
         const url = '/api/icss/introduceInfo/getByQuestionId';

+ 10 - 10
src/store/reducers/assistCheck.js

@@ -26,7 +26,7 @@ export default (state = initSearchList, action) => {
         newState.list = action.list
         return newState;
     }
-    if (action.type == GET_ASSIST_LABEL) {
+    if (action.type == GET_ASSIST_LABEL) {             //默认
         const newState = Object.assign({}, state);
         const tempArr = newState.list;
         const tempArrs = newState.assistLabel;
@@ -37,14 +37,14 @@ export default (state = initSearchList, action) => {
                 tempArrs.push(tempArr[i]);
                 newState.assistLabel = [...tempArrs];
             }
-            for (let j = 0; j < tempArrs.length; j++) {
-                tmpString += (tempArrs[j].name+(tempArrs[j].value?(','+tempArrs[j].value):'')+(tempArrs[j].time?',报告日期,'+tempArrs[j].time:'')+';')
-            }
+        }
+        for (let j = 0; j < tempArrs.length; j++) {
+            tmpString += (tempArrs[j].name+(tempArrs[j].value?(':'+tempArrs[j].value):'')+(tempArrs[j].time?',报告日期:'+tempArrs[j].time:'')+';')
         }
         newState.dataString = tmpString
         return newState;
     }
-    if (action.type == DEL_ASSIST_LABEL) {
+    if (action.type == DEL_ASSIST_LABEL) {        //删除
         const newState = Object.assign({}, state);
         const tempArr = newState.assistLabel;
         let tmpString = '';
@@ -54,13 +54,13 @@ export default (state = initSearchList, action) => {
             return
         }
         for (let i = 0; i < tempArr.length; i++) {
-            tmpString += (tempArr[i].name+(tempArr[i].value?(','+tempArr[i].value):'')+(tempArr[i].time?',报告日期,'+tempArr[i].time:'')+';')
+            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?',报告日期:'+tempArr[i].time:'')+';')
         }
         newState.assistLabel = [...tempArr]
         newState.dataString = tmpString
         return newState;
     }
-    if (action.type == CHANGE_ASSIST_VAL) {
+    if (action.type == CHANGE_ASSIST_VAL) {           //改变输入值
         const newState = Object.assign({}, state);
         const tempArr = newState.assistLabel;
         let tmpString = '';
@@ -69,12 +69,12 @@ export default (state = initSearchList, action) => {
                 tempArr[i].value = action.val
                 newState.assistLabel = [...tempArr]
             }
-            tmpString += (tempArr[i].name+(tempArr[i].value?(','+tempArr[i].value):'')+(tempArr[i].time?',报告日期,'+tempArr[i].time:'')+';')
+            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?',报告日期:'+tempArr[i].time:'')+';')
         }
         newState.dataString = tmpString
         return newState;
     }
-    if (action.type == CHANGE_DATE) {
+    if (action.type == CHANGE_DATE) {             //新增
         const newState = Object.assign({}, state);
         const tempArr = newState.assistLabel;
         let tmpString = '';
@@ -83,7 +83,7 @@ export default (state = initSearchList, action) => {
                 tempArr[i].time = action.date
                 newState.assistLabel = [...tempArr]
             }
-            tmpString += (tempArr[i].name+(tempArr[i].value?(','+tempArr[i].value):'')+(tempArr[i].time?',报告日期,'+tempArr[i].time:'')+';')
+            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?',报告日期:'+tempArr[i].time:'')+';')
         }
         newState.dataString = tmpString
         return newState;

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

@@ -1,6 +1,6 @@
 import {SET,SETNUMBER4,SETSELECTED4,SETCHECKBOX,ADDLABELITEM,SETCHECKTEXT,SETSEARCHDATA,
-  SELECTSEARCHDATA,CHANGECHECKTEXTLABEL,CLEARCHECKBODY,CHECK_FOCUS_INDEX,CHECKBODY_CLEAR,SETCHECKINPUT,DEL_CHECKBODY} from '../types/checkBody.js';
-import {set,setNumberValue,setRadioValue,setCheckBoxValue,addLabelItem,setCheckText,setSearchData,insertLabelData,changeLabelVal,clearCheckBody,setInputLabel,backspaceText} from '../actions/checkBody.js';
+  SELECTSEARCHDATA,CHANGECHECKTEXTLABEL,CLEARCHECKBODY,CHECK_FOCUS_INDEX,CHECKBODY_CLEAR,SETCHECKINPUT,DEL_CHECKBODY,CHANGECHECKTEXTLABEL_NUMBER} from '../types/checkBody.js';
+import {set,setNumberValue,setRadioValue,setCheckBoxValue,addLabelItem,setCheckText,setSearchData,insertLabelData,changeLabelVal,clearCheckBody,setInputLabel,backspaceText,changeNumLabelVal} from '../actions/checkBody.js';
 import config from '@config/index.js';
 
 const block = Object.assign(JSON.parse(config.textLabel),{full:true});
@@ -33,6 +33,8 @@ export default function(state=initState,action){
       return clearCheckBody(state,action);
     case CHANGECHECKTEXTLABEL://改变标签值
       return changeLabelVal(state,action);
+    case CHANGECHECKTEXTLABEL_NUMBER://数字键盘
+      return changeNumLabelVal(state,action);
     case CHECK_FOCUS_INDEX:
       res.focusIndex = action.index;
       res.span = action.$span;

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

@@ -1,9 +1,9 @@
 // 现病史
 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} from '../types/currentIll';
+  SET_CURRENT_SEARCH,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,SELECT_SEARCHDATA,CLEAR_CURRENT_EDIT,CURRENTADDLABELITEM,SETCURRENTINPUT,DEL_CURRENT,CURRENT_TEXT_LABEL_NUMBER} from '../types/currentIll';
 import {confirm,insertProcess,setData,setCheckBox,setRadioValue,setNumberValue,changeLabelVal,clearCurrentIll,
-  setTextModeValue,setModule,bigDataSymptom,setCheckText,insertLabelData,clearCurrentEdit,addLabelItem,setInputLabel,backspaceText} from '../actions/currentIll';
+  setTextModeValue,setModule,bigDataSymptom,setCheckText,insertLabelData,clearCurrentEdit,addLabelItem,setInputLabel,backspaceText,changeNumLabelVal} from '../actions/currentIll';
 
 const initState = {
   moduleData:[],
@@ -42,6 +42,8 @@ export default function(state=initState,action){
       return setNumberValue(state,action);
     case CURRENT_TEXT_LABEL://标签双击编辑
       return changeLabelVal(state,action);
+    case CURRENT_TEXT_LABEL_NUMBER://数字键盘
+      return changeNumLabelVal(state,action);
     case CURRENT_GET_BIGDATAPUSH://标签双击编辑
       return bigDataSymptom(state,action);
     case SET_CURRENT_SEARCH://搜索结果

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

@@ -17,4 +17,4 @@ export default (state = initPersonList, action) => {
         return newState;
     }
     return state;
-}
+}

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

@@ -1,9 +1,9 @@
 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} from '../types/mainSuit'
+  INSERT_SEARCH,MAIN_FOCUS_INDEX,SETTEXTMODEVALUE,SETMAINTEXT,MAINADDLABELITEM,SETMAININPUT,DEL_MAIN,CHANGE_LABELVAL_NUMBER} from '../types/mainSuit'
 import {getCommSymptoms,handleTailClick,insertMain,setSearch,getBigSymptom,setMainMoudle,confirm,
-  setNumberValue,setRadioValue,commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,changeEditClear,addLabelItem,setInputLabel,backspaceText} from '../actions/mainSuit'
+  setNumberValue,setRadioValue,commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,changeEditClear,addLabelItem,setInputLabel,backspaceText,changeNumLabelVal} from '../actions/mainSuit'
 
 
 const initState = {
@@ -62,6 +62,8 @@ export default function(state=initState,action){
       return setRadioValue(state,action);
     case CHANGE_LABELVAL://改变标签值
       return changeLabelVal(state,action);
+    case CHANGE_LABELVAL_NUMBER://数字标签输入值
+      return changeNumLabelVal(state,action);
     case SAVE_FREE://自由输入
       return saveFreeVal(state,action);
     case MAIN_FOCUS_INDEX:

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

@@ -1,6 +1,6 @@
 import {SETDATA,CONFIRMSELECTED,SETRADIO,SETNUMBER,SETOTHERCHECKBOX,SETOTHERTEXT,SETOTHERSEARCHDATA,
-  SELECTOTHERSEARCHDATA,CLEAROTHERHISTORY,CHANGEOTHERTEXTLABEL,SETOTHERINPUT,SETTEXTMODEVALUE,OTHER_FOCUS_INDEX,OTHERHIS_CLEAR,OTHERADDLABELITEM,OTHEREDICLEAR,DEL_OTHERHIS} from '../types/otherHistory';
-import {confirm,setRadioValue,setNumberValue,setCheckBoxValue,setCheckText,setSearchData,insertLabelData,clearOtherHistory,changeTextLabel,setOtherInput,setTextModeValue,addLabelItem,otherEditClear,backspaceText} from '../actions/otherHistory';
+  SELECTOTHERSEARCHDATA,CLEAROTHERHISTORY,CHANGEOTHERTEXTLABEL,SETOTHERINPUT,SETTEXTMODEVALUE,OTHER_FOCUS_INDEX,OTHERHIS_CLEAR,OTHERADDLABELITEM,OTHEREDICLEAR,DEL_OTHERHIS,CHANGEOTHERTEXTLABEL_NUMBER} from '../types/otherHistory';
+import {confirm,setRadioValue,setNumberValue,setCheckBoxValue,setCheckText,setSearchData,insertLabelData,clearOtherHistory,changeTextLabel,setOtherInput,setTextModeValue,addLabelItem,otherEditClear,backspaceText,changeNumLabelVal} from '../actions/otherHistory';
 
 const initState = {data:[],saveText:[],selecteds:[],focusIndex:'',editClear:true};/*mockData.OtherHis.moduleDetailDTOList;[
     mockData.radioData,
@@ -35,6 +35,8 @@ export default function(state=initState,action){//console.log(state)
       return clearOtherHistory(state,action);
     case CHANGEOTHERTEXTLABEL:
       return changeTextLabel(state,action);
+    case CHANGEOTHERTEXTLABEL_NUMBER:
+      return changeNumLabelVal(state,action);
     case SETOTHERINPUT:
       return setOtherInput(state,action);
     case SETTEXTMODEVALUE:

+ 6 - 3
src/store/reducers/print.js

@@ -1,10 +1,11 @@
-import { SHOW_PRINT_PREVIEW, CLOSE_PRINT_PREVIEW, SAVE_MESSAGE, CLOSE_PREVIEW, SHOW_PREVIEW,CLEAR_MESSAGE } from "../types/print";
-import { showPrintPreview, closePrintPreview, saveMessage, showPreview, closePreview } from "../actions/print";
+import { SHOW_PRINT_PREVIEW, CLOSE_PRINT_PREVIEW, SAVE_MESSAGE, CLOSE_PREVIEW, SHOW_PREVIEW,CLEAR_MESSAGE,DIAG_SHOW } from "../types/print";
+import { showPrintPreview, closePrintPreview, saveMessage, showPreview, closePreview,diagShow } from "../actions/print";
 
 const initState = {
   visible: false,
   preVisible: false,
-  saveMessage: {}
+  saveMessage: {},
+  diagShow: false
 };
 export default function(state = initState, action) {
   switch (action.type) {
@@ -20,6 +21,8 @@ export default function(state = initState, action) {
       return saveMessage(state, action);
     case CLEAR_MESSAGE:
       return clearMessage(state, action);
+    case DIAG_SHOW:
+      return diagShow(state, action);
     default:
       return state;
   }

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

@@ -9,7 +9,7 @@ import {
   CHANGE_VISIBLE,
   SHOW_MESSAGE,
   KEEP_PUSH_DATA,
-  ALL_CHECKED_SHOW
+  ALL_CHECKED_SHOW,
 } from '../types/tabTemplate';
 
 

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

@@ -12,4 +12,5 @@ export const CLEARCHECKBODY = 'clear_check_body';
 export const CHECK_FOCUS_INDEX = 'check_focus_text_index';
 export const CHECKBODY_CLEAR = 'clear_search_check_body';
 export const SETCHECKINPUT = 'set_check_body_input_label';
-export const DEL_CHECKBODY = 'DEL_CHECKBODY';//backspace
+export const DEL_CHECKBODY = 'DEL_CHECKBODY';//backspace
+export const CHANGECHECKTEXTLABEL_NUMBER = 'CHANGECHECKTEXTLABEL_NUMBER';//数字键盘

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

@@ -21,4 +21,5 @@ export const CLEAR_CURRENT_EDIT = 'CLEAR_CURRENT_EDIT' ;
 export const CURRENTADDLABELITEM = 'current_add_label_item';    //带加号的标签复制
 export const SETCURRENTINPUT = 'SET_CURRENT_ILL_INPUT_LABEL';     //文本输入标签存值
 export const DEL_CURRENT = 'DEL_CURRENT';     //backspace删除
+export const CURRENT_TEXT_LABEL_NUMBER = 'CURRENT_TEXT_LABEL_NUMBER';     //数字键盘输入
 

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

@@ -21,4 +21,5 @@ export const SETTEXTMODEVALUE = 'SET_TEXT_MODE_VALUE';  //文本模式下输入
 export const SETMAINTEXT = 'SETMAINTEXT';  //模板下输入值
 export const MAINADDLABELITEM = 'MAIN_ADD_LABEL_ITEM';      //带加号的标签复制
 export const SETMAININPUT = 'SET_MAIN_INPUT_LABEL';     //文本输入标签存值
-export const DEL_MAIN = 'DEL_MAIN';     //文本输入标签存值
+export const DEL_MAIN = 'DEL_MAIN';     //删除标签
+export const CHANGE_LABELVAL_NUMBER = 'CHANGE_LABELVAL_NUMBER';     //数字键盘输入存值

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

@@ -16,4 +16,5 @@ export const OTHER_FOCUS_INDEX = 'other_focus_text_index';
 export const OTHERHIS_CLEAR = 'OTHERHIS_CLEAR';  //清空搜索值
 export const OTHERADDLABELITEM = 'other_add_label_item';    //带加号的标签复制
 export const OTHEREDICLEAR = 'OTHEREDICLEAR';    //文本框是否可以编辑
-export const DEL_OTHERHIS = 'DEL_OTHERHIS';    //backspace
+export const DEL_OTHERHIS = 'DEL_OTHERHIS';    //backspace
+export const CHANGEOTHERTEXTLABEL_NUMBER = 'CHANGEOTHERTEXTLABEL_NUMBER';    //数字键盘

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

@@ -3,4 +3,5 @@ export const CLOSE_PRINT_PREVIEW = 'CLOSE_PRINT_PREVIEW'
 export const SAVE_MESSAGE = 'SAVE_MESSAGE'
 export const CLEAR_MESSAGE = 'CLEAR_MESSAGE'
 export const SHOW_PREVIEW = 'SHOW_PREVIEW'
-export const CLOSE_PREVIEW = 'CLOSE_PREVIEW'
+export const CLOSE_PREVIEW = 'CLOSE_PREVIEW'
+export const DIAG_SHOW = 'DIAG_SHOW'

+ 1 - 1
src/utils/ajax.js

@@ -7,7 +7,7 @@ const qs=require('querystring');
 const isLocal = window.location.hostname.indexOf('localhost')!=-1;
 const qhost = isLocal?host:'';
 axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
-axios.defaults.baseURL = host;       //默认地址
+//axios.defaults.baseURL = host;       //默认地址
 // axios.defaults.timeout = 60000;       //请求超时
 
 

+ 18 - 6
src/utils/tools.js

@@ -474,24 +474,36 @@ function filterArr(arr){
     return tmpArr.join("").replace(/\s/g,'');
 }
 
-function filterDataArr(arr){   //数据处理
+function filterDataArr(arrTmp){   //数据处理
     let tmpArr = [];
+    let arr = arrTmp.join('').split('');
     for(let i = 0;i < arr.length;i++){
         if(arr[i] && arr[i].indexOf('undefined') == -1){
-            if(tmpArr[tmpArr.length-1] != ',' ){
+            if(tmpArr[tmpArr.length-1] != ',' && tmpArr[tmpArr.length-1] != ',' ){
                 tmpArr.push(arr[i])
-            }
-            else if(tmpArr[tmpArr.length-1] == ',' && arr[i] != ',') {
-              if(arr[i] == '。'){
+            }else if((tmpArr[tmpArr.length-1] == ',' && (arr[i] != ',' || arr[i] != ',')) || (tmpArr[tmpArr.length-1] == ',' && (arr[i] != ',' || arr[i] != ','))) {
+              if(arr[i] == '。'){     //前面逗号后面句号 [',','。']
+                tmpArr.pop();
+                tmpArr.push(arr[i]);
+              }else if(tmpArr[tmpArr.length-2] == '。' && (tmpArr[tmpArr.length-1] == ',' || tmpArr[tmpArr.length-1] == ',')){//前面句号后面逗号 ['。',',']
+                tmpArr.pop();
+                tmpArr.push(arr[i]);
+              }else if(arr[i] == ',' || arr[i] == ','){    //  中英文逗号交替[',',',']
+                tmpArr.pop();
+                tmpArr.push(arr[i]);
+              }else if(arr[i] == '、'){    //前面逗号后面句号 [',','、']
                 tmpArr.pop();
                 tmpArr.push(arr[i]);
+              }else if(tmpArr[tmpArr.length-2] == '、' && (tmpArr[tmpArr.length-1] == ',' || tmpArr[tmpArr.length-1] == ',')){    //前面逗号后面句号 ['、',',']
+                tmpArr.splice(tmpArr.length-2,1);
+                tmpArr.push(arr[i]);
               }else{
                 tmpArr.push(arr[i]);
               }
             }
         }
     }
-    return (tmpArr.join('')).replace(/,^|,^|,$|,$/gi,"");
+    return (tmpArr.join('')).replace(/^,+/,"").replace(/,+$/,"").replace(/,+$/,"").replace(/,+$/,"");
 }
 // 取消默认行为
 function preventDefault(event) {