Explorar el Código

Merge branch 'dev/new1' into dev/zhangxc1

zhangxc hace 6 años
padre
commit
a2ff4128b2
Se han modificado 48 ficheros con 759 adiciones y 279 borrados
  1. 4 3
      src/common/components/EditableSpan/index.jsx
  2. 1 1
      src/common/components/InspectCommon/index.jsx
  3. 3 1
      src/common/components/InspectCommon/index.less
  4. 1 1
      src/common/components/NumberPan/index.jsx
  5. 21 4
      src/common/components/Textarea/index.jsx
  6. 20 14
      src/common/js/func.js
  7. 3 3
      src/components/AddInspect/SlideExcel/index.jsx
  8. 1 0
      src/components/AddInspect/index.less
  9. 1 1
      src/components/AssistCheck/index.jsx
  10. 23 9
      src/components/CheckBody/index.jsx
  11. 1 1
      src/components/Diagnosis/index.jsx
  12. 1 0
      src/components/DiagnosticItem/index.jsx
  13. 1 2
      src/components/Inspect/index.jsx
  14. 3 0
      src/components/MultSpread/index.jsx
  15. 61 19
      src/components/NumberDrop/index.jsx
  16. 35 18
      src/components/NumberUnitDrop/index.jsx
  17. 2 2
      src/components/Operation/index.jsx
  18. 7 3
      src/components/PreviewBody/index.jsx
  19. 16 2
      src/components/PushItems/index.jsx
  20. 1 1
      src/components/SpreadDrop/index.jsx
  21. 18 62
      src/components/Treat/index.jsx
  22. 6 0
      src/components/Treat/index.less
  23. 18 10
      src/components/TreatDesc/DrugInfo/index.jsx
  24. 10 0
      src/components/TreatDesc/DrugInfo/index.less
  25. 3 2
      src/config/index.js
  26. 1 0
      src/containers/CheckBody.js
  27. 1 1
      src/containers/Inspect.js
  28. 2 2
      src/containers/Multiple.js
  29. 24 8
      src/containers/NumberUnitDrop.js
  30. 4 2
      src/containers/RadioInpDrop.js
  31. 14 8
      src/containers/SpreadDrop.js
  32. 5 2
      src/containers/eleType.js
  33. 52 8
      src/store/actions/checkBody.js
  34. 87 31
      src/store/actions/currentIll.js
  35. 2 0
      src/store/actions/diagnosticList.js
  36. 21 22
      src/store/actions/mainSuit.js
  37. 70 8
      src/store/actions/otherHistory.js
  38. 3 3
      src/store/actions/patInfo.js
  39. 6 0
      src/store/actions/treat.js
  40. 3 3
      src/store/async-actions/fetchModules.js
  41. 10 2
      src/store/async-actions/homePage.js
  42. 2 1
      src/store/async-actions/mainSuit.js
  43. 2 1
      src/store/reducers/diagnosticList.js
  44. 76 8
      src/store/reducers/inspect.js
  45. 4 2
      src/store/reducers/treat.js
  46. 1 0
      src/store/types/treat.js
  47. 2 2
      src/utils/config.js
  48. 106 6
      src/utils/tools.js

+ 4 - 3
src/common/components/EditableSpan/index.jsx

@@ -185,9 +185,10 @@ class EditableSpan extends Component{
         obj.focus();
       }
     }
-    ele = document.activeElement;
-    boxTop = target.innerText?getPageCoordinate(e).boxTop:$(ele).offset().top+30;
-    setSearchLocation(boxTop,ele.offsetLeft)     //搜索框的位置动态获取
+    // 注释掉,放开会影响删除
+    // ele = document.activeElement;
+    // boxTop = target.innerText?getPageCoordinate(e).boxTop:$(ele).offset().top+30;
+    // setSearchLocation(boxTop,ele.offsetLeft)     //搜索框的位置动态获取
   }  
   handleKeyup(e){
     const {boxMark,handleKeydown,i,value,removeId,handleClear,delSingleLable,setSearchLocation} = this.props;

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

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

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

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

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

@@ -55,7 +55,7 @@ class NumberPan extends Component{
       display:show?'table':'none'        //table onBlur阻止冒泡是为了修复multSpread中数字键盘点击触发最外层数字组件onBlur事件
     }
   }
-  render(){  
+  render(){
     const select = this.handleSelect.bind(this); 
     const domNode = document.getElementById('root');
     return ReactDom.createPortal(

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

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

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

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

+ 3 - 3
src/components/AddInspect/SlideExcel/index.jsx

@@ -31,7 +31,7 @@ class SlideExcel extends Component {
     })
   }
   render() {
-    const {items,item,idx} = this.props;
+    const {items,item,idx,dateTime} = this.props;
     const {show} = this.state;
     return (
       <li className={styles.excelDataLis} style={{border:items.lisExcelRes.length-1 == idx? 0:''}}>
@@ -46,7 +46,7 @@ class SlideExcel extends Component {
                       <td style={{width:'25%'}}>
                           {normalVal(value.min,value.max)}
                       </td>
-                      <td style={{width:'25%'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+this.toTime(value.time)}</td>
+                      <td style={{width:'25%'}}>{value.time == ''?('导入时间: '+dateTime):'化验时间: '+this.toTime(value.time)}</td>
                   </tr>
                 })):(item.lisExcelItem && item.lisExcelItem.map((value,idx)=>{
                   if(idx < 4){
@@ -56,7 +56,7 @@ class SlideExcel extends Component {
                         <td style={{width:'25%'}}>
                             {normalVal(value.min,value.max)}
                         </td>
-                        <td style={{width:'25%'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+this.toTime(value.time)}</td>
+                        <td style={{width:'25%'}}>{value.time == ''?('导入时间: '+dateTime):'化验时间: '+this.toTime(value.time)}</td>
                     </tr>
                   }
                 }))

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

@@ -118,6 +118,7 @@
     margin-bottom: 5px;
     border-top: 1px solid #EAEDF1;
     overflow: hidden;
+    box-sizing: border-box;
 }
 .itemPart {
     height: 28px;

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

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

+ 23 - 9
src/components/CheckBody/index.jsx

@@ -31,15 +31,25 @@ class CheckBody extends Component{
   }
   getLabels(){
     const {data,showArr,saveText,selecteds} = this.props;
-    let arr = [],list=[];
-    const {boxMark,showAll} = this.state;
-    const showData = showAll?[...data]:[...data].splice(0,config.showCheckNum*2+1);
+    let arr = [],list=[];//console.log(data,saveText)
+    const {boxMark,showAll} = this.state;//console.log(data)
+    const moreNum =data.length-[...data].reverse().findIndex((it)=>it.showInCheck)-1;//被隐藏的位置
+    //console.log(moreNum,this.props.defaultShowAll,showAll);
+    const moreText = filterDataArr([...saveText].splice(moreNum));      //被收起的标签中是否有有值得,有则不能再收起showMoreBtn?more:''
+    const more = this.props.defaultShowAll||showAll?<span className={style['more']} onClick={this.showHide}>收起<img src={hideImg} /></span>:<span className={style['more']} onClick={this.showHide}>展开<img src={showImg} /></span>;
+    const showMoreBtn = data.length>moreNum&&!moreText;
+    let showArray = data.filter((it)=>{
+      if(it.showInCheck)
+        return it;
+    });
+    const showData = moreText||this.props.defaultShowAll||showAll?[...data]:showArray;//[...data].splice(0,config.showCheckNum*2+1);
     if(showData){
       list = showData;
       arr = list.map((it,i)=>{
         return chooseType({item:it,boxMark,i,showArr,saveText,selecteds});
       });
     }
+    showMoreBtn&&arr.push(more);      //是否显示收起展开按钮
     return arr;
   }
   handleClick(e){//让搜索框跟随鼠标点击移动
@@ -89,6 +99,14 @@ class CheckBody extends Component{
     //有主诉时且本身无数据,第一次点击获取数据,(不论获取成功与否)再点击不获取(直到刷新成空白页或清空)
     if(hasMain&&isEmpty!=false){
       this.props.getInit();
+      //隐藏区域有默认选中项,默认全部展开-有延迟,弃用
+      /*const that = this;
+      setTimeout(function(){
+        that.props.showAll&&that.setState({
+          showAll:true
+        });
+      },900)*/
+
     }
   }
   showHide(){
@@ -105,15 +123,11 @@ class CheckBody extends Component{
   }
   render(){
     const {searchData,totalHide,data,boxLeft,boxTop,saveText} = this.props;
-    const {showAll} = this.state;
-    const moreNum =config.showCheckNum*2+1;
-    const moreText = filterDataArr([...saveText].splice(moreNum));
-    const more = showAll?<span className={style['more']} onClick={this.showHide}>收起<img src={hideImg} /></span>:<span className={style['more']} onClick={this.showHide}>展开<img src={showImg} /></span>;
-    const showMoreBtn = data.length>moreNum&&!moreText;
+
     return  <div className={style['container']}>
       <ItemBox title='查体' handleClick={this.handleClick}>
         {this.getLabels()}
-        {showMoreBtn?more:''}
+        {/*{showMoreBtn?more:''}*/}
         {searchData && searchData.length>0?<SearchDrop data={searchData} show={!totalHide} left={boxLeft} top={boxTop} onSelect={this.handleSearchSelect}></SearchDrop>:''}
       </ItemBox>
     </div>

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

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

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

@@ -65,6 +65,7 @@ class DiagnosticItem extends Component{
                 hideSearch&&hideSearch()
         //     })
         // }, 0)
+        document.getElementById("diagnosisResult").scrollIntoView(true)
     }
 
     render(){

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

@@ -146,9 +146,8 @@ class Inspect extends React.Component {
         return (
             <div className={styles.wrapper} >
                 {/* 导入功能插件,ie8/9权限问题暂未解决,先隐藏 */}
-
                 <div className={styles.top}>
-                    <span>化验结果数据</span>
+                    <span id="inspectResultData">化验结果数据</span>
                     <div className={this.getStyle()} onClick={ieVersion&&ieVersion<=9?null:this.handleImportExcel}>
                        {/* <button disabled={ieVersion&&ieVersion>9?true:false}>导入化验结果</button>*/}
                         <div className={styles.pushButton}>导入化验结果</div>

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

@@ -54,6 +54,7 @@ class MultSpread extends Component{
         case +it.controlType===1:
           const list = it.questionDetailList&&it.questionDetailList.length>0?it.questionDetailList:it.questionMapping;
           return <RadioDrop data={list}
+                            boxMark={boxMark}
                             prefix={it.labelPrefix}
                             suffix={it.labelSuffix}
                             placeholder={it.name}
@@ -100,6 +101,8 @@ class MultSpread extends Component{
           return <NumberDrop prefix={it.labelPrefix}
                              suffix={it.labelSuffix}
                              placeholder={it.name}
+                             min={it.minValue}
+                             max={it.maxValue}
                              show={show}
                              allClick={false}
                              ikey={inx}

+ 61 - 19
src/components/NumberDrop/index.jsx

@@ -1,6 +1,6 @@
 import React,{Component} from 'react';
 import className from 'classnames';
-import {NumberPan} from '@commonComp';
+import {NumberPan,Notify} from '@commonComp';
 import style from './index.less';
 import $ from "jquery";
 import {handleEnter,getPageCoordinate} from '@utils/tools.js';
@@ -20,6 +20,7 @@ class NumberDrop extends Component{
     this.state={
       editable:false,      //标签是否可输入
       timer:null,
+      sltTimer:null,
       hasSelect:false,       //是否点过下拉键盘
       boxLeft:0,
       boxTop:0,
@@ -39,21 +40,50 @@ class NumberDrop extends Component{
     this.handleBlur = this.handleBlur.bind(this);
     this.changeToEdit = this.changeToEdit.bind(this);
     this.handleKeyDowm = this.handleKeyDowm.bind(this);
+    this.beyondArea = this.beyondArea.bind(this);
   }
   select(text){        //选中键盘上数字事件
-    const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
+    let timer = null;
+    clearTimeout(this.state.sltTimer);
+    const {handleSelect,ikey,suffix,prefix,mainSaveText,min,max} = this.props;
+    const needCompare=min!=undefined&&max!=undefined;
     if(!text){
       this.setState({
         placeholder:this.props.placeholder
       });
     }else{
+      //console.log(text,isNaN(+text),max<+text)
+      if(needCompare){
+        if(!isNaN(+text)&&max<+text){     //数值过大
+          this.beyondArea();
+          return;
+        }
+        const that = this;
+        timer = setTimeout(function(){
+          clearTimeout(that.state.sltTimer);
+          if(!that.props.show&&!isNaN(+text)&&min>+text){
+            that.beyondArea();
+            return;
+          }
+        },1500);
+      }
       this.setState({
-        hasSelect:true
+        hasSelect:true,
+        sltTimer:timer
       });
     }
 
     handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
   }
+  beyondArea(){
+    const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
+    Notify.info("数值在正常值范围内,请重新输入");
+    handleSelect&&handleSelect({ikey,text:'',suffix,prefix,mainSaveText});
+    this.setState({
+      placeholder:this.props.placeholder,
+      hasSelect:false
+    });
+  }
   handleNumFocus(e){       //数字框可编辑状态下聚集事件,处理是否显示下拉等
     const {placeholder} = this.state;
     const val = e.target.innerText.trim();
@@ -67,7 +97,6 @@ class NumberDrop extends Component{
   }
   handleNumClick(e){     //数字框不可编辑的状态时点击事件,点击将数字框变为可输入且下拉不再显示直到失焦后再次聚集
     const {show,handleShow,ikey,id,patId,handleHide,value} = this.props;
-    this.$span.current.focus();
     if(show) {
       handleHide && handleHide();
       return;
@@ -80,6 +109,11 @@ class NumberDrop extends Component{
       //双击时不显示下拉
       clearTimeout(that.state.timer);
       const timer = setTimeout(function(){
+        //只有弹窗关闭则点击数字键盘会清空当前数据
+        that.$span.current.focus();
+        that.setState({
+          hasSelect:false
+        });
         handleShow&&handleShow({ikey,id:patId||id});
       },300);
       this.setState({
@@ -100,31 +134,38 @@ class NumberDrop extends Component{
   }
   numInpBlur(e){        //数字框失焦,保存值到store中
     e.stopPropagation();
-    if(this.props.show){      //修改清空后第一次点击键盘不触发click事件bug
+    const {handleSelect,ikey,suffix,prefix,mainSaveText,min,max,show} = this.props;
+    if(show){      //修改清空后第一次点击键盘不触发click事件bug
       return;
     }
-    const that = this;
-    //setTimeout(function(){      //第一次选中数字时placeholder闪一下优化
-      if(!e.target.innerText.trim()){
-        that.setState({
-          placeholder:that.props.placeholder
-        });
-      }
-    //},100);
+    //输入超出合理范围提示且清空
+    const txt = e.target.innerText.replace(/^\s*/,'');
+    if(max!=undefined&&!isNaN(+txt)&&(min>+txt||max<+txt)){
+      this.beyondArea();
+      return;
+    }
+    //输入为空时显示placeholder
+    if(!e.target.innerText.trim()){
+      this.setState({
+        placeholder:this.props.placeholder
+      });
+    }
 
-    this.setState({
+    /*this.setState({
       hasSelect:false
-    });
+    });*/
     const val = e.target.innerText.replace(/^\s*/,'');
-    const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
     const {placeholder} = this.state;
-    const text = val===placeholder?'':val;
+    let text = val===placeholder?'':val.replace(/[\u4e00-\u9fa5]/g,'');
     e.target.innerText = '';      //避免出现重复输入值
     handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
   }
   handleSpanInp(e){   //数字框输入事件
     e.stopPropagation();
     const {handleHide} = this.props;
+    /*this.setState({     //再键盘点击数字要清空
+      hasSelect:false
+    });*/
     handleHide&&handleHide();
   }
   handleKeyDowm(e){
@@ -133,14 +174,15 @@ class NumberDrop extends Component{
     const key = e.key;
     const ctrlOn = e.ctrlKey;
     const isCopyPaste = ctrlOn&&(key=='v'||key=='c');
-    if(!/[0-9|.|~|\/]/.test(key)&&key.length==1&&!isCopyPaste){
+    if((!/[0-9|.|~|\/]/.test(key)&&key.length==1&&!isCopyPaste)){
       e.preventDefault();
       return false;
     }
   }
   getClasses(){         //整个标签是否有值的状态
     const {hideTag,placeholder,value} = this.props;
-    const val = this.$span.current&&this.$span.current.innerText.trim()||value;
+    const $span = this.$span.current;
+    const val = value;//$span&&$span.innerText.trim()||value;
     const blueBorder = this.state.editable?style['blue-border']:'';
     const isSelected = val&&val!=placeholder?style['selected']:style['container'];
     const noTag = hideTag?style['no-tag']:'';

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

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

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

@@ -166,7 +166,7 @@ class Operation extends Component {
       return false
     }
     console.log(jsonStr,'文本')
-    console.log(jsonData.chief,'结构')       //测试需要用到,不要删了
+    console.log(jsonData,'结构')       //测试需要用到,不要删了
     for(let i = 0;i <tmpLis.length;i++){
       let dataStr = tmpLis[i].preview;
       let dataJson = tmpLis[i].dataJson;
@@ -346,4 +346,4 @@ class Operation extends Component {
   }
 }
 
-export default Operation;
+export default Operation;

+ 7 - 3
src/components/PreviewBody/index.jsx

@@ -3,6 +3,7 @@ import style from "./index.less";
 import { normalVal, filterDataArr, filterOtherDataArr,timestampToTime } from '@utils/tools';
 import Notify from '@commonComp/Notify';
 import $ from "jquery";
+import { relative } from "path";
 
 (function ($) {
   var opt;
@@ -235,9 +236,12 @@ class PreviewBody extends Component {
               }
               {
                 dataJson.lis.labelList && dataJson.lis.labelList.map((item, idx) => {
-                  if (item.show) {
+                  // if (item.show) {
                     return <table style={{ margin: '8px 0', width: '100%' }}>
-                      <tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ borderBottom: '1px solid #666666' }}>{item.name}</span></td></tr>
+                      {
+                        item.show?<tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ borderBottom: '1px solid #666666' }}> {item.name} </span></td></tr>:
+                        <tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ position:'relative',left:'-10px' }}>「{item.name}」</span></td></tr>
+                      }
                       {
                         item.details.map((val) => {
                           if (val.value && val.value != '') {
@@ -253,7 +257,7 @@ class PreviewBody extends Component {
                         })
                       }
                     </table>
-                  }
+                  // }
                 })
               }
             </td>

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

@@ -78,12 +78,17 @@ class PushItems extends Component {
       value:''
     }
     if(checkedAssay.length > 0){
-      let assayArr = []
+      let assayArr = [],tmpDetail=[]
       for(let i = 0;i < checkedAssay.length;i++){
         let tmpObj = JSON.parse(JSON.stringify(obj));
+        if (checkedAssay[i].controlType == 0) {
+          tmpDetail = checkedAssay[i].questionMapping
+        }else if(checkedAssay[i].controlType == 1 || checkedAssay[i].controlType == 6){
+          tmpDetail.push(checkedAssay[i])
+        }
         tmpObj.questionId = checkedAssay[i].id
         tmpObj.name = checkedAssay[i].name
-        tmpObj.details = checkedAssay[i].questionMapping
+        tmpObj.details = tmpDetail
         assayArr.push(tmpObj)
       }
       store.dispatch(addLabel(assayArr))
@@ -98,6 +103,15 @@ class PushItems extends Component {
       }
       store.dispatch(addAssistLabel(checkArr))
     }
+    if(checkedAssay.length > 0){
+      document.getElementById("inspectResultData").scrollIntoView(true)
+    }else{
+      if(checkedCheck.length > 0){
+        document.getElementById("assistResultData").scrollIntoView(true)
+      }else{
+        return;
+      }
+    }
   }
 
   changeAssay(item) {

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

@@ -228,7 +228,7 @@ class SpreadDrop extends Component{
       const tIndex= exists.findIndex((it)=>it.questionId===item.questionId);
       const bIndex= withs.findIndex((it)=>it.questionId===item.questionId);
       if(tIndex!=-1){
-        exists.splice(tIndex,1,item);
+        exists.splice(tIndex,1,Object.assign({},item,{name}));    //修改单选列连接字符不显示bug
         this.setState({
           exists,
         })

+ 18 - 62
src/components/Treat/index.jsx

@@ -3,6 +3,7 @@ import style from './index.less';
 import GeneralTreat from './GeneralTreat/index.jsx';
 import DrugTreat from './DrugTreat/index.jsx';
 import TreatDesc from '@components/TreatDesc'
+import {dragBox,windowRemoveEventHandler} from '@utils/tools'
 import DrugInfo from '@components/TreatDesc/DrugInfo';
 import Notify from '@commonComp/Notify'
 import close from './img/close.png';
@@ -13,70 +14,23 @@ import $ from "jquery";
 class Treat extends Component {
     constructor(props){
         super(props);
+        this.state = {
+          zIndex:301
+        }
         this.hideTreat = this.hideTreat.bind(this);
         this.handlePrescription = this.handlePrescription.bind(this);
         this.handleDetermine = this.handleDetermine.bind(this);
+        this.setTreatBox = this.setTreatBox.bind(this);
     }
     componentDidMount(){
-        let wrap = document.getElementById('treatWrapper')
-        let drag = document.getElementById('dragTreatTitle')
-        let width = $(window).width();
-        let height = $(window).height();
-        let mouseX = 0,mouseY = 0,dragX = 0,dragY = 0,isDrag = false,isMove = false;
-        
-        let maxDragX = width - wrap.offsetWidth
-        let maxDragY = height - wrap.offsetHeight
-        drag.onmousedown = (event)=>{    //鼠标位置获取,计算点击位置到拖拽元素左边的距离
-          let e = event || window.event;
-          mouseX = e.pageX - wrap.offsetLeft
-          mouseY = e.pageY - wrap.offsetTop
-          isDrag = true
-        }
-        document.onmousemove = (event)=>{      //移动的
-          let e = event || window.event;
-          if(isDrag){
-            dragX = e.pageX - mouseX
-            dragY = e.pageY - mouseY
-            if(dragX < 0){      //不能超出左边界
-              dragX = 0
-            }
-            if(dragY < 0){      //不能超出上边界
-              dragY = 0
-            }
-            // if(wrap.offsetLeft >= maxDragX){
-            //   dragX = maxDragX
-            // }else{
-            //   dragX = e.pageX - mouseX
-            // }
-
-            // if(height-drag.offsetHeight > wrap.offsetTop){
-            //   dragY = height-drag.offsetHeight
-            // }
-            isMove = true
-            wrap.style.left = dragX + 'px'
-            wrap.style.marginLeft = 0 + 'px'
-            wrap.style.top = dragY + 'px'
-          }
-        }
-        document.onmouseup = ()=>{
-          if(isMove){
-            wrap.style.left = dragX + 'px'
-            wrap.style.top = dragY + 'px'
-          }else{
-            wrap.style.left = '50%'
-            wrap.style.top = '10%'
-            wrap.style.marginLeft = '-340px'
-          }
-          isDrag = false
-          return false
-        }
+      dragBox('treatWrapper','dragTreatTitle')
     }
+    
     hideTreat() {
         const { hideTreat,clearTreat } = this.props;
         clearTreat && clearTreat();
         hideTreat && hideTreat();
-        // document.onmousemove = null
-        // document.onmouseup = null
+        // windowRemoveEventHandler('mousemove',handleMove,document)
     }
     handlePrescription() {
         Notify.info('该功能即将上线,敬请期待。', 2000)
@@ -91,16 +45,22 @@ class Treat extends Component {
         const {  showDrugInfo } = this.props;
         showDrugInfo && showDrugInfo();
     }
-
+    setTreatBox(idx){
+      this.setState({
+        zIndex:idx == 300?300 : 500
+      })
+    }
     render(){
         const { generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore} = this.props;
         const { setDrugInfoMore } = this.props
+        const { zIndex } = this.state
         return(
             <div   className={style['treat-wrapper']}>
                 <div className={style['treat-mask']} onClick={this.hideTreat}>
                 </div>
-                <div id="treatWrapper" className={style['treat-box']}  onselectstart="return false">
-                    <div id="dragTreatTitle" className={style['treat-title']}>治疗方案 ({treatItem.name})<img onClick={this.hideTreat} src={close}/></div>
+                <div id="treatWrapper" className={style['treat-box']}  onselectstart="return false" style={{zIndex:zIndex}}>
+                    <img className={style.close} onClick={this.hideTreat} src={close}/>
+                    <div onMouseDown={this.setTreatBox} id="dragTreatTitle" className={style['treat-title']}>治疗方案 ({treatItem.name})</div>
 
                     <div className={style['treat-inner-box']}>
                         <GeneralTreat icon={generalIcon} title='一般治疗'   generalTreat={generalTreat}></GeneralTreat>
@@ -128,14 +88,10 @@ class Treat extends Component {
                     </TreatDesc>}
                 </div>
                 
-                
-                {showDrug && drugInfo && <DrugInfo drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
+                {showDrug && drugInfo && <DrugInfo setTreatBox={this.setTreatBox} drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
                 {/* 查询多个药品说明书 (添加数据查看药品说明书用)*/}
                 {/* {showDrug && <DrugInfo drugInfoList = {drugInfoList} hideDrugInfoMore = {hideDrugInfoMore}></DrugInfo>} */}
             </div>
-                
-            
-        
         )
     }
 }

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

@@ -14,6 +14,12 @@
     // z-index: 301;
     z-index: 300;
 }
+.close {
+  position: absolute;
+  z-index:9999;
+  top: 0;
+  right: 0;
+}
 .treat-mask {
     position: fixed;
     width: 100%;

+ 18 - 10
src/components/TreatDesc/DrugInfo/index.jsx

@@ -2,14 +2,20 @@ import React, { Component } from 'react';
 import style from './index.less';
 import close from './../img/close.png';
 import $ from "jquery";
+import {dragBox} from '@utils/tools'
 
 
 class DrugInfo extends Component {
     constructor(props) {
         super(props);
         this.state = {
-            currentIndex: 0
+            currentIndex: 0,
+            zIndex:301
         }
+        this.setDragBox = this.setDragBox.bind(this)
+    }
+    componentDidMount(){
+      dragBox('drugWrapper','drugTitle')
     }
     handleClickMenu(index, item, drugDesc) {
         const that = this
@@ -40,12 +46,19 @@ class DrugInfo extends Component {
             }
         }
     }
-
+    setDragBox(){
+      const {zIndex,setTreatBox} = this.props
+      setTreatBox(300)
+      this.setState({
+        zIndex:zIndex+10
+      })
+    }
     render() {
         const { drugInfo, hideDrugInfo, drugInfoList,hideDrugInfoMore } = this.props
-        const { currentIndex } = this.state
-        return (<div className={style['drug-info-wrapper']}>
-                <h3 className={style['drug-title']}>{drugInfo.title}说明书  <img src={close} onClick={hideDrugInfo} className={style['close-drug-desc']}/> </h3>
+        const { currentIndex,zIndex } = this.state
+        return (<div className={style['drug-info-wrapper']} id="drugWrapper" style={{zIndex:zIndex}}>
+                <img src={close} onClick={hideDrugInfo} className={style['close-drug-desc']}/>
+                <h3 onMouseDown={this.setDragBox} id="drugTitle" className={style['drug-title']}>{drugInfo.title}说明书  </h3>
                 { drugInfo && drugInfo.drugDesc.length > 0 && <div className={style['drug-desc-wrapper']} id='drugDesc' onScroll={this.handleScrollModal.bind(this,  drugInfo.drugDesc)}>
                     <div className={style['drug-title1']} >{drugInfo.title}说明书</div>
                     {drugInfo.drugDesc.map((item, index) =>{
@@ -55,7 +68,6 @@ class DrugInfo extends Component {
                         </div>
                     })}
                     <div className={style['content-menu-box']}>
-                        
                         <div className={style['content-menu']}>
                             {drugInfo.drugDesc.map((item, index) => {
                                 return (<div >
@@ -67,18 +79,14 @@ class DrugInfo extends Component {
                                     </div>
                                 </div>)
                             })}
-
                         </div>
-                    
                     </div>
                 </div> }
                 { !drugInfo || (drugInfo && drugInfo.drugDesc.length === 0) && <div className={style['drug-desc-wrapper']}>
                     <div>
                         该药品暂无说明
                     </div>
-                    
                 </div> }
-
         </div>)
 
 

+ 10 - 0
src/components/TreatDesc/DrugInfo/index.less

@@ -24,10 +24,20 @@
     line-height: 40px;
     padding: 0 40px;
     border-bottom: 1px solid #979797;
+    cursor: move;
+    moz-user-select: -moz-none;
+    -moz-user-select: none;
+    -o-user-select:none;
+    -khtml-user-select:none;
+    -webkit-user-select:none;
+    -ms-user-select:none;
+    user-select:none;
 }
 .close-drug-desc {
     position: absolute;
     right: 0;
+    top: 0;
+    z-index: 9999;
     width: 40px;
 }
 .drug-desc-item {

+ 3 - 2
src/config/index.js

@@ -26,7 +26,7 @@ export default {
     addOthSId:21,      //现病史 添加其他症状id
     banId:10,       //伴 id
     limited:30,    //主诉限制字数
-    limitText:"已超过30字符,请修改主诉",    //主诉限制提示
+    limitText:"已超过30字符(含标点),请修改主诉",    //主诉限制提示
     delayTime:500,      //延迟搜索的时间
     delayPushTime:1000,    //延迟推送时间
     pushDelay:1000,
@@ -44,5 +44,6 @@ export default {
     },
     showCheckNum:16,        //查体默认展开非自由文本标签的个数
     radioOptionPer:'()',     //单选项输入占位符
-    Params
+    textReg:new RegExp("([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9])"), //包含中英文或数字
+  Params
 };

+ 1 - 0
src/containers/CheckBody.js

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

+ 1 - 1
src/containers/Inspect.js

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

+ 2 - 2
src/containers/Multiple.js

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

+ 24 - 8
src/containers/NumberUnitDrop.js

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

+ 4 - 2
src/containers/RadioInpDrop.js

@@ -142,10 +142,12 @@ function mapDispatchToProps(dispatch,store){
       });
     },
     handleSaveInp(params){
-      const {boxMark,ikey} = params;
+      const {boxMark} = params;
+      const index = params.ikey;
+      let ikey = getLabelIndex(index);
       dispatch({
         type:InputActions[+boxMark],
-        data:{values:params.values,ikey:ikey}
+        data:{values:params.values,ikey:boxMark==4?params.ikey:ikey}
       });
       dispatch(billing());
       dispatch({

+ 14 - 8
src/containers/SpreadDrop.js

@@ -136,7 +136,7 @@ function currentIll(dispatch,store,params){
   let existsId = exists && exists.length>0?getIds(exists):[];
   let withsId = withs && withs.length>0?getIds(withs):[];
   // const ids = existsId.join(",")+withsId.join(",");
-  const ids = (existsId.concat(withsId)).join(",");console.log("点击的下标是:",index,"选中的id是:",ids)
+  const ids = (existsId.concat(withsId)).join(",");
   let has = [],wes=[];
   //获取选中项目模板
   fetchModules(ids).then((res)=>{
@@ -292,8 +292,10 @@ function handleModuleDiff(dispatch,store,params){
 
 //主诉普通多选确定
 function mainSuitCheck(dispatch,store,params){
-  const {nones,exists,withs,order,mainSaveText,value} = params;
+  const {nones,exists,withs,order,mainSaveText,value,ikey} = params;
   let existsName = getNames(exists,order);
+  let withsName = getNames(withs);
+  let labelInx = getLabelIndex(ikey);
   let text = filterDataArr(mainSaveText);
   /*if(text.length >= config.limited){
     Notify.info(config.limitText);
@@ -305,11 +307,12 @@ function mainSuitCheck(dispatch,store,params){
     Notify.info(config.limitText);
     return
   }
-  const index = params.ikey;
-  let ikey = getLabelIndex(index);
+  // const index = params.ikey;
+  // let ikey = getLabelIndex(index);
   dispatch({
     type: COMM_CONFIRM,
-    data: {exists:exists,existsName:existsName,ikey}
+    // data: {exists:exists,existsName:existsName,ikey}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   });
   dispatch({//隐藏下拉
     type:HIDEDROP
@@ -324,7 +327,8 @@ function currentCheck(dispatch,store,params){
   let labelInx = getLabelIndex(ikey);
   dispatch({
     type:SETMAINCHECKBOX,
-    data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    // data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   })
 }
 
@@ -337,7 +341,8 @@ function checkBodyCheck(dispatch,store,params){
   let labelInx = getLabelIndex(ikey);
   dispatch({
     type:SETCHECKBOX,
-    data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    // data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   })
 }
 //其他史普通多选确定
@@ -348,7 +353,8 @@ function otherHisCheck(dispatch,store,params){
   let labelInx = getLabelIndex(ikey);
   dispatch({
     type:SETOTHERCHECKBOX,
-    data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    // data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   })
 }
 

+ 5 - 2
src/containers/eleType.js

@@ -19,14 +19,15 @@ import Multiple from '@containers/Multiple';
  * *******/
 //单选类型
 export function singleRadio(params){
-  const data = params.item;//console.log(111,data);
+  const data = params.item;
   const {i,hideTag,boxMark,showArr,selecteds,boxTop,boxLeft} = params;
   const showInx = boxMark+i+'0';    //单括号多标签的情况下需要识别同一个标签内多个下拉组件的显示状态
   switch (+data.controlType){
     case 0:
     case 1:
+      const custom= JSON.parse(localStorage.getItem('radio'+data.id));
       const list = data.questionDetailList&&data.questionDetailList.length>0?data.questionDetailList:data.questionMapping;
-      return <RadioDrop data={list}
+      return <RadioDrop data={custom&&custom.length?[...custom,...list]:list}
                         prefix={data.labelPrefix}
                         suffix={data.labelSuffix}
                         placeholder={data.name}
@@ -73,6 +74,8 @@ export function singleRadio(params){
     case 7:
       return <NumberDrop prefix={data.labelPrefix}
                          suffix={data.labelSuffix}
+                         min={data.minValue}
+                         max={data.maxValue}
                          placeholder={data.name}
                          boxMark={boxMark}
                          id={data.id}

+ 52 - 8
src/store/actions/checkBody.js

@@ -4,8 +4,10 @@ import {getLabelIndex,fullfillText} from '@common/js/func.js';
 export function set(state,action){
   let res = Object.assign({},state);
   const {data} = action;
-  res.data = [...data];
-  res.saveText = fullfillText(res.data).saveText;//存逗号
+  const obj = fullfillText(data,false,false,false);
+  res.data = obj.newArr;
+  res.saveText = obj.saveText;//存逗号
+  res.showAll = obj.checkHiddenDefault;
   res.update = Math.random();
   res.isEmpty = action.isEmpty;
   return res;
@@ -103,7 +105,11 @@ export function setRadioValue(state,action){
   }
   if(+item.tagType===1){      //独立单选组件
     item.value = text;
-    res.saveText[labelInx] = item.labelPrefix+text+item.labelSuffix;
+    const exist = JSON.parse(localStorage.getItem('radio'+item.id)||null);
+    if(exist){    //选中状态处理
+      exist[0].selected=exist[0].id==id;
+      localStorage.setItem('radio'+item.id,JSON.stringify(exist));
+    }
     item.questionDetailList.map((its)=>{
       if(its.id === id){
         its.selected = true;
@@ -111,6 +117,7 @@ export function setRadioValue(state,action){
         its.selected = false;
       }
     });
+    res.saveText[labelInx] = item.labelPrefix+text+item.labelSuffix;
   }else{      //组合组件中的单选组件
     item.questionMapping[subInx].value = text;
     let hasValue = false;
@@ -203,7 +210,7 @@ export const setRadioInputValue = (state,action)=>{
 export function addLabelItem(state,action){
   let res = Object.assign({},state);
   const {data,i} = action;
-  const textLabel = JSON.parse(config.textLabel);
+  const textLabel = Object.assign({},JSON.parse(config._textLabel),{showInCheck:JSON.parse(data).showInCheck});
   //使用Object.assign({},data)拷贝操作时复制项和原项会同步修改
   if(!data) return res;
   res.data.splice(+i+2,0,JSON.parse(data),textLabel);
@@ -228,8 +235,8 @@ export function setCheckText(state,action) {
 //多选文字,如杂音
 export function setCheckBoxValue(state,action) {
   let res = Object.assign({},state);
-  const {labelInx,excluName,existsName,nones,withsName} = action.data;
-  let showText = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones&&nones.replace('、','')||'');
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
   if(pattern.test(showText)){
@@ -254,11 +261,17 @@ export function setSearchData(state,action){
 //插入标签数据-搜索
 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,searchInEnd}=action;
   const showText = res.saveText[index];
-  const spreadLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
+  let tempLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
+  //查体中,默认显示区域搜索出来的标签要默认显示,隐藏区域搜索出的默认隐藏
+  let hideAreaIndex = [...res.data].reverse().findIndex((it)=>it.showInCheck);
+  hideAreaIndex = res.data.length-hideAreaIndex-1;        //默认显示的最后一个标签的位置
+  const text = Object.assign({},JSON.parse(config._textLabel),{showInCheck:index>hideAreaIndex?false:true});
+  let spreadLabels =tempLabels.map((it)=>{
+    return Object.assign({},it,{showInCheck:index>hideAreaIndex?false:true});
+  });
   let reg = searchInEnd?new RegExp(searchStr+"$"):new RegExp("^"+searchStr);
   const newText=showText.replace(reg,'')||'';
   if(!isReplace){
@@ -308,6 +321,33 @@ export const changeLabelVal = (state,action)=>{//双击标签输入改变值
   if(labText && labText.trim()){
     if(item){
       item.value = newVal;
+      const canAdd=hasNoSame(item.questionDetailList,labText);
+      //单选双击编辑的内容自动加到下拉选项中,双击编辑但未修改不添加
+      if(canAdd&&+item.tagType===1&&(+item.controlType===1||+item.controlType===0)){
+        const li = {
+          id:-Math.floor(Math.random()*1000),
+          name:labText,
+          questionId:item.id,
+          orderNo:0,
+          code:0,
+          defaultSelect:"0",
+          remark:null,
+          abnormal:0,
+          selected:true
+        };
+
+        const exist = JSON.parse(localStorage.getItem('radio'+item.id)||null);
+        //console.log(exist)
+        if(exist&&typeof exist=='object'){     //已添加过编辑的数据
+          //exist.push(li);
+          exist[0]=li;        //暂限添1条
+          localStorage.setItem('radio'+item.id,JSON.stringify(exist));
+        }else{
+          localStorage.setItem('radio'+item.id,JSON.stringify([li]));
+        }
+      }
+      //取消原选中状态
+      item.questionDetailList.find((it)=>it.selected==true).selected=false;
       item.labelPrefix = prefix||'';
       item.labelSuffix = suffix||'';
       // res.saveText[index] = totalVal;
@@ -323,6 +363,10 @@ export const changeLabelVal = (state,action)=>{//双击标签输入改变值
   return res;
 }
 
+function hasNoSame(arr,text){
+  return arr.findIndex((it)=>text==it.name)==-1;
+}
+
 // 数字键盘较特殊,有直接输入
 export const changeNumLabelVal = (state,action)=>{
   const res = Object.assign({},state);

+ 87 - 31
src/store/actions/currentIll.js

@@ -63,12 +63,10 @@ export const setData = (state,action) =>{
   res.symptomIds = JSON.parse(JSON.stringify(mainIds));
   const num = action.info.num;//点击了几次添加病情变化
   const symptomFeature = action.info.symptomFeature;//分词
-  // const useEmpty = action.info.useEmpty;
   let useEmpty,mainData;
-  // let mainData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
   let mainModleData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
   let moduleData = JSON.parse(JSON.stringify(res.moduleData));//现病史模板
-  let addModule = JSON.parse(JSON.stringify(res.addModule));//拷贝的模板
+  // let addModule = JSON.parse(JSON.stringify(res.addModule));//拷贝的模板
   let current = JSON.parse(JSON.stringify(moduleData));
   let newMain = [];
   let mainLabelModule = res.mainLabelModule;//主诉选中的症状id获取到的模板
@@ -102,7 +100,7 @@ export const setData = (state,action) =>{
     })
     useEmpty = existData&&existData.length>0?false:true;
   }
-  // console.log(888,useEmpty);
+  
   if (useEmpty) {
     // res.data = res.emptyData;
     res.data = JSON.parse(JSON.stringify(res.emptyData));
@@ -137,12 +135,8 @@ export const setData = (state,action) =>{
       // 主症状添加tongYong标签选中文字
       let tongYText = tongYong?{name:tongYong,value:tongYong,tagType:config.tagType}:'';
       let mainCopy = JSON.parse(JSON.stringify(main));
-      /*if(tongYText){
-        for(let j=0; j<mainCopy.length; j++){
-          mainCopy[j].name = tongYong + (mainCopy[j].name).replace('、',"");
-          mainCopy[j].value = tongYong + (mainCopy[j].value).replace('、',"");
-        }
-      }*/
+      let manInput = [];
+      // 去掉主诉添加的顿号 
       for(let j=0; j<mainCopy.length; j++){
         if(tongYText){
           mainCopy[j].name = tongYong + (mainCopy[j].name).replace('、',"");
@@ -150,11 +144,18 @@ export const setData = (state,action) =>{
         }else{
           mainCopy[j].name = (mainCopy[j].name).replace('、',"");
           mainCopy[j].value = (mainCopy[j].value).replace('、',"");
+        }  
+        //查询是否有手动输入--输入的内容放到最后(3-27)
+        if(mainCopy[j].name != mainCopy[j].value){
+          const inputText = mainCopy[j].value.replace(mainCopy[j].name,"");
+          const textObj = Object.assign({},JSON.parse(config.textLabel),{name:inputText});
+          if(config.textReg.test(inputText)){//包含中英文或数字->即不全是标点符号才插入
+             manInput.push(textObj);
+          }
+          mainCopy[j].value = mainCopy[j].name;
         }
-        
       }
 
-
        // 将ids接口获取到的模板匹配到对应主症状后面
       // 主症状
       let newMainCopy = JSON.parse(JSON.stringify(mainCopy));
@@ -174,7 +175,8 @@ export const setData = (state,action) =>{
               if(items.length==0){//没有尾巴时给症状后加逗号(3.5)
                 for(let j=0; j<newMainCopy.length; j++){
                   if(newMainCopy[j].id==mainCopy[k].id){
-                    newMainCopy[j].value = newMainCopy[j].name = mainCopy[k].value+',';
+                    // newMainCopy[j].value = newMainCopy[j].name = mainCopy[k].value+',';
+                    newMainCopy[j].value = newMainCopy[j].name = mainCopy[k].value||mainCopy[k].name+',';
                   }
                 }
               }       
@@ -192,15 +194,20 @@ export const setData = (state,action) =>{
       }
       // 伴随
       // 去掉顿号
-     /* for(let b=0; b<withs.length; b++){
-        withs[b].name = withs[b].name.replace('、',"");
-      }*/
-      // let newWiths = JSON.parse(JSON.stringify(withs));
       let newWiths = [];
+      let manWithInput = [];
       if(withs.length>0){
         for(let b=0; b<withs.length; b++){
           withs[b].name = withs[b].name.replace('、',"");
           withs[b].value = withs[b].value.replace('、',"");
+          if(withs[b].name != withs[b].value){
+            const inputText = withs[b].value.replace(withs[b].name,"");
+            const textObj = Object.assign({},JSON.parse(config.textLabel),{name:inputText});
+            if(config.textReg.test(inputText)){//包含中英文或数字->即不全是标点符号才插入
+              manWithInput.push(textObj);
+            }           
+            withs[b].value = withs[b].name;  
+          }
         }
         newWiths = JSON.parse(JSON.stringify(withs));
         let withInd = 0;
@@ -221,8 +228,9 @@ export const setData = (state,action) =>{
               withLengArr[d] = items.length;
               if(items.length==0){//没有尾巴时给症状后加逗号(3.5)
                 for(let j=0; j<newWiths.length; j++){
-                  if(newWiths[j].id==mainCopy[d].id){
-                    newWiths[j].value = newWiths[j].name = withs[d].value+',';
+                  if(newWiths[j].id==withs[d].id){
+                    // newWiths[j].value = newWiths[j].name = withs[d].value+',';
+                    newWiths[j].value = newWiths[j].name = withs[d].value||withs[d].name+',';
                   }
                 }
               }
@@ -235,7 +243,7 @@ export const setData = (state,action) =>{
         }
       }
       
-      let symptomArr = newMainCopy.concat(newWiths);
+      let symptomArr = newMainCopy.concat(manInput,newWiths,manWithInput);
       let newSymptomArr = JSON.parse(JSON.stringify(symptomArr));  
       //组装好的主症状和伴随症状插入现病史模板(flag=4前)
       let insertIdx = null;
@@ -269,7 +277,7 @@ export const setData = (state,action) =>{
               if(items.length==0){//没有尾巴时给症状后加逗号(3.5)
                 for(let j=0; j<featureData.length; j++){
                   if(featureData[j].id==symptomFeature[k].id){
-                    featureData[j].value = featureData[j].name = symptomFeature[k].value+',';
+                    featureData[j].value = featureData[j].name = symptomFeature[k].value||symptomFeature[k].name+',';
                   }
                 }
               }
@@ -361,16 +369,15 @@ export const confirm = (state,action) =>{
 //普通多选确定事件-主诉通用特征、初为后为等
 export const setCheckBox = (state,action)=>{
   const res = Object.assign({},state);
-  const {exists,labelInx,existsName} = action.data;
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
-  let names=existsName;
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones&&nones.replace('、','')||'');
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
-  if(pattern.test(existsName)){
-    names = existsName.substr(0,existsName.length-1);
+  if(pattern.test(showText)){
+    showText = showText.substr(0,showText.length-1);
   }
-  let arr = res.data;
-  arr[labelInx].value = names;
-  res.saveText[labelInx] = names;
+  res.data[labelInx].value = showText;
+  res.saveText[labelInx] = showText;
   res.selecteds[labelInx] = action.data;
   res.update=Math.random();
   return res;
@@ -425,6 +432,11 @@ export function setRadioValue(state,action){
   if(+item.tagType===1){
     item.value = text;
     res.saveText[labelInx] = item.labelPrefix+text+item.labelSuffix;
+    const exist = JSON.parse(localStorage.getItem('radio'+item.id)||null);
+    if(exist){    //选中状态处理
+      exist[0].selected=exist[0].id==id;
+      localStorage.setItem('radio'+item.id,JSON.stringify(exist));
+    }
     item.questionDetailList.map((its)=>{
       if(its.id === id){
         its.selected = true;
@@ -517,6 +529,33 @@ export const changeLabelVal = (state,action)=>{
   if(labText.trim()){
     if(item){
       item.value = newVal;
+      const canAdd=hasNoSame(item.questionDetailList,labText);
+      //单选双击编辑的内容自动加到下拉选项中,双击编辑但未修改不添加
+      if(canAdd&&+item.tagType===1&&(+item.controlType===1||+item.controlType===0)){
+        const li = {
+          id:-Math.floor(Math.random()*1000),
+          name:labText,
+          questionId:item.id,
+          orderNo:0,
+          code:0,
+          defaultSelect:"0",
+          remark:null,
+          abnormal:0,
+          selected:true
+        };
+
+        const exist = JSON.parse(localStorage.getItem('radio'+item.id)||null);
+        //console.log(exist)
+        if(exist&&typeof exist=='object'){     //已添加过编辑的数据
+          //exist.push(li);
+          exist[0]=li;        //暂限添1条
+          localStorage.setItem('radio'+item.id,JSON.stringify(exist));
+        }else{
+          localStorage.setItem('radio'+item.id,JSON.stringify([li]));
+        }
+      }
+      //取消原选中状态
+      item.questionDetailList.find((it)=>it.selected==true).selected=false;
       item.labelPrefix = prefix||'';
       item.labelSuffix = suffix||'';
       res.saveText[index] = labText;
@@ -530,6 +569,9 @@ export const changeLabelVal = (state,action)=>{
   return res;
 }
 
+function hasNoSame(arr,text){
+  return arr.findIndex((it)=>text==it.name)==-1;
+}
 // 数字键盘较特殊,有直接输入
 export const changeNumLabelVal = (state,action)=>{
   const res = Object.assign({},state);
@@ -824,12 +866,26 @@ export function removeId(state,action){
 // 单列多选
 export function multipleComfirn(state,action){
   let res = Object.assign({},state);
-  const {ikey,seleData} = action.data;
-  let data = res.data;
+  const {ikey,seleData,fullIkey} = action.data;
+  let data = res.data;//console.log(action,data[ikey])
+  let index = fullIkey.substr(fullIkey.length-1,1);
+  if(data[ikey].tagType==3){    //在组合项中
+    let item = data[ikey].questionMapping;
+    let arr=[];
+    item[index].value = seleData;
+    item.map((it)=>{
+      if(it.value){
+        arr.push(it.labelPrefix+it.value+it.labelSuffix);
+      }
+    });
+    res.saveText[ikey] = arr.join("");
+    res.update = Math.random();
+    res.selecteds[ikey] = {[index]:action.data};
+    return res;
+  }
   data[ikey].value = seleData;
   res.saveText[ikey] = seleData;
   res.selecteds[ikey] = action.data;
-  res.update = Math.random();
   return res;
 }
 

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

@@ -67,11 +67,13 @@ export const setDiagToMainSuit = (state, action) => {
     res.mainSuitStr = action.data;
     return res;
 }
+
 export const clearAllDiag = (state, action) => {
     const res = Object.assign({}, state);
     res.diagnosticList = action.data
     res.diagnosticStr = action.saveText
     res.mainSuitStr = action.mainSuitStr
+    res.diagnosticStrNoType = action.saveText
     return res;
 }
 

+ 21 - 22
src/store/actions/mainSuit.js

@@ -264,17 +264,16 @@ export const confirm = (state,action) =>{
 // 普通多选确定事件
 export const commConfirm=(state,action)=>{
   const res = Object.assign({},state);
-  const {exists,ikey,existsName} = action.data;
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
-  let names=existsName;
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones&&nones.replace('、','')||'');
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
-  if(pattern.test(existsName)){
-    names = existsName.substr(0,existsName.length-1);
+  if(pattern.test(showText)){
+    showText = showText.substr(0,showText.length-1);
   }
-  let arr = res.data;
-  arr[ikey].value = names;
-  res.saveText[ikey] = names;
-  res.selecteds[ikey] = action.data;
+  res.data[labelInx].value = showText;
+  res.saveText[labelInx] = showText;
+  res.selecteds[labelInx] = action.data;
   res.update=Math.random();
   return res;
 }
@@ -521,29 +520,29 @@ export const setRadioInputValue = (state,action)=>{
 //双击标签输入改变值
 export const changeLabelVal = (state,action)=>{
   const res = Object.assign({},state);
-  const index = parseInt(action.data.ikey);
-  const newVal = action.data.changeVal;
-  let data = res.data;
-  let item = data[index];
+  const {changeVal,totalVal,ikey,prefix,suffix} = action.data;
+  const index = ikey;
+  const newVal = changeVal;
+  let item = res.data[index];
   const next = res.data[+index+1];
   const nextVal = next.value||next.name;
   //标签后是不是标点符号标签,是的话删除本标签时一起删除
   let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
-  // if(newVal&&newVal.trim()){//时间单位传空--键盘输入
-  if(newVal){
+  let labText = totalVal?totalVal:newVal;
+  if(labText.trim()){
     if(item){
       item.value = newVal;
-      res.saveText[index] = newVal;
+      item.labelPrefix = prefix||'';
+      item.labelSuffix = suffix||'';
+      res.saveText[index] = labText;
     }
   }else{//删除完标签内容则删除该标签
     const num = nextIsDot?2:1;
-    data.splice(index,num);
-    // data[index].value = "";
-    // res.data.splice(index,1);
-    res.saveText.splice(index,1);
-    // res.saveText[index] = "";
-  } 
-  res.update = Math.random();
+    res.data.splice(index,num);
+    res.selecteds.splice(index,num);//杂音类样式选中状态对应
+    res.saveText = fullfillText(res.data).saveText;
+  }
+  res.update = Math.random();//console.log(222,res);
   return res;
 }
 

+ 70 - 8
src/store/actions/otherHistory.js

@@ -69,6 +69,11 @@ export function setRadioValue(state,action){
   if(+item.tagType===1){
     item.value = text;
     res.saveText[labelInx] = item.labelPrefix+text+item.labelSuffix;
+    const exist = JSON.parse(localStorage.getItem('radio'+item.id)||null);
+    if(exist){    //选中状态处理
+      exist[0].selected=exist[0].id==id;
+      localStorage.setItem('radio'+item.id,JSON.stringify(exist));
+    }
     item.questionDetailList.map((its)=>{
       if(its.id === id){
         its.selected = true;
@@ -196,10 +201,10 @@ export function setOtherInput(state,action){
 
 //多选文字,如杂音
 export function setCheckBoxValue(state,action) {
-  let res = Object.assign({},state);
-  const {labelInx,excluName,existsName,nones,withsName} = action.data;
-  let showText = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
+  const res = Object.assign({},state);
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones&&nones.replace('、','')||'');
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
   if(pattern.test(showText)){
     showText = showText.substr(0,showText.length-1);
@@ -207,7 +212,7 @@ export function setCheckBoxValue(state,action) {
   res.data[labelInx].value = showText;
   res.saveText[labelInx] = showText;
   res.selecteds[labelInx] = action.data;
-  res.update = Math.random();
+  res.update=Math.random();
   return res;
 }
 //搜索结果
@@ -274,20 +279,59 @@ export function changeTextLabel(state,action) {
   if(labText.trim()){
     if(item){
       item.value = newVal;
+      //月经史特殊处理
+      if(item.formulaCode){
+        res[item.formulaCode] = newVal;
+      }
+      const canAdd=hasNoSame(item.questionDetailList,labText);
+      //单选双击编辑的内容自动加到下拉选项中,双击编辑但未修改不添加
+      if(canAdd&&+item.tagType===1&&(+item.controlType===1||+item.controlType===0)){
+        const li = {
+          id:-Math.floor(Math.random()*1000),
+          name:labText,
+          questionId:item.id,
+          orderNo:0,
+          code:0,
+          defaultSelect:"0",
+          remark:null,
+          abnormal:0,
+          selected:true
+        };
+
+        const exist = JSON.parse(localStorage.getItem('radio'+item.id)||null);
+        //console.log(exist)
+        if(exist&&typeof exist=='object'){     //已添加过编辑的数据
+          //exist.push(li);
+          exist[0]=li;        //暂限添1条
+          localStorage.setItem('radio'+item.id,JSON.stringify(exist));
+        }else{
+          localStorage.setItem('radio'+item.id,JSON.stringify([li]));
+        }
+      }
+      //取消原选中状态
+      item.questionDetailList.find((it)=>it.selected==true).selected=false;
       item.labelPrefix = prefix||'';
       item.labelSuffix = suffix||'';
       res.saveText[index] = labText;
     }
   }else{//删除完标签内容则删除该标签
     const num = nextIsDot?2:1;
+    //月经史特殊处理
+    if(res.data[index].formulaCode){
+      res[res.data[index].formulaCode]=undefined;
+    }
     res.data.splice(index,num);
     res.selecteds.splice(index,num);//杂音类样式选中状态对应
     res.saveText = fullfillText(res.data).saveText;
   }
-  res.update = Math.random();
+  res.update = Math.random();//console.log(888,res,action);
   return res;
 }
 
+function hasNoSame(arr,text){
+  return arr.findIndex((it)=>text==it.name)==-1;
+}
+
 // 数字键盘较特殊,有直接输入
 export const changeNumLabelVal = (state,action)=>{
   const res = Object.assign({},state);
@@ -368,6 +412,10 @@ export function backspaceText(state,action){
     res.saveText.splice(delIndex,1);
   }
   else{
+    //月经史删除处理
+    if(data[delIndex-1].formulaCode){
+      res[data[delIndex-1].formulaCode]=undefined;
+    }
     data.splice(delIndex-1,2);
     res.saveText.splice(delIndex-1,2);
   }
@@ -392,12 +440,26 @@ export function removeId(state,action){
 // 单列多选
 export function multipleComfirn(state,action){
   let res = Object.assign({},state);
-  const {ikey,seleData} = action.data;
-  let data = res.data;
+  const {ikey,seleData,fullIkey} = action.data;
+  let data = res.data;//console.log(action,data[ikey])
+  let index = fullIkey.substr(fullIkey.length-1,1);
+  if(data[ikey].tagType==3){    //在组合项中
+    let item = data[ikey].questionMapping;
+    let arr=[];
+    item[index].value = seleData;
+    item.map((it)=>{
+      if(it.value){
+        arr.push(it.labelPrefix+it.value+it.labelSuffix);
+      }
+    });
+    res.saveText[ikey] = arr.join("");
+    res.update = Math.random();
+    res.selecteds[ikey] = {[index]:action.data};
+    return res;
+  }
   data[ikey].value = seleData;
   res.saveText[ikey] = seleData;
   res.selecteds[ikey] = action.data;
-  res.update = Math.random();
   return res;
 }
 

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

@@ -26,8 +26,8 @@ export const updatePatientMessage=(state,action)=>{
       // sex: 2
     // };
     res.message = action.data;
-    if(!action.data.selfDeptId){    //selfDeptId这个参数是跟外部对接用的
-        res.message = mock;
-    }
+    /*if(!action.data.selfDeptId){    //selfDeptId这个参数是跟外部对接用的
+        res.message = {};
+    }*/
     return res;
 };

+ 6 - 0
src/store/actions/treat.js

@@ -105,3 +105,9 @@ export const isFirstMainDiag = (state, action) => {
     res.isFirstMainDiag = false;
     return res;
 }
+//回读清除是否第一次主诊断
+export const clearFirstMainDiag = (state, action) => {
+    const res = Object.assign({}, state);
+    res.isFirstMainDiag = action.flag;
+    return res;
+}

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

@@ -147,11 +147,11 @@ export function getInitData(){
     json(api.getBigPush,param).then((res)=>{
       if(+res.data.code === 0){
         const data = res.data.data&&res.data.data.vital;
-        const str = JSON.stringify(data);
-        const arr = fullfillText(JSON.parse(str),false,false,false).newArr;
+        //const str = JSON.stringify(data);
+        //const arr = fullfillText(JSON.parse(str),false,false,false).newArr;
         dispatch({
           type:SET,
-          data:[...arr],
+          data:[...data],
           isEmpty:false
         });
       }else{

+ 10 - 2
src/store/async-actions/homePage.js

@@ -5,6 +5,7 @@ import {SET_MAINSUIT} from '@store/types/mainSuit';
 import config from '@config/index.js';
 import store from '@store';
 import {fullfillText} from '@common/js/func';
+import {formatContinueDots} from '@utils/tools';
 import {getOtherHisRecord,getInitData} from '@store/async-actions/fetchModules.js';
 import {initHistoryDetails} from '@store/async-actions/patInfo';
 
@@ -18,7 +19,7 @@ function modulesParseJson(data){
   data.map((it)=>{
     moduleName[config.moduleCP[it.id]] = it.name;//添加病情变化/病程变化子模板需要使用模板名称
     obj = fullfillText(it.moduleDetailDTOList);
-    json[config.moduleCP[it.id]] = obj.newArr;
+    json[config.moduleCP[it.id]] = formatContinueDots(obj.newArr);
     saveTextJson[config.moduleCP[it.id]] = obj.saveText;
   });
   return {json,saveTextJson,moduleName};
@@ -27,7 +28,14 @@ function modulesParseJson(data){
 export const getInitModules= (dispatch,getStore)=>{
   const state = getStore();
   const {message} = state.patInfo;
-  return json(api.getModules,{age:message.patientAge,sexType:message.sex}).then((res) => {
+  const param = {
+    age:message.patientAge,
+    sexType:message.sex,
+    mouduleType:1,//慢病2  科室1 其他0
+    relationId:message.hospitalDeptId, //慢病id  科室id  其他0
+  }
+  // return json(api.getModules,{age:message.patientAge,sexType:message.sex}).then((res) => {
+  return json(api.getModules,param).then((res) => {
       dispatch(initHistoryDetails(message));      //历史病历回读
       if (res.data.code == '0') {
         const newObj = modulesParseJson(res.data.data);

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

@@ -18,7 +18,8 @@ export const getCommSymptoms = ()=>{//获取常见症状
     const params = {
       'deptId':deptCode,
       'age':message.patientAge,
-      'sexType':message.sex
+      'sexType':message.sex,
+      'type':1
     };
     json(api.getCommSymptoms,params).then((res)=>{
         let result = res.data;

+ 2 - 1
src/store/reducers/diagnosticList.js

@@ -30,7 +30,8 @@ const initState = {
         //     type: 1
         // }
     ],
-    mainSuitStr:''
+    mainSuitStr:'',
+    diagnosticStrNoType:'',
 
 }
 

+ 76 - 8
src/store/reducers/inspect.js

@@ -23,6 +23,7 @@ const initSearchList = {
 
     getExcelDataList: [], //导入的数据
     pushItem:[],    //推送的数据
+    pushItems:[],    //右侧模板预览的数据
 }
 
 export default (state = initSearchList, action) => {
@@ -41,6 +42,11 @@ export default (state = initSearchList, action) => {
                 newState.labelList = [...tempArrs]
             }
         }
+        
+        let tmpArr = newState.getExcelDataList;
+        let tmpArr2 = newState.labelList;
+        newState.pushItems = getPushLists(tmpArr,tmpArr2);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems)
         return newState;
     }
     if (action.type == RESET_LABEL) {             //选中的结果重组
@@ -56,6 +62,11 @@ export default (state = initSearchList, action) => {
           tempArr.push(action.lis[i]);
         }
         newState.labelList = [...tempArr]
+        
+        let tmpArr = newState.getExcelDataList;
+        let tmpArr2 = newState.labelList;
+        newState.pushItems = getPushLists(tmpArr,tmpArr2);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems);
         return newState;
     }
     if (action.type == FILL_ACTIVE) {                        //点击标签放到暂存里
@@ -79,7 +90,8 @@ export default (state = initSearchList, action) => {
         }
         tempArrs.show = false;
         newState.pushItem = getPushList(tmpArr,tmpArr2);
-        newState.inspectStrPlus = getStringPlus(newState.pushItem)
+        newState.pushItems = getPushLists(tmpArr,tmpArr2);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems)
         return newState;
     }
     if (action.type == GET_EXCEL) {              //导入数据
@@ -120,7 +132,8 @@ export default (state = initSearchList, action) => {
         newState.getExcelDataList = [...tmpArr];
         let tempArr1 = newState.getExcelDataList;
         newState.pushItem = getPushList(tempArr1,tempArr2);
-        newState.inspectStrPlus = getStringPlus(newState.pushItem)
+        newState.pushItems = getPushLists(tempArr1,tempArr2);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems)
         return newState;
     }
     if (action.type == CHECK_VALUE_IS_CHANGE) {     //数据添加后显示与否
@@ -135,7 +148,8 @@ export default (state = initSearchList, action) => {
         newState.labelList = tempArrs;
         // tempArrAct.show = true;
         newState.pushItem = getPushList(tmpArr,tempArrs);
-        newState.inspectStrPlus = getStringPlus(newState.pushItem)
+        newState.pushItems = getPushLists(tmpArr,tempArrs);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems)
         return newState;
     }
     if (action.type == CLEAR_ALL_LABEL) {     //清空所有数据
@@ -155,7 +169,8 @@ export default (state = initSearchList, action) => {
         newState.labelList = [...tempArr];
         let tmpArr = newState.getExcelDataList;
         newState.pushItem = getPushList(tmpArr,tempArr);
-        newState.inspectStrPlus = getStringPlus(newState.pushItem)
+        newState.pushItems = getPushLists(tmpArr,tempArr);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems)
         return newState;
     }
     return state;
@@ -186,7 +201,8 @@ function getExcelString(action,newState,tmpArr,tmpArr2) {
         })
     })
     newState.pushItem = getPushList(tmpArr,tmpArr2);
-    newState.inspectStrPlus = getStringPlus(newState.pushItem)
+    newState.pushItems = getPushLists(tmpArr,tmpArr2);
+    newState.inspectStrPlus = getStringPlus(newState.pushItems)
   }else{
     newState.inspectStrPlus = '';
     newState.pushItem = []
@@ -224,8 +240,13 @@ function getString(lists) {
 function getStringPlus(dataList){
   let strPlus = '';
   dataList && dataList.map((item)=>{
-    let strTmp = item.name + ',' + item.detailName + ',' + (item.otherValue ? item.otherValue : (item.value + item.units)) +';'
-    strPlus += strTmp;
+    if(item.detailName){
+      let strTmp = item.name + ',' + item.detailName + ',' + (item.otherValue ? item.otherValue : (item.value + item.units)) +';'
+      strPlus += strTmp;
+    }else{
+      let strTmp = item.name+';'
+      strPlus += strTmp;
+    }
   })
   return strPlus;
 }
@@ -256,7 +277,49 @@ function getPushList(data1,data2){     //推送数据
         })
     })
     data2.length>0 && data2.map((item)=>{        //填写单数据拼接
-        item.details.map((val)=>{
+      item.details && item.details.map((val)=>{
+            if(val.value != undefined && val.value != ''){
+                let tmpObj = {};
+                tmpObj.name = item.name || '';
+                tmpObj.detailName = val.name || '';
+                tmpObj.uniqueName = val.uniqueName || '';//公表名称
+                tmpObj.source = '0';     //数据来源
+                tmpObj.maxValue = val.maxValue ? val.maxValue : '';
+                tmpObj.minValue = val.minValue ? val.minValue : '';
+                tmpObj.units = val.labelSuffix || '';
+                tmpObj.value = (val.value-0) === (val.value-0) ? val.value:'';
+                tmpObj.otherValue = (val.value-0) === (val.value-0) ?'':val.value;
+                tmpArr2.push(tmpObj);
+            }
+        })
+    })
+    totalTmpArr = tmpArr1.concat(tmpArr2);
+    return totalTmpArr;
+}
+function getPushLists(data1,data2){     //推送数据
+    let tmpArr1 = [];
+    let tmpArr2 = [];
+    let totalTmpArr = [];
+    data1.length>0 && data1.map((items)=>{    //excel导入的数据拼接
+        items.lisExcelRes.map((item)=>{
+            item.lisExcelItem.map((part)=>{
+                let tmpObj = {};
+                tmpObj.name = part.mealName || '';//套餐名
+                tmpObj.detailName = part.itemName || '';//化验项名
+                tmpObj.uniqueName = part.uniqueName || '';//公表名称
+                tmpObj.source = '1';//数据来源
+                tmpObj.maxValue = part.max || ''; 
+                tmpObj.minValue = part.min || '';
+                tmpObj.units = part.unit || '';//单位
+                tmpObj.value = (part.value-0) === (part.value-0) ? part.value:'';//值
+                tmpObj.otherValue = (part.value-0) === (part.value-0) ?'':part.value; //阴性阳性
+                tmpArr1.push(tmpObj);
+            })
+        })
+    })
+    data2.length>0 && data2.map((item)=>{        //填写单数据拼接
+      if(item.show){
+          item.details.map((val)=>{
             if(val.value != undefined && val.value != ''){
                 let tmpObj = {};
                 tmpObj.name = item.name || '';
@@ -271,6 +334,11 @@ function getPushList(data1,data2){     //推送数据
                 tmpArr2.push(tmpObj);
             }
         })
+      }else{
+        let tmpObj = {};
+        tmpObj.name = item.name;
+        tmpArr2.push(tmpObj);
+      }
     })
     totalTmpArr = tmpArr1.concat(tmpArr2);
     return totalTmpArr;

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

@@ -1,5 +1,5 @@
-import { SELECT_DRUG, SET_TREAT_INFO, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,SHOW_TREAT, HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, SET_GENERAL_TREAT, SET_TREATMENT, SET_SURGERY_TREAT, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST,IS_FIRST_MAIN_DIAG } from '../types/treat'
-import { selectDrug, setTreatInfo, setOtherDrug, setDrugInfo, clearDrugInfo, showTreat, hideTreat, clearTreat, showDrugInfo, hideDrugInfo, setTreatment, setGeneralTreat, setSurgeryTreat, setRecommendBasic, setDrugInfoList, isFirstMainDiag } from '../actions/treat'
+import { SELECT_DRUG, SET_TREAT_INFO, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,SHOW_TREAT, HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, SET_GENERAL_TREAT, SET_TREATMENT, SET_SURGERY_TREAT, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST,IS_FIRST_MAIN_DIAG,CLEAR_FIRST_MAIN_DIAG } from '../types/treat'
+import { selectDrug, setTreatInfo, setOtherDrug, setDrugInfo, clearDrugInfo, showTreat, hideTreat, clearTreat, showDrugInfo, hideDrugInfo, setTreatment, setGeneralTreat, setSurgeryTreat, setRecommendBasic, setDrugInfoList, isFirstMainDiag,clearFirstMainDiag } from '../actions/treat'
 const initState = {
     show: false, //治疗方案显示隐藏
     showDrugInfo: false, //药品信息显示隐藏
@@ -200,6 +200,8 @@ export default function(state=initState, action){
             return setDrugInfoList(state, action);
         case IS_FIRST_MAIN_DIAG: 
             return isFirstMainDiag(state, action)
+        case CLEAR_FIRST_MAIN_DIAG: 
+            return clearFirstMainDiag(state, action)
         default:
             return state
     }

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

@@ -14,4 +14,5 @@ export const SET_RECOMMEND_BASIC = 'SET_RECOMMEND_BASIC'//设置其他推荐推
 export const SET_TREAT_INFO = 'SET_TREAT_INFO' //设置治疗方案信息(name,id等)
 export const SET_DRUG_INFO_LIST = 'SET_DRUG_INFO_LIST' //查询多个药品说明书(添加数据时查看药品说明用)
 export const IS_FIRST_MAIN_DIAG = 'IS_FIRST_MAIN_DIAG' //是否为主诊断第一次开单
+export const CLEAR_FIRST_MAIN_DIAG = 'CLEAR_FIRST_MAIN_DIAG' //回读清空是否为主诊断第一次开单
 

+ 2 - 2
src/utils/config.js

@@ -1,7 +1,7 @@
 // const host='http://192.168.3.100:5050';//王峰
 // const host='http://192.168.3.101:5050';//任国宾
-// const host='http://192.168.2.241:5050';//后端接口访问地址
-const host='http://192.168.2.236:5050';//后端接口访问地址
+const host='http://192.168.2.241:5050';//后端接口访问地址
+// const host='http://192.168.2.236:5050';//后端接口访问地址
 //const host='http://192.168.2.164:8080';
 // const host='http://192.168.3.117:8080'; //周铁刚
 // const newIcssVisitUrl = '223.93.170.82:13000';    //icss服务访问地址(跳转目的地),不能加http://

+ 106 - 6
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 {CLEAR_FIRST_MAIN_DIAG} from "../store/types/treat";
 import {tabChange} from '@store/actions/tabTemplate';
 import config from '@config/index.js';
 
@@ -187,7 +188,8 @@ const getAllDataList =(baseList) =>{           //获取所有模块结构化的
     jsonData.addItems = baseList.homePage.addItems||{};
     jsonData.mainsuitIds = baseList.mainSuit.mainIds;      //主诉去重
     jsonData.currentIds = baseList.currentIll.symptomIds;      //现病史去重
-    //console.log(jsonData,'结构化数据获取')
+    jsonData.isFirstMainDiag = baseList.treat.isFirstMainDiag;      //治疗方案
+    // console.log(jsonData,'结构化数据获取')
     return jsonData;
 }
 const getAllDataStringList =(baseList) =>{           //获取所有模块文本的数据
@@ -260,6 +262,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
             data:{},
             saveText:'',
         });
+        store.dispatch({
+          type:CLEAR_FIRST_MAIN_DIAG,
+          flag:true
+        });
         storageLocal.remove('emrParam');
        // Notify.success('页面已清空')
     }else{
@@ -325,6 +331,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                   type:SETREADDITEMS,
                   data:dataJson.addItems
                 });
+                store.dispatch({
+                  type:CLEAR_FIRST_MAIN_DIAG,
+                  flag:dataJson.isFirstMainDiag
+                });
               //tab跳回辅助信息
               store.dispatch(tabChange('0'));
             }else{    //结构化历史病历回读
@@ -389,6 +399,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                 type:SETREADDITEMS,
                 data:dataJson.addItems
               });
+              store.dispatch({
+                type:CLEAR_FIRST_MAIN_DIAG,
+                flag:dataJson.isFirstMainDiag
+              });
             }
         } else {
             if(type == 'template'){     //纯文本模板回读
@@ -438,6 +452,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                 type:SETREADDITEMS,
                 data:dataJson.addItems
               });
+              store.dispatch({
+                type:CLEAR_FIRST_MAIN_DIAG,
+                flag:dataJson.isFirstMainDiag
+              });
               //tab跳回辅助信息
               store.dispatch(tabChange('0'));
             }else{  //纯文本历史病历回读
@@ -493,6 +511,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                 type:SETREADDITEMS,
                 data:dataJson.addItems
               });
+              store.dispatch({
+                type:CLEAR_FIRST_MAIN_DIAG,
+                flag:dataJson.isFirstMainDiag
+              });
             }
         }
     }
@@ -525,7 +547,7 @@ function filterDataArr(arrTmp){   //数据处理
     return trimDots(tmpArr.join(''));      //去掉开头的标点符号,最后的标点保留第一个,中间连续的保留第一个
 }
 //其他史预览数据处理-月经史
-function filterOtherDataArr(arrTmp,jsonArr){
+function filterOtherDataArr(arrTmp,jsonArr){console.log(arrTmp,jsonArr)
   let tmpArr = [];
   let index1 = jsonArr.findIndex((item)=>{
     return item.formulaCode=='yjs_1';
@@ -550,15 +572,26 @@ function filterOtherDataArr(arrTmp,jsonArr){
       return word.substr(0,1);
     });
   });
-  const str1 = [...tmpArr].splice(0,index1).join("");
-  const str2 = [...tmpArr].splice(index1).join("");
+  const splitNum = [index1,index2,index3,index4].find((i)=>i!=-1);
+  const str1 = [...tmpArr].splice(0,splitNum).join("");
+  const str2 = [...tmpArr].splice(splitNum).join("");
   return {str1:trimDots(str1),str2:trimDots(str2),index:index1};
 }
 //去掉开头的标点符号,最后的标点保留第一个,中间连续的保留第一个
 function trimDots(str){
   return str.replace(config.punReg,function(word){
     return word.substr(0,1);
-  }).replace(/^[,,.。::"“??”;;、!!]+/,'');
+  }).replace(/^[,,.。::"“??”;;、!!\s]+/,'');
+}
+
+//标签间连续标点只保留一个,保留前面一个
+function formatContinueDots(data){
+  let arr=data.filter((it,i)=>{
+    if(!(it.name==','&&data[i-1].name==',')){
+      return it;
+    }
+  });
+  return arr;
 }
 
 // 取消默认行为
@@ -694,6 +727,70 @@ function timestampToTime(timestamp) {     //excel导入2019年5月1日会转换
   var s = date.getSeconds();
   return Y+M+D+h+m+s;
 }
+function getPageLength(event) {     //兼容ie8获取页面距离左和上的距离,包括滚动距离
+  let e = event || window.event;
+  let scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
+  let scrollY = document.documentElement.scrollTop || document.body.scrollTop;
+  let x = e.pageX || e.clientX + scrollX;
+  let y = e.pageY || e.clientY + scrollY;
+  let page = {
+    pageX:x,
+    pageY:y
+  }
+  return page;
+}
+function dragBox(domWrap,domDrag){
+  let wrap = document.getElementById(domWrap);//呗拖拽的元素
+  let drag = document.getElementById(domDrag);//拖拽区域
+  let width = window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;//屏幕宽度
+  let height = window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;//屏幕高度
+  let mouseX = 0,mouseY = 0,dragX = 0,dragY = 0,isDrag = false,isMove = false;
+  let maxDragX = width - wrap.offsetWidth;//最大可推拽x方向距离
+  let maxDragY = height - wrap.offsetHeight;//最大可拖拽y方向距离
+  windowEventHandler('mousedown',(event)=>{    //鼠标位置获取,计算点击位置到拖拽元素左边的距离
+    wrap = document.getElementById(domWrap);
+    drag = document.getElementById(domDrag);
+    let page = getPageLength(event);
+    mouseX = page.pageX - wrap.offsetLeft      //鼠标到拖拽元素的左边界的距离
+    mouseY = page.pageY - wrap.offsetTop       //鼠标到拖拽元素的上边界的距离
+    isDrag = true
+  },drag)
+  // windowEventHandler('mousemove',handleMove,document)
+  windowEventHandler('mousemove',(event)=>{      //移动的
+    let page = getPageLength(event);
+    if(isDrag){
+      dragX = page.pageX - mouseX          //鼠标可拖拽到左边的最大距离
+      dragY = page.pageY - mouseY          //鼠标可拖拽到上边的最大距离
+      if(dragX < 0){      //不能超出左边界
+        dragX = 0
+      }
+      if(dragY < 0){      //不能超出上边界
+        dragY = 0
+      }
+      if(width-dragX < wrap.offsetWidth){    //不能超出右边界
+        dragX = maxDragX
+      }
+      if(height-dragY < wrap.offsetHeight){     //不能超出下边界
+        dragY = maxDragY
+      }
+      isMove = true
+      wrap.style.left = dragX + 'px'
+      wrap.style.marginLeft = 0 + 'px'
+      wrap.style.top = dragY + 'px'
+    }
+  },document)
+  windowEventHandler('mouseup',(event)=>{
+    if(isMove){ //有move就设置位置没有移动就不处理
+      wrap.style.left = dragX + 'px'
+      wrap.style.top = dragY + 'px'
+    }
+    isDrag = false
+    return false
+  },document)
+}
+// function handleMove(event,mouseX){
+//     console.log(event)
+// }
 module.exports = {
     checkType: Type.checkType,
     regexp,
@@ -721,5 +818,8 @@ module.exports = {
     normalVal,
     getPageCoordinate,
     windowRemoveEventHandler,
-    timestampToTime
+    timestampToTime,
+    getPageLength,
+    dragBox,
+    formatContinueDots
 };