Quellcode durchsuchen

Merge branch 'dev/new1' into dev/zhangxc1

zhangxc vor 6 Jahren
Ursprung
Commit
8e25532ad8
60 geänderte Dateien mit 823 neuen und 722 gelöschten Zeilen
  1. 4 4
      src/common/components/ConfirmModal/index.jsx
  2. 1 1
      src/common/components/ConfirmModal/index.less
  3. 54 15
      src/common/components/EditableSpan/index.jsx
  4. 1 2
      src/common/components/InspectCommon/index.less
  5. 2 2
      src/common/components/ItemBox/index.jsx
  6. 3 1
      src/common/components/NumberPan/index.jsx
  7. 20 14
      src/common/components/SearchOption/index.jsx
  8. 2 2
      src/common/components/SearchOption/index.less
  9. 2 1
      src/common/js/func.js
  10. 11 4
      src/common/less/variables.less
  11. 2 1
      src/components/AddAssistCheck/Textarea/index.jsx
  12. 2 2
      src/components/AddAssistCheck/Textarea/index.less
  13. 4 24
      src/components/AddAssistCheck/index.jsx
  14. 8 49
      src/components/AddAssistCheck/index.less
  15. 0 1
      src/components/AddInspect/index.jsx
  16. 1 1
      src/components/AddInspect/index.less
  17. 6 6
      src/components/Banner/index.jsx
  18. 14 17
      src/components/CheckBody/index.jsx
  19. 8 6
      src/components/CurrentIll/index.jsx
  20. 17 2
      src/components/InfoTitle/index.jsx
  21. 1 1
      src/components/InfoTitle/index.less
  22. 1 1
      src/components/Inspect/index.jsx
  23. 4 6
      src/components/Inspect/index.less
  24. 6 3
      src/components/MultSpread/index.jsx
  25. 15 8
      src/components/NumberDrop/index.jsx
  26. 28 31
      src/components/Operation/index.jsx
  27. 3 0
      src/components/Operation/index.less
  28. 8 4
      src/components/OtherHistory/index.jsx
  29. 230 161
      src/components/PreviewBody/index.jsx
  30. 5 106
      src/components/PreviewBody/index.less
  31. 15 106
      src/components/PrintPreview/index.jsx
  32. 15 9
      src/components/PushContainer/index.jsx
  33. 1 1
      src/components/PushContainer/index.less
  34. 2 0
      src/components/SearchDrop/index.less
  35. 4 2
      src/components/SpreadDrop/index.jsx
  36. 2 2
      src/components/SpreadDrop/index.less
  37. 5 2
      src/containers/CheckBody.js
  38. 13 9
      src/containers/CurrentIll.js
  39. 18 2
      src/containers/EditableSpan.js
  40. 3 0
      src/containers/MainSuit.js
  41. 6 6
      src/containers/NumberDrop.js
  42. 4 2
      src/containers/OtherHistory.js
  43. 2 0
      src/containers/TypeConfigContainer.js
  44. 1 1
      src/containers/eleType.js
  45. 5 5
      src/modules/HomePage/index.jsx
  46. 43 22
      src/store/actions/checkBody.js
  47. 71 25
      src/store/actions/currentIll.js
  48. 60 11
      src/store/actions/mainSuit.js
  49. 45 19
      src/store/actions/otherHistory.js
  50. 9 1
      src/store/async-actions/fetchModules.js
  51. 2 1
      src/store/async-actions/patInfo.js
  52. 4 3
      src/store/async-actions/tabTemplate.js
  53. 1 1
      src/store/async-actions/treat.js
  54. 5 5
      src/store/reducers/assistCheck.js
  55. 4 2
      src/store/reducers/checkBody.js
  56. 5 3
      src/store/reducers/currentIll.js
  57. 6 3
      src/store/reducers/mainSuit.js
  58. 1 0
      src/store/types/currentIll.js
  59. 1 0
      src/store/types/mainSuit.js
  60. 7 3
      src/utils/tools.js

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

@@ -134,20 +134,20 @@ class ConfirmModal extends Component {
                         <div className={styles['modal-content']}>{children}</div>
                         {noFooter ? '' : <div className={styles['modal-operator']+' clearfix'}>
                             <div className={styles['modal-btn-box']}>
-                                <button 
+                                <div 
                                     onClick={this.confirm} 
                                     className={styles['modal-operator-confirm']}
                                     style={{borderColor: okBorderColor, background: oKBg, color: okColor}}>
                                     { okText}
-                                </button>
+                                </div>
                             </div>
                             <div className={styles['modal-btn-box']}>
-                                <button 
+                                <div 
                                 onClick={this.cancel} 
                                 className={styles['modal-operator-close']}
                                 style={{borderColor: cancelBorderColor, background: cancelBg, color: cancelColor}}>
                                 { cancelText}
-                            </button>
+                            </div>
                             </div>
                         </div>}
                     </div>

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

@@ -46,7 +46,7 @@
     outline: none;
     margin: auto;
     height: 34px;
-    line-height: 24px;
+    line-height: 32px;
     opacity: 1;
     color: #fff;
     cursor: pointer;

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

@@ -35,6 +35,7 @@ class EditableSpan extends Component{
     this.handleBlur = this.handleBlur.bind(this);
     this.handleKeydown = this.handleKeydown.bind(this);
     this.handleKeyup = this.handleKeyup.bind(this);
+    this.moveEnd = this.moveEnd.bind(this);
   }
   handleFocus(e){
     e.stopPropagation();
@@ -50,7 +51,7 @@ class EditableSpan extends Component{
   onChange(e){
     e.stopPropagation();
     const {handleChange,boxMark,i,handleSearch,value,mainSaveText,mainIds} = this.props;
-    const {labelVal,oldText,searchPre} = this.state;
+    const {labelVal,searchPre} = this.state;
     const text1 =e.target.innerText;
     let mainText = filterArr(mainSaveText);//主诉字数
     if(+boxMark==1){
@@ -80,17 +81,18 @@ class EditableSpan extends Component{
     clearTimeout(this.state.timer);
     const timer = setTimeout(function(){
       let newText = e.target.innerText;
-      let temp = '';
+      let temp = '',isEnd=false;
       let search='';
       clearTimeout(that.state.timer);
-      // temp = newText.replace(oldText.replace(/(^\s*)|(\s*$)/g,''),'');
-      temp = newText.replace(searchPre.replace(/(^\s*)|(\s*$)|(^\,*)|(\,*$)/g,''),'');
-      search = temp.replace(/(^\s*)|(\s*$)|(^\,*)|(\,*$)/g,'');
-      // console.log(111,labelVal,searchPre,333,newText,444,search);
-      handleSearch&&handleSearch({text:search,boxMark,mainIds});
-      /*that.setState({
-        oldText:newText.replace(search,'')
-      })*/
+      temp = newText.replace(searchPre,'');
+      isEnd = !(newText.indexOf(searchPre)>0);
+      search = temp.replace(/[(^\s*)|(\s*$)|(^\,*)|(\,*$)]/g,'');
+      //console.log(labelVal,'旧:',searchPre,'新:',newText,'搜索:',search);
+      handleSearch&&handleSearch({text:search,isEnd,boxMark,mainIds});
+      //搜索后保持现在的值,继续输入时要用于对比
+      that.setState({
+        searchPre:newText
+      });
     },config.delayTime);
     this.setState({
       timer
@@ -110,10 +112,34 @@ class EditableSpan extends Component{
     });
   }
 
+  moveEnd(obj) {
+    obj.focus();
+    if($.support.msie)
+    {
+        var range = document.selection.createRange();
+        this.last = range;
+        range.moveToElementText(obj);
+        range.select();
+        document.selection.empty(); //取消选中
+    }
+    else
+    {
+        var range = document.createRange();
+        range.selectNodeContents(obj);
+        range.collapse(false);
+        var sel = window.getSelection();
+        sel.removeAllRanges();
+        sel.addRange(range);
+    }
+  }
+
   handleKeydown(e){
     const ev = e||window.event;
     const target = ev.target||ev.srcElement;
     let innerVal = target.innerText;
+    /*if(this.props.full){
+      return false;
+    }*/
     //禁止回车事件
     if(ev.keyCode==13){return false;}
     //backspace事件
@@ -126,21 +152,34 @@ class EditableSpan extends Component{
 
   }
   handleKeyup(e){
-     const {boxMark,handleKeydown,i,value} = this.props;
-     const {preVal,index} = this.state;
+    const {boxMark,handleKeydown,i,value,removeId} = this.props;
+    const {preVal,index} = this.state;
     const ev = e||window.event;
     const target = ev.target||ev.srcElement;
     let innerVal = target.innerText;
     if(ev.keyCode==8){
+      // 主诉现病史去重:删除最后一个字的时候移除该数据(将name、id和value替换成空)并移除id
+      let pattern1 = new RegExp(/^\,|^\,|^\.|^\。|^\、|^\;|^\;|^\:|^\:/);
+      if(pattern1.test(preVal)){//以标点开头的情况-现病史
+        if(preVal.trim().length==2){
+          removeId && removeId({boxMark,i:index,text:""});
+        }
+      }else{
+        if(preVal.trim().length==1){
+          removeId && removeId({boxMark,i:index,text:""});
+        }
+      }
+      
       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)){
+        let preObj = $(this.$span.current).prev();
+        let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
         handleKeydown&&handleKeydown({boxMark,i:index,text:data});
+        this.moveEnd(obj[0]);  
         this.setState({
-          // index:index-1 //连续往前删除,体验不佳
           index: null
         })
       }
@@ -171,7 +210,7 @@ class EditableSpan extends Component{
   }
 
   render() {
-    return <span className={style['editable-span']}
+    return <span className={style['editable-span']+(this.props.full?' '+style['full']:'')}
                       contentEditable='true'
                       ref={this.$span}
                       onInput={this.onChange}

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

@@ -8,9 +8,8 @@
     min-width: 300px;
     max-width: 600px;
     box-sizing: border-box;
-    box-shadow: 0 6px 20px 0 #989DA3;
     margin-bottom: 80px;
-    // border: 1px solid #989DA3;
+    .llStyle;
 }
 .btnWrap{
     span {

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

@@ -33,7 +33,7 @@ class ItemBox extends Component {
   }
   handleInput(e){
     const {onchange,data} = this.props;
-    if(data&&data.length==0){//避免结构化下触发onchange,导致下拉要点两下
+    if((data&&data.length==0)||!data){//避免结构化下触发onchange,导致下拉要点两下
       onchange&&onchange(e)
     }
   }
@@ -49,7 +49,7 @@ class ItemBox extends Component {
   render(){
     const {title,children,editable,className,handleFocus,onchange,fuzhen,border,handleBlur,titleTop,backgroundColor} = this.props;
     return <div className={style["box"]+" "+"clearfix"} >
-      <div className={style["title"] + ' ' + className} style={{marginTop:titleTop?'22px':''}}>{title}</div>
+      <div className={style["title"] + ' '+(className||'')} style={{marginTop:titleTop?'22px':''}}>{title}</div>
       <div ref={this.$div} className={`${style["content"]} ${border?style["border"]:''} ${backgroundColor?style["noBorder"]:''}`} contentEditable={editable} style={this.getBoxStyle()} onFocus={handleFocus} onInput={this.handleInput} onClick={(e)=>{this.handleClick(e);}} onBlur={handleBlur}>
         {fuzhen?children||fuzhen:children}
       </div>

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

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

+ 20 - 14
src/common/components/SearchOption/index.jsx

@@ -46,9 +46,22 @@ class SearchOption extends React.Component {
         });
         handleChangeValue('');
     }
-
+    handleInput(e){
+      if((e.target.value).trim() != ''){
+          this.props.handleChangeValue(e.target.value);
+          this.setState({
+              val:e.target.value,
+              show:true
+          })
+      }else{
+          this.handleClearVal()
+          this.setState({
+              show:false
+          })
+      }
+    }
     render() {
-        const { handleChangeValue,children,visible } = this.props;
+        const { children,visible } = this.props;
         const { show } = this.state;
         return (
             <div id="searchOption" className={visible?`${styles.search} ${styles.show} searchOption`:`${styles.search} ${styles.hide} searchOption`}>
@@ -67,18 +80,11 @@ class SearchOption extends React.Component {
                         }
                     }}
                     onBlur={()=>{this.setState({border:false,val:''})}}
-                    onKeyUp={(e) => { 
-                        if((e.target.value).trim() != ''){
-                            handleChangeValue(e.target.value);
-                            this.setState({
-                                val:e.target.value,
-                                show:true
-                            })
-                        }else{
-                            this.setState({
-                                show:false
-                            })
-                        }
+                    onInput={(e) => { 
+                        this.handleInput(e)
+                    }}
+                    onPropertyChange={(e) => {  // 兼容ie
+                        this.handleInput(e)
                     }}
                     placeholder="搜索"
                 />

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

@@ -8,8 +8,8 @@
     top: 40px;
     z-index: 99;
     background-color: #fff;
-    box-shadow: 0 6px 20px 0 #989DA3;
     margin-bottom: 80px;
+    .llStyle;
     .autoList {
         max-height: 225px;
         min-height: 80px;
@@ -47,4 +47,4 @@
 }
 .hide {
     display: none;
-}
+}

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

@@ -121,7 +121,8 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       }else{    //本身是或者前面是文本标签时,前面不添加文本标签
         newArr.push(it);
         tempText = value?it.labelPrefix+value+it.labelSuffix:'';
-        tempText = notText?tempText:it.value||it.name;
+        // tempText = notText?tempText:it.value||it.name;
+        tempText = notText?tempText:(it.value||it.value==""?it.value:it.name);
         saveText.push(tempText);
       }
       if(notText&&!noEnd&&i===arr.length-1){//最后一个非文本标签,后面添加一个文本标签

+ 11 - 4
src/common/less/variables.less

@@ -77,15 +77,15 @@
   text-align: left;
   border: none;
   color:#000000;
-  padding-left: 40px;
+  /*padding-left: 40px;*/
   cursor: pointer;
   background: rgba(59,158,208,0.1);
   background-image: url(../images/first.png);
   background-repeat: no-repeat;
-  background-position: 20px 10px;
+  background-position: 0px 10px;
 }
 .clear{
-  width: 88px;
+  width: 60px;
   height: 44px;
   line-height: 44px;
   font-size: 12px;
@@ -96,6 +96,7 @@
   outline: none;
   text-align: center;
   cursor: pointer;
+  margin-left: 22px;
 }
 .confirm{
   width: 120px;
@@ -147,11 +148,17 @@
   color: unset!important;
   border:none!important;
   &:before,&:after{
-  content: unset!important;
+  content: ''!important;
 }
   /*color: @placeholder-color;*/
 }
 
 .hide{
   display: none!important;
+}
+
+.llStyle{
+  box-shadow: 0 10px 20px 0 #989DA3;
+  filter:progid:DXImageTransform.Microsoft.Shadow(color='#989DA3',Direction=125,Strength=6);
+  border: 1px solid #f3f0f0;
 }

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

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

+ 2 - 2
src/components/AddAssistCheck/Textarea/index.less

@@ -4,8 +4,8 @@
   max-height: 100px;
   border-bottom: 1px dashed #333;
   box-sizing: border-box;
-  min-height: 20px;
-  width: 100%;
+  // min-height: 20px;
+  // width: 100%;
   outline: none;
   line-height: 20px;
   resize: none;

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

@@ -108,27 +108,11 @@ class AddAssistCheck extends React.Component {
         return <ul className={styles.labelWrap} id="datePick">
             {
                 assistLabel.map((item,idx) => {
-                    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)=>{
-                                    handleChangeAssistValue(e.target.value,idx,e)
-                                    if(e.target.value.trim() == '') {
-                                        e.target.style.height = '18px';
-                                        return;
-                                    }
-                                    e.target.style.height = e.targetv.scrollHeight+'px';
-                                }}
-                                value={item.value}
-                                // onFocus={(e)=>{e.target.style.height = e.target.scrollHeight+'px';}}
-                                onKeyUp={(e)=>{handleChangeAssistValue(e.target.value,idx,e)}} 
-                                placeholder="报告描述或意见"
-                            ></textarea> */}
+                    return (<li key={item.id} className={styles.assistLists}>
+                        <span className={styles.assistName}>{item.name}:</span>
+                        <div className={styles.textareaWrap}>
                             <Textarea value={item.value} handlePush={handlePush} isRead={isRead} handleChangeAssistValue={handleChangeAssistValue} idx={idx}></Textarea>
-                        </p>
+                        </div>
                         <div className={styles.pointerFinger}>
                             <p onClick={()=>this.handleShowDate(idx)}>报告日期:<span>{item.time || this.state.dateTime}</span></p>
                             <i onClick={()=>this.handleShowDate(idx)}></i>
@@ -137,14 +121,10 @@ class AddAssistCheck extends React.Component {
                                 <Calendar isShow={true} handleChange={(info)=>{handleChangeDate(info,idx);this.setState({date:false})}}></Calendar>
                             </div>
                         </div>
-                        {/* <p className={styles.iptWrap}> */}
-                            {/* <input type="text" onChange={(e)=>{handleChangeAssistValue(e.target.value,idx)}} placeholder={"报告描述或意见"}/> */}
-                        {/* </p> */}
                     </li>)
                 })
             }
         </ul>
-        
     }
     render() {
         const { handleChangeValue, list } = this.props;

Datei-Diff unterdrückt, da er zu groß ist
+ 8 - 49
src/components/AddAssistCheck/index.less


+ 0 - 1
src/components/AddInspect/index.jsx

@@ -155,7 +155,6 @@ class Inspect extends React.Component {
                 if(tempNumPlus == tempArr.details.length){
                     tempArr.show = false;
                 }
-                   
             }
         }
         tempArr.time = this.state.dateTime;

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

@@ -1,6 +1,6 @@
 @import "~@less/variables.less";
 .labelWrap>li {
-    cursor: pointer;
+    // cursor: pointer;
     color: #767676;
     position: relative;
     padding-top: 10px;

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

@@ -11,7 +11,7 @@ class Banner extends Component {
     super(props)
     this.state = {
       mode: props.typeConfig,
-      zIndex:40
+      zIndex:204
     };
     this.showConfigModal = this.showConfigModal.bind(this);
     this.closeConfigModal = this.closeConfigModal.bind(this);
@@ -22,7 +22,7 @@ class Banner extends Component {
   showConfigModal(){
     this.setState({
       mode:this.props.typeConfig,
-      zIndex:202
+      zIndex:206
     });
     this.props.showConfigModal()
   }
@@ -30,7 +30,7 @@ class Banner extends Component {
   closeConfigModal(){
     this.props.closeConfigModal();
     this.setState({
-      zIndex:40
+      zIndex:204
     })
   }
 
@@ -50,7 +50,7 @@ class Banner extends Component {
     confirmType&&confirmType(mode);
     this.closeConfigModal()
     this.setState({
-      zIndex:40
+      zIndex:204
     })
   }
   /*componentDidUpdate(){
@@ -61,12 +61,12 @@ class Banner extends Component {
     }
   }*/
   render() {
-    const {visible} = this.props;
+    const {visible,disVisible,copyVisible} = this.props;
     const {mode,zIndex} = this.state;
     const {showConfigModal, closeConfigModal, changeType, confirmType} = this;
 
     return (
-      <div className={style["logo"]} style={{zIndex:zIndex}}>
+      <div className={style["logo"]} style={{zIndex:disVisible||copyVisible?40:zIndex}}>
         <img src={logo} />
         <span>|&nbsp;&nbsp;智能辅助临床决策系统</span>
         <div className={style["buon"]} onClick={showConfigModal}>

+ 14 - 17
src/components/CheckBody/index.jsx

@@ -15,7 +15,7 @@ class CheckBody extends Component{
     this.handleClick = this.handleClick.bind(this);
     this.handleSearchSelect = this.handleSearchSelect.bind(this);
     this.getData = this.getData.bind(this);
-    this.handleInput = this.handleInput.bind(this);
+    //this.handleInput = this.handleInput.bind(this);
   }
   getLabels(){
     const {data,showArr,saveText,selecteds} = this.props;
@@ -38,8 +38,11 @@ class CheckBody extends Component{
     if(totalHide){
       return ;
     }
-    let boxLeft = e.pageX -102 + 'px';
-    let boxTop =  (+e.target.offsetTop+22)+'px';
+    //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
+    const ele = document.activeElement;
+    const height = ele.offsetHeight;
+    let boxTop = (+(ele.offsetTop)+height)+'px';
+    let boxLeft = ele.offsetLeft + 'px';
     this.setState({
       boxLeft:boxLeft,
       boxTop:boxTop
@@ -47,34 +50,28 @@ class CheckBody extends Component{
   }
   handleSearchSelect(obj){
    const {questionId,name} = obj;
-   const {fetchModules,focusTextIndex,span} = this.props;//console.log(focusTextIndex)
-    fetchModules&&fetchModules({id:questionId,index:focusTextIndex,name,span});
+   const {fetchModules,focusTextIndex,span,searchInEnd} = this.props;
+    fetchModules&&fetchModules({id:questionId,index:focusTextIndex,name,span,searchInEnd});
   }
   getData(){
     //第一次聚焦查体时,主诉有数据则调接口,主诉无数据则显示提示;其他时间查体模板数据不调接口
-    const {hasMain,saveText,data,fetchPushInfos} = this.props;
+    const {hasMain,saveText,data,isEmpty} = this.props;
     const hasData = saveText.join("")||data.length>0;
 
-    if(hasData){
+    if(!hasMain&&isEmpty){          //无主诉且本身无数据时,点击提示(空白页、清空)
+      Notify.error("无法操作,请先输入主诉");
       return ;
     }
-    if(hasMain){
+    //有主诉时且本身无数据,第一次点击获取数据,(不论获取成功与否)再点击不获取(直到刷新成空白页或清空)
+    if(hasMain&&isEmpty){
       this.props.getInit();
-    }else{
-      Notify.error("无法操作,请先输入主诉");
-    }
-
-  }
-  handleInput(e){  //主诉未填无法输入
-    if(!this.props.hasMain){
-      e.target.innerText='';
     }
   }
   render(){
     const {searchData,totalHide,data} = this.props;
     const {boxLeft,boxTop,boxMark} = this.state;
     return  <div className={style['container']}>
-      <ItemBox title='查体' editable={!data.length}  handleClick={this.handleClick} onchange={this.handleInput}>
+      <ItemBox title='查体' handleClick={this.handleClick}>
         {this.getLabels()}
         {searchData && searchData.length>0?<SearchDrop data={searchData} show={!totalHide} left={boxLeft} top={boxTop} onSelect={this.handleSearchSelect}></SearchDrop>:''}
       </ItemBox>

+ 8 - 6
src/components/CurrentIll/index.jsx

@@ -34,7 +34,7 @@ class CurrentIll extends Component{
 
   handleFocus(e){
     // 判断主诉是否为空
-    const {mainData,mainText,setData,moduleNum,mainIds,data,changeEditIll,editClear} = this.props;
+    const {mainData,mainText,setData,moduleNum,mainIds,data,changeEditIll,editClear,mainSymptIds} = this.props;
     const that = this;
     let mainFinallyText = filterDataArr(mainText);
     // if(mainData.length == 0 && !mainText[0]){
@@ -45,7 +45,8 @@ class CurrentIll extends Component{
         forbidInput:true
       })
     }else {
-      let useEmpty = mainData.length>0?false:true;
+      // let useEmpty = mainData.length>0?false:true;
+      let useEmpty = mainSymptIds.length>0?false:true;
       let num = moduleNum.num;//主诉使用了几个模板
       // if(editClear && data.length==0){//第一次聚焦去设置现病史的data
       if(data.length==0){//第一次聚焦去设置现病史的data
@@ -76,10 +77,11 @@ class CurrentIll extends Component{
 
   handleClick(e){//让搜索框跟随鼠标点击移动
     // e.stopPropagation(); //冒泡到最顶层关闭其他下拉
-    let boxLeft = e.pageX -62 + 'px';
-    // let boxTop = e.pageY - 164 + 'px';console.log(124,e.pageY,boxTop);
-    let offsetTop = e.target.offsetTop;
-    let boxTop = offsetTop + 28 + 'px';
+    //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
+    const ele = document.activeElement;
+    const height = ele.offsetHeight;
+    let boxTop = (+(ele.offsetTop)+height)+'px';
+    let boxLeft = +ele.offsetLeft+90 + 'px';
     this.setState({
       boxLeft:boxLeft,
       boxTop:boxTop

+ 17 - 2
src/components/InfoTitle/index.jsx

@@ -1,6 +1,7 @@
 import React, { Component } from "react";
 import PatInfoContainer from '@containers/PatInfoContainer.js';
 import style from "./index.less";
+import { connect } from 'react-redux';
 import historyCase from '@common/images/history.png';
 import health from '@common/images/health.png'
 import store from '@store';
@@ -18,7 +19,8 @@ class InfoTitle extends Component {
         store.dispatch(showHistory(true))
     }
     render() {
-        return <div className={style['title-wrapper']} >
+        const {disVisible,copyVisible} = this.props;
+        return <div className={style['title-wrapper']} style={{zIndex:disVisible||copyVisible?40:204}}>
             <PatInfoContainer />
             <div className={style["operations"]} onClick={this.showHistoryBox}>
                 <span><img src={historyCase} />&nbsp;历史病历</span>
@@ -30,5 +32,18 @@ class InfoTitle extends Component {
         </div>;
     }
 }
+function mapStateToProps(state) {
+  return {
+    disVisible: state.copyRight.disVisible,
+    copyVisible:state.copyRight.copyVisible
+  }
+}
+
+const InfoTitleCont = connect(
+  mapStateToProps,
+  null
+)(InfoTitle);
+
+
 
-export default InfoTitle;
+export default InfoTitleCont;

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

@@ -9,7 +9,7 @@
   left: 10px;
   top: 50px;
   right: 480px;
-  z-index: 200;
+  z-index: 204;
 }
 .operations, .health{
   float: left;

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

@@ -150,7 +150,7 @@ class Inspect extends React.Component {
                     <span>化验结果数据</span>
                     <div className={this.getStyle()} onClick={ieVersion&&ieVersion<=9?null:this.handleImportExcel}>
                        {/* <button disabled={ieVersion&&ieVersion>9?true:false}>导入化验结果</button>*/}
-                        <button>导入化验结果</button>
+                        <div className={styles.pushButton}>导入化验结果</div>
                         <input type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} />
                     </div>
                 </div>

+ 4 - 6
src/components/Inspect/index.less

@@ -31,14 +31,13 @@
             color:@placeholder-color;
         }
     }
-    button {
-        outline: none;
+    .pushButton {
         font-size: 12px;
         padding: 0 8px;
         background-color: #fff;
         height: 28px;
-        line-height: 30px;
-        border: 0 none;
+        line-height: 28px;
+        border-radius: 5px;
         color: @template-color;
     }
 }
@@ -59,12 +58,11 @@
     width: 100px;
     height: 34px;
     line-height: 34px;
-    margin: 0 auto;
+    margin: 10px auto;
     background-color: #78bddd;
     border-radius: 5px;
     text-align: center;
     color: #fff;
-    margin-bottom: 20px;
     cursor: pointer;
 }
 

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

@@ -39,9 +39,12 @@ class MultSpread extends Component{
   }
   getLabels(){
     const {data,ikey,showArr,copyId} = this.props;
+    const {editable}= this.state;
+    let show = false;
     let inx = '';
     const list = data.map((it,i)=>{
       inx=ikey+''+i;
+      show = editable?false:showArr&&showArr[inx];
       switch (+it.controlType){
         case 0:
         case 1:
@@ -50,7 +53,7 @@ class MultSpread extends Component{
                             prefix={it.labelPrefix}
                             suffix={it.labelSuffix}
                             placeholder={it.name}
-                            show={showArr&&showArr[inx]}
+                            show={show}
                             value = {it.value}
                             ikey={inx}
                             id={it.id}
@@ -62,7 +65,7 @@ class MultSpread extends Component{
                                placeholder={it.name}
                                boxMark={ikey.substr(0,1)}
                                id={it.id}
-                               show={showArr&&showArr[inx]}
+                               show={show}
                                ikey={inx}
                                value={it.value}
                                hideTag={true}></NumberUnitDrop>;
@@ -78,7 +81,7 @@ class MultSpread extends Component{
           return <NumberDrop prefix={it.labelPrefix}
                              suffix={it.labelSuffix}
                              placeholder={it.name}
-                             show={showArr&&showArr[inx]}
+                             show={show}
                              ikey={inx}
                              id={it.id}
                              patId = {copyId}

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

@@ -23,6 +23,8 @@ class NumberDrop extends Component{
       isClosed:false
     };
     this.$span = React.createRef();
+    this.$pre = React.createRef();
+    this.$suf = React.createRef();
     this.select = this.select.bind(this);
     this.numInpBlur = this.numInpBlur.bind(this);
     this.handleSpanInp = this.handleSpanInp.bind(this);
@@ -81,8 +83,9 @@ class NumberDrop extends Component{
       numEditable:true,
       hasSelect:false
     });
+    const val = e.target.innerText.replace(/^\s*/,'');
     const {handleSelect,ikey,suffix,prefix,mainSaveText,placeholder} = this.props;
-    const text = e.target.innerText===placeholder?'':e.target.innerText;
+    const text = val===placeholder?'':val;
     e.target.innerText = '';      //避免出现重复输入值
     handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
   }
@@ -110,14 +113,17 @@ class NumberDrop extends Component{
     }
   }
   handleBlur(e){     //双击编辑blur
-    const {handleLabelChange,ikey,boxMark} = this.props;
+    const {handleLabelChange,ikey,boxMark,value} = this.props;
     //if(!this.state.editable) return;
     this.setState({
       editable: false
     });
     let totalVal = e.target.innerText;
-    let changeVal = this.props.value;
-    handleLabelChange && handleLabelChange({ikey,changeVal,type:boxMark,totalVal});
+    let changeVal = this.$span.current.innerText.replace(/^\s*/,'');//数字框值-修改后;去掉前空格避免多空格叠加
+    let prefix = this.$pre.current.innerText.replace(/^\s*/,''); //前缀值-修改后
+    let suffix = this.$suf.current.innerText.replace(/^\s*/,''); //后缀值-修改后
+    //console.log('数字框:'+changeVal,";全部:"+totalVal,";前缀:"+prefix+";后缀:"+suffix);
+    handleLabelChange && handleLabelChange({ikey,changeVal,type:boxMark,totalVal,prefix,suffix});
   }
   getSpanClass(){       //将被替换的文字选中状态显示
     const {hasSelect} = this.state;
@@ -129,9 +135,10 @@ class NumberDrop extends Component{
     const {numEditable,editable,hasSelect} = this.state;
     return <div className={this.getClasses()}
                 onDoubleClick={this.changeToEdit}
-                onBlur={this.handleBlur} contentEditable={editable}
+                contentEditable={editable}
+                onBlur={this.handleBlur}
                 onkeydown={handleEnter}>
-      <span>&nbsp;{prefix}</span>
+      <span ref = {this.$pre}>&nbsp;{prefix}</span>
       <span onFocus={this.handleNumFocus}
             onClick={this.handleNumClick}
             contentEditable={numEditable}
@@ -140,8 +147,8 @@ class NumberDrop extends Component{
             onBlur={this.numInpBlur}
             onInput={this.handleSpanInp}
             className={this.getSpanClass()}
-            onkeydown={handleEnter}>{value||placeholder}</span>
-      <span>&nbsp;{suffix}</span>
+            onkeydown={handleEnter}>&nbsp;{value||placeholder}</span>
+      <span ref = {this.$suf}>&nbsp;{suffix}</span>
       <NumberPan handleSelect={(text)=>this.select(text)}
                  onClose={handleHide}
                  show={show} toClear={!hasSelect}/>

+ 28 - 31
src/components/Operation/index.jsx

@@ -143,11 +143,19 @@ class Operation extends Component {
       title: val
     })
   }
+  handleInput(e){
+    let val = e.target.value
+    if(e.target.value.length > 30){
+        e.target.value = val.substring(0,30)
+        this.onchange(val.substring(0,30))
+    }else{
+        this.onchange(e.target.value)
+    }
+  }
   keypress(event) {
     let e = event?event:window.event;
     if (e.keyCode == 13) {
-      // this.makeSure()
-      // store.dispatch(changeVisible(false))
+      this.makeSure()
     }
   }
   saveHis(type) {
@@ -172,14 +180,15 @@ class Operation extends Component {
     let jsonStr = getAllDataStringList(baseList);
     let whichSign = baseList.typeConfig.typeConfig;
     let tmpLis = baseList.tabTemplate.items;
-    if (whichSign == 0) {
-      for(let i = 0;i <tmpLis.length;i++){
-        let dataStr = tmpLis[i].dataJson;
-        if(dataStr == JSON.stringify(jsonData)){
-          Notify.info('该模板已保存');
-          return false;
-        }
+    for(let i = 0;i <tmpLis.length;i++){
+      let dataStr = tmpLis[i].preview;
+      let jsStr = tmpLis[i].dataJson;
+      if(JSON.stringify(JSON.parse(dataStr)) == JSON.stringify(jsonStr) && jsStr == JSON.stringify(jsonData)){
+        Notify.info('该模板已保存');
+        return false;
       }
+    }
+    if (whichSign == 0) {
       if (
         JSON.stringify(jsonData.advice) == '{}' &&
         (jsonData.chief.length < 1 && jsonStr.chief == '[]') &&
@@ -197,15 +206,6 @@ class Operation extends Component {
         return true;
       }
     } else if(whichSign == 1) {
-      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 == '[]' && 
@@ -231,14 +231,11 @@ class Operation extends Component {
         placeholder="请输入模板名称"
         type="text"
         maxLength='30'
-        onChange={(e) => {
-          let val = e.target.value
-          if (e.target.value.length > 30) {
-            e.target.value = val.substring(0, 30)
-            this.onchange(val.substring(0, 30))
-          } else {
-            this.onchange(e.target.value)
-          }
+        onInput={(e) => {
+          this.handleInput(e)
+        }}
+        onPropertyChange={(e) => {  // 兼容ie
+          this.handleInput(e)
         }}
         onKeyPress={e => this.keypress(e)}
       />
@@ -281,11 +278,11 @@ class Operation extends Component {
     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>
-      <button className={style['preButton']} onClick={() => { this.saveHis(3) }}><img src={saveHistory} /> 保存病历模板</button>
-      <button className={style['saveButton']} onClick={() => { this.saveAll(1) }}>保存</button>
-      <button className={`${style['clearButton']} ${style['saveButton']}`} onClick={() => { this.clearAll(2) }}>清除</button>
+      <span className={style['button']} onClick={showPrint}><img src={printImg} /> 打印病历</span>
+      <span className={style['preButton']} onClick={showPreview}><img src={preview} /> 预览</span>
+      <span className={style['preButton']} onClick={() => { this.saveHis(3) }}><img src={saveHistory} /> 保存病历模板</span>
+      <span className={style['saveButton']} onClick={() => { this.saveAll(1) }}>保存</span>
+      <span className={`${style['clearButton']} ${style['saveButton']}`} onClick={() => { this.clearAll(2) }}>清除</span>
       <PrintPreviewContainer visible={visible} onClose={closePrint} />
       <PreviewContainer visible={preVisible} onClose={closePreview} />
       <ConfirmModal

+ 3 - 0
src/components/Operation/index.less

@@ -45,11 +45,14 @@
     .saveButton {
         width: 80px;
         height: 34px;
+        line-height: 32px;
+        text-align: center;
         outline: none;
         border-radius: 4px;
         cursor: pointer;
         color: #000;
         border: 1px solid #3B9ED0;
+        box-sizing: border-box;
         background: #fff;
         margin-left:20px;
         background: #3B9ED0;

+ 8 - 4
src/components/OtherHistory/index.jsx

@@ -26,8 +26,8 @@ class OtherHistory extends Component{
   }
   handleSearchSelect(obj){
     const {questionId,name} = obj;
-    const {fetchModules,focusTextIndex,span} = this.props;
-    fetchModules&&fetchModules({id:questionId,index:focusTextIndex,name,span});
+    const {fetchModules,focusTextIndex,span,searchInEnd} = this.props;
+    fetchModules&&fetchModules({id:questionId,index:focusTextIndex,name,span,searchInEnd});
   }
   getLabels(){
     const {data,showArr,selecteds,saveText} = this.props;
@@ -51,6 +51,7 @@ class OtherHistory extends Component{
       return;
     }
     if(+type===0&&!hasMain){
+      document.activeElement.blur();        //修改第一次提示后不再提示bug
       Notify.error("无法操作,请先输入主诉");
       return;
     }
@@ -69,8 +70,11 @@ class OtherHistory extends Component{
     //e.stopPropagation();
     const {fetchPushInfos} = this.props;
     //fetchPushInfos&&fetchPushInfos();
-    let boxLeft = e.pageX - 102 + 'px';
-    let boxTop = (+e.target.offsetTop+22)+'px';
+    //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
+    const ele = document.activeElement;
+    const height = ele.offsetHeight;
+    let boxTop = (+(ele.offsetTop)+height)+'px';
+    let boxLeft = ele.offsetLeft + 'px';
     this.setState({
       boxLeft:boxLeft,
       boxTop:boxTop

+ 230 - 161
src/components/PreviewBody/index.jsx

@@ -1,6 +1,64 @@
 import React, { Component } from "react";
 import style from "./index.less";
 import $ from "jquery";
+
+(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: "0px", 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();
+  }
+})($);
+
 import {filterDataArr} from '@utils/tools'
 class PreviewBody extends Component {
     constructor(props) {
@@ -11,6 +69,7 @@ class PreviewBody extends Component {
         this.$content = React.createRef();
         this.normalVal = this.normalVal.bind(this);
         this.getCurrentDate = this.getCurrentDate.bind(this);
+        this.onPrint = this.onPrint.bind(this);
     }
     componentDidMount(){
         this.getCurrentDate();
@@ -18,6 +77,15 @@ class PreviewBody extends Component {
     componentWillReceiveProps(){
         $(this.$content.current)[0].scrollIntoView(true);
     }
+    onPrint() {
+      $("#content").jqprint({
+          debug: false,
+          importCSS: true,
+          printContainer: true,
+          operaSupport: false,
+      });
+      this.props.onClose()
+  }
     getCurrentDate(){
         let myDate = new Date();
         let year = myDate.getFullYear();       //获取完整的年份(4位,1970-????)
@@ -45,183 +113,184 @@ class PreviewBody extends Component {
         if(val.questionDetailList.length > 0){
             return val.questionDetailList.map((item)=>{
                 if(val.value == item.name){
-                    return <td style={{width:'23%'}}><span className={item.abnormal != '0' ?"red":'' }>{val.value}</span> { val.labelSuffix}</td>
+                    return <td style={{width:'23%'}}><span style={{color:item.abnormal != '0' ?"red":null}}>{val.value}</span> { val.labelSuffix}</td>
                 }
             })
         }else{
-            return <td style={{width:'23%'}}><span className={val.value > val.maxValue || val.value < val.minValue?"red":''}>{val.value}</span> { val.labelSuffix}</td>
+            return <td style={{width:'23%'}}><span style={{color:val.value > val.maxValue || val.value < val.minValue?"red":null}}>{val.value}</span> { val.labelSuffix}</td>
         }
     }
     render() {
         const { show, preInfo, dataJson, dataStr,baseObj } = this.props;
 
         return <div className={style['content']}>
-            <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>
-                    <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>姓名:{baseObj?baseObj.patientName:JSON.stringify(preInfo) == '{}'?'':preInfo.patientName}</td>
-                    <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>年龄:{baseObj?baseObj.patientAge:JSON.stringify(preInfo) == '{}'?'':preInfo.patientAge}</td>
-                    <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>性别:{baseObj?baseObj.patientSex:JSON.stringify(preInfo) == '{}'?'':preInfo.patientSex}</td>
-                </tr>
-                <tr>
-                    <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>就诊时间:{baseObj?baseObj.inquiryDate:(JSON.stringify(preInfo) == '{}'?'':preInfo.systemTime.split(' ')[0])}</td>
-                    <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>科室:{baseObj?baseObj.hospitalDeptName:(JSON.stringify(preInfo) == '{}'?'':preInfo.hospitalDeptName)}</td>
-                    <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>医生:{baseObj?baseObj.doctorName:(JSON.stringify(preInfo) == '{}'?'':preInfo.doctorName)}</td>
-                    <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>门诊号:{baseObj?baseObj.inquiryCode:(JSON.stringify(preInfo) == '{}'?'':preInfo.recordId)}</td>
-                </tr>
-            </table>
-            <table>
-                <tr style={{ verticalAlign: 'top' }}>
-                    <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>主诉:</td>
-                    <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',lineHeight:'18px' }}>
-                        {
-                            filterDataArr(JSON.parse(dataStr.chief))
-                        }
-                    </td>
-                </tr>
-                <tr style={{ verticalAlign: 'top' }}>
-                    <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>现病史:</td>
-                    <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',lineHeight:'18px'  }}>
-                        {
-                            filterDataArr(JSON.parse(dataStr.present))
-                        }
-                    </td>
-                </tr>
-                <tr style={{ verticalAlign: 'top' }}>
-                    <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>其他史:</td>
-                    <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',lineHeight:'18px'  }}>
-                        {
-                            filterDataArr(JSON.parse(dataStr.other))
-                        }
-                    </td>
-                </tr>
-                <tr style={{ verticalAlign: 'top' }}>
-                    <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>查体:</td>
-                    <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',lineHeight:'18px'  }}>
-                        {
-                            filterDataArr(JSON.parse(dataStr.vital))
-                        }
-                    </td>
-                </tr>
-                <tr style={{ verticalAlign: 'top',width:'100%',overflow:"hidden" }}>
-                    <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>化验:</td>
-                    <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',width:'650px'}}>
-                        {/* <table style={{ width: '100%' }}> */}
+            <div className={style['contents']} id="content" style={{margin:"0 auto"}}>
+                <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 0px 30px 0px', borderCollapse: 'collapse', width: "100%" }}>
+                    <tr>
+                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>卡号:{baseObj?baseObj.patientIdNo:JSON.stringify(preInfo) == '{}'?'':preInfo.patientIdNo}</td>
+                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>姓名:{baseObj?baseObj.patientName:JSON.stringify(preInfo) == '{}'?'':preInfo.patientName}</td>
+                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>年龄:{baseObj?baseObj.patientAge:JSON.stringify(preInfo) == '{}'?'':preInfo.patientAge}</td>
+                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>性别:{baseObj?baseObj.patientSex:JSON.stringify(preInfo) == '{}'?'':preInfo.patientSex}</td>
+                    </tr>
+                    <tr>
+                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>就诊时间:{baseObj?baseObj.inquiryDate:(JSON.stringify(preInfo) == '{}'?'':preInfo.systemTime.split(' ')[0])}</td>
+                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>科室:{baseObj?baseObj.hospitalDeptName:(JSON.stringify(preInfo) == '{}'?'':preInfo.hospitalDeptName)}</td>
+                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>医生:{baseObj?baseObj.doctorName:(JSON.stringify(preInfo) == '{}'?'':preInfo.doctorName)}</td>
+                        <td style={{ border: '1px solid #aaa', padding: '8px 10px', width: '25%' }}>门诊号:{baseObj?baseObj.inquiryCode:(JSON.stringify(preInfo) == '{}'?'':preInfo.recordId)}</td>
+                    </tr>
+                </table>
+                <table style={{width:"100%"}}>
+                    <tr style={{ verticalAlign: 'top' }}>
+                        <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>主诉:</td>
+                        <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',lineHeight:'18px' }}>
                             {
-                                dataJson.lis.getExcelDataList && dataJson.lis.getExcelDataList.map((items)=>{
-                                    return items.lisExcelRes && items.lisExcelRes.map((item)=>{
-                                        return <table style={{margin:'8px 0',width:'100%',fontSize:'12px'}}>
-                                            <tr style={{fontSize:'14px',lineHeight:'1.5'}}>{item.menus}</tr>
-                                            {
-                                                item.lisExcelItem && item.lisExcelItem.map((value)=>{
-                                                    return <tr style={{lineHeight:'1.5',width:'650px'}}>
-                                                        <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:'28%',fontSize:'12px'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+value.time}</td>
-                                                    </tr>
-                                                })
-                                            }
-                                        </table>
-                                    })
-                                })
+                                filterDataArr(JSON.parse(dataStr.chief))
+                            }
+                        </td>
+                    </tr>
+                    <tr style={{ verticalAlign: 'top' }}>
+                        <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>现病史:</td>
+                        <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',lineHeight:'18px'  }}>
+                            {
+                                filterDataArr(JSON.parse(dataStr.present))
                             }
+                        </td>
+                    </tr>
+                    <tr style={{ verticalAlign: 'top' }}>
+                        <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>其他史:</td>
+                        <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',lineHeight:'18px'  }}>
                             {
-                                dataJson.lis.labelList && dataJson.lis.labelList.map((item,idx) => {
-                                    if(item.show){
-                                        return <table style={{margin:'8px 0',width:'100%'}}>
-                                            <tr style={{fontSize:'14px',lineHeight:'1.5'}}>{item.name}</tr>
-                                            {
-                                                item.details.map((val)=>{
-                                                    if(val.value && val.value != ''){
-                                                        return <tr style={{lineHeight:'1.5',width:'100%',fontSize:'12px'}}>
-                                                            <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)}
+                                filterDataArr(JSON.parse(dataStr.other))
+                            }
+                        </td>
+                    </tr>
+                    <tr style={{ verticalAlign: 'top' }}>
+                        <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>查体:</td>
+                        <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',lineHeight:'18px'  }}>
+                            {
+                                filterDataArr(JSON.parse(dataStr.vital))
+                            }
+                        </td>
+                    </tr>
+                    <tr style={{ verticalAlign: 'top',width:'100%',overflow:"hidden" }}>
+                        <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>化验:</td>
+                        <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',maxWidth:'650px'}}>
+                            {/* <table style={{ width: '100%' }}> */}
+                                {
+                                    dataJson.lis.getExcelDataList && dataJson.lis.getExcelDataList.map((items)=>{
+                                        return items.lisExcelRes && items.lisExcelRes.map((item)=>{
+                                            return <table style={{margin:'8px 0',width:'100%',fontSize:'12px'}}>
+                                                <tr style={{fontSize:'14px',lineHeight:'1.5'}}>{item.menus}</tr>
+                                                {
+                                                    item.lisExcelItem && item.lisExcelItem.map((value)=>{
+                                                        return <tr style={{lineHeight:'1.5',maxWidth:'650px'}}>
+                                                            <td style={{width:'25%',fontSize:'12px'}}>{value.itemName}</td>
+                                                            <td style={{width:'23%',fontSize:'12px'}}><span style={{fontSize:'12px',color:value.type == 1?"red":null}}>{value.value}</span> {value.unit}</td>
+                                                            <td style={{width:'24%',fontSize:'12px'}}>
+                                                                {this.normalVal(value.min,value.max)}
                                                             </td>
-                                                            <td style={{width:'28%'}}>{'化验时间:'+item.time}</td>
+                                                            <td style={{width:'28%',fontSize:'12px'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+value.time}</td>
                                                         </tr>
-                                                    }
-                                                })
-                                            }
-                                        </table>
-                                    }
+                                                    })
+                                                }
+                                            </table>
+                                        })
+                                    })
+                                }
+                                {
+                                    dataJson.lis.labelList && dataJson.lis.labelList.map((item,idx) => {
+                                        if(item.show){
+                                            return <table style={{margin:'8px 0',width:'100%'}}>
+                                                <tr style={{fontSize:'14px',lineHeight:'1.5'}}>{item.name}</tr>
+                                                {
+                                                    item.details.map((val)=>{
+                                                        if(val.value && val.value != ''){
+                                                            return <tr style={{lineHeight:'1.5',width:'100%',fontSize:'12px'}}>
+                                                                <td style={{width:'25%'}}>{val.name}</td>
+                                                                {this.showDetails(val)}
+                                                                
+                                                                <td style={{width:'24%'}}>
+                                                                    {this.normalVal(val.minValue,val.maxValue)}
+                                                                </td>
+                                                                <td style={{width:'28%'}}>{'化验时间:'+item.time}</td>
+                                                            </tr>
+                                                        }
+                                                    })
+                                                }
+                                            </table>
+                                        }
+                                    })
+                                }
+                            {/* </table> */}
+                        </td>
+                    </tr>
+                    <tr style={{ verticalAlign: 'top' }}>
+                        <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>辅检:</td>
+                        <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',lineHeight:'18px' }}>
+                            {
+                                dataStr.pacs && dataStr.pacs != '' && dataStr.pacs.split(';').map((item)=>{
+                                    return <div style={{ fontSize: '14px' }}>{item}</div>
+                                })
+                            }
+                        </td>
+                    </tr>
+                    <tr style={{ verticalAlign: 'top' }}>
+                        <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>诊断:</td>
+                        <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',lineHeight:'18px' }}>
+                            {
+                                dataStr.diag && dataStr.diag != '' && dataStr.diag.split(';').map((item)=>{
+                                    return <div style={{ fontSize: '14px'}}>{item}</div>
                                 })
                             }
-                        {/* </table> */}
-                    </td>
-                </tr>
-                <tr style={{ verticalAlign: 'top' }}>
-                    <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>辅检:</td>
-                    <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',lineHeight:'18px' }}>
-                        {
-                            dataStr.pacs && dataStr.pacs != '' && dataStr.pacs.split(';').map((item)=>{
-                                return <div style={{ fontSize: '14px' }}>{item}</div>
-                            })
-                        }
-                    </td>
-                </tr>
-                <tr style={{ verticalAlign: 'top' }}>
-                    <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>诊断:</td>
-                    <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px',lineHeight:'18px' }}>
-                        {
-                            dataStr.diag && dataStr.diag != '' && dataStr.diag.split(';').map((item)=>{
-                                return <div style={{ fontSize: '14px'}}>{item}</div>
-                            })
-                        }
-                    </td>
-                </tr>
-                <tr style={{ verticalAlign: 'top' }}>
-                    <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>医嘱:</td>
-                    <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px' }}>
-                        {
-                            dataJson.advice.assay && dataJson.advice.assay.length > 0 || dataJson.advice.check && dataJson.advice.check.length > 0 ? <p style={{fontSize:'14px',marginBottom:"8px"}}>开单项目</p> : ''
-                        }
-                        {
-                            dataJson.advice.assay && <div style={{ fontSize: '12px', padding: '0px 0px 5px 0px' }}>{dataJson.advice.assay}</div>
-                        }
-                        {
-                            dataJson.advice.check && <div style={{ fontSize: '12px', padding: '0px 0px 5px 0px' }}>{dataJson.advice.check}</div>
-                        }
-                        {dataJson.advice.scheme && dataJson.advice.scheme.length > 0  && <p style={{fontSize:'14px', marginBottom: '8px',marginTop:'8px'}}>治疗方案</p>}
-                        {
-                            dataJson.advice.scheme && dataJson.advice.scheme.map((item, index) => {
-                                return <p>{item.treatment.map((it,ii) =>{
-                                  return(it.treatmentStr && it.treatmentStr.length > 0 ? 
-                                    <div style={{ fontSize: '12px', padding: '0px 0px 5px 0px' }}>{ it.treatmentStr }</div>: '')
-                                })}</p>
-                              })
-                        }
-                    </td>
-                </tr>
-            </table>
-            <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',
-                        cursor:'default',
-                        color: '#cbc7c7',
-                        border: '1px solid #cbc7c7',
-                        paddingBottom: '0'
-                    }}>此处签名</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>
+                        </td>
+                    </tr>
+                    <tr style={{ verticalAlign: 'top' }}>
+                        <td style={{ width: 70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px' }}>医嘱:</td>
+                        <td style={{ fontSize: '14px', padding: '0px 0px 16px 0px' }}>
+                            {
+                                dataJson.advice.assay && dataJson.advice.assay.length > 0 || dataJson.advice.check && dataJson.advice.check.length > 0 ? <p style={{fontSize:'14px',marginBottom:"8px"}}>开单项目</p> : ''
+                            }
+                            {
+                                dataJson.advice.assay && <div style={{ fontSize: '12px', padding: '0px 0px 5px 0px' }}>{dataJson.advice.assay}</div>
+                            }
+                            {
+                                dataJson.advice.check && <div style={{ fontSize: '12px', padding: '0px 0px 5px 0px' }}>{dataJson.advice.check}</div>
+                            }
+                            {dataJson.advice.scheme && dataJson.advice.scheme.length > 0  && <p style={{fontSize:'14px', marginBottom: '8px',marginTop:'8px'}}>治疗方案</p>}
+                            {
+                                dataJson.advice.scheme && dataJson.advice.scheme.map((item, index) => {
+                                    return <p>{item.treatment.map((it,ii) =>{
+                                      return(it.treatmentStr && it.treatmentStr.length > 0 ? 
+                                        <div style={{ fontSize: '12px', padding: '0px 0px 5px 0px' }}>{ it.treatmentStr }</div>: '')
+                                    })}</p>
+                                  })
+                            }
+                        </td>
+                    </tr>
+                </table>
+                <table style={{ marginTop: '10px',marginBottom:'30px',display: show ? 'block' : 'none' }}>
+                    <tr style={{position:'absolute',right:'0px',verticalAlign: 'top'}}>
+                        <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>
+            
+            <div onClick={()=>{this.onPrint()}} style={{
+                display: show ? 'inline-block' : 'none',
+                padding: '10px 20px',
+                float:'right',
+                marginTop:'15px',
+                background: '#3B9ED0',
+                color: '#fff',
+                borderRadius: '4px',
+                cursor: 'pointer'
+            }}>打印</div>
         </div>
     }
 }

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

@@ -1,3 +1,4 @@
+
     .content {
       position: fixed;
       bottom: 70px;
@@ -5,116 +6,14 @@
       top:120px;
       width: 820px;
       padding: 0 40px 60px 40px;
-    }
-
-    .foot{
-      font-size: 12px;
-      color: #000000;
-      letter-spacing: 0;
-      line-height: 24px;
-      float: left;
-      padding:  12px 0px 15px 20px;
-    }
-
-    .line{
-      opacity: 0.2;
-      filter:alpha(opacity=20);
-      -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=20);";
-      background: #FFFFFF;
-      border: 1px solid #979797;
-      margin:  45px 0px 15px 0px;
-    }
-    .button {
-      text-align: right;
-      padding: 20px 20px 10px 0px;
-      span{
-        display: inline-block;
-        width: 60px;
-        height: 24px;
-        background: #3B9ED0;
-        font-size: 14px;
-        color: #FFFFFF;
-        font-size: 14px;
-        text-align: center;
-        line-height: 24px;
-        border-radius: 4px;
-        cursor: pointer;
+      .contents {
+        position: relative;
+        padding-bottom: 26px;
       }
     }
     .patInfo {
       td {
-        border: 1px solid #aaa
+        border: 1px solid #aaa;
       }
     }
-    .signature {
-      border: 1px solid #000;
-    }
-  .previewInspect {
-      width: 150px;
-      font-size: 10px;
-      line-height: 2;
-  }
-  .previewPerson {
-      clear:both;
-      font-size: 24px;
-      margin: 0 0 30px 0px;
-  }
-  .previewTable {
-      width: 100%;
-      margin: 0 0px 30px 0px;
-      border-collapse: collapse;
-      td {
-          width: 25%;
-          box-sizing: border-box;
-      }
-  }
-  .previewTableTd {
-      border: 1px solid #aaa;
-      padding: 8px 10px;
-  }
-  // width:70, textAlign: 'right', padding: '0px 5px 16px 0px', fontSize: '14px'
-  .partTtable {
-      
-      .verticalT {
-          vertical-align: top;
-      }
-      .siginNature {
-        vertical-align: bottom;
-        float: right;
-      }
-      .partTtableList {
-          width: 70px;
-          text-align: right;
-          padding: 0 5px 16px 0;
-          font-size: 14px;
-      }
-      .partTtableLis {
-          font-size: 14px;
-          padding: 0 0 16px 0;
-      }
-      .partTtableLisS {
-          padding: 0 0 10px 0;
-          font-size: 14px;
-      }
-      .partTtableT {
-          width: 70px;
-          text-align: right;
-          padding: 0 5px 16px 0;
-          font-size: 14px;
-      }
-      .partTtableDes {
-          font-size: 14px;
-          padding: 0px 0px 0px 0px;
-      }
-  }
-  .assignArea {
-      width: 220px;
-      height: 60px;
-      text-align: center;
-      line-height: 60px;
-      color: #979797;
-      border: 1px solid #979797;
-      padding-bottom: 0 !important;
-  }
-  
   

+ 15 - 106
src/components/PrintPreview/index.jsx

@@ -4,105 +4,26 @@ import style from "./index.less";
 import PreviewBody from "../PreviewBody";
 import store from '@store';
 import Notify from '@commonComp/Notify';
-import close from '../../common/images/icon_close.png'
-import $ from 'jquery'
-(function ($) {
-    var opt;
+import close from '../../common/images/icon_close.png';
 
-    $.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: "0px", 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 PrintPreview extends Component {
     constructor(props) {
         super(props)
-        this.onPrint = this.onPrint.bind(this);
     }
-    onPrint() {
-        $("#content").jqprint({
-            debug: false,
-            importCSS: true,
-            printContainer: true,
-            operaSupport: false
-        });
-        this.props.onClose()
-    }
-    surePrint(jsonData,jsonStr,whichSign){
-        if(whichSign == 0){
-            if(jsonData.chief.length < 1){
-                Notify.info('主诉不能为空');
-                return;
-            }else if(jsonData.diag.length < 1){
-                Notify.info('诊断不能为空');
-                return;
-            }else{
-                this.onPrint();
-                this.props.save(true)
-            }
+    surePrint(jsonStr){
+        if(JSON.parse(jsonStr.chief).length == 1 && JSON.parse(jsonStr.chief)[0].trim() ==''){
+          Notify.info('主诉不能为空');
+            return false;
+        }else if(jsonStr.chief && JSON.parse(jsonStr.chief).length < 1){
+            Notify.info('主诉不能为空');
+            return false;
+        }else if(!jsonStr.diag || jsonStr.diag.trim().length < 1){
+            Notify.info('诊断不能为空');
+            return false;
         }else{
-            if(JSON.parse(jsonStr.chief).length == 1 && JSON.parse(jsonStr.chief)[0] ==''){
-                Notify.info('主诉不能为空');
-                return;
-            }else if(JSON.parse(jsonStr.chief).length < 1){
-                Notify.info('主诉不能为空');
-                return;
-            }else if(jsonStr.diag.trim().length < 1){
-                Notify.info('诊断不能为空');
-                return;
-            }else{
-                this.onPrint();
-                this.props.save(true)
-            }
+            this.onPrint();
+            this.props.save(true)
         }
     }
     render() {
@@ -110,13 +31,12 @@ class PrintPreview extends Component {
         let baseList = store.getState();
         const dataJson = getAllDataList(baseList);
         const dataStr = getAllDataStringList(baseList);
-        let whichSign = baseList.typeConfig.typeConfig;
 
         return <div className={style['container']} style={visible ? { display: 'block' } : { display: 'none' }}>
             <div className={style['shade']}></div>
             <div className={style['modal']}>
                 <div className={style['close']}>打印<img src={close} onClick={onClose} /></div>
-                <div id="content">
+                {/* <div id="content"> */}
                     <PreviewBody
                         preInfo={preInfo}
                         dataJson={dataJson}
@@ -124,18 +44,7 @@ class PrintPreview extends Component {
                         show={true}
                         onClose={onClose}
                     ></PreviewBody>
-                </div>
-
-                <div onClick={()=>{this.surePrint(dataJson,dataStr,whichSign)}} style={{
-                    padding: '10px 20px',
-                    position: 'absolute',
-                    bottom: '20px',
-                    right: '20px',
-                    background: '#3B9ED0',
-                    color: '#fff',
-                    borderRadius: '4px',
-                    cursor: 'pointer'
-                }}>打印</div>
+                {/* </div> */}
             </div>
         </div>
     }

+ 15 - 9
src/components/PushContainer/index.jsx

@@ -113,10 +113,19 @@ class PushContainer extends Component {
     keypress(event){
         let e = event?event:window.event;
         if(e.keyCode == 13) {
-            // this.makeSure()
+            this.makeSure()
             // store.dispatch(changeVisible(false))
         }
     }
+    handleInput(e){
+      let val = e.target.value
+      if(e.target.value.length > 30){
+          e.target.value = val.substring(0,30)
+          this.onchange(val.substring(0,30))
+      }else{
+          this.onchange(e.target.value)
+      }
+    }
     changeTitle(){
         return <div className={style['box']}>
             <input className={style['ipt']} 
@@ -124,14 +133,11 @@ class PushContainer extends Component {
                 type="text" 
                 value={this.state.title}
                 maxLength='30'
-                onKeyUp={(e) => {
-                    let val = e.target.value
-                    if(e.target.value.length > 30){
-                        e.target.value = val.substring(0,30)
-                        this.onchange(val.substring(0,30))
-                    }else{
-                        this.onchange(e.target.value)
-                    }
+                onInput={(e) => {
+                  this.handleInput(e)
+                }}
+                onPropertyChange={(e) => {  // 兼容ie
+                  this.handleInput(e)
                 }}
                 onKeyPress={e=>this.keypress(e)}
             />

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

@@ -7,7 +7,7 @@
   padding-top: 20px;
   position: absolute;
   right: 10px;
-  z-index: 201;
+  z-index: 200;
 
   position: fixed;
   top: 50px;

+ 2 - 0
src/components/SearchDrop/index.less

@@ -1,5 +1,7 @@
 @import "~@less/variables.less";
 .list{
+  max-height:300px;
+  overflow-y: auto;
   .pop;
   left: 85px;
   padding: 0 0 10px;

+ 4 - 2
src/components/SpreadDrop/index.jsx

@@ -55,7 +55,8 @@ class SpreadDrop extends Component{
     e&&e.stopPropagation();
     let boxLeft = e.pageX -175 + 'px';
     let offsetTop = e.target.offsetTop;
-    let boxTop = offsetTop + 29 + 'px';
+    const ht = e.target.offsetHeight;   //如杂音选中文字有多行时,写死会遮挡
+    let boxTop = offsetTop + ht + 'px';
     this.setState({
       boxLeft:boxLeft,
       boxTop:boxTop
@@ -124,6 +125,7 @@ class SpreadDrop extends Component{
     if(editable){
       // 更改标签的value值
       let changeVal = e.target.innerText;
+      e.target.innerText = '';      //避免出现重复输入值
       handleLabelChange && handleLabelChange({ikey,changeVal,type});
     }
     this.setState({
@@ -173,7 +175,7 @@ class SpreadDrop extends Component{
     const {handleConfirm,ikey,type,tagType,order,mainSaveText,copyType} = this.props;
     const params = Object.assign({},this.state,{ikey,type,tagType,order,mainSaveText,copyType});
     handleConfirm&&handleConfirm(params);
-	this.btnClickFlag = true;
+	  this.btnClickFlag = true;
     //点确定后隐藏弹窗
     this.props.handleHide();
   }

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

@@ -6,7 +6,7 @@
 }
 .drop-list{
   .pop;
-  padding:20px;
+  padding:20px 20px 20px 0;
   .row{
     display: inline-block;
     // width: 200px;
@@ -21,7 +21,7 @@
     border-bottom: 1px @disable-border-color solid;
   }
   li{
-    padding-left: 40px;
+    padding-left: 20px;
     cursor: pointer;
     .mult-li;
   }

+ 5 - 2
src/containers/CheckBody.js

@@ -10,6 +10,7 @@ function mapStateToProps(state){
   const hasMain = mainSuit.saveText.join('');//||mainSuit.data.length;
   return {
     data:checkBody.data,
+    isEmpty:checkBody.isEmpty,
     update:checkBody.update,   //用于触发更新
     showArr:homePage.showDrop,
     totalHide:homePage.totalHide,
@@ -18,6 +19,7 @@ function mapStateToProps(state){
     hasMain,//主诉选中的数据
     focusTextIndex:checkBody.focusIndex,    //聚焦的自由文本标签index
     span:checkBody.span,
+    searchInEnd:checkBody.searchInEnd,      //是否在搜索末尾插入结果
     selecteds:checkBody.selecteds       //普通多选选中状态
   }
 }
@@ -28,7 +30,7 @@ function mapDispatchToProps(dispatch,state){
       dispatch(getInitData());
     },
     fetchModules(param){
-      const {id,name,index,span} = param;
+      const {id,name,index,span,searchInEnd} = param;
       getModule(id).then((res)=>{
         if(res.data.code=='0'){
           dispatch({
@@ -37,7 +39,8 @@ function mapDispatchToProps(dispatch,state){
             name,
             data: res.data.data,
             span,
-            isReplace:false
+            isReplace:false,
+            searchInEnd
           })
           dispatch({
             type:ISREAD

+ 13 - 9
src/containers/CurrentIll.js

@@ -28,7 +28,8 @@ function mapStateToProps(state) {
         mainData:state.mainSuit.data,//主诉使用的模板
         moduleNum:state.mainSuit.moduleNum,//主诉使用的模板
         type: state.typeConfig.typeConfig,
-        mainIds:state.mainSuit.mainIds,//主诉症状选中的id
+        mainIds:state.mainSuit.mainIds,//主诉症状选中的id(去重用)
+        mainSymptIds:state.mainSuit.mainSymptIds,//主诉症状选中的id(移植用)
         fillInfo: state.fillInfo,
         showArr:homePage.showDrop,
         totalHide: homePage.totalHide,
@@ -102,14 +103,17 @@ function mapDispatchToProps(dispatch) {
             const {id,name,index,span} = param;
             getModule(id).then((res)=>{
                 if(res.data.code=='0'){
-                dispatch({
-                    type:SELECT_SEARCHDATA,
-                    index,
-                    name,
-                    data: res.data.data,
-                    span,
-                    isReplace:false
-                })
+                  dispatch({
+                      type:SELECT_SEARCHDATA,
+                      index,
+                      name,
+                      data: res.data.data,
+                      span,
+                      isReplace:false
+                  })
+                  dispatch({
+                    type:ISREAD
+                  })
                 }
             });
         },

+ 18 - 2
src/containers/EditableSpan.js

@@ -1,9 +1,9 @@
 import {connect} from 'react-redux';
 import {EditableSpan} from '@commonComp';
 import {SETCHECKTEXT,SETSEARCHDATA,CHECK_FOCUS_INDEX,CHECKBODY_CLEAR,DEL_CHECKBODY} from '@types/checkBody';
-import {SET_SEARCH,MAIN_FOCUS_INDEX,CLEAR_SEARCH,SETMAINTEXT,DEL_MAIN} from '@types/mainSuit';
+import {SET_SEARCH,MAIN_FOCUS_INDEX,CLEAR_SEARCH,SETMAINTEXT,DEL_MAIN,REMOVE_MAIN_ID} from '@types/mainSuit';
 import {SETOTHERTEXT,SETOTHERSEARCHDATA,OTHER_FOCUS_INDEX,OTHERHIS_CLEAR,DEL_OTHERHIS} from '@types/otherHistory';
-import {SET_CURRENT_SEARCH,CURRENT_CLEAR,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,DEL_CURRENT} from '@types/currentIll';
+import {SET_CURRENT_SEARCH,CURRENT_CLEAR,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,DEL_CURRENT,REMOVE_CURR_ID} from '@types/currentIll';
 import {getSearch} from '@store/async-actions/fetchModules.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {didPushParamChange} from '@utils/tools.js';
@@ -26,6 +26,7 @@ function mainSuitSearch(obj){
         dispatch({
           type:SET_SEARCH,
           data:res.data.data,
+          isEnd:obj.isEnd,      //true为在末尾插入搜索结果否则在前面插入
           inpStr:text //搜索输入的值
         })
       }
@@ -41,6 +42,7 @@ function currentSearch(obj){
         dispatch({
           type:SET_CURRENT_SEARCH,
           data:res.data.data,
+          isEnd:obj.isEnd,      //true为在末尾插入搜索结果否则在前面插入
           inpStr:text
         })
       }
@@ -56,6 +58,7 @@ function checkBodySearch(obj){
         dispatch({
           type:SETSEARCHDATA,
           data:res.data.data,
+          isEnd:obj.isEnd,      //true为在末尾插入搜索结果否则在前面插入
           inpStr:text
         });
       }
@@ -71,6 +74,7 @@ function otherHisSearch(obj) {
         dispatch({
           type:SETOTHERSEARCHDATA,
           data:res.data.data,
+          isEnd:obj.isEnd,      //true为在末尾插入搜索结果否则在前面插入
           inpStr:text
         });
       }
@@ -232,6 +236,18 @@ function mapDispatchToProps(dispatch,state) {
         type:ISREAD
       })
     },
+    removeId(obj){//删除时移除id
+      switch (+obj.boxMark){
+        case 1:
+          dispatch({type:REMOVE_MAIN_ID,index:obj.i,text:obj.text});
+          break;
+        case 2:
+          dispatch({type:REMOVE_CURR_ID,index:obj.i,text:obj.text});
+          break;
+        default:
+          break;
+      }
+    }
   }
 }
 

+ 3 - 0
src/containers/MainSuit.js

@@ -115,6 +115,9 @@ function mapDispatchToProps(dispatch) {
           info:obj.item,
           span:obj.span
         })
+        dispatch({
+          type:ISREAD
+        })
       },
       clearSearch:()=>{
         dispatch({

+ 6 - 6
src/containers/NumberDrop.js

@@ -79,7 +79,7 @@ function mainSuitLabel(dispatch,params){
   dispatch({
     // type:CHANGE_LABELVAL,
     type:CHANGE_LABELVAL_NUMBER,
-    data:{changeVal:changeVal,ikey:ikey,totalVal}
+    data:Object.assign({},params,{ikey})
   })
 }
 // 现病史
@@ -89,19 +89,19 @@ function currentLabel(dispatch,params){
   dispatch({
     // type:CURRENT_TEXT_LABEL,
     type:CURRENT_TEXT_LABEL_NUMBER,
-    data:{changeVal:params.changeVal,ikey:ikey}
+    data:Object.assign({},params,{ikey})
   })
 }
 
 //其他史
 function otherHisLabelEdit(dispatch,params){
   const index = params.ikey;
-  const {changeVal,totalVal} = params;
+  //const {changeVal,totalVal} = params;
   let ikey = getLabelIndex(index);
   dispatch({
     // type:CHANGEOTHERTEXTLABEL,
     type:CHANGEOTHERTEXTLABEL_NUMBER,
-    data:{changeVal:changeVal,ikey:ikey,totalVal}
+    data:Object.assign({},params,{ikey})
   })
 }
 
@@ -109,11 +109,11 @@ function otherHisLabelEdit(dispatch,params){
 function checkBodyLabelEdit(dispatch,params){
   const index = params.ikey;
   let ikey = getLabelIndex(index);
-  const {changeVal,totalVal} = params;
+  //const {changeVal,totalVal} = params;
   dispatch({
     // type:CHANGECHECKTEXTLABEL,
     type:CHANGECHECKTEXTLABEL_NUMBER,
-    data:{changeVal:changeVal,ikey:ikey,totalVal}
+    data:Object.assign({},params,{ikey})
   })
 }
 function mapDispatchToProps(dispatch,store){

+ 4 - 2
src/containers/OtherHistory.js

@@ -23,6 +23,7 @@ function mapStateToProps(state){
     searchData:otherHistory.searchData,    //延迟搜索结果
     focusTextIndex:otherHistory.focusIndex,    //聚焦的自由文本标签index
     span:otherHistory.span,
+    searchInEnd:otherHistory.searchInEnd,      //是否在搜索末尾插入结果
     selecteds:otherHistory.selecteds,       //普通多选选中状态
     editClear:otherHistory.editClear,       //编辑状态
     isRead:state.homePage.isRead
@@ -56,7 +57,7 @@ function mapDispatchToProps(dispatch,store){
       },500);
     },
     fetchModules(param){
-      const {id,name,index,span} = param;
+      const {id,name,index,span,searchInEnd} = param;
       getModule(id).then((res)=>{
         if(res.data.code=='0'){
           dispatch({
@@ -65,7 +66,8 @@ function mapDispatchToProps(dispatch,store){
             name,
             data: res.data.data,
             span,
-            isReplace:false
+            isReplace:false,
+            searchInEnd
           });
           dispatch({
             type:ISREAD

+ 2 - 0
src/containers/TypeConfigContainer.js

@@ -11,6 +11,8 @@ import {Notify} from '@commonComp';
 
 function mapStateToProps(state) {
   return {
+    disVisible:state.copyRight.disVisible,
+    copyVisible:state.copyRight.copyVisible,
     //failed:state.typeConfig.failed,
     typeConfig:state.typeConfig.typeConfig||config.defaultValue.mode,
     visible:state.typeConfig.visible

+ 1 - 1
src/containers/eleType.js

@@ -124,7 +124,7 @@ export default function(params){
     case 8:
       // 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()}/>;
+      return <EditableSpan {...params} value={data.value||data.value==''?data.value:data.name} full={data.full} update={Math.random()}/>;
     case 11://推送类型
       return multCheckLabels(params,data.tagType);
     default:

+ 5 - 5
src/modules/HomePage/index.jsx

@@ -6,7 +6,7 @@ import BodyContainer from "@components/BodyContainer";
 
 import {HIDEDROP} from '@store/types/homePage.js';
 import style from './index.less';
-import {getInitModules} from '@store/async-actions/homePage.js';
+/*import {getInitModules} from '@store/async-actions/homePage.js';*/
 import { getUrlArgObject } from "@utils/tools";
 
 class HomePage extends Component {
@@ -17,7 +17,7 @@ class HomePage extends Component {
         }
     }
     
-    componentDidMount(){
+    /*componentDidMount(){
         clearTimeout(this.state.timer);
         const that = this;
         const timer = setTimeout(function(){//解决患者信息在获取模板之后的问题
@@ -26,7 +26,7 @@ class HomePage extends Component {
         this.setState({
             timer
         })      
-    }
+    }*/
     render() {
         return <div className={style['home-page']} onClick={this.props.hideAllDrop}>
             <BannerContainer />
@@ -48,9 +48,9 @@ const mapDispatchToProps = function (dispatch) {
               type:HIDEDROP
             });
         },
-        getInit(){
+        /*getInit(){
             dispatch(getInitModules);
-        }
+        }*/
     }
 };
 

+ 43 - 22
src/store/actions/checkBody.js

@@ -7,6 +7,7 @@ export function set(state,action){
   res.data = [...data];
   res.saveText = fullfillText(res.data).saveText;//存逗号
   res.update = Math.random();
+  res.isEmpty = false;
   return res;
 }
 //查体中数字键盘选中事件
@@ -37,7 +38,7 @@ export function setNumberValue(state,action){
 }
 
 //查体单选下拉选中
-export function setRadioValue(state,action){console.log(221)
+export function setRadioValue(state,action){
   let res = Object.assign({},state);
   const {ikey,id,text} = action;
   let labelInx = getLabelIndex(ikey);
@@ -130,31 +131,46 @@ export function setSearchData(state,action){
   let res = Object.assign({},state);
   res.searchData = action.data;
   res.searchStr = action.inpStr;
+  res.searchInEnd = action.isEnd;
   return res;
 }
 
-//插入标签数据
+//插入标签数据-搜索
 export function insertLabelData(state,action){
   let res = Object.assign({},state);
   const text = Object.assign({},JSON.parse(config.textLabel));
   const searchStr = res.searchStr;
-  const {index,data,isReplace,span}=action;
+  const {index,data,isReplace,span,searchInEnd}=action;
   const showText = res.saveText[index];
-  const spreadLabels = data;
-  const toEnd = showText.indexOf(searchStr)>0;    //替换前或后的搜索词(中间不可搜)
-  let reg = toEnd?new RegExp(searchStr+"$"):new RegExp("^"+searchStr);
+  const spreadLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
+  let reg = searchInEnd?new RegExp(searchStr+"$"):new RegExp("^"+searchStr);
   const newText=showText.replace(reg,'')||'';
   if(!isReplace){
     span.current.innerText = newText;
     const pText = Object.assign({},text,{value:newText});
-    res.data.splice(index,1,pText,spreadLabels,text);
-    res.saveText.splice(index,1,newText,'','');
-    res.selecteds.splice(index,1,null,null,null);
+    if(searchInEnd){
+      res.data.splice(index,1,pText,...spreadLabels,text);
+      res.saveText = fullfillText(res.data).saveText;
+      //res.saveText.splice(index,1,newText,'','');
+      res.selecteds.splice(index,1,null,new Array(spreadLabels.length).fill(null),null);
+    }else{
+      res.data.splice(index,1,text,...spreadLabels,pText);
+      res.saveText = fullfillText(res.data).saveText;
+      //res.saveText.splice(index,1,'','',newText);
+      res.selecteds.splice(index,1,null,new Array(spreadLabels.length).fill(null),null);
+    }
+
   }else{
     span.current.innerText = ' ';
-    res.data.splice(index+1,0,spreadLabels,text);
-    res.saveText.splice(index+1,0,'','');
-    res.selecteds.splice(index+1,0,null,null);
+    if(searchInEnd){
+      res.data.splice(index+1,0,spreadLabels,text);
+      res.saveText.splice(index+1,0,'','');
+      res.selecteds.splice(index+1,0,null,null);
+    }else{
+      res.data.splice(index,0,text,spreadLabels);
+      res.saveText.splice(index,0,'','');
+      res.selecteds.splice(index,0,null,null);
+    }
   }
   res.searchData = [];    //选中清空搜索内容(即关闭搜索弹窗)
   res.update = Math.random();
@@ -163,23 +179,24 @@ export function insertLabelData(state,action){
 
 export const changeLabelVal = (state,action)=>{//双击标签输入改变值
   const res = Object.assign({},state);
-  const index = action.data.ikey;
-  const newVal = action.data.changeVal;     //下拉修改的内容
-  const totalVal = action.data.totalVal;    //包含前后缀修改的内容
-  let labText = totalVal?totalVal:newVal;
+  const {changeVal,totalVal,ikey,prefix,suffix} = action.data;
+  const index = ikey;
+  const newVal = changeVal;     //下拉修改的内容
+  let labText = totalVal?totalVal:newVal;   //如单选没有前后缀
   let item = res.data[index];
   // if(newVal && newVal.trim()){
   if(labText && labText.trim()){
     if(item){
       item.value = newVal;
+      item.labelPrefix = prefix||'';
+      item.labelSuffix = suffix||'';
       // 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;
 }
@@ -187,14 +204,17 @@ export const changeLabelVal = (state,action)=>{//双击标签输入改变值
 // 数字键盘较特殊,有直接输入
 export const changeNumLabelVal = (state,action)=>{
   const res = Object.assign({},state);
-  const index = action.data.ikey;
-  const newVal = action.data.changeVal;
+  const {changeVal,totalVal,ikey,prefix,suffix} = action.data;
+  const index = ikey;
+  const newVal = changeVal;
   let item = res.data[index];
-  if(newVal.trim()){
+  if(totalVal.trim()){
     if(item){
       item.value = newVal;
+      item.labelPrefix = prefix||'';
+      item.labelSuffix = suffix||'';
     }
-    res.saveText[index] = newVal;
+    res.saveText[index] = totalVal;
   }else{//删除完标签内容则删除该标签
     res.data.splice(index,1);
     res.saveText = fullfillText(res.data).saveText;
@@ -208,6 +228,7 @@ export function clearCheckBody(state,action){  //清空
   let res = Object.assign({},state);
   res.data = action.data;
   res.saveText = action.saveText;
+  res.isEmpty = action.isEmpty;
   res.selecteds = action.selecteds?action.selecteds:[];
   return res;
 }

+ 71 - 25
src/store/actions/currentIll.js

@@ -364,13 +364,17 @@ 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;
+  const {changeVal,totalVal,ikey,prefix,suffix} = action.data;
+  const index = ikey;
+  const newVal = changeVal;
+  let labText = totalVal?totalVal:newVal;
   let item = res.data[index];
-  if(newVal.trim()){
+  if(labText.trim()){
     if(item){
       item.value = newVal;
-      res.saveText[index] = newVal;
+      item.labelPrefix = prefix||'';
+      item.labelSuffix = suffix||'';
+      res.saveText[index] = labText;
     }
   }else{//删除完标签内容则删除该标签
     res.data.splice(index,1);
@@ -383,13 +387,22 @@ export const changeLabelVal = (state,action)=>{
 // 数字键盘较特殊,有直接输入
 export const changeNumLabelVal = (state,action)=>{
   const res = Object.assign({},state);
-  const index = action.data.ikey;
-  const newVal = action.data.changeVal;
+  const {changeVal,totalVal,ikey,prefix,suffix} = action.data;
+  const index = ikey;
+  const newVal = changeVal;
   let item = res.data[index];
-  if(item){
-    item.value = newVal;
+  let labText = totalVal?totalVal:newVal;   //如单选没有前后缀
+  if(labText.trim()){
+    if(item){
+      item.value = newVal;
+      item.labelPrefix = prefix||'';
+      item.labelSuffix = suffix||'';
+    }
+    res.saveText[index] = labText;
+  }else{//删除完标签内容则删除该标签
+    res.data.splice(index,1);
+    res.saveText = fullfillText(res.data).saveText;
   }
-  res.saveText[index] = newVal;
   res.update = Math.random();
   return res;
 }
@@ -457,11 +470,12 @@ export function setCheckText(state,action) {
 
 //搜索 插入标签数据
 export function insertLabelData(state,action){
-  let res = Object.assign({},state);//console.log(789,res,action);
-  const text = Object.assign(JSON.parse(config.textLabel),{name:action.name});
+  let res = Object.assign({},state); 
   const {index,data,isReplace,span}=action;
   let id = data.id;
+  let searchData = action.name;
   res.symptomIds.push(id);
+  const text = Object.assign(JSON.parse(config.textLabel),{name:searchData},{id:id});
   let focusIndex = res.focusIndex;
   
   if(isReplace){
@@ -473,25 +487,36 @@ export function insertLabelData(state,action){
                               return item.symptomType==0||item.symptomType==2;
                             })));
     res.data = fullfillText(resData).newArr;
-    res.saveText[focusIndex] = action.name;
+    res.saveText[focusIndex] = searchData;
   }else{
+    let resData;
     // res.data.splice(index,0,data);
     const searchStr = res.searchStr;
     let innerText = span.current.innerText;
     let strIndex = innerText.indexOf(searchStr);
-    let value;
-    if(strIndex <= 1){//前
-      value = innerText.replace(searchStr,action.name);
+    const value = innerText.replace(searchStr,"");
+    // let value;
+    // if(strIndex <= 1){//前
+    if(strIndex < 1){//前
+      res.data.splice(focusIndex,0,text);
+      res.saveText.splice(focusIndex,0,searchData);
+      res.data[focusIndex+1].value = value;
+      res.saveText[focusIndex+1] = value;
+      resData = JSON.parse(JSON.stringify(res.data));
+      resData.splice(focusIndex+1,0,...(data.questionMapping.filter((item)=>{
+                              return item.symptomType==0||item.symptomType==2;
+                            })));
     }else{
-      let temp = innerText.substring(0,innerText.lastIndexOf(searchStr));
-      value = temp + action.name;
-    }
-    span.current.innerText = value;
-    let resData = JSON.parse(JSON.stringify(res.data));
-    resData[focusIndex].value = value;
-    resData.splice(focusIndex+1,0,...(data.questionMapping.filter((item)=>{
+      res.data.splice(focusIndex+1,0,text);
+      res.saveText.splice(focusIndex+1,0,searchData);
+      res.data[focusIndex].value = value;
+      resData = JSON.parse(JSON.stringify(res.data));
+      // +3是因为插入一个文本标签加一个符号标签  
+      resData.splice(focusIndex+3,0,...(data.questionMapping.filter((item)=>{
                               return item.symptomType==0||item.symptomType==2;
                             })));
+    }
+    span.current.innerText = value;
     res.data = fullfillText(resData).newArr;
     res.saveText = fullfillText(resData).saveText;
   }
@@ -545,13 +570,34 @@ export function backspaceText(state,action){
   let res = Object.assign({},state);
   const {delIndex,text} = action;
   const data = res.data;
-  if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
-    // 前一个是文本标签或者子模板,只改变值
+  // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
+  // 前一个是文本标签或者子模板,只改变值
+  if(data[delIndex-1].flag&&data[delIndex-1].flag==3){//子模板不删  
     // data[delIndex].value = text;
-  }else{
+  }else if(data[delIndex-1].tagType==8){
+    data.splice(delIndex,1);
+  }
+  else{
     data.splice(delIndex-1,2);
   }
   res.saveText = fullfillText(data).saveText;
   res.update = Math.random();
   return res;
+}
+
+//删除后移除id
+export function removeId(state,action){
+  let res = Object.assign({},state);
+  const {index,text} = action;
+  const data = res.data;
+  const id = data[index].id;
+  let ids = res.symptomIds;
+  if(ids.includes(id)){
+    ids.splice(ids.indexOf(id),1);
+  }
+  data[index].id = "";
+  data[index].name = text;
+  data[index].value = text;
+  res.update = Math.random();
+  return res;
 }

+ 60 - 11
src/store/actions/mainSuit.js

@@ -110,6 +110,7 @@ export const insertMain = (state,action) => {
   // res.saveText[inserIndx] = text.name;
   res.saveText = fullfillText(res.data).saveText;
   res.mainIds.push(id);
+  res.mainSymptIds.push(id);
   res.editClear = false;//主诉框编辑状态
   res.update=Math.random();
   return res;
@@ -138,6 +139,7 @@ export const confirm = (state,action) =>{
     let existsId = getIds(exists);
     let withsId = getIds(withs);
     res.mainIds = res.mainIds?res.mainIds.concat(existsId,withsId):[];
+    res.mainSymptIds = res.mainSymptIds.concat(existsId,withsId);
   }
 
   let text = saveText.slice(0,labelIndx);
@@ -255,7 +257,7 @@ export const insertSearch = (state,action)=>{
     res.saveText[focusIndex] = searchData;
     res.mainIds.push(id);*/
     // 追加--前or后?searchStr
-    const searchStr = res.searchStr;
+    /*const searchStr = res.searchStr;
     let innerText = span.current.innerText;
     let index = innerText.indexOf(searchStr);
     let value;
@@ -268,7 +270,24 @@ export const insertSearch = (state,action)=>{
     // let value = innerText + searchData;
     span.current.innerText = value;
     res.data[focusIndex].value = value;
-    res.saveText[focusIndex] = value;
+    res.saveText[focusIndex] = value;*/
+
+    // 从新插入一个span标签
+    const searchStr = res.searchStr;
+    let innerText = span.current.innerText;
+    const value = innerText.replace(searchStr,"");
+    let index = innerText.indexOf(searchStr);
+    if(index < 1){//前
+      res.data.splice(focusIndex,0,text);
+      res.saveText.splice(focusIndex,0,searchData);
+      res.data[focusIndex+1].value = value;
+      res.saveText[focusIndex+1] = value;
+    }else{
+      res.data.splice(focusIndex+1,0,text);
+      res.saveText.splice(focusIndex+1,0,searchData);
+      res.data[focusIndex].value = value;
+    }
+    span.current.innerText = value;
     res.mainIds.push(id);
   }
   // console.log(456,res,action);
@@ -385,18 +404,22 @@ export const changeLabelVal = (state,action)=>{
 // 数字键盘较特殊,有直接输入
 export const changeNumLabelVal = (state,action)=>{
   const res = Object.assign({},state);
-  const index = action.data.ikey;
-  const newVal = action.data.changeVal;
+  const {changeVal,totalVal,ikey,prefix,suffix} = action.data;
+  const index = ikey;
+  const newVal = changeVal;
+  let labText = totalVal?totalVal:newVal;   //如单选没有前后缀
   let item = res.data[index];
-  if(newVal.trim()){
+  if(labText.trim()){
     if(item){
       item.value = newVal;
-      res.saveText[index] = newVal;
+      item.labelPrefix = prefix||'';
+      item.labelSuffix = suffix||'';
+      res.saveText[index] = labText;
     }
   }else{//删除完标签内容则删除该标签
     res.data.splice(index,1);
     res.saveText = fullfillText(res.data).saveText;
-  }  
+  }
   res.update = Math.random();//console.log(44,action,res);
   return res;
 }
@@ -422,7 +445,8 @@ export const clearMainSuit = (state,action)=>{//回读和清除
   res.saveText = action.saveText;
   // res.saveText = fullfillText(action.data).saveText;//解决删除data里的值保存,回读后页面上有内容saveText里没有的情况
   res.selecteds = action.selecteds?action.selecteds:[];
-  res.mainIds = action.mainIds
+  res.mainIds = action.mainIds;
+  res.mainSymptIds = action.mainSymptIds;
   if(action.editClear){
     res.editClear = action.editClear;
   }
@@ -494,12 +518,37 @@ export function backspaceText(state,action){
   let res = Object.assign({},state);
   const {delIndex} = action;
   const data = res.data;
-  if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
+  if(data[delIndex-1].flag&&data[delIndex-1].flag==3){
+  // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
     // 前一个是文本标签或者子模板 不做处理
-  }else{
+  }else if(data[delIndex-1].tagType==8){
+    data.splice(delIndex,1);
+  }
+  else{
     data.splice(delIndex-1,2);
   }
   res.saveText = fullfillText(data).saveText;
   res.update = Math.random();
   return res;
-}
+}
+
+//删除后移除id
+export function removeId(state,action){
+  let res = Object.assign({},state);
+  const {index,text} = action;
+  const data = res.data;
+  const id = data[index].id;
+  let ids = res.mainIds;
+  let mainIds = res.mainSymptIds;
+  if(ids.includes(id)){
+    ids.splice(ids.indexOf(id),1);
+  }
+  if(mainIds.includes(id)){
+    mainIds.splice(mainIds.indexOf(id),1);
+  }
+  data[index].id = "";
+  data[index].name = text;
+  data[index].value = text;
+  res.update = Math.random();
+  return res;
+}

+ 45 - 19
src/store/actions/otherHistory.js

@@ -32,6 +32,7 @@ export const confirm = (state,action) =>{
   if(items.length==0&&nones){
     arr[ikey-1].value = newPreText;
     res.saveText[ikey-1] = newPreText;
+    res.selecteds[ikey] = null;       //无殊选中状态遗留bug修改
     res.update=Math.random();
     return res;
   }
@@ -171,29 +172,41 @@ export function setSearchData(state,action){
   let res = Object.assign({},state);
   res.searchData = action.data;
   res.searchStr = action.inpStr;
+  res.searchInEnd = action.isEnd;
   return res;
 }
 
-//插入标签数据
+//插入标签数据-搜索
 export function insertLabelData(state,action){
   let res = Object.assign({},state);
   const text = Object.assign({},JSON.parse(config.textLabel));
   const searchStr = res.searchStr;
-  const {index,data,isReplace,span}=action;
+  const {index,data,isReplace,span,searchInEnd}=action;
   const showText = res.saveText[index];
-  const spreadLabels = data;
-  const toEnd = showText.indexOf(searchStr)>0;    //替换前或后的搜索词(中间不可搜)
-  let reg = toEnd?new RegExp(searchStr+"$"):new RegExp("^"+searchStr);
+  const spreadLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
+  let reg = searchInEnd?new RegExp(searchStr+"$"):new RegExp("^"+searchStr);
   const newText=showText.replace(reg,'')||' ';
   if(!isReplace){
     span.current.innerText = newText;
     const pText = Object.assign({},text,{value:newText});
-    res.data.splice(index,1,pText,spreadLabels,text);
-    res.saveText.splice(index,1,newText,'','');
+    if(searchInEnd){
+      res.data.splice(index,1,pText,...spreadLabels,text);
+      res.saveText = fullfillText(res.data).saveText;
+      //res.saveText.splice(index,1,newText,'','');
+    }else{
+      res.data.splice(index,1,...spreadLabels,pText,text);
+      res.saveText = fullfillText(res.data).saveText;//.splice(index,1,'',newText,'');
+    }
   }else{
     span.current.innerText = ' ';
-    res.data.splice(index+1,0,spreadLabels,text);
-    res.saveText.splice(index+1,0,'','');
+    if(searchInEnd){
+      res.data.splice(index+1,0,spreadLabels,text);
+      res.saveText.splice(index+1,0,'','');
+    }else{
+      res.data.splice(index,0,text,spreadLabels);
+      res.saveText.splice(index,0,'','');
+    }
+
   }
   res.searchData = [];    //选中清空搜索内容(即关闭搜索弹窗)
   res.update = Math.random();
@@ -202,13 +215,17 @@ 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;
+  const {changeVal,totalVal,ikey,prefix,suffix} = action.data;
+  const index = ikey;
+  const newVal = changeVal;
   let item = res.data[index];
-  if(newVal.trim()){
+  let labText = totalVal?totalVal:newVal;
+  if(labText.trim()){
     if(item){
       item.value = newVal;
-      res.saveText[index] = newVal;
+      item.labelPrefix = prefix||'';
+      item.labelSuffix = suffix||'';
+      res.saveText[index] = labText;
     }
   }else{//删除完标签内容则删除该标签
     res.data.splice(index,1);
@@ -221,13 +238,22 @@ export function changeTextLabel(state,action) {
 // 数字键盘较特殊,有直接输入
 export const changeNumLabelVal = (state,action)=>{
   const res = Object.assign({},state);
-  const index = action.data.ikey;
-  const newVal = action.data.changeVal;
+  const {changeVal,totalVal,ikey,prefix,suffix} = action.data;
+  const index = ikey;
+  const newVal = changeVal;
   let item = res.data[index];
-  if(item){
-    item.value = newVal;
-  }
-  res.saveText[index] = newVal;
+  let labText = totalVal?totalVal:newVal;   //如单选没有前后缀
+  if(labText.trim()){
+    if(item){
+      item.value = newVal;
+      item.labelPrefix = prefix||'';
+      item.labelSuffix = suffix||'';
+    }
+    res.saveText[index] = labText;
+  }else{//删除完标签内容则删除该标签
+    res.data.splice(index,1);
+    res.saveText = fullfillText(res.data).saveText;
+  };
   res.update = Math.random();
   return res;
 }

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

@@ -6,6 +6,7 @@ import store from '@store';
 import {getEMRParams} from '@utils/tools.js';
 import {Notify} from '@commonComp';
 import {SETOTHERHISTORY} from "../types/homePage";
+import config from "@config/index";
 
 const api={
   getSpreadModule:'/api/icss/questionInfo/getByIds',
@@ -106,9 +107,16 @@ export function getInitData(){
         const arr = fullfillText(JSON.parse(str),false,false,false).newArr;
         dispatch({
           type:SET,
-          data:[...arr]
+          data:[...arr],
+          isEmpty:false
         });
       }else{
+        const block = Object.assign(JSON.parse(config.textLabel),{full:true});      //无数据时保留一个自由文本标签可输入
+        dispatch({
+          type:SET,
+          data:[block],
+          isEmpty:false
+        });
         Notify.error(res.data.msg);
       }
     });

+ 2 - 1
src/store/async-actions/patInfo.js

@@ -21,7 +21,7 @@ export const initPersonInfo = (dispatch, getState) => {
         const data = res.data;
         if (data.code == 0) {
             dispatch(getInfos(data.data));
-            console.log(data.data)
+            //console.log(data.data)
             getPatientMessage(dispatch, getState);
         } else {
             console.log(res)
@@ -94,6 +94,7 @@ export const getPatientMessage = (dispatch, getState) => {
         type: CONFIRM_TYPE,
         confirmType:data1.modeValue
       });
+      dispatch(getInitModules);     //确保病人信息获取以后再获取模板等数据,否则参数为空
       if(state.tabTemplate.items.length == 0){
         dispatch(initItemList(data1.modeValue));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
       }

+ 4 - 3
src/store/async-actions/tabTemplate.js

@@ -125,15 +125,16 @@ export const delBatchItem = (ids) => { //批量删除
 export const changeTitleAsync = (obj) => { //改标题
   let baseList = store.getState();
   let whichSign = baseList.typeConfig.typeConfig;
+  let state = baseList.patInfo.message;
   if (obj.title == '') {
     Notify.success('请输入模板名称');
     return;
   }
   return (dispatch) => {
     axios.json('/api/icss/templateInfo/updateByIdUsNames', {
-      "doctorId": 1,
-      "hospitalDeptId": 1,
-      "hospitalId": 1,
+      "doctorId": state.doctorId,
+      "hospitalDeptId": state.hospitalDeptId,
+      "hospitalId": state.hospitalId,
       "id": obj.id,
       "modeName": obj.title,
       "type": whichSign

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

@@ -137,7 +137,7 @@ export const getTreatResult = (item) =>{
                         surgeryTreat: treat.surgeryTreatment,
                     })
                 }
-
+                
         }).catch((e) =>{
             console.log(e)
         })

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

@@ -20,7 +20,7 @@ function getCurrentDate() {
     let date = year+'-'+(mon<10?'0'+mon:mon)+'-'+(day<10?'0'+day:day);
     return date;
 }
-export default (state = initSearchList, action) => {
+export default (state = initSearchList, action) => { 
     if (action.type == GET_ASSIST_SEARCH_LIST) {
         const newState = Object.assign({}, state);
         newState.list = action.list
@@ -39,7 +39,7 @@ export default (state = initSearchList, action) => {
             }
         }
         for (let j = 0; j < tempArrs.length; j++) {
-            tmpString += (tempArrs[j].name+(tempArrs[j].value?(':'+tempArrs[j].value):'')+(tempArrs[j].time?',报告日期:'+tempArrs[j].time:'')+';')
+            tmpString += (tempArrs[j].name+(tempArrs[j].value?(':'+tempArrs[j].value):'')+(tempArrs[j].time?',报告日期:'+tempArrs[j].time:'')+';')
         }
         newState.dataString = tmpString
         return newState;
@@ -54,7 +54,7 @@ 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
@@ -69,7 +69,7 @@ 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;
@@ -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

@@ -3,13 +3,15 @@ import {SET,SETNUMBER4,SETSELECTED4,SETCHECKBOX,ADDLABELITEM,SETCHECKTEXT,SETSEA
 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});
+//const block = Object.assign(JSON.parse(config.textLabel),{full:false});//空白时保留一个自由文本标签
 const initState = {
                 data:[],
                 saveText:[],    //saveText为生成的纯文本
                 searchData:[],
                 selecteds:[],
-                focusIndex:''};
+                focusIndex:'',
+                isEmpty:true      //是否为空白,需要请求数据
+          };
 export default function(state=initState,action){
   let res = Object.assign({},state);
   switch(action.type){

+ 5 - 3
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,CURRENT_TEXT_LABEL_NUMBER} from '../types/currentIll';
+  SET_CURRENT_SEARCH,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,SELECT_SEARCHDATA,CLEAR_CURRENT_EDIT,CURRENTADDLABELITEM,SETCURRENTINPUT,DEL_CURRENT,CURRENT_TEXT_LABEL_NUMBER,REMOVE_CURR_ID} from '../types/currentIll';
 import {confirm,insertProcess,setData,setCheckBox,setRadioValue,setNumberValue,changeLabelVal,clearCurrentIll,
-  setTextModeValue,setModule,bigDataSymptom,setCheckText,insertLabelData,clearCurrentEdit,addLabelItem,setInputLabel,backspaceText,changeNumLabelVal} from '../actions/currentIll';
+  setTextModeValue,setModule,bigDataSymptom,setCheckText,insertLabelData,clearCurrentEdit,addLabelItem,setInputLabel,backspaceText,changeNumLabelVal,removeId} from '../actions/currentIll';
 
 const initState = {
   moduleData:[],
@@ -16,7 +16,7 @@ const initState = {
   emptyData:[],
   symptomIds:[] //搜索去重
 };
-export default function(state=initState,action){
+export default function(state=initState,action){    
   const res = Object.assign({},state);
   switch (action.type){
     case SET_CURRENT://需要处理截取的模板
@@ -69,6 +69,8 @@ export default function(state=initState,action){
       return setInputLabel(state,action);
     case DEL_CURRENT:
       return backspaceText(state,action);
+    case REMOVE_CURR_ID:
+      return removeId(state,action);
     default:
       return state;
   }

+ 6 - 3
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,CHANGE_LABELVAL_NUMBER} from '../types/mainSuit'
+  INSERT_SEARCH,MAIN_FOCUS_INDEX,SETTEXTMODEVALUE,SETMAINTEXT,MAINADDLABELITEM,SETMAININPUT,DEL_MAIN,CHANGE_LABELVAL_NUMBER,REMOVE_MAIN_ID} from '../types/mainSuit'
 import {getCommSymptoms,handleTailClick,insertMain,setSearch,getBigSymptom,setMainMoudle,confirm,
-  setNumberValue,setRadioValue,commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,changeEditClear,addLabelItem,setInputLabel,backspaceText,changeNumLabelVal} from '../actions/mainSuit'
+  setNumberValue,setRadioValue,commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,changeEditClear,addLabelItem,setInputLabel,backspaceText,changeNumLabelVal,removeId} from '../actions/mainSuit'
 
 
 const initState = {
@@ -18,8 +18,9 @@ const initState = {
   selecteds:[],
   moduleNum:{num:0},//点了几次添加病情变化
   focusIndex:'',
-  mainIds:[], //选中的主症状和伴随的id
+  mainIds:[], //选中的主症状和伴随的id(搜索去重)
   editClear:true,
+  mainSymptIds:[]//选中的主症状和伴随的id(移植到现病史)
 }
 
 export default function(state=initState,action){
@@ -82,6 +83,8 @@ export default function(state=initState,action){
       return setInputLabel(state,action);
     case DEL_MAIN:
       return backspaceText(state,action);
+    case REMOVE_MAIN_ID:
+      return removeId(state,action);
     default:
       return state;
   }

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

@@ -22,4 +22,5 @@ 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';     //数字键盘输入
+export const REMOVE_CURR_ID = 'REMOVE_CURR_ID';     //删除后移除id
 

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

@@ -23,3 +23,4 @@ export const MAINADDLABELITEM = 'MAIN_ADD_LABEL_ITEM';      //带加号的标签
 export const SETMAININPUT = 'SET_MAIN_INPUT_LABEL';     //文本输入标签存值
 export const DEL_MAIN = 'DEL_MAIN';     //删除标签
 export const CHANGE_LABELVAL_NUMBER = 'CHANGE_LABELVAL_NUMBER';     //数字键盘输入存值
+export const REMOVE_MAIN_ID = 'REMOVE_MAIN_ID';     //移除id

+ 7 - 3
src/utils/tools.js

@@ -8,6 +8,7 @@ import {clearAllLabel} from '@store/actions/inspect';
 import {CLEAR_ALL_DIAG} from '@store/types/diagnosticList';
 import {CLEAR_ALL_PUSH_MESSAGE, SET_TIPS} from '@store/types/pushMessage';
 import {ISREAD, SETREADDITEMS} from "../store/types/homePage";
+import config from '@config/index.js';
 
 /***
  * 工具函数
@@ -176,6 +177,7 @@ const getAllDataList =(baseList) =>{           //获取所有模块结构化的
     jsonData.checkBodySelecteds = baseList.checkBody.selecteds;      //主诉选中状态保存
     jsonData.addItems = baseList.homePage.addItems||{};
     jsonData.mainsuitIds = baseList.mainSuit.mainIds;      //主诉去重
+    jsonData.mainSymptIds = baseList.mainSuit.mainSymptIds;      //主诉去重
     jsonData.currentIds = baseList.currentIll.symptomIds;      //现病史去重
     // console.log(jsonData,'结构化数据获取')
     return jsonData;
@@ -231,10 +233,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
         type:ISREAD
       });
     if(action == 'clear'){     //清空
-        store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[]});
+        store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[],mainSymptIds:[]});
         store.dispatch({type: CLEAR_CURRENT_ILL,data:[],saveText:[],selecteds:[],editClear:true,symptomIds:[]});
         store.dispatch({type: CLEAROTHERHISTORY,data:[],saveText:[],selecteds:[],editClear:true});
-        store.dispatch({type: CLEARCHECKBODY,data:[],saveText:[],selecteds:[]});
+        store.dispatch({type: CLEARCHECKBODY,data:[],isEmpty:true,saveText:[],selecteds:[]});
         store.dispatch(clearAssistData([],''));
         store.dispatch(clearAllLabel([],[],''));
         store.dispatch({
@@ -264,6 +266,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     selecteds:dataJson.mainSuitSelecteds?dataJson.mainSuitSelecteds:[],
                     saveText:JSON.parse(dataJsonStr.chief),
                     mainIds:dataJson.mainsuitIds?dataJson.mainsuitIds:[],
+                    mainSymptIds:dataJson.mainSymptIds?dataJson.mainSymptIds:[],
                 });
                 store.dispatch({
                     type: CLEAR_CURRENT_ILL,
@@ -316,7 +319,8 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     data:dataJson.chief,
                     selecteds:dataJson.mainSuitSelecteds?dataJson.mainSuitSelecteds:[],
                     saveText:dataJsonStr[0].content ? JSON.parse(dataJsonStr[0].content) :[],
-                    mainIds:dataJson.mainsuitIds?dataJson.mainsuitIds:[]
+                    mainIds:dataJson.mainsuitIds?dataJson.mainsuitIds:[],
+                    mainSymptIds:dataJson.mainSymptIds?dataJson.mainSymptIds:[],
                 });
                 store.dispatch({
                     type: CLEAR_CURRENT_ILL,