Browse Source

Merge branch 'dev/byll' of http://192.168.2.236:10080/zhouna/newICSS into dev/byll

Luolei 6 years ago
parent
commit
9c6774d062
34 changed files with 488 additions and 203 deletions
  1. 2 2
      src/common/components/DropList/index.jsx
  2. 3 2
      src/common/components/EditableSpan/index.jsx
  3. 2 1
      src/common/components/ItemBox/index.less
  4. 2 2
      src/common/components/NumberUnitPan/index.jsx
  5. 13 20
      src/common/components/Textarea/index.jsx
  6. 3 3
      src/components/AddAssistCheck/index.jsx
  7. 3 3
      src/components/AddInspect/index.jsx
  8. 6 7
      src/components/CheckBody/index.jsx
  9. 4 2
      src/components/MultSpread/index.jsx
  10. 53 30
      src/components/NumberDrop/index.jsx
  11. 2 2
      src/components/PushItems/DetailsModal/index.jsx
  12. 1 1
      src/components/PushItems/index.jsx
  13. 4 4
      src/components/RadioDrop/index.jsx
  14. 2 2
      src/components/RadioInpDrop/index.jsx
  15. 1 1
      src/components/SpreadDrop/index.jsx
  16. 2 1
      src/components/Treat/index.jsx
  17. 14 12
      src/components/TreatDesc/DrugInfo/index.jsx
  18. 14 9
      src/components/TreatDesc/DrugInfo/index.less
  19. 5 1
      src/containers/MultSpread.js
  20. 4 1
      src/containers/NumberDrop.js
  21. 3 3
      src/containers/NumberUnitDrop.js
  22. 20 11
      src/containers/RadioInpDrop.js
  23. 17 4
      src/containers/SpreadDrop.js
  24. 4 2
      src/containers/eleType.js
  25. 88 0
      src/mock/chronicTable.js
  26. 6 2
      src/store/actions/checkBody.js
  27. 85 39
      src/store/actions/currentIll.js
  28. 76 19
      src/store/actions/mainSuit.js
  29. 37 10
      src/store/actions/otherHistory.js
  30. 3 3
      src/store/async-actions/homePage.js
  31. 0 1
      src/store/async-actions/pushMessage.js
  32. 3 1
      src/utils/config.js
  33. 4 1
      src/utils/tools.js
  34. 2 1
      static/pages/hisLib/infomation.js

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

@@ -43,14 +43,14 @@ class DropList extends Component{
     onSelect&&onSelect(undefined);
   }
   render(){
-    const {data} = this.props;
+    const {data,hideTag,boxMark} = this.props;
     const domNode = document.getElementById('root');
     return ReactDom.createPortal(
       <div className={this.getClass()} style={this.getStyle()} contentEditable='false'>
         <ul>
           {data&&data.map((it)=>{
             /*return <li onClick={(e)=>this.handleSelect(e,it)} className={it.selected||(it.selected!==false&&+it.defaultSelect===1)?style['selected']:''}>{it.labelPrefix}{it.questionDetailList&&it.questionDetailList.length>0?it.questionDetailList[0].name:it.name}{it.labelSuffix}</li>*/
-            return <li onClick={(e)=>this.handleSelect(e,it)} className={it.selected||(it.selected!==false&&+it.defaultSelect===1)?style['selected']:''}>{it.labelPrefix}{it.name}{it.labelSuffix}</li>
+            return <li onClick={(e)=>this.handleSelect(e,it)} className={it.selected||(boxMark!=1&&!hideTag&&it.selected!==false&&+it.defaultSelect===1)?style['selected']:''}>{it.labelPrefix}{it.name}{it.labelSuffix}</li>
           })}
           <li onClick={(e)=>this.handleClear(e)} className='red'>清空选项</li>
         </ul>

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

@@ -224,8 +224,9 @@ class EditableSpan extends Component{
         }*/
         let data = innerVal.trim();
         //判断是否为空、中英文:, 。、;,且不是第一位
-        let pattern = new RegExp(/^\,?$|^\,?$|^\.?$|^\。?$|^\、?$|^\;?$|^\;?$|^\:?$|^\:?$|\s/);
-        if(index!==0 && pattern.test(data)){
+        // let pattern = new RegExp(/^\,?$|^\,?$|^\.?$|^\。?$|^\、?$|^\;?$|^\;?$|^\:?$|^\:?$|\s/);
+        // if(index!==0 && pattern.test(data)){
+        if(index!==0 && !config.punctuationReg.test(data)){
           // let preObj = $(this.$span.current).prev();
           let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
           handleKeydown&&handleKeydown({boxMark,i:index,text:data});

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

@@ -24,10 +24,11 @@
     padding:5px;
     outline: none;
     border-bottom:1px @part-border-color dashed;
-    border-radius: 4px;
+    /*border-radius: 4px;*/
   }
   .border {
       border:1px @part-border-color dashed !important;
+      border-radius: 4px;
   }
   .noBorder{
     border: none;

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

@@ -83,7 +83,7 @@ class NumberUnitPan extends Component{
           <td><span onClick={this.handleSelect}>1</span></td>
           <td><span onClick={this.handleSelect}>2</span></td>
           <td><span onClick={this.handleSelect}>3</span></td>
-          <td><span onClick={this.handleSelect}>分</span></td>
+          <td><span onClick={this.handleSelect}>分</span></td>
           <td><span onClick={this.handleSelect}>周</span></td>
           <td><span onClick={this.handleSelect}>余</span></td>
         </tr>
@@ -91,7 +91,7 @@ class NumberUnitPan extends Component{
           <td><span onClick={this.handleSelect}>4</span></td>
           <td><span onClick={this.handleSelect}>5</span></td>
           <td><span onClick={this.handleSelect}>6</span></td>
-          <td><span onClick={this.handleSelect}>时</span></td>
+          <td><span onClick={this.handleSelect}>时</span></td>
           <td><span onClick={this.handleSelect}>月</span></td>
           <td><span onClick={this.handleSelect}>次</span></td> 
         </tr>

+ 13 - 20
src/common/components/Textarea/index.jsx

@@ -17,7 +17,7 @@ class Textarea extends Component {
     this.$dom = React.createRef();
     this.handleInput = this.handleInput.bind(this);
     this.handleFocus = this.handleFocus.bind(this);
-    this.handleBlur = this.handleBlur.bind(this);
+    //this.handleBlur = this.handleBlur.bind(this);
     this.handleKeydown = this.handleKeydown.bind(this);
   }
   handleFocus(){            //初始显示props中的值,focus已经显示输入的值,避免值更新闪烁
@@ -36,7 +36,7 @@ class Textarea extends Component {
     const text = e.target.innerText || e.target.innerHTML;
     const stimer = this.state.timer;
     if(boxMark=='1'&&text.length>config.limited){           //主诉字符数限制
-      e.target.innerText?(e.target.innerText = text.substr(0,config.limited)):(e.target.innerHTML = text.substr(0,config.limited)); 
+      e.target.innerText?(e.target.innerText = text.substr(0,config.limited)):(e.target.innerHTML = text.substr(0,config.limited));
       e.target.blur();
       Notify.error(config.limitText);
       if(overFlag){
@@ -59,7 +59,7 @@ class Textarea extends Component {
     })
 
     //存值到store
-    // handleInput&&handleInput({text});
+    handleInput&&handleInput({text});
     //右侧推送--延时推送
     clearTimeout(stimer);
     let timer = setTimeout(function(){
@@ -70,6 +70,14 @@ class Textarea extends Component {
       timer
     });
   }
+  handleKeydown(e){
+    const {boxMark} = this.props;
+    const ev = e||window.event;
+    if(+boxMark==1){
+      //禁止回车事件
+      if(ev.keyCode==13){return false;}
+    }
+  }
   shouldComponentUpdate(next){
     if(JSON.stringify(next) == JSON.stringify(this.props)){
       return false;
@@ -78,14 +86,14 @@ class Textarea extends Component {
   }
   componentWillReceiveProps(next){
     const isRead = this.props.isRead;
-    if(next.isRead != isRead||next.value!=this.props.value){      //value对比解决复诊不显示bug
+    if(next.isRead != isRead||(next.value!=this.props.value&&next.value&&next.value.indexOf("复诊")!=-1)){    //value对比解决复诊不显示bug,复诊对比解决关标跳到前面bug
       this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
     }
   }
   componentDidMount(){
     const {value} = this.props;
     if(value){
-      this.$dom.current.innerText?(this.$dom.current.innerText = value||''):(this.$dom.current.innerHTML=value||'');
+      this.$dom.current.innerText?(this.$dom.current.innerText = value||''):(this.$dom.current.innerText=value||'');
     }
     if(isIE()){
       $(this.$dom.current).onIe8Input(function(e){
@@ -93,20 +101,6 @@ 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 (
@@ -118,7 +112,6 @@ class Textarea extends Component {
              ref={this.$dom}
              contentEditable={true}
              onInput={this.handleInput}
-             onBlur={this.handleBlur}
              onkeydown={this.handleKeydown}>
         </div>
       </div>

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

@@ -145,9 +145,9 @@ class AddAssistCheck extends React.Component {
                     cancel={this.handleCancel}
                     okText="删除"
                     cancelText='取消'
-                    okBorderColor={'#3B9ED0'}
-                    okColor={'#fff'}
-                    oKBg={'#3B9ED0'}
+                    // okBorderColor={'#3B9ED0'}
+                    // okColor={'#fff'}
+                    // oKBg={'#3B9ED0'}
                 >
                     <p className={styles['center']}>是否删除该辅检项?</p>
                 </ConfirmModal>

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

@@ -331,9 +331,9 @@ class Inspect extends React.Component {
                     cancel={this.handleCancel}
                     okText="删除"
                     cancelText='取消'
-                    okBorderColor={'#3B9ED0'}
-                    okColor={'#fff'}
-                    oKBg={'#3B9ED0'}
+                    // okBorderColor={'#3B9ED0'}
+                    // okColor={'#fff'}
+                    // oKBg={'#3B9ED0'}
                 >
                     <p className={styles['center']}>{toastText}</p>
                 </ConfirmModal>

+ 6 - 7
src/components/CheckBody/index.jsx

@@ -32,17 +32,16 @@ class CheckBody extends Component{
   getLabels(){
     const {data,showArr,saveText,selecteds} = this.props;
     let arr = [],list=[];//console.log(data,saveText)
-    const {boxMark,showAll} = this.state;//console.log(data)
+    const {boxMark,showAll} = this.state;
     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 moreText = filterDataArr([...saveText].splice(moreNum+1));      //被收起的标签中是否有有值得,有则不能再收起showMoreBtn?more:''
+    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;
     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);
+    const showData = moreText||showAll?[...data]:showArray;//[...data].splice(0,config.showCheckNum*2+1);
     if(showData){
       list = showData;
       arr = list.map((it,i)=>{
@@ -115,9 +114,9 @@ class CheckBody extends Component{
     });
   }
   componentWillUpdate(next){
-    if(!this.props.isEmpty&&next.isEmpty){
+    if((this.props.defaultShowAll&&!next.defaultShowAll)||(!this.props.defaultShowAll&&next.defaultShowAll)||(!this.props.isEmpty&&next.isEmpty)){
       this.setState({
-        showAll:false
+        showAll:next.defaultShowAll
       })
     }
   }

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

@@ -98,11 +98,13 @@ class MultSpread extends Component{
                             id={it.id}
                             ikey={inx} hideTag={true}></InlineTag>;
         case +it.controlType===7:
+          const min = data.minValue!=null&&data.minValue!=undefined?data.minValue-1:undefined;
+          const max = data.maxValue!=null&&data.maxValue!=undefined?+data.maxValue+1:undefined;
           return <NumberDrop prefix={it.labelPrefix}
                              suffix={it.labelSuffix}
                              placeholder={it.name}
-                             min={it.minValue}
-                             max={it.maxValue}
+                             min={min}
+                             max={max}
                              show={show}
                              allClick={false}
                              ikey={inx}

+ 53 - 30
src/components/NumberDrop/index.jsx

@@ -39,7 +39,7 @@ class NumberDrop extends Component{
     this.handleNumFocus = this.handleNumFocus.bind(this);
     this.handleBlur = this.handleBlur.bind(this);
     this.changeToEdit = this.changeToEdit.bind(this);
-    this.handleKeyDowm = this.handleKeyDowm.bind(this);
+    //this.handleKeyDowm = this.handleKeyDowm.bind(this);
     this.beyondArea = this.beyondArea.bind(this);
   }
   select(text){        //选中键盘上数字事件
@@ -52,16 +52,14 @@ class NumberDrop extends Component{
         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;
+        const isFine = this.validSymbols(text,min,max);      //有~或/时是否合理
+        const hasSymbol = /[\/|\~]/g.test(text);           //是否有~或/
+        const singleFine = !isNaN(+text)&&min<text&&text<max;   //无~或/时是否合理
         timer = setTimeout(function(){
           clearTimeout(that.state.sltTimer);
-          if(!that.props.show&&!isNaN(+text)&&min>+text){
+          if(text!=''&&(!hasSymbol&&!singleFine)||(hasSymbol&&!isFine)){
             that.beyondArea();
             return;
           }
@@ -77,7 +75,7 @@ class NumberDrop extends Component{
   }
   beyondArea(){
     const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
-    Notify.info("输入数值不在合理值范围内,请重新输入!");
+    Notify.info("输入数值不符合规范,请重新输入!");
     handleSelect&&handleSelect({ikey,text:'',suffix,prefix,mainSaveText});
     this.setState({
       placeholder:this.props.placeholder,
@@ -132,18 +130,49 @@ class NumberDrop extends Component{
     }
     e.stopPropagation();
   }
+  validSymbols(txt,min,max){
+    //输入只有一个~或/时判断两边是否为合理数字,有多个为不合理
+    const index1 = txt.indexOf('~');
+    const index2 = txt.indexOf('/');
+    const needCompare = min!=undefined&&max!=undefined;
+    let arr1=[],arr2=[];
+    if(index1!=-1&&index1==txt.lastIndexOf('~')&&index1!=txt.length-1){   //有且只有一个~,且不在最后
+      arr1 = txt.split('~');
+      //~的范围在合理范围内为合理值
+      if(!isNaN(+arr1[0])&&!isNaN(+arr1[1])&&((!needCompare)||(needCompare&&min<arr1[0]&&arr1[0]<max&&min<arr1[1]&&arr1[1]<max))){
+        return true
+      }
+      return false;
+    }
+    if(index2!=-1&&index2==txt.lastIndexOf('/')&&index2!=txt.length-1){   //有且只有一个~,且不在最后
+      arr2 = txt.split('/');
+      // /两边的数字分别在合理范围内为合理值
+      if(!isNaN(+arr2[0])&&!isNaN(+arr2[1])&&((!needCompare)||(needCompare&&min<arr2[0]&&arr2[0]<max&&min<arr2[1]&&arr2[1]<max))){
+        return true
+      }
+      return false;
+    }
+    return false;
+  }
   numInpBlur(e){        //数字框失焦,保存值到store中
     e.stopPropagation();
     const {handleSelect,ikey,suffix,prefix,mainSaveText,min,max,show} = this.props;
     if(show){      //修改清空后第一次点击键盘不触发click事件bug
       return;
     }
-    //输入超出合理范围提示且清空
-    const txt = e.target.innerText.replace(/^\s*/,'');
-    if(max!=undefined&&!isNaN(+txt)&&(min>+txt||max<+txt)){
-      this.beyondArea();
-      return;
-    }
+    //输入超出合理范围或输入不是数字提示且清空
+    const needCompare=min!=undefined&&max!=undefined;
+    //if(needCompare){
+      const txt = e.target.innerText.trim();
+      const isFine = this.validSymbols(txt,min,max);      //有~或/时是否合理
+      const hasSymbol = /[\/|\~]/g.test(txt);           //是否有~或/
+      const singleFine = (!isNaN(+txt)&&!needCompare)||(!isNaN(+txt)&&needCompare&&min<txt&&txt<max);   //无~或/时是否合理
+      if(txt!=''&&(!hasSymbol&&!singleFine)||(hasSymbol&&!isFine)){
+        this.beyondArea();
+        return;
+      }
+    //}
+
     //输入为空时显示placeholder
     if(!e.target.innerText.trim()){
       this.setState({
@@ -151,24 +180,18 @@ class NumberDrop extends Component{
       });
     }
 
-    /*this.setState({
-      hasSelect:false
-    });*/
-    const val = e.target.innerText.replace(/^\s*/,'');
+    const val = e.target.innerText.trim();
     const {placeholder} = this.state;
-    let text = val===placeholder?'':val.replace(/[\u4e00-\u9fa5]/g,'');
-    e.target.innerText = '';      //避免出现重复输入值
+    let text = val===placeholder?'':val;
+    //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){
+  /*handleKeyDowm(e){
     handleEnter();
     //只能输入数字
     const key = e.key;
@@ -178,7 +201,7 @@ class NumberDrop extends Component{
       e.preventDefault();
       return false;
     }
-  }
+  }*/
   getClasses(){         //整个标签是否有值的状态
     const {hideTag,placeholder,value} = this.props;
     const $span = this.$span.current;
@@ -212,10 +235,10 @@ class NumberDrop extends Component{
     this.setState({
       editable: false
     });
-    let totalVal = e.target.innerText;
-    let changeVal = this.$span.current.innerText.replace(/^\s*/,'');//数字框值-修改后;去掉前空格避免多空格叠加
-    let prefix = this.$pre.current.innerText.replace(/^\s*/,''); //前缀值-修改后
-    let suffix = this.$suf.current.innerText.replace(/^\s*/,''); //后缀值-修改后
+    let totalVal = e.target.innerText.trim();
+    let changeVal = this.$span.current.innerText.trim();//数字框值-修改后;去掉前空格避免多空格叠加
+    let prefix = this.$pre.current.innerText.trim(); //前缀值-修改后
+    let suffix = this.$suf.current.innerText.trim(); //后缀值-修改后
     //console.log('数字框:'+changeVal,";全部:"+totalVal,";前缀:"+prefix+";后缀:"+suffix);
     handleLabelChange && handleLabelChange({ikey,changeVal,type:boxMark,totalVal,prefix,suffix});
   }
@@ -248,7 +271,7 @@ class NumberDrop extends Component{
             onBlur={this.numInpBlur}
             onInput={this.handleSpanInp}
             className={this.getSpanClass()}
-            onkeydown={this.handleKeyDowm}>&nbsp;{value||placeholder}</span>
+            >&nbsp;{value||placeholder}</span>
       <span ref = {this.$suf}>&nbsp;{suffix}</span>
       <NumberPan handleSelect={(text)=>this.select(text)}
                  onClose={handleHide}

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

@@ -3,6 +3,7 @@ import styles from "./index.less";
 import NewPortal from './NewPortal'
 import close from "./../img/close.png";
 import $ from "jquery";
+import { imageUrlPrefix } from '@utils/config.js';
 class DetailsModal extends Component {
     constructor(props) {
         super(props);
@@ -50,11 +51,10 @@ class DetailsModal extends Component {
     render() {
         const {showTipsDetails, tipsDetails} = this.props;
         const { currentIndex } = this.state
-        const imageUrlPrefix = 'http://192.168.2.241:82'; //图片服务器地址
         return (<NewPortal visible={showTipsDetails}>
         <div className={styles['details-wrapper']}>
            <div className={styles['details-content-wrapper']}>
-                <h1 className={styles['details-content-name']} >{tipsDetails && tipsDetails.name} <img className={styles['details-close']} onClick={this.hideTips} src={close} /></h1>
+                <h1 className={styles['details-content-name']} >{tipsDetails && tipsDetails.tagName} <img className={styles['details-close']} onClick={this.hideTips} src={close} /></h1>
                 <div className={styles['details-content']} id= 'detailsContent' onScroll={this.handleScrollModal.bind(this, tipsDetails)}>
                     {tipsDetails && tipsDetails.introduceDetailList && tipsDetails.introduceDetailList.map((item, index) => {
                         return (<div id={item.title}>

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

@@ -326,7 +326,7 @@ class PushItems extends Component {
                 <img src={recommendImg} />
                 推荐检验检查
                 <div className={style["billing"]} 
-                     style={assay.length === 0 && check.length === 0 ? {color: 'gray', border: '1px solid gray'} : ''} 
+                     style={assay.length === 0 && check.length === 0 ? {color: 'gray', border: '1px solid gray', cursor:'auto'} : ''} 
                      onClick={assay.length === 0 && check.length === 0 ? '' : billing}>
                     开单
                 </div>

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

@@ -99,11 +99,11 @@ class RadioDrop extends Component{
     },$("#addScrollEvent")[0])
   }
   componentDidMount(){    //默认值选中
-    const {data,ikey,handleSelect,hideTag,mainSaveText,value} = this.props;
+    const {data,ikey,handleSelect,hideTag,mainSaveText,value,boxMark} = this.props;
     const selected = data.find((it)=>{
       return it.selected === undefined&&+it.defaultSelect===1;
     });
-    if(!hideTag&&selected){
+    if(boxMark!=1&&!hideTag&&selected){
       // const text = selected.labelPrefix+selected.name+selected.labelSuffix;
       const text = selected.name;
       handleSelect&&handleSelect({ikey,id:selected.id,text,mainSaveText,value});
@@ -142,7 +142,7 @@ class RadioDrop extends Component{
     handleDbclick&&handleDbclick({id:patId||id});
   }
   render(){
-    const {data,prefix,suffix,placeholder,show,value} = this.props;
+    const {data,prefix,suffix,placeholder,show,value,hideTag,boxMark} = this.props;
     const {boxLeft,boxTop} = this.state;
     return <div className={style['container']} ref = {this.$cont}>
       {prefix}
@@ -155,7 +155,7 @@ class RadioDrop extends Component{
         {value||placeholder}
       </div>
       {suffix}
-      <DropList onSelect={this.handleSelect} data={data} left={boxLeft} top={boxTop} show={show}/>
+      <DropList onSelect={this.handleSelect} boxMark={boxMark} data={data} left={boxLeft} top={boxTop} show={show} hideTag={hideTag}/>
     </div>
   }
 }

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

@@ -55,7 +55,7 @@ class RadioInpDrop extends Component{
     return style['tag'];
   }
   handleSelect(item){
-    const {handleSelect,ikey,value,placeholder} = this.props;
+    const {handleSelect,ikey,value,placeholder,mainSaveText} = this.props;
     let vals = {}, inx = 0;
     if(!item){
       handleSelect&&handleSelect({ikey});  //清空
@@ -75,7 +75,7 @@ class RadioInpDrop extends Component{
     this.setState({
       texts:vals
     });
-    handleSelect&&handleSelect({ikey,id:item.id,values:vals});
+    handleSelect&&handleSelect({ikey,id:item.id,values:vals,mainSaveText,value});
   }
   handleShow(e){
     //e.stopPropagation();

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

@@ -250,7 +250,7 @@ class SpreadDrop extends Component{
         // withs:withOn?[]:[...withs,id],     //取消“伴”选中,伴随症状全部取消选中    
         // withs:withOn?[]:[...withs,{id:item.id,name:name}],
         withs:withOn?[]:withs,
-        ban:withOn?{}:{id:id,name:name},
+        ban:withOn?{}:{id:id,name:name,value:name},
         //withsName:withOn?"":withsName+name,     //取消“伴”选中,伴随症状全部取消选中
         nowOn:withOn?(noneOn?'none':''):'with'
       });

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

@@ -27,9 +27,10 @@ class Treat extends Component {
     }
     
     hideTreat() {
-        const { hideTreat,clearTreat } = this.props;
+        const { hideTreat,clearTreat, hideDrugInfo } = this.props;
         clearTreat && clearTreat();
         hideTreat && hideTreat();
+        hideDrugInfo && hideDrugInfo();
         // windowRemoveEventHandler('mousemove',handleMove,document)
     }
     handlePrescription() {

+ 14 - 12
src/components/TreatDesc/DrugInfo/index.jsx

@@ -60,22 +60,24 @@ class DrugInfo extends Component {
                     <div className={style['drug-title1']} >{drugInfo.title}说明书</div>
                     {drugInfo.drugDesc.map((item, index) =>{
                         return <div className={style['drug-desc-item']} id={item.title.trim()}>
-                            <span className={style['drug-desc-title']} >{item.title.trim()}</span> 
+                            <div className={style['drug-desc-title']} >{item.title.trim()}</div> 
                             <div className={style['drug-desc-content']} dangerouslySetInnerHTML ={{__html: item.content}}></div> 
                         </div>
                     })}
                     <div className={style['content-menu-box']}>
-                        <div className={style['content-menu']}>
-                            {drugInfo.drugDesc.map((item, index) => {
-                                return (<div >
-                                    <div className={style['details-menu-title-box']}>
-                                        {index === 0 ? '' : <div className={style['details-content-menu-line']}></div>}
-                                        <span onClick={this.handleClickMenu.bind(this, index, item, drugInfo.drugDesc)} className={style['details-content-menu-name']} style = {index === currentIndex ? {color:'#0089be'} : ''}>
-                                            <span className={style['details-content-menu-circle']} style = {index === currentIndex ? {background:'#0089be'} : ''}></span>{item.title}
-                                        </span>
-                                    </div>
-                                </div>)
-                            })}
+                        <div className={style['content-menu-wrapper']}>
+                            <div className={style['content-menu']}>
+                                {drugInfo.drugDesc.map((item, index) => {
+                                    return (<div >
+                                        <div className={style['details-menu-title-box']}>
+                                            {index === 0 ? '' : <div className={style['details-content-menu-line']}></div>}
+                                            <span onClick={this.handleClickMenu.bind(this, index, item, drugInfo.drugDesc)} className={style['details-content-menu-name']} style = {index === currentIndex ? {color:'#0089be'} : ''}>
+                                                <span className={style['details-content-menu-circle']} style = {index === currentIndex ? {background:'#0089be'} : ''}></span>{item.title}
+                                            </span>
+                                        </div>
+                                    </div>)
+                                })}
+                            </div>
                         </div>
                     </div>
                 </div> }

+ 14 - 9
src/components/TreatDesc/DrugInfo/index.less

@@ -55,11 +55,11 @@
     display: inline-block;
     font-weight: bold;
     font-size: 14px;
-    height: 100%;
-    float: left;
-    width: 190px;
-    text-align-last:justify;    /*chrome*/
-    text-justify: distribute;   /*ff*/
+    // height: 100%;
+    // float: left;
+    // width: 190px;
+    // text-align-last:justify;    /*chrome*/
+    // text-justify: distribute;   /*ff*/
 }
 .drug-desc-title::before {
     content: '【'
@@ -76,16 +76,21 @@
 }
 .drug-desc-content {
     /*width: 100%;*/
-    margin-left: 210px;
-    margin-right: 160px;
+    margin: 0px 160px 0px 10px;
 }
 
 .content-menu-box {
     position: absolute;
     top: 50px;
-    right: -20px;
-    width: 200px;
+    right: 20px;
+    width: 160px;
     height: 80%;
+    overflow: hidden;
+    
+}
+.content-menu-wrapper {
+    width: 200px;
+    height: 100%;
     overflow-y: auto;
 }
 .content-menu {

+ 5 - 1
src/containers/MultSpread.js

@@ -5,7 +5,7 @@ import {SETSELECTED,CLEARSELECTED,CONFIRMSELECTED,CHANGEOTHERTEXTLABEL,OTHERADDL
 import {CHANGECHECKTEXTLABEL,ADDLABELITEM} from '@types/checkBody.js';
 import {CHANGE_LABELVAL,MAINADDLABELITEM} from '@store/types/mainSuit.js';
 import {CURRENTADDLABELITEM} from '@store/types/currentIll.js';
-import {HIDE,RESET,CLICKCOUNT,SETADDITEMINIT} from '@store/types/homePage.js';
+import {HIDE,RESET,CLICKCOUNT,SETADDITEMINIT,ISREAD} from '@store/types/homePage.js';
 
 function mapStateToProps(state){
   return {}
@@ -27,6 +27,10 @@ const getCopyData = (copyId,inx,boxMark)=>{
       data:JSON.stringify(copy),
       i:inx
     });
+    //自由文本组件更新
+    dispatch({
+      type:ISREAD
+    })
   }
 };
 

+ 4 - 1
src/containers/NumberDrop.js

@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
 import NumberDrop from "@components/NumberDrop";
 import {SETNUMBER,CHANGEOTHERTEXTLABEL,CHANGEOTHERTEXTLABEL_NUMBER} from '@types/otherHistory';
 import {SETNUMBER4,CHANGECHECKTEXTLABEL,CHANGECHECKTEXTLABEL_NUMBER} from '@types/checkBody.js';
-import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP} from '@types/homePage.js';
+import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP,ISREAD} from '@types/homePage.js';
 import {NUMBER_SELECT,CHANGE_LABELVAL,CHANGE_LABELVAL_NUMBER} from '@store/types/mainSuit.js';
 import {getLabelIndex} from '@common/js/func.js';
 import {CURRENT_NUMBER,CURRENT_TEXT_LABEL,CURRENT_TEXT_LABEL_NUMBER} from '@store/types/currentIll.js';
@@ -90,6 +90,9 @@ function currentLabel(dispatch,params){
     // type:CURRENT_TEXT_LABEL,
     type:CURRENT_TEXT_LABEL_NUMBER,
     data:Object.assign({},params,{ikey})
+  });
+  dispatch({
+    type:ISREAD
   })
 }
 

+ 3 - 3
src/containers/NumberUnitDrop.js

@@ -54,15 +54,15 @@ function handleModuleDiff(dispatch,params){
   switch (+type){
     case 1:
       if(mark){//选中才限制,清空和回退无需验证
-        // let text = filterDataArr(mainSaveText);
-        let text = filterArr(mainSaveText);
+        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

+ 20 - 11
src/containers/RadioInpDrop.js

@@ -14,7 +14,7 @@ import config from '@config/index.js';
 
 function mapStateToProps(state){
   return {
-    //mainSaveText:state.mainSuit.saveText,
+    mainSaveText:state.mainSuit.saveText,
   }
 }
 
@@ -22,11 +22,11 @@ function mapStateToProps(state){
 // 主诉选中事件
 function mainSelect(dispatch,params){
   const {ikey,id,values} = params;
-  let index = getLabelIndex(ikey);
+  //let index = getLabelIndex(ikey);
   dispatch({
     type:SET_MS_RADIO_INPUT_VAL,
     data:{
-      ikey:index,
+      ikey,
       id,
       values
     }
@@ -36,11 +36,11 @@ function mainSelect(dispatch,params){
 // 现病史选中事件
 function currentSelect(dispatch,params){
   const {ikey,id,values} = params;
-  let index = getLabelIndex(ikey);
+  //let index = getLabelIndex(ikey);
   dispatch({
     type:SET_RADIO_INPUT_VALUE,
     data:{
-      ikey:index,
+      ikey,
       id,
       values
     }
@@ -51,11 +51,11 @@ function currentSelect(dispatch,params){
 //其他史选中事件
 function otherSelect(dispatch,params){
   const {ikey,id,values} = params;
-  let index = getLabelIndex(ikey);
+  //let index = getLabelIndex(ikey);
   dispatch({
     type:SET_OT_RADIO_INPUT_VAL,
     data:{
-      ikey:index,
+      ikey,
       id,
       values
     }
@@ -75,13 +75,22 @@ function checkSelect(dispatch,params){
 }
 //在不同模块(主诉、现病史等)下拉选中调用不同事件
 function handleModuleDiff(dispatch,store,params){
-  const {mainSaveText,value,text} = params;
+  const {mainSaveText,values,value} = params;
   const type = params.ikey.substr(0,1);    //当前所在的项目
   switch (+type){
     case 1:
-      if(text){//有选值才需要判断,清空不需要处理
+      if(values){//有选值才需要判断,清空不需要处理
+        let str='',temp='';
+        for(let i in values){
+          temp = values[i];
+          if(typeof temp=='object'){
+            str+=temp.value;
+          }else{
+            str+=temp;
+          }
+        }
         let mainText = filterDataArr(mainSaveText);
-        let lengths = value?mainText.length - value.length + text.length:mainText.length + text.length;
+        let lengths = value?mainText.length - value.length + str.length:mainText.length + str.length;
         if(lengths >= config.limited){
           Notify.info(config.limitText);
           return
@@ -147,7 +156,7 @@ function mapDispatchToProps(dispatch,store){
       let ikey = getLabelIndex(index);
       dispatch({
         type:InputActions[+boxMark],
-        data:{values:params.values,ikey:boxMark==4?params.ikey:ikey}
+        data:{values:params.values,ikey:params.ikey}
       });
       dispatch(billing());
       dispatch({

+ 17 - 4
src/containers/SpreadDrop.js

@@ -53,6 +53,19 @@ function mainSuitModule(dispatch,store,params){
     Notify.info(config.limitText);
     return
   }
+  // 给主症状伴随添加exists字段
+  if(exists.length>0){
+    for(let k=0; k<exists.length; k++){
+      exists[k].value=exists[k].name;
+      exists[k].exist=1;
+    }
+  }
+  if(withs.length>0){
+    for(let n=0; n<withs.length; n++){
+      withs[n].value=withs[n].name;
+      withs[n].exist=2;
+    }
+  }
   // let existsName = getNames(exists);
   // let withsName = getNames(withs);
   const copExists = JSON.parse(JSON.stringify(exists));
@@ -78,7 +91,6 @@ function mainSuitModule(dispatch,store,params){
     if(banIndex==-1){
       num = 1;
     }
-    console.log(11,exists,mainSlice);
     // ikey前的data里没有exist=1的数据,则existNum=1
     if(exists.length>0){
       for(let i=0; i<mainSlice.length; i++){
@@ -205,7 +217,7 @@ function otherHisConfirm(dispatch,store,params){
       });
       dispatch({
         type: CONFIRMSELECTED,
-        data: {exists:fullfillText(has,false,false).newArr,withs:fullfillText(wes,false,false).newArr,nones:nones,ikey,copyType}
+        data: {exists:fullfillText(has,false,true).newArr,withs:fullfillText(wes,false,true).newArr,nones:nones,ikey,copyType}
       });
       dispatch({
         type:ISREAD
@@ -483,7 +495,7 @@ function mapDispatchToProps(dispatch,store){
           // let pushDataList = result.data.symptom;
           let bigDataList = result.data.symptom;
           let pushDataList = [];
-          if(bigDataList.length>0){//剔除没有id
+          if(bigDataList&&bigDataList.length>0){//剔除没有id
             pushDataList = bigDataList.filter(function(item){
               return item.id
             });
@@ -509,7 +521,7 @@ function mapDispatchToProps(dispatch,store){
             // return
           }*/
           //推送无数据显示空下拉并提示暂无推送--1.9/1.18
-          if(pushDataList.length == 0){Notify.info("暂无推送");}
+          if(!pushDataList || pushDataList.length == 0){Notify.info("暂无推送");}
           if(obj.type == 1){// 主诉--添加症状
               dispatch({
                 type:GET_BIGDATAPUSH,
@@ -525,6 +537,7 @@ function mapDispatchToProps(dispatch,store){
             }
         }else{
           console.log(result.msg);
+          Notify.info("暂无推送");
           // 接口请求失败,不往下执行显示下拉
           return
         }

+ 4 - 2
src/containers/eleType.js

@@ -72,10 +72,12 @@ export function singleRadio(params){
                         id={data.id}
                         ikey={showInx}></InlineTag>;
     case 7:
+      const min = data.minValue!=null&&data.minValue!=undefined?data.minValue-1:undefined;
+      const max = data.maxValue!=null&&data.maxValue!=undefined?+data.maxValue+1:undefined;
       return <NumberDrop prefix={data.labelPrefix}
                          suffix={data.labelSuffix}
-                         min={data.minValue}
-                         max={data.maxValue}
+                         min={min}
+                         max={max}
                          placeholder={data.name}
                          boxMark={boxMark}
                          id={data.id}

+ 88 - 0
src/mock/chronicTable.js

@@ -0,0 +1,88 @@
+module.exports = {
+  data:{
+    "title":[
+        {
+            "name":"临床体格检查",
+            "column":"name"
+        },
+        {
+            "name":"临床症状",
+            "column":"detailName"
+        },
+        {
+            "name":"得分",
+            "column":"score"
+        },
+        {
+            "name":"推荐选项",
+            "column":""
+        }
+    ],
+    "result":[
+        {
+            "min":0,
+            "max":6,
+            "text":"无"
+        },
+        {
+            "min":7,
+            "max":12,
+            "text":"轻度"
+        },
+        {
+            "min":13,
+            "max":29,
+            "text":"中度"
+        },
+        {
+            "min":30,
+            "max":46,
+            "text":"重度"
+        }
+    ],
+    "details":[
+        {
+            "name":"右拇指振动觉",
+            "type":"1:radio,2:checkbox.....",
+            "details":[
+                {
+                    "detailName":"正常",
+                    "score":0,
+                    "state":"0:未选中,1-选中"
+                },
+                {
+                    "detailName":"减退",
+                    "score":1,
+                    "state":0
+                },
+                {
+                    "detailName":"消失",
+                    "score":2,
+                    "state":1
+                }
+            ]
+        },
+        {
+            "name":"左拇指振动觉",
+            "type":"1:radio,2:checkbox.....",
+            "details":[
+                {
+                    "detailName":"正常",
+                    "score":0,
+                    "state":"0:未选中,1-选中"
+                },
+                {
+                    "detailName":"减退",
+                    "score":1,
+                    "state":0
+                },
+                {
+                    "detailName":"消失",
+                    "score":2,
+                    "state":1
+                }
+            ]
+        }
+    ]
+  }
+}

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

@@ -1,5 +1,6 @@
 import config from '@config/index.js';
 import {getLabelIndex,fullfillText} from '@common/js/func.js';
+import {formatContinueDots} from '@utils/tools.js';
 //设置查体数据
 export function set(state,action){
   let res = Object.assign({},state);
@@ -148,7 +149,7 @@ export const setRadioInputValue = (state,action)=>{
   let index = getLabelIndex(ikey);
   let innerInx = ikey.substr(ikey.length-1);
   let item = res.data[index];
-  if(item.tagType==3){      //在组合项中
+  if(item.tagType!=1){      //在组合项中
     item = res.data[index].questionMapping[innerInx];
   }
   let str='',temp='',obj=item.questionDetailList;
@@ -194,7 +195,7 @@ export const setRadioInputValue = (state,action)=>{
   }
   item.vals = values;
   item.value = str;
-  if(res.data[index].tagType==3){
+  if(res.data[index].tagType!=1){
     let hasValue = false;
     const sub = res.data[index].questionMapping.map((it)=>{
       return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
@@ -265,6 +266,7 @@ export function insertLabelData(state,action){
   const {index,data,isReplace,span,searchInEnd}=action;
   const showText = res.saveText[index];
   let tempLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
+  tempLabels = formatContinueDots(tempLabels);
   //查体中,默认显示区域搜索出来的标签要默认显示,隐藏区域搜索出的默认隐藏
   let hideAreaIndex = [...res.data].reverse().findIndex((it)=>it.showInCheck);
   hideAreaIndex = res.data.length-hideAreaIndex-1;        //默认显示的最后一个标签的位置
@@ -438,10 +440,12 @@ export function backspaceText(state,action){
     // 前一个是文本标签或者子模板 不做处理
   }else if(data[delIndex-1].tagType==8){
     data.splice(delIndex,1);
+    res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
     res.saveText.splice(delIndex,1);
   }
   else{
     data.splice(delIndex-1,2);
+    res.selecteds.splice(delIndex-1,2);      //杂音类样式选中状态对应
     res.saveText.splice(delIndex-1,2);
   }
   // res.saveText = fullfillText(data).saveText;

+ 85 - 39
src/store/actions/currentIll.js

@@ -1,6 +1,7 @@
 import {getLabelIndex,fullfillText,getIds} from '@common/js/func.js';
 import config from '@config/index.js';
 import {getInitModules} from '@store/async-actions/homePage.js';
+import {formatContinueDots} from '@utils/tools';
 
 //插入病程变化模板
 function insertPro(data,processModule){
@@ -20,8 +21,29 @@ function insertPro(data,processModule){
 //设置模板
 export const setModule = (state,action)=>{
   const res = Object.assign({},state);
-  res.moduleData = action.data;
-  res.processModule = action.processModule;//病程变化模板
+  // 处理tagType=4的类型
+  const originalData = action.data;
+  const originalSonData = action.processModule;
+  let spreadLabels=[];
+  let sonSpreadLabels=[];//子模板
+  for(let i=0; i<originalData.length;i++){
+    if(originalData[i].tagType==4){
+      spreadLabels.push(...originalData[i].questionMapping);
+    }else{
+      spreadLabels.push(originalData[i]);
+    }
+  }
+  for(let j=0; j<originalSonData.length;j++){
+    if(originalSonData[j].tagType==4){
+      sonSpreadLabels.push(...originalSonData[j].questionMapping);
+    }else{
+      sonSpreadLabels.push(originalSonData[j]);
+    }
+  }
+  // res.moduleData = action.data;
+  // res.processModule = action.processModule;//病程变化模板
+  res.moduleData = spreadLabels;
+  res.processModule = sonSpreadLabels;//病程变化模板
   res.processModuleName = action.processModuleName;//模板名称
   res.emptyData = action.emptyData;//空模板
   let data = action.data;
@@ -83,7 +105,7 @@ export const setData = (state,action) =>{
   let newMain = [];
   let mainLabelModule = res.mainLabelModule;//主诉选中的症状id获取到的模板
   let objToArr = [];
-  let keyArr = Object.keys(mainLabelModule); 
+  let keyArr = Object.keys(mainLabelModule);
   for(let i=0; i<keyArr.length; i++){
     objToArr.push(mainLabelModule[JSON.parse(keyArr[i])]);
   }
@@ -256,7 +278,7 @@ export const setData = (state,action) =>{
       }
       
       let symptomArr = newMainCopy.concat(manInput,newWiths,manWithInput);
-      let newSymptomArr = JSON.parse(JSON.stringify(symptomArr));  
+      let newSymptomArr = formatContinueDots(JSON.parse(JSON.stringify(symptomArr)));   //过来连续标点
       //组装好的主症状和伴随症状插入现病史模板(flag=4前)
       let insertIdx = null;
       for(let j=0; j<current.length; j++){
@@ -488,8 +510,13 @@ export function setRadioValue(state,action){
 export const setRadioInputValue = (state,action)=>{
   const res = Object.assign({},state);
   const {ikey,values,id} = action.data;
-  const item = res.data[ikey];
-  let str='',temp='',obj=res.data[ikey].questionDetailList;
+  let index = getLabelIndex(ikey);
+  let innerInx = ikey.substr(ikey.length-1);
+  let item = res.data[index];
+  if(item.tagType!=1){      //在组合项中
+    item = res.data[index].questionMapping[innerInx];
+  }
+  let str='',temp='',obj=item.questionDetailList;
   if(!values){    //清空
     let sld=obj.find((item)=>{
       return item.selected==true;
@@ -497,7 +524,18 @@ export const setRadioInputValue = (state,action)=>{
     sld?sld.selected=false:'';
     item.vals = null;
     item.value = '';
-    res.saveText[ikey] = '';
+    if(res.data[index].tagType!=1){
+      let hasValue = false;
+      const sub = res.data[index].questionMapping.map((it)=>{
+        if(it.value){     //至少有一个子值才黑显
+          hasValue = true;
+        }
+        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      });
+      res.saveText[index] = hasValue?sub.join(''):'';
+    }else{
+      res.saveText[index] = '';
+    }
     res.update = Math.random();
     return res;
   }
@@ -521,7 +559,15 @@ export const setRadioInputValue = (state,action)=>{
   }
   item.vals = values;
   item.value = str;
-  res.saveText[ikey] = str;
+  if(res.data[index].tagType!=1){
+    let hasValue = false;
+    const sub = res.data[index].questionMapping.map((it)=>{
+      return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+    });
+    res.saveText[index] = sub.join('');
+  }else {
+    res.saveText[ikey] = str;
+  }
   res.update = Math.random();
   return res;
 }
@@ -685,15 +731,21 @@ export function insertLabelData(state,action){
   let focusIndex = res.focusIndex;
   let saveText = res.saveText;
   let banIdx = saveText.indexOf("伴");
-  
+  //伴随展开数据-过滤了连续标点
+  const FilteredDotMapping2=formatContinueDots(data.questionMapping.filter((item)=>{
+    return item.symptomType==0||item.symptomType==2;
+  }));
+  //主症状展开数据-过滤连续了标点
+  const FilteredDotMapping1=formatContinueDots(data.questionMapping.filter((item)=>{
+    return item.symptomType==0||item.symptomType==1;
+  }));
   if(isReplace){
     span.current.innerText?(span.current.innerText = ''):(span.current.innerHTML = '');
     // res.data.splice(focusIndex,1,text,data);
     // 搜索结果展开伴随symptomType==2的尾巴
+
     let resData = JSON.parse(JSON.stringify(res.data));
-    resData.splice(focusIndex,1,text,...(data.questionMapping.filter((item)=>{
-                              return item.symptomType==0||item.symptomType==2;
-                            })));
+    resData.splice(focusIndex,1,text,...(FilteredDotMapping2));
     res.data = fullfillText(resData).newArr;
     res.saveText[focusIndex] = searchData;
   }else{
@@ -707,55 +759,45 @@ export function insertLabelData(state,action){
       res.symptomIds.push(id);
       // 没有伴展开主诉symptomType=0/1的尾巴,有伴一>第一个点选上去的伴为依据,伴前展开主诉,伴后展开伴随;多余的伴以及手动输入的伴不做处理(2-25)
       if(banIdx==-1){
+
         // if(strIndex <= 1){//前
         if(strIndex < 1){//前
-          res.data.splice(index,1,text,...(data.questionMapping.filter((item)=>{
-                                   return item.symptomType==0||item.symptomType==1;
-                                })),pText);
+          res.data.splice(index,1,text,...(FilteredDotMapping1),pText);
           res.saveText = fullfillText(res.data).saveText;
-          res.selecteds.splice(index,1,null,...new Array(data.questionMapping.length).fill(null),null);
+          res.selecteds.splice(index,1,null,...new Array(FilteredDotMapping1.length).fill(null),null);
         }else{
-          res.data.splice(index,1,pText,text,...(data.questionMapping.filter((item)=>{
-                                   return item.symptomType==0||item.symptomType==1;
-                                })));
+          res.data.splice(index,1,pText,text,...(FilteredDotMapping1));
           res.saveText = fullfillText(res.data).saveText;
-          res.selecteds.splice(index,1,null,null,...new Array(data.questionMapping.length).fill(null));
+          res.selecteds.splice(index,1,null,null,...new Array(FilteredDotMapping1.length).fill(null));
         }
       }else{
         if(focusIndex > banIdx){//伴后
           if(strIndex < 1){//前
-            res.data.splice(index,1,text,...(data.questionMapping.filter((item)=>{
-                                   return item.symptomType==0||item.symptomType==2;
-                                })),pText);
+            res.data.splice(index,1,text,...(FilteredDotMapping2),pText);
             res.saveText = fullfillText(res.data).saveText;
-            res.selecteds.splice(index,1,null,...new Array(data.questionMapping.length).fill(null),null);
+            res.selecteds.splice(index,1,null,...new Array(FilteredDotMapping2.length).fill(null),null);
           }else{
-            res.data.splice(index,1,pText,text,...(data.questionMapping.filter((item)=>{
-                                   return item.symptomType==0||item.symptomType==2;
-                                })));
+            res.data.splice(index,1,pText,text,...(FilteredDotMapping2));
             res.saveText = fullfillText(res.data).saveText;
-            res.selecteds.splice(index,1,null,null,...new Array(data.questionMapping.length).fill(null));
+            res.selecteds.splice(index,1,null,null,...new Array(FilteredDotMapping2.length).fill(null));
           }
         }else{//伴前
           if(strIndex < 1){//前
-            res.data.splice(index,1,text,...(data.questionMapping.filter((item)=>{
-                                   return item.symptomType==0||item.symptomType==1;
-                                })),pText);
+            res.data.splice(index,1,text,...(FilteredDotMapping1),pText);
             res.saveText = fullfillText(res.data).saveText;
-            res.selecteds.splice(index,1,null,...new Array(data.questionMapping.length).fill(null),null);
+            res.selecteds.splice(index,1,null,...new Array(FilteredDotMapping1.length).fill(null),null);
           }else{
-            res.data.splice(index,1,pText,text,...(data.questionMapping.filter((item)=>{
-                                   return item.symptomType==0||item.symptomType==1;
-                                })));
+            res.data.splice(index,1,pText,text,...(FilteredDotMapping1));
             res.saveText = fullfillText(res.data).saveText;
-            res.selecteds.splice(index,1,null,null,...new Array(data.questionMapping.length).fill(null));
+            res.selecteds.splice(index,1,null,null,...new Array(FilteredDotMapping1.length).fill(null));
           }
         }
       }
       res.data = fullfillText(res.data).newArr;
       res.saveText = fullfillText(res.data).saveText;
     }else{//标签
-      const spreadLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
+      const arr=fullfillText(data.questionMapping).newArr;      //过滤连续标点
+      const spreadLabels = data.tagType==4?formatContinueDots(arr):[data];
       if(strIndex < 1){//前
         // 判断前一个是否为文本标签,是直接插入标签,不是则在前面插入一个空文本标签
         const preItem = res.data[index-1];
@@ -799,10 +841,12 @@ export const clearCurrentEdit = (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+1,0,JSON.parse(data),textLabel);
+  res.data.splice(+i+2,0,JSON.parse(data),textLabel);
+  res.saveText.splice(+i+2,0,'','');
+  res.selecteds.splice(+i+2,0,null,null);
   res.update = Math.random();
   return res;
 }
@@ -841,10 +885,12 @@ export function backspaceText(state,action){
     // data[delIndex].value = text;
   }else if(data[delIndex-1].tagType==8){
     data.splice(delIndex,1);
+    res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
     res.saveText.splice(delIndex,1);
   }
   else{
     data.splice(delIndex-1,2);
+    res.selecteds.splice(delIndex-1,2);      //杂音类样式选中状态对应
     res.saveText.splice(delIndex-1,2);
   }
   // res.saveText = fullfillText(data).saveText;

+ 76 - 19
src/store/actions/mainSuit.js

@@ -22,9 +22,31 @@ export const setMainMoudle = (state,action) => {
   const res = Object.assign({},state);
   // const emptySpan = JSON.parse(config.textLabel);
   // let data = action.data.push(emptySpan);
-  res.moduleData = action.data;
+  // 处理tagType=4的类型
+  // const originalData = JSON.parse(JSON.stringify(action.data));
+  const originalData = action.data;
+  const originalSonData = action.addSymptom;
+  let spreadLabels=[];
+  let sonSpreadLabels=[];//子模板
+  for(let i=0; i<originalData.length;i++){
+    if(originalData[i].tagType==4){
+      spreadLabels.push(...originalData[i].questionMapping);
+    }else{
+      spreadLabels.push(originalData[i]);
+    }
+  }
+  for(let j=0; j<originalSonData.length;j++){
+    if(originalSonData[j].tagType==4){
+      sonSpreadLabels.push(...originalSonData[j].questionMapping);
+    }else{
+      sonSpreadLabels.push(originalSonData[j]);
+    }
+  }
+  // res.moduleData = action.data;
+  // res.addSmoduleData = action.addSymptom;
+  res.moduleData = spreadLabels;
   res.saveText = res.save||[];
-  res.addSmoduleData = action.addSymptom;
+  res.addSmoduleData = sonSpreadLabels;
   res.addModuleName = action.addModuleName;
   res.update=Math.random();
   return res;
@@ -167,16 +189,19 @@ export const confirm = (state,action) =>{
   // 第二病程-伴位置处理
   let forwardId;
   let text;
-  for(let n=labelIndx-1; n>0; n--){
+  for(let n=labelIndx-1; n>=0; n--){
     // if(arr[n].id==8){
     if(arr[n].flag && arr[n].flag==1){//添加症状打标flag=1
       forwardId = n;
-      continue;
+      break;
     }
   }
   if(forwardId){
     text = saveText.slice(forwardId,labelIndx);
     let index = text.indexOf('伴');
+    let sliceArr = arr.slice(forwardId,labelIndx);
+    let newSliceArr = JSON.parse(JSON.stringify(sliceArr));
+
     if(index==-1){//没有伴,直接插入ikey前
       if(exists.length > 0){
         let withsAddP = addPoint(exists,1);
@@ -200,17 +225,27 @@ export const confirm = (state,action) =>{
     }
     }else{//有伴
       if(exists.length > 0){
-        for(let i=0; i<exists.length; i++){
-          let pos = index + i;
-          arr.splice(pos,0,getTextLabel(exists[i].id,'、'+exists[i].name,1));
-          res.saveText[pos] = exists[i].name;
+        // 判断前面是否已有主症状--是否加顿号、
+        let existsAddP,startInd;
+        for(let m=0; m<newSliceArr.length; m++){
+          if(newSliceArr[m].exist && newSliceArr[m].exist==1){
+            startInd = 0; 
+            break;
+          }else{
+            startInd = 1;
+          }
+        }
+        existsAddP = addPoint(exists,startInd);
+        for(let i=0; i<existsAddP.length; i++){
+          let pos = forwardId + index + i;
+          arr.splice(pos,0,getTextLabel(existsAddP[i].id,existsAddP[i].name,1));
+          res.saveText[pos] = existsAddP[i].name;
         }
       }
       
       if(withs.length>0){//有伴插到ikey前既可
         let withsAddP = addPoint(withs,0);     
         for(let j=0; j<withsAddP.length; j++){
-          // let withsPos = labelIndx + j;
           let withsPos = labelIndx +length + j;
           arr.splice(withsPos,0,getTextLabel(withsAddP[j].id,withsAddP[j].name,2));
           res.saveText[withsPos] = withsAddP[j].name;
@@ -229,9 +264,6 @@ export const confirm = (state,action) =>{
         }
       }
       if(withs.length > 0){
-        /*for(let k=1; k<withs.length; k++){
-          withs[k].name = '、'+ withs[k].name;
-        }*/
         let withsAddP = addPoint(withs,1);
         let newWiths = JSON.parse(JSON.stringify(withsAddP));
         if(banText){
@@ -255,7 +287,6 @@ export const confirm = (state,action) =>{
       if(withs.length>0){//有伴插到ikey前既可
         let withsAddP = addPoint(withs,0);     
         for(let j=0; j<withsAddP.length; j++){
-          // let withsPos = labelIndx + j;
           let withsPos = labelIndx +length + j;
           arr.splice(withsPos,0,getTextLabel(withsAddP[j].id,withsAddP[j].name,2));
           res.saveText[withsPos] = withsAddP[j].name;
@@ -491,8 +522,13 @@ export function setRadioValue(state,action){
 export const setRadioInputValue = (state,action)=>{
   const res = Object.assign({},state);
   const {ikey,values,id} = action.data;
-  const item = res.data[ikey];
-  let str='',temp='',obj=res.data[ikey].questionDetailList;
+  let index = getLabelIndex(ikey);
+  let innerInx = ikey.substr(ikey.length-1);
+  let item = res.data[index];
+  if(item.tagType!=1){      //在组合项中
+    item = res.data[index].questionMapping[innerInx];
+  }
+  let str='',temp='',obj=item.questionDetailList;
   if(!values){    //清空
     let sld=obj.find((item)=>{
       return item.selected==true;
@@ -500,7 +536,18 @@ export const setRadioInputValue = (state,action)=>{
     sld?sld.selected=false:'';
     item.vals = null;
     item.value = '';
-    res.saveText[ikey] = '';
+    if(res.data[index].tagType!=1){
+      let hasValue = false;
+      const sub = res.data[index].questionMapping.map((it)=>{
+        if(it.value){     //至少有一个子值才黑显
+          hasValue = true;
+        }
+        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      });
+      res.saveText[index] = hasValue?sub.join(''):'';
+    }else{
+      res.saveText[index] = '';
+    }
     res.update = Math.random();
     return res;
   }
@@ -524,7 +571,15 @@ export const setRadioInputValue = (state,action)=>{
   }
   item.vals = values;
   item.value = str;
-  res.saveText[ikey] = str;
+  if(res.data[index].tagType!=1){
+    let hasValue = false;
+    const sub = res.data[index].questionMapping.map((it)=>{
+      return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+    });
+    res.saveText[index] = sub.join('');
+  }else {
+    res.saveText[ikey] = str;
+  }
   res.update = Math.random();
   return res;
 }
@@ -642,10 +697,12 @@ export function setCheckText(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+1,0,JSON.parse(data),textLabel);
+  res.data.splice(+i+2,0,JSON.parse(data),textLabel);
+  res.saveText.splice(+i+2,0,'','');
+  res.selecteds.splice(+i+2,0,null,null);
   res.update = Math.random();
   return res;
 }

+ 37 - 10
src/store/actions/otherHistory.js

@@ -1,5 +1,6 @@
 import config from '@config/index';
 import {getLabelIndex,fullfillText} from '@common/js/func.js';
+import {formatContinueDots} from '@utils/tools.js';
 
 //多选标签选中确定处理
 export const confirm = (state,action) =>{
@@ -37,7 +38,6 @@ export const confirm = (state,action) =>{
     return res;
   }
   //有,伴,无随配
-  //arr.splice(ikey-1,1);
   let flabel = items[items.length-1];         //要插入的最后一个标签
   let labelText = flabel.value!==undefined?flabel.value:flabel.name;
   let text = labelText;
@@ -47,8 +47,6 @@ export const confirm = (state,action) =>{
     text = flabel.value;
   }
   arr.splice(ikey,0,...exists,...withs);
-  //arr[ikey-1].value = text;
-  //res.saveText[ikey+items.length] = text;
   res.saveText = fullfillText(arr).saveText;
   res.update=Math.random();         //用于触发组件更新(data变化了因在对象中无法被组件检测到)
   return res;
@@ -109,8 +107,13 @@ export function setRadioValue(state,action){
 export const setRadioInputValue = (state,action)=>{
   const res = Object.assign({},state);
   const {ikey,values,id} = action.data;
-  const item = res.data[ikey];
-  let str='',temp='',obj=res.data[ikey].questionDetailList;
+  let index = getLabelIndex(ikey);
+  let innerInx = ikey.substr(ikey.length-1);
+  let item = res.data[index];
+  if(item.tagType!=1){      //在组合项中
+    item = res.data[index].questionMapping[innerInx];
+  }
+  let str='',temp='',obj=item.questionDetailList;
   if(!values){    //清空
     let sld=obj.find((item)=>{
       return item.selected==true;
@@ -118,7 +121,18 @@ export const setRadioInputValue = (state,action)=>{
     sld?sld.selected=false:'';
     item.vals = null;
     item.value = '';
-    res.saveText[ikey] = '';
+    if(res.data[index].tagType!=1){
+      let hasValue = false;
+      const sub = res.data[index].questionMapping.map((it)=>{
+        if(it.value){     //至少有一个子值才黑显
+          hasValue = true;
+        }
+        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      });
+      res.saveText[index] = hasValue?sub.join(''):'';
+    }else{
+      res.saveText[index] = '';
+    }
     res.update = Math.random();
     return res;
   }
@@ -142,7 +156,15 @@ export const setRadioInputValue = (state,action)=>{
   }
   item.vals = values;
   item.value = str;
-  res.saveText[ikey] = str;
+  if(res.data[index].tagType!=1){
+    let hasValue = false;
+    const sub = res.data[index].questionMapping.map((it)=>{
+      return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+    });
+    res.saveText[index] = sub.join('');
+  }else {
+    res.saveText[ikey] = str;
+  }
   res.update = Math.random();
   return res;
 }
@@ -231,7 +253,8 @@ export function insertLabelData(state,action){
   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 searchLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
+  const spreadLabels = formatContinueDots(searchLabels);
   let reg = searchInEnd?new RegExp(searchStr+"$"):new RegExp("^"+searchStr);
   const newText=showText.replace(reg,'')||' ';
   if(!isReplace){
@@ -386,10 +409,12 @@ export const setTextModeValue = (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+1,0,JSON.parse(data),textLabel);
+  res.data.splice(+i+2,0,JSON.parse(data),textLabel);
+  res.saveText.splice(+i+2,0,'','');
+  res.selecteds.splice(+i+2,0,null,null);
   res.update = Math.random();
   return res;
 }
@@ -409,6 +434,7 @@ export function backspaceText(state,action){
     // 前一个是文本标签或者子模板 不做处理
   }else if(data[delIndex-1].tagType==8){
     data.splice(delIndex,1);
+    res.selecteds.splice(delIndex,1);      //杂音类样式选中状态对应
     res.saveText.splice(delIndex,1);
   }
   else{
@@ -417,6 +443,7 @@ export function backspaceText(state,action){
       res[data[delIndex-1].formulaCode]=undefined;
     }
     data.splice(delIndex-1,2);
+    res.selecteds.splice(delIndex-1,2);      //杂音类样式选中状态对应
     res.saveText.splice(delIndex-1,2);
   }
   // res.saveText = fullfillText(data).saveText;

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

@@ -63,12 +63,12 @@ export const getInitModules= (dispatch,getStore)=>{
         });
         dispatch({
           type:SET_CURRENT,
-          data:initData.current,
+          data:formatContinueDots(initData.current),
           save:initSaveText.current,
-          processModule:initData.process,//病程变化
+          processModule:formatContinueDots(initData.process),//病程变化
           processModuleName:initModuleName.process,//病程变化模板名称
           saveProcess:initSaveText.process,
-          emptyData:initData.currentEmpty,//现病史空模板
+          emptyData:formatContinueDots(initData.currentEmpty),//现病史空模板
           saveEmpty:initSaveText.currentEmpty,
         });
         dispatch(getOtherHisRecord());          //获取其他史最近记录

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

@@ -101,7 +101,6 @@ export const getTipsDetails = () => {
 
         //弹窗显示
         const url ='/introduceInfo/getByQuestionId'
-        const imageUrlPrefix = 'http://192.168.2.241:82'
         
         const params = {
             type: 7,

+ 3 - 1
src/utils/config.js

@@ -6,7 +6,9 @@ const host='http://192.168.2.241: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://
+const imageUrlPrefix = 'http://192.168.2.241:82'
 module.exports={
     host,
-    prefix:'/api/icss'            //带权限验证的api
+    prefix:'/api/icss',            //带权限验证的api
+    imageUrlPrefix
 };

+ 4 - 1
src/utils/tools.js

@@ -587,7 +587,10 @@ function trimDots(str){
 //标签间连续标点只保留一个,保留前面一个
 function formatContinueDots(data){
   let arr=data.filter((it,i)=>{
-    if(!(it.name==','&&data[i-1].name==',')){
+    if(i==0||(it.name&&(it.name.match(config.punctuationReg))||(data[i-1].name&&data[i-1].name.match(config.punctuationReg)))){
+      return it;
+    }
+    if(!it.name){       //主诉现病史病情变化
       return it;
     }
   });

+ 2 - 1
static/pages/hisLib/infomation.js

@@ -1,10 +1,11 @@
+import { imageUrlPrefix } from '@utils/config.js';
 (function($){
     getInfomation();
     function getInfomation(){
         // var infoUrl ="http://" + window.location.host+'/icss-web/kl/introduce/get_by_itemidAndType';
         // var infoUrl ="http://" + window.location.host+'/api/icss/introduceInfo/getByQuestionId';
         var infoUrl ='/api/icss/introduceInfo/getByQuestionId'
-        var imageUrlPrefix = 'http://192.168.2.241:82'
+        // var imageUrlPrefix = 'http://192.168.2.241:82'
         var urlParam = parseUrlParams();
         console.log(urlParam)
         var param = {