瀏覽代碼

Merge branch 'dev/new1' into mainTag5.3.3

luolei 5 年之前
父節點
當前提交
48409e768b
共有 37 個文件被更改,包括 212 次插入524 次删除
  1. 1 1
      src/common/components/ConfirmModal/index.jsx
  2. 3 11
      src/common/components/EditableSpan/index.jsx
  3. 1 0
      src/components/AddInspect/SlideExcel/index.less
  4. 1 1
      src/components/AddInspect/SlideSelect/index.jsx
  5. 1 0
      src/components/AddInspect/SlideSelect/index.less
  6. 1 1
      src/components/AddInspect/index.jsx
  7. 2 2
      src/components/AssessResult/ScaleItem/index.jsx
  8. 1 8
      src/components/ChronicInfo/index.jsx
  9. 2 2
      src/components/DiagnosticItem/index.jsx
  10. 15 3
      src/components/DiagnosticItem/index.less
  11. 4 3
      src/components/DiagnosticList/index.jsx
  12. 7 0
      src/components/DiagnosticList/index.less
  13. 0 1
      src/components/MultSpread/index.jsx
  14. 8 8
      src/components/NumberDrop/index.jsx
  15. 2 2
      src/components/PushItems/PushDiag/index.jsx
  16. 10 80
      src/components/RadioInpDrop/index.jsx
  17. 1 5
      src/containers/CurrentIll.js
  18. 4 3
      src/containers/DiagnosticList.js
  19. 0 3
      src/containers/InlineTag.js
  20. 8 62
      src/containers/RadioInpDrop.js
  21. 1 1
      src/containers/SpreadDrop.js
  22. 1 0
      src/containers/eleType.js
  23. 0 32
      src/store/actions/checkBody.js
  24. 0 26
      src/store/actions/currentIll.js
  25. 0 27
      src/store/actions/mainSuit.js
  26. 36 27
      src/store/actions/otherHistory.js
  27. 3 14
      src/store/async-actions/fetchModules.js
  28. 4 17
      src/store/async-actions/historyTemplates.js
  29. 3 1
      src/store/async-actions/mainSuit.js
  30. 7 24
      src/store/async-actions/pushMessage.js
  31. 3 1
      src/store/async-actions/tabTemplate.js
  32. 2 2
      src/store/reducers/checkBody.js
  33. 2 2
      src/store/reducers/currentIll.js
  34. 2 2
      src/store/reducers/mainSuit.js
  35. 3 3
      src/store/reducers/otherHistory.js
  36. 12 146
      src/utils/tools.js
  37. 61 3
      src/utils/utils.js

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

@@ -130,7 +130,7 @@ class ConfirmModal extends Component {
         return (
             <NewPortal visible={visible}>
                 <div className={styles['modal-wrapper']} id='confirm'>
-                    <div className={styles[['modal']]} style = {{width: width, marginLeft:marginLeft, height:height, marginTop:marginTop}}>
+                    <div className={styles[['modal']]} style = {{width: width, marginLeft:marginLeft, minHeight:height, marginTop:marginTop}}>
                         <div className={styles['modal-title']} style={{background: titleBg}}>
                             {icon?<img src={icon} className={styles['icon']}/>:''}
                             {title ? title : ''} 

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

@@ -1,7 +1,7 @@
 import React,{Component} from 'react';
 import style from './index.less';
 import config from "@config/index";
-import {filterArr,isIE,getPageCoordinate,filterDataArr} from '@utils/tools.js';
+import {filterArr,isIE,getPageCoordinate,filterDataArr,preventDefault} from '@utils/tools.js';
 import Notify from '../Notify/index.js';
 import classNames from 'classnames';
 
@@ -184,11 +184,7 @@ class EditableSpan extends Component{
       let preObj = $(this.$span.current).prev();
       let obj = preObj[0]&&preObj[0].nodeName=="DIV"?preObj.prev():preObj;
       if(textIndex == 0){
-        if(ev.preventDefault){//阻止默认事件
-          ev.preventDefault();
-        }else{
-          ev.returnValue=false;
-        }
+        preventDefault(ev);
         if(obj){
           obj[0]&&this.moveEnd(obj[0]);
         }
@@ -199,11 +195,7 @@ class EditableSpan extends Component{
       let nextObj = $(this.$span.current).next();
       let obj = nextObj[0]&&nextObj[0].nodeName=="DIV"?nextObj.next():nextObj;
       if(textIndex == textLength || textLength==undefined || (textIndex == 0 && textLength==1)){
-        if(ev.preventDefault){//阻止默认事件
-          ev.preventDefault();
-        }else{
-          ev.returnValue=false;
-        }
+        preventDefault(ev);
         if(obj){
           obj[0]&&obj.focus();
         }

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

@@ -175,6 +175,7 @@
   }
 }
 .tagSpan {
+  display: inline-block;
   position: relative;
 }
 .tagSpan:hover {

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

@@ -121,7 +121,7 @@ class SlideSelect extends Component {
     const listLen = currentData.details&&currentData.details.length;
     const stopScroll =(windowWidth<1300&&listLen>12)||(windowWidth>1299&&listLen>24);
     return (
-      <li key={item.questionId} className={styles.slideLi}> 
+      <li key={item.questionId} className={`${styles.slideLi} clearfix`}> 
         {
             // 标签,血常规。。
             item.show ?

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

@@ -189,6 +189,7 @@
     background-size: 100% auto; 
   }
 .tagSpan {
+  display: inline-block;
   position: relative;
 }
 .tagSpan:hover {

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

@@ -315,7 +315,7 @@ class Inspect extends React.Component {
     </ul>
   }
   showDetails(val) {
-    let min = val.minValue||undefined, max = val.maxValue||undefined, value = val.value, dom = '';
+    let min = val.minValue, max = val.maxValue, value = val.value, dom = '';
     if(min == null&&max == null||min == undefined&&max == undefined||min == ''&&max == ''){
       dom = getStatusImg(0, value, 1)
     }else if (!isNaN(min) && !isNaN(max)) {//有最大值最小值

+ 2 - 2
src/components/AssessResult/ScaleItem/index.jsx

@@ -7,7 +7,7 @@ import level1 from "@common/images/级别1.png";
 import checkIcon from '@common/images/check.png';
 import {ComplexModal,MiniToast,Radio} from '@commonComp';
 import Notify from '@commonComp/Notify';
-import {deepClone} from '@utils/tools';
+import {deepClone,preventDefault} from '@utils/tools';
 import { getFormulaResult } from '@store/async-actions/fetchModules'
 /**
  * 来源于页面选择
@@ -79,7 +79,7 @@ class ScaleItem extends Component {
   handleReg(e){   //只能输入数字和特殊符号
     const key = e.key;
     if(key!='Backspace'&&((/[^\d|.\/%*~]/.test(key)))){
-      e.preventDefault();
+      preventDefault(e);
     }
   }
   handleInputformula(id,calcuContent,i,e) {

+ 1 - 8
src/components/ChronicInfo/index.jsx

@@ -232,13 +232,6 @@ class ChronicInfo extends React.Component{
     this.closeFormula(it);
     chronicMagItem&&this.handleAddAssessItem(v,pIndex,i);
   }
-  handleReg(e){   //只能输入数字和特殊符号
-    //const hasDot = e.target.value.indexOf('.')!=-1;
-    // const key = e.key;
-    // if(key!='Backspace'&&((/[^\d|.\/%*~]/.test(key)))){
-    //   e.preventDefault();
-    // }
-  }
   handleInputformula(id,calcuContent,i,e) {
     const {calcuValues} = this.state;
     let obj = deepClone(calcuValues);
@@ -450,7 +443,7 @@ class ChronicInfo extends React.Component{
                                           <span>{item.isShow == '0' ? item.name+':':'请输入'+item.name+':'}</span>
                                         </td>
                                         <td>
-                                          {item.isShow == '0' ? item.value + ' ' +item.uint : <input type="text" className={style['itemInp']} placeholder="请输入"  value={item.value} onKeyDown={this.handleReg.bind(this)} onInput={this.handleInputformula.bind(this,v.conceptId,details,idd)}/>}
+                                          {item.isShow == '0' ? item.value + ' ' +item.uint : <input type="text" className={style['itemInp']} placeholder="请输入"  value={item.value} onInput={this.handleInputformula.bind(this,v.conceptId,details,idd)}/>}
                                         </td>
                                         <td>
                                           {item.isShow != '0'&&<span>{item.uint}</span>}

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

@@ -102,13 +102,13 @@ class DiagnosticItem extends Component{
         const { visible,hasEnterItem,hasEnterImg } = this.state
         const { item, title, type } = this.props
         return (<span className={style['diag-item']} >
-                    <span className={`${style['diag-name']} ${type == 'search' ? style['diag-name-search'] : ''}`} 
+                    <span className={`${style['diag-name']}`} 
                           title = {title && item.name + (item.showType === 2 || item.showType === 3 ? '('+ item.retrievalName+')': '')}
                           onMouseEnter={this.handleMouseEnterDrug.bind(this)}
                           onMouseLeave = {this.handleMouseLeaveDrug.bind(this)}
                           onClick={() =>{this.chooseDiagodal(item)}}
                           >
-                        {item.name} {item.retrievalName ? '('+ item.retrievalName+')': ''}
+                        <p className={`${style['diag-name-box']} ${type == 'search'?style['diag-name-search']:style['diag-name-disSelect']}`}>{item.name} {item.retrievalName ? '('+ item.retrievalName+')': ''}</p>
                         {type== 'disSelect' &&<img className={style['info-img']}  
                                 title='点击i图标可查看详细说明'
                                 style ={hasEnterItem  ? {display: "inline-block"} : {display: "none"}}

+ 15 - 3
src/components/DiagnosticItem/index.less

@@ -1,9 +1,9 @@
 .confirm-info {
-    height: 70px;
+    min-height: 70px;
     font-size: 16px;
-    line-height: 16px;
+    line-height: 20px;
     text-align: center;
-    padding: 10px 30px;
+    padding: 10px 20px 20px;
 }
 .diag-item {
     display: inline-block;
@@ -14,6 +14,18 @@
     text-overflow: ellipsis;
     white-space: nowrap;
 }
+.diag-name-box {
+    display: inline-block;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+}
+.diag-name-search {
+    max-width: 250px;
+}
+.diag-name-disSelect {
+    max-width: 340px;
+}
 .diag-name {
     position: relative;
     display: inline-block;

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

@@ -241,6 +241,7 @@ class DiagnosticList extends Component {
         this.props.getBilling();
       }
     }
+   
     handleEnterDel(index) {
       this.setState({
         hasOnIndex: index,
@@ -274,7 +275,7 @@ class DiagnosticList extends Component {
       })
     }
     render(){
-        const { list, treatment, showReferRecord, showHistoryCase ,chronicMagItem,loading,refreshScroller} = this.props;
+        const { list, treatment, showReferRecord, showHistoryCase ,chronicMagItem,loading,refreshScroller,windowWidth} = this.props;
         const {visible, treatTitle, showAssess, isAssessConfirm, assessId, disName, hasOndel, hasOnIndex,hasEnterItem,hasEnterImg} = this.state;
         const chronicList = JSON.parse(localStorage.getItem('chronic')||null);
         let isChronic = false;      //是否要显示管理评估
@@ -288,7 +289,7 @@ class DiagnosticList extends Component {
                         const hasTreat = item.treat && ((item.treat.commonTreatment&&item.treat.commonTreatment.content) || (item.treat.surgeryTreatment&&item.treat.surgeryTreatment.content) || item.treat.treatment.length>0 ||(item.adverseReactions&&item.adverseReactions.length > 0)
                            || (item.drugHistory && item.drugHistory['慢病用药内容'] &&  item.drugHistory['慢病用药内容'].length > 0) || (item.drugHistory &&item.drugHistory['普通病用药内容'] &&  item.drugHistory['普通病用药内容'].length > 0) ||item.follow)
                         isChronic = chronicMagItem&&item.type==2&&chronicList.findIndex((it)=>it.conceptId==item.conceptId)!=-1;
-                        return (<div draggable={true} className={style['diag-box'] + ' clearfix'}  key={item.conceptId} >
+                        return (<div draggable={true} className={style['diag-box'] + ' clearfix'} id="diagListBox" key={item.conceptId} >
                                     {index === 0 ? '' : <span className={style['diag-up']} onClick={() => {this.upDiagnostic(index)}}><img className={style["diag-up"]} src={diagUp}/></span>}
                                     {list.length === 1 ? '' : index !== 0 ? '' : <span onClick={() => {this.downDiagnostic(index)}} className={style['diag-down']}><img className={style["diag-down"]} src={diagDown}/></span>}
                                     <span className={style['diag-number']} style={{fontWeight:index === 0 ?'bold':'normal'}}>{index === 0 ? '1' : index+1}</span>
@@ -296,7 +297,7 @@ class DiagnosticList extends Component {
                                        onMouseEnter={this.handleMouseEnterDrug.bind(this,index)}
                                        onMouseLeave = {this.handleMouseLeaveDrug.bind(this)}
                                     >
-                                      <span  onClick={this.handleClickDiag.bind(this,item,false,true,false)}>
+                                      <span   className={style['diag-name-box']} style={{maxWidth: windowWidth > 1024 ?windowWidth-900 +'px':'130px'}} onClick={this.handleClickDiag.bind(this,item,false,true,false)}>
                                         {item.name}
                                       </span>
                                       <img className={style['info-img']}  

+ 7 - 0
src/components/DiagnosticList/index.less

@@ -50,6 +50,7 @@
 
 
 .diag-name {
+   
     margin-left: 10px;
     border-bottom: 1px solid #666;
     box-sizing: border-box;
@@ -58,6 +59,12 @@
     font-weight: bold;
     cursor: pointer;
 }
+.diag-name-box {
+    .ellipsis;
+    display: inline-block;
+    line-height: 16px;
+    // max-width: 220px;
+}
 
 .diag-up, .diag-down {
     position: relative;

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

@@ -206,7 +206,6 @@ class MultSpread extends Component{
                              wrBmi={wrBmi}
                              bmi={bmi}
                              setBMIParam={this.setBMIParam}
-                             formulaCode={it.formulaCode}
                              num = {count++}
                              min={min}
                              max={max}

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

@@ -38,7 +38,7 @@ class NumberDrop extends Component{
     let timer = null;
     clearTimeout(this.state.sltTimer);
     clearTimeout(this.state.blurTimer);
-    const {handleSelect,ikey,suffix,prefix,mainSaveText,min,max} = this.props;
+    const {handleSelect,ikey,suffix,prefix,mainSaveText,min,max,formulaCode} = this.props;
     const needCompare=min!=undefined&&max!=undefined;
     if(!text){
       this.setState({
@@ -64,7 +64,7 @@ class NumberDrop extends Component{
       });
     }
 
-    handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
+    handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText,formulaCode});
     //BMI相关数据上传
     this.emitBMIData(text);
   }
@@ -85,9 +85,9 @@ class NumberDrop extends Component{
     }
   }
   beyondArea(){
-    const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
+    const {handleSelect,ikey,suffix,prefix,mainSaveText,formulaCode} = this.props;
     Notify.info("输入数值不符合规范,请重新输入!");
-    handleSelect&&handleSelect({ikey,text:'',suffix,prefix,mainSaveText});
+    handleSelect&&handleSelect({ikey,text:'',suffix,prefix,mainSaveText,formulaCode});
     this.emitBMIData('');
     this.setState({
       placeholder:this.props.placeholder,
@@ -153,7 +153,7 @@ class NumberDrop extends Component{
   }
   numInpBlur(e){        //数字框失焦,保存值到store中
     e.stopPropagation();
-    const {handleSelect,ikey,suffix,prefix,mainSaveText,min,max,show} = this.props;
+    const {handleSelect,ikey,suffix,prefix,mainSaveText,min,max,show,formulaCode} = this.props;
     /*if(show){      //修改清空后第一次点击键盘不触发click事件bug--失焦placehoder消失,弃用
       return;
     }*/
@@ -184,7 +184,7 @@ class NumberDrop extends Component{
     const {placeholder} = this.state;
     let text = val===placeholder?'':val;
     //e.target.innerText = '';      //避免出现重复输入值
-    handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
+    handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText,formulaCode});
     this.emitBMIData(text);
   }
   handleSpanInp(e){   //数字框输入事件
@@ -227,11 +227,11 @@ class NumberDrop extends Component{
     //BMI存值
     const {formulaCode,bmi,suffix,prefix,ikey,handleSelect,mainSaveText,wrBmi} = this.props;
     if(formulaCode==="BMI_RES"&&nextProps.bmi!==bmi){
-      handleSelect&&handleSelect({ikey,text:nextProps.bmi,suffix,prefix,mainSaveText});
+      handleSelect&&handleSelect({ikey,text:nextProps.bmi,suffix,prefix,mainSaveText,formulaCode});
     }
     //手动修改BMI时身高体重清空
     if(wrBmi!==nextProps.wrBmi&&(formulaCode==="BMI_SG"||formulaCode==="BMI_TZ")){
-      handleSelect&&handleSelect({ikey,text:'',suffix,prefix,mainSaveText});
+      handleSelect&&handleSelect({ikey,text:'',suffix,prefix,mainSaveText,formulaCode});
     }
 
     if((nextProps.placeholder == this.props.placeholder)&&(nextProps.value == this.props.value)){

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

@@ -47,14 +47,14 @@ class PushDiag extends Component {
         let ItemNum = 0;
         return (<div className={style['push-diag-wrapper']}>
             <h1 className={style['push-diag-title']} style={{background:titleBg}}><img className={style['push-diag-icon']} src={icon} />{title}</h1>
-            <div className={`${style['push-diag-box']} ${domH>50&&showSlide?style['push-diag-more-slide-d']:style['push-diag-more-slide-u']}`} ref={this.$ide}>
+            <div className={`${style['push-diag-box']} ${domH>55&&showSlide?style['push-diag-more-slide-d']:style['push-diag-more-slide-u']}`} ref={this.$ide}>
                 {
                     diagList.map((item, index) => {
                         ItemNum = ItemNum + item.name.length + 1;
                         return <div key={item.id} className={style['push-diag-item']}><DiagnosticItem item={item} type='disSelect'/></div>
                     })
                 }
-                {domH>50&&<div onClick={() => this.handleShow()} className={`${style['push-diag-more']} ${showSlide?style['push-diag-more-d']:style['push-diag-more-u']}`}>{showSlide ? ' 更多': '收起'}<img className={style['push-diag-more-icon']} src={showSlide ? showImg : hideImg}/></div>}
+                {domH>55&&<div onClick={() => this.handleShow()} className={`${style['push-diag-more']} ${showSlide?style['push-diag-more-d']:style['push-diag-more-u']}`}>{showSlide ? ' 更多': '收起'}<img className={style['push-diag-more-icon']} src={showSlide ? showImg : hideImg}/></div>}
 
             </div>
         </div>)

+ 10 - 80
src/components/RadioInpDrop/index.jsx

@@ -20,18 +20,13 @@ class RadioInpDrop extends Component{
   constructor(props){
     super(props);
     this.state={
-      editable:false,
-      timer:null,
       texts:props.vals||{0:props.value||props.placeholder},
       over:false,
-      tmpDom:null
     };
     this.$cont = React.createRef();
     this.isIE = navigator.appName=="Microsoft Internet Explorer" && navigator.appVersion.split(";")[1].replace(/[ ]/g,"")=="MSIE8.0";
     this.handleSelect = this.handleSelect.bind(this);
     this.handleShow = this.handleShow.bind(this);
-    this.handledbClick = this.handledbClick.bind(this);
-    this.handleEditLabel = this.handleEditLabel.bind(this);
     this.parseInputDom = this.parseInputDom.bind(this);
     this.handleInnerInp = this.handleInnerInp.bind(this);
   }
@@ -76,25 +71,11 @@ class RadioInpDrop extends Component{
     handleSelect&&handleSelect({ikey,id:item.id,values:vals,mainSaveText,value});
   }
   handleShow(e){
-    //e.stopPropagation();
+    e.stopPropagation();
     const {handleShow,ikey,id,patId} = this.props;
-    const that = this;
-    const timer = setTimeout(()=>{
-      if (that.state.editable) {//如果处于编辑状态点击不显示下拉框
-        return
-      }else {
-        document.activeElement.blur()//chrome41有效,但是失去焦点的span仍能编辑
-        $(e.target).parent().parent().prev().attr({"contentEditable":false})
-        this.setState({
-          tmpDom:e.target
-        })
-        handleShow && handleShow({ikey,id:patId||id});
-      }
-    },300);
-    
-    this.setState({
-      timer,
-    });
+    document.activeElement.blur()//chrome41有效,但是失去焦点的span仍能编辑
+    handleShow && handleShow({ikey,id:patId||id});
+
     windowEventHandler('scroll',()=>{      //弹窗跟随滚动条滚动或者关闭弹窗
       let scrollYs = $("#addScrollEvent")[0].scrollTop;
       this.setState({
@@ -102,49 +83,6 @@ class RadioInpDrop extends Component{
       })
     },$("#addScrollEvent")[0])
   }
-  /*componentDidMount(){    //默认值选中
-    const {data,ikey,handleSelect} = this.props;
-    const selected = data.find((it)=>{
-      return it.selected === undefined&&+it.defaultSelect===1;
-    });
-    if(selected){
-      // const text = selected.labelPrefix+selected.name+selected.labelSuffix;
-      const text = selected.name;
-      handleSelect&&handleSelect({ikey,id:selected.id,text});
-    }
-  }*/
-  handleEditLabel(e){
-    e.stopPropagation();
-    if(!this.state.editable){     //ie8点开下拉未选值存值bug修改
-      return;
-    }
-    const {ikey,boxMark,handleLabelEdit} = this.props;
-    this.setState({
-      editable:false
-    });  
-   // 更改标签的value值
-    const ev = e || window.event;
-    let changeVal = ev.target.innerText || ev.target.innerHTML;
-    if(!this.isIE){
-      ev.target.innerText?(ev.target.innerText = ''):(ev.target.innerHTML = '');
-    }
-    handleLabelEdit && handleLabelEdit({ikey,changeVal,type:boxMark});
-  }
-  handledbClick(e){
-    const {value,id,handleDbclick,patId} = this.props;
-    clearTimeout(this.state.timer);//取消延时的单击事件
-    //e.preventDefault();
-    if(value&&value.trim()) {//有选中值的标签才能双击编辑
-      this.setState({
-        editable: true
-      });
-    };
-    //失焦关闭编辑状态
-    setTimeout(()=>{
-      e.target.focus();
-    })
-    handleDbclick&&handleDbclick({id:patId||id});
-  }
   handleInnerInp(i,val){
     const {ikey,boxMark,handleSaveInp,mainSaveText} = this.props;
     let vals = this.state.texts; 
@@ -183,7 +121,7 @@ class RadioInpDrop extends Component{
     for(let i in texts){
       temp = texts[i];
       if(typeof temp=='object'){
-        list.push(<InputComp handleInp={this.handleInnerInp} editable={true} index={i} value={temp.value} over={over}></InputComp>);
+        list.push(<InputComp handleInp={this.handleInnerInp} index={i} value={temp.value} over={over}></InputComp>);
       }else{
         list.push(<span>&nbsp;{temp}</span>);
       }
@@ -191,18 +129,10 @@ class RadioInpDrop extends Component{
     return list;
   }
   render(){
-    const {data,show,vals,placeholder,hideTag} = this.props;
-    const {tmpDom} = this.state
-    if(!show&&tmpDom){
-      $(tmpDom).parent().parent().prev().attr({"contentEditable":true})
-    }
-    // 移除双击编辑 onDoubleClick={hideTag?null:this.handledbClick}
+    const {data,show,vals,placeholder} = this.props;
     return <div className={style['container']} ref = {this.$cont}>
       <div className={this.getClass()}
-           onBlur={this.handleEditLabel}
-           contentEditable={this.state.editable}
-           
-           onClick={(e)=>this.handleShow(e,true)}
+           onClick={(e)=>this.handleShow(e)}
            onKeyDown={handleEnter}>
         {vals?this.parseInputDom():<span>{placeholder}</span>}
       </div>
@@ -238,13 +168,13 @@ class InputComp extends Component{
     }
   }
   render(){
-    const {editable,value} = this.props;
-    return editable?<span contentEditable={true}
+    const {value} = this.props;
+    return <span contentEditable={true}
                           ref={this.$inp}
                  className={style['inner-inp']}
                  onClick={(e)=>{e.stopPropagation()}}
                  onFocus={(e)=>{e.stopPropagation()}}
-                 onBlur={this.handleBlur}>&nbsp;{value}</span>:<span>&nbsp;{value}</span>
+                 onBlur={this.handleBlur}>&nbsp;{value}</span>
   }
 }
 

+ 1 - 5
src/containers/CurrentIll.js

@@ -127,10 +127,6 @@ function mapDispatchToProps(dispatch) {
                   }
                 }
             });
-          //右侧推送
-          setTimeout(function(){ 
-            dispatch(billing());
-          },200);
         },
         changeEditIll(bool){
             dispatch({
@@ -142,7 +138,7 @@ function mapDispatchToProps(dispatch) {
         dispatch({
           type: SAVE_CURR_FREE,
           data:item
-        })
+        });
         //右侧推送
           setTimeout(function(){ 
             if(didPushParamChange()){

+ 4 - 3
src/containers/DiagnosticList.js

@@ -9,6 +9,7 @@ import {keepPushData} from '@store/actions/tabTemplate';
 import { visibleHistory } from '@store/actions/historyTemplates'
 import {autoFillModules} from '@store/async-actions/fetchModules';
 import {SET_ASSESS_DATA} from '@types/assessResult';
+import {didPushParamChange} from '@utils/tools';
 
 function mapStateToProps(state) {
     const {diagnosticList,assessResult,pushMessage } = state;
@@ -27,6 +28,7 @@ function mapStateToProps(state) {
         scaleInfo: pushMessage.scaleInfo,//量表内容
         showHide: pushMessage.showHide,
         loading: diagnosticList.loading,
+        windowWidth: state.homePage.windowWidth
     }
 }
 
@@ -78,9 +80,6 @@ function mapDispatchToProps(dispatch) {
                 type: GET_DIAGNOSTIC_STR
             });
         },
-        getSearchResult:() => {
-            dispatch(getSearchResult)
-        },
         showTreat: () => {
             dispatch({
                 type: SHOW_TREAT,
@@ -95,7 +94,9 @@ function mapDispatchToProps(dispatch) {
             dispatch(getConceptDetail(item,noTips,noDetails,noNotify))
         },
         getBilling: () => {
+          if (didPushParamChange()) {
             dispatch(billing())
+          }
         },
         hideReferRecord: ()=>{
             dispatch({

+ 0 - 3
src/containers/InlineTag.js

@@ -6,9 +6,6 @@ import {SETCURRENTINPUT,CURRENT_TEXT_LABEL} from '@types/currentIll';
 import {SETCHECKINPUT} from "@types/checkBody";
 import InlineTag from "../common/components/InlineTag";
 import {getLabelIndex} from '@utils/tools.js';
-import {CHANGEOTHERTEXTLABEL} from "../store/types/otherHistory";
-import {CHANGECHECKTEXTLABEL} from "../store/types/checkBody";
-import {CHANGE_LABELVAL} from "../store/types/mainSuit";
 
 function mapStateToProps(state){
   return {}

+ 8 - 62
src/containers/RadioInpDrop.js

@@ -1,11 +1,11 @@
 import React from 'react';
 import {connect} from 'react-redux';
 import RadioInpDrop from "@components/RadioInpDrop";
-import {SETRADIO,CLEARSELECTED,CONFIRMSELECTED,CHANGEOTHERTEXTLABEL,SET_OT_RADIO_INPUT_VAL} from '@types/otherHistory';
-import {SETSELECTED4,CHANGECHECKTEXTLABEL,SET_CK_RADIO_INPUT_VAL} from '@types/checkBody';
+import {SETRADIO,CLEARSELECTED,CONFIRMSELECTED,SET_OT_RADIO_INPUT_VAL} from '@types/otherHistory';
+import {SETSELECTED4,SET_CK_RADIO_INPUT_VAL} from '@types/checkBody';
 import {SETDROPSHOW,HIDE,RESET,HIDEDROP,CLICKCOUNT,ISREAD} from '@types/homePage.js';
-import {RADIO_SELECT,CHANGE_LABELVAL,SET_MS_RADIO_INPUT_VAL} from '@store/types/mainSuit.js';
-import {CURRENT_RADIO,CURRENT_TEXT_LABEL,SET_RADIO_INPUT_VALUE} from '@store/types/currentIll.js';
+import {RADIO_SELECT,SET_MS_RADIO_INPUT_VAL} from '@store/types/mainSuit.js';
+import {CURRENT_RADIO,SET_RADIO_INPUT_VALUE} from '@store/types/currentIll.js';
 import {Notify} from '@commonComp';
 import {filterArr,didPushParamChange,filterDataArr,getLabelIndex,fullfillText} from '@utils/tools.js';
 import {billing} from '@store/async-actions/pushMessage';
@@ -110,13 +110,6 @@ function handleModuleDiff(dispatch,store,params){
   }
 }
 /**************标签双击输入action types**************/
-//对应模块单选双击编辑事件
-const dbEditActions = {
-  1:CHANGE_LABELVAL,
-  2:CURRENT_TEXT_LABEL,
-  3:CHANGEOTHERTEXTLABEL,
-  4:CHANGECHECKTEXTLABEL
-};
 //对应模块单选带输入存值事件
 const InputActions = {
   1:SET_MS_RADIO_INPUT_VAL,
@@ -141,62 +134,15 @@ function mapDispatchToProps(dispatch,store){
         }
       },500);
     },
-    handleDbclick(obj){//双击统计
-      dispatch({
-        type:CLICKCOUNT,
-        data:obj,
-        clickType:'双击',
-        num:1
-      });
-    },
     handleSaveInp(params){
-      const {boxMark,mainSaveText,values} = params;
-      const index = params.ikey;
-      let ikey = getLabelIndex(index);
-      // 输入框字数限制
-      /*if(boxMark==1){
-        if(values){
-          let str='',temp='';
-          for(let i in values){
-            temp = values[i];
-            if(typeof temp=='object'){
-              str+=temp.value;
-            }else{
-              str+=temp;
-            }
-          }
-          let oldVal = mainSaveText[ikey];
-          let mainText = filterDataArr(mainSaveText);
-          let lengths = 0;console.log("单选框输入:",params,oldVal,mainText.length)
-          if(oldVal && oldVal.length > str.length){
-            lengths = mainText.length + (str.length - oldVal.length);
-          }else{
-            lengths = mainText.length + str.length;
-          }  
-          if(lengths >= config.limited){
-            Notify.info(config.limitText);
-            return
-          }
-        }
-      }*/
+      const {boxMark} = params;
       dispatch({
         type:InputActions[+boxMark],
         data:{values:params.values,ikey:params.ikey}
       });
-      dispatch(billing());
-      dispatch({
-        type:ISREAD
-      })
-    },
-    handleLabelEdit(params){
-      const {type} = params;
-      const index = params.ikey;
-      let ikey = getLabelIndex(index);
-      dispatch({
-        type:dbEditActions[+type],
-        data:{changeVal:params.changeVal,ikey:ikey}
-      });
-      dispatch(billing());
+      if(didPushParamChange()) {     //操作后内容有变化才推送
+        dispatch(billing());
+      }
       dispatch({
         type:ISREAD
       })

+ 1 - 1
src/containers/SpreadDrop.js

@@ -198,7 +198,7 @@ function otherHisConfirm(dispatch,store,params){
   let existsId = getIds(exists);
   let withsId = getIds(withs);
   // const ids = existsId.length>0?existsId.join(",")+','+withsId.join(","):withsId.join(",");
-  const ids = existsId.concat(withsId);console.log(555,ids)
+  const ids = existsId.concat(withsId);
   if(!ids&&nones){      //只有无的项目
     dispatch({
       type: CONFIRMSELECTED,

+ 1 - 0
src/containers/eleType.js

@@ -87,6 +87,7 @@ export function singleRadio(params){
                          suffix={data.labelSuffix}
                          min={min}
                          max={max}
+                         formulaCode={data.formulaCode}
                          isExtBlue={data.specFlag===4?true:false}
                          placeholder={data.name}
                          boxMark={boxMark}

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

@@ -255,38 +255,6 @@ export function clearCheckBody(state,action){  //清空
   return res;
 }
 
-//文本输入标签
-export function setInputLabel(state,action){
-  let res = Object.assign({}, state);
-  const {i,text,prefix,suffix,subIndex} = action;
-  const item = res.data[i];
-  if(+item.tagType===3){      //multSpred标签
-    item.questionMapping[subIndex].value = text;
-    let texts = item.questionMapping.map((it)=>{
-      if(it.tagType===8){
-        return it.name;
-      }else{
-        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
-      }
-      
-    });
-    res.saveText[i] = texts.join('');
-    res.update = Math.random();
-    return res;
-  }else{
-    if(item){
-      item.value=text;
-    }
-  }
-  if(text){
-    res.saveText[i] = prefix+text+suffix;
-  }else{//删除完要清空
-    res.saveText[i] = "";
-  }
-  res.update = Math.random();
-  return res;
-}
-
 // backspace删除
 export function backspaceText(state,action){
   let res = Object.assign({},state);

+ 0 - 26
src/store/actions/currentIll.js

@@ -671,32 +671,6 @@ export function addLabelItem(state,action){
   return res;
 }
 
-//文本输入标签
-export function setInputLabel(state,action){
-  let res = Object.assign({},state);
-  const {i,text,prefix,suffix,subIndex,total} = action;
-  const item = res.data[i];
-  if(+item.tagType===3){      //multSpred标签
-    item.questionMapping[subIndex].value = text;
-    let texts = item.questionMapping.map((it)=>{
-      return it.value?(it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||''):'';
-    });
-    res.saveText[i] = texts.join('');
-    res.update = Math.random();
-    return res;
-  }else{
-    if(item){
-      item.value=text;
-      res.saveText[i] = (prefix ||'')+ text + (suffix||'');
-    }else if(!total){//整个标签内容完全删除
-      res.data.splice(i,1);
-      res.saveText.splice(i,1);
-    }
-  }
-  res.update = Math.random();//console.log(888,res,action)
-  return res;
-}
-
 // backspace删除
 export function backspaceText(state,action){
   let res = Object.assign({},state);

+ 0 - 27
src/store/actions/mainSuit.js

@@ -680,33 +680,6 @@ export function addLabelItem(state,action){
   return res;
 }
 
-//文本输入标签
-export function setInputLabel(state,action){
-  let res = Object.assign({},state);//console.log(state,action)
-  const {i,text,prefix,suffix,subIndex} = action;
-  const item = res.data[i];
-  if(+item.tagType===3){      //multSpred标签
-    item.questionMapping[subIndex].value = text;
-    let texts = item.questionMapping.map((it)=>{
-      return it.value?(it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||''):'';
-    });
-    res.saveText[i] = texts.join('');
-    res.update = Math.random();
-    return res;
-  }else{
-    if(item){
-      item.value=text;
-    }
-  }
-  if(text){
-    res.saveText[i] = prefix+text+suffix;
-  }else{//删除完要清空
-    res.saveText[i] = "";
-  }
-  res.update = Math.random();
-  return res;
-}
-
 // backspace删除
 export function backspaceText(state,action){
   let res = Object.assign({},state);

+ 36 - 27
src/store/actions/otherHistory.js

@@ -64,33 +64,6 @@ export function setCheckText(state,action) {
   return res;
 }
 
-//文本输入标签
-export function setOtherInput(state,action){
-  let res = Object.assign({}, state);//console.log(state,action)
-  const {i, text, prefix, suffix, subIndex} = action;
-  const item = res.data[i];
-  if (+item.tagType === 3 || +item.tagType === 4) {      //multSpred标签
-    item.questionMapping[subIndex].value = text;
-    let texts = item.questionMapping.map((it) => {
-      return (it.labelPrefix || '') + (it.value || '') + (it.labelSuffix || '');
-    });
-    res.saveText[i] = texts.join('');
-    res.update = Math.random();
-    return res;
-  } else {
-    if (item) {
-      item.value = text;
-    }
-  }
-  if(text){
-    res.saveText[i] = prefix+text+suffix;
-  }else{//删除完要清空
-    res.saveText[i] = "";
-  }
-  res.update = Math.random();
-  return res;
-}
-
 //多选文字,如杂音
 export function setCheckBoxValue(state,action) {
   const res = Object.assign({},state);
@@ -247,6 +220,42 @@ export const setTextModeValue = (state,action)=>{
   return res;
 };
 
+//数字键盘选中事件
+export function setNumberValue(state,action){
+  let res = Object.assign({},state);
+  const param = action.params;
+  const ikey = param.ikey;
+  const code = param.formulaCode;
+  let labelInx = getLabelIndex(ikey);
+  const subInx = ikey.substr(ikey.length-1);
+  let item = res.data[labelInx];
+  if(+item.tagType===1){
+    item.value = param.text;
+    res.saveText[labelInx] = param.text?item.labelPrefix+param.text+item.labelSuffix:'';
+  }else{
+    item.questionMapping[subInx].value = param.text;
+    let hasValue = false;
+    const sub = item.questionMapping.map((it)=>{
+      if(it.value){     //至少有一个子值才黑显
+        hasValue = true;
+      }
+      if(it.tagType===8){       //维护时的连接词无value
+        return it.name;
+      }else{
+        //组合中未填值的子标签预览中不显示
+        if(!it.value){
+          return '';
+        }
+        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      }
+    });
+    res.saveText[labelInx] = hasValue?sub.join(''):'';
+  }
+  res[code] = param.text;
+  res.update = Math.random();
+  return res;
+}
+
 //复制标签(如血压)事件
 export function addLabelItem(state,action){
   let res = Object.assign({},state);

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

@@ -11,6 +11,7 @@ import {CURRENT_CHRONIC} from '@store/types/currentIll';
 import {MODI_LOADING} from '@store/types/homePage';
 import {GET_ALL_HIS,FILTER_ALL_HIS} from '@store/types/emergencyHis';
 import {SET_IMPORT_CHECKBODY_LABEL} from "../types/checkBody";
+import {getBigPush} from '@utils/utils';
 
 const api={
   // getSpreadModule:'/questionInfo/getByIds',
@@ -18,7 +19,6 @@ const api={
   getModule:'/questionInfo/getById',
   searchURL: '/retrieval/getTagInfos',
   getOtherHisRecord: '/inquiryInfo/getLastOther',
-  getBigPush:'/push/pushInner',
   saveMode:'/doctorPageMode/saveDoctorPageModes',
   getSymptomFeature:'/feature/getSymptomFeature',
   getAssess:'/evaluationModuleMapping/getEvaluationModules',    //获取管理评估-慢病
@@ -134,19 +134,8 @@ export function pregetCheckbodyData(flag){     //flag=true获取到数据后立
     if(flag){
       dispatch({type:MODI_LOADING,flag:true});
     }
-    const emrData = getEMRParams();
-    const param = {
-      age: emrData.age,
-      featureType: "1,42,41,7",
-      diag: emrData.dis,
-      lis: emrData.lis,
-      other: emrData.other,
-      pacs: emrData.pacs,
-      sex: emrData.sex,
-      vital:emrData.vital,
-      symptom: emrData.current+emrData.main
-    };
-    json(api.getBigPush,param).then((res)=>{
+
+    getBigPush("1,42,41,7").then((res)=>{
       if(+res.data.code === 0){
         const obj = res.data.data;
         const data = obj&&obj.moduleVital;

+ 4 - 17
src/store/async-actions/historyTemplates.js

@@ -7,7 +7,6 @@ import { billing } from '@store/async-actions/pushMessage';
 
 export const initItemList = (item) => {
   let baseList = store.getState();
-  // let whichSign = baseList.typeConfig.typeConfig;
   let state = baseList.patInfo.message;
   const param = {
       "hospitalId": state.hospitalId,
@@ -17,16 +16,6 @@ export const initItemList = (item) => {
       "current": 1,
       "size": 9999
     }
-    /*return (dispatch) => {
-        axios.json('/inquiryInfo/hisInquirys',param).then((res)=>{
-            const data =res.data;
-            if(data.code == 0){
-                dispatch(initHistory(data.data));
-            }else{
-                console.log(data)
-            }
-        })
-    }*/
     return axios.json('/inquiryInfo/hisInquirys',param);
 };
 export const getHistempDetail = (item) => {
@@ -38,13 +27,11 @@ export const getHistempDetail = (item) => {
             const data =res.data;
             if(data.code == 0){
                 let tmpData = data.data
-                // let tmpList = tmpData.inquiryDetailList
-                // tmpData.detailList = tmpList
-                // console.log(tmpData)
-                pushAllDataList(item.sign,'push',tmpData,'history')       //引用     
-                store.dispatch(billing());
+                pushAllDataList(item.sign,'push',tmpData,'history')       //引用
+                if(didPushParamChange()) {
+                  dispatch(billing());
+                }
             }else{
-                // console.log(data)
                 Notify.error(data.msg);
             }
         })

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

@@ -45,14 +45,16 @@ export async function getCommSymptomPush(){//获取大数据推送症状
       const emrData = getEMRParams();
       const params = {
         "age": emrData.age,
+        "hosCode": emrData.hosCode,
         "featureType": type,//类型1:症状,4:查体,5:化验,6:辅检,7:诊断
         "diag": emrData.dis,
         "lis": emrData.lis,
         "other": emrData.other,
         "pacs": emrData.pacs,
         "sex": emrData.sex,
+        "vital":emrData.vital,
         "symptom": emrData.current + emrData.main
       };
-    const bigData = await json(api.symptomPush,params);
+    const bigData = json(api.symptomPush,params);
     return bigData;
 }

+ 7 - 24
src/store/async-actions/pushMessage.js

@@ -3,13 +3,13 @@ import { BILLING_ADVICE, SET_TIPS, SET_TIPS_DETAILS ,SET_CHRONIC_TABLELIST,SET_S
 import { SET_DRUG_INFO, SHOW_DRUG_INFO } from '@store/types/treat';
 import { SET_CLICK_DIAG } from '../types/diagnosticList';
 import {storageLocal,getEMRParams} from '@utils/tools';
+import {getBigPush} from '@utils/utils';
 import {SET_IMPORT_CHECKBODY_LABEL,PRESET} from "../types/checkBody";
 import dataLis from '@components/EmergencyProcedure/emergency';
 import  Notify from '@commonComp/Notify';
 import {pregetCheckbodyData} from '@store/async-actions/fetchModules';
 import {tabChange} from '@store/actions/tabTemplate';
 const api={
-  push:'/push/pushInner',
   getTableList:'/scale/getList', //获取量表列表
   getTableInfo:'/scale/getContent', //获取量表明细
   getConceptDetail:'/conceptDetail/getConceptDetail', //获取静态提示信息
@@ -19,28 +19,14 @@ const api={
 export const billing = (mdata,boxMark) => {
  return (dispatch, getState) =>{
   const state = getState();
-  let url = api.push;
    const checkBody = state.checkBody.data;
    let diagMain = state.diagnosticList.diagnosticList.length>0&&state.diagnosticList.diagnosticList[0]
    let getCheck = boxMark==2&&!(checkBody&&checkBody.length>0&&!checkBody[0].full);
   const emrData = getEMRParams();
-  const params = {
-    age: emrData.age,
-    featureType: getCheck?"42,41,5,6,7":"42,5,6,7",    //41只返回查体模板,4只返回查体高亮
-    // featureType: "22",
-    diag: emrData.dis,
-    lis: emrData.lis,
-    other: emrData.other,
-    pacs: emrData.pacs,
-    sex: emrData.sex,
-    vital:emrData.vital,
-    symptom: mdata?(emrData.current + mdata):(emrData.current + emrData.main),
-    hosCode: emrData.hosCode
-  };
-  let savePm = Object.assign({},params);
-  delete savePm.featureType;
-  storageLocal.set('emrParam',savePm);      //推送数据存储,用作推送前对比是否有变,有变才推送
-    json(url, params).then((data) => {
+  //mdata为主诉无标签直接输入时的内容,symptom参数传主诉+现病史文本
+  const mainData =  mdata?(emrData.current + mdata):(emrData.current + emrData.main);
+  const feaType = getCheck?"42,41,5,6,7":"42,5,6,7";    //41只返回查体模板,4只返回查体高亮
+   getBigPush(feaType,mainData,true).then((data) => {
         let {dis, lab, pacs,vitalIds,moduleVital} = data.data.data||{};
         lab = lab||[];
         pacs = pacs||[];
@@ -52,7 +38,7 @@ export const billing = (mdata,boxMark) => {
             setPushEmergency={}, //急诊
             setPushEmergencyIdx='',//急诊对应本地数据
             likely=[];//鉴别诊断
-            doubt = dis&&dis['疑似诊断'],
+            doubt = dis&&dis['拟诊'],
             possible = dis&&dis['可能诊断'];
             vigilant = dis&&dis['警惕'];
             determine = dis&&dis['确诊']; //确诊
@@ -115,10 +101,8 @@ export const billing = (mdata,boxMark) => {
       console.log(e)
   });
    //单独调指标
-   const ps = Object.assign({},params,{featureType:'22'});
-   json(url, ps).then((data) => {
+   getBigPush('22',mainData).then((data) => {
      let {medicalIndications} = data.data.data||{};
-
      //慢病推送模块数据
      dispatch({
        type:SET_CHRONIC_PUSHS,
@@ -285,7 +269,6 @@ export const getScaleInfo = (it)=>{
             symptom: emrData.current + emrData.main,
             // indications:'' //指标结果
           };
-        // json(api.push, params)
         json(api.getTableInfo, params)
         .then((res)=>{
             const result = res.data;

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

@@ -171,7 +171,9 @@ export const setPageView = (id) => { //获取模板结构化数据
       if (data.code == 0) {
         //模板列表不筛选模式后,单个模式引用时看本身的模式
         pushAllDataList(data.data.type, 'push', data.data, 'template')//引用
-        store.dispatch(billing())
+        if(didPushParamChange()){     //诊断变化时会调推送,避免重复调
+          dispatch(billing())
+        }
       } else {
         Notify.error(data.msg);
       }

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

@@ -3,9 +3,9 @@ import {RECOVER_TAG_CHECK,SET,SETNUMBER4,SETSELECTED4,SETCHECKBOX,ADDLABELITEM,S
   SETCHECKINPUT,DEL_CHECKBODY,CHECKCONFIRMSELECTED,
   CHECKBODY_MUL,DEL_CHECKBODY_LABLE,SET_CK_RADIO_INPUT_VAL,SET_IMPORT_CHECKBODY_LABEL,PRESET} from '../types/checkBody.js';
 import {recoveTag,set,setCheckBoxValue,addLabelItem,setCheckText,
-  setSearchData,insertLabelData,changeLabelVal,clearCheckBody,setInputLabel,backspaceText
+  setSearchData,insertLabelData,changeLabelVal,clearCheckBody,backspaceText
   ,confirm,multipleComfirn,delSingleLable,setImportCheckbodyLabel,preSetCheckbody} from '../actions/checkBody.js';
-import {setRadioInputValue,setRadioValue,setNumberValue} from '@utils/utils';
+import {setRadioInputValue,setRadioValue,setNumberValue,setInputLabel} from '@utils/utils';
 import config from '@config/index.js';
 
 const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签

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

@@ -4,9 +4,9 @@ import {RECOVER_TAG_CURRENT,SET_CURRENT,CURRENT_CONFIRM,INSERT_PROCESS,SET_CURRE
   SET_CURRENT_SEARCH,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,SELECT_SEARCHDATA,CLEAR_CURRENT_EDIT,CURRENTADDLABELITEM,
   SETCURRENTINPUT,DEL_CURRENT,REMOVE_CURR_ID,CURRENT_MUL,DEL_CURRENT_LABLE,SET_RADIO_INPUT_VALUE,CURRENT_CHRONIC,SAVE_CURR_FREE} from '../types/currentIll';
 import {recoveTag,confirm,insertProcess,setData,setCheckBox,changeLabelVal,clearCurrentIll,
-  setTextModeValue,setModule,bigDataSymptom,setCheckText,insertLabelData,clearCurrentEdit,addLabelItem,setInputLabel,
+  setTextModeValue,setModule,bigDataSymptom,setCheckText,insertLabelData,clearCurrentEdit,addLabelItem,
   backspaceText,removeId,multipleComfirn,delSingleLable,fillChronicModule} from '../actions/currentIll';
-import {setRadioInputValue,setRadioValue,setNumberValue} from '@utils/utils';
+import {setRadioInputValue,setRadioValue,setNumberValue,setInputLabel} from '@utils/utils';
 
 const initState = {
   moduleData:[],

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

@@ -5,9 +5,9 @@ import {RECOVER_TAG_MAIN,COMM_SYMPTOMS,CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,
   REMOVE_MAIN_ID,MAINSUIT_MUL,DEL_MAIN_LABLE,SET_FEATURE,SET_MS_RADIO_INPUT_VAL,SAVE_CHRONIC,MAIN_REMOVE_SPAN,SET_ADD_SEARCH,CLEAR_ADD_SEARCH} from '../types/mainSuit'
 import {recoveTag,getCommSymptoms,handleTailClick,insertMain,setSearch,getBigSymptom,setMainMoudle,confirm,
   commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,
-  addLabelItem,setInputLabel,backspaceText,removeId,multipleComfirn,delSingleLable,
+  addLabelItem,backspaceText,removeId,multipleComfirn,delSingleLable,
   getSymptomFeature} from '../actions/mainSuit'
-import {setRadioInputValue,setNumberValue,setRadioValue} from '@utils/utils';
+import {setRadioInputValue,setNumberValue,setRadioValue,setInputLabel} from '@utils/utils';
 
 const initState = {
   showDrop:false,

+ 3 - 3
src/store/reducers/otherHistory.js

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

+ 12 - 146
src/utils/tools.js

@@ -22,84 +22,7 @@ import $ from 'jquery';
  * 工具函数
  *
  * ***/
-const ARR = "Array";
-const NUMBER = "Number";
-const STRING = "String";
-const OBJECT = "Object";
-const UNDEFINED = "Undefined";
-const NULL = "Null";
-const BOOLEAN = "Boolean";
 const qs = require('qs');
-
-//  数据类型判断
-const Type = {
-    typeConstant: {
-        'array': ARR,
-        'number': NUMBER,
-        'string': STRING,
-        'object': OBJECT,
-        'undefined': UNDEFINED,
-        'null': NULL,
-        'boolean': BOOLEAN
-    },
-    tolower: (str)=> {
-        if(typeof str !== "string") {
-            return "";
-        }
-        return str.toLowerCase();
-    },
-    checkType: (el, type)=> {
-        type = Type.tolower(type);
-        type = Type.typeConstant[type];
-        return Object.prototype.toString.call(el) === "[object "+ type +"]";
-    }
-}
-
-// 计算字符串长度,该长度将一个中文字算作2个字符长度
-const regexp = {
-    ch: (str)=> {//匹配中文
-        if(typeof str !== "string") {
-            return "";
-        }
-        return str.match(/[\u4e00-\u9fa5]/g) || "";
-    },
-    chLen: function (str) {//中文长度
-        return regexp.ch(str).length;
-    },
-    strLen: function (str) {//字符串长度(一个中文当作两个英文字母)
-        if(typeof str !== "string") {
-            return 0;
-        }
-        return str.length + regexp.chLen(str);
-    }
-}
-
-//判断是否空对象或未定义
-const isUndefined = function (str) {
-    if(str === 0 || str === "") {
-        return false;
-    }
-    return (Type.checkType(str, 'null') || Type.checkType(str, 'undefined'));
-   
-}
-//sessionStorage方法封装
-const Storage = {
-    session: {
-        get: function (name) {
-            return JSON.parse(sessionStorage.getItem(name));
-        },
-        set: function (name, data) {
-            sessionStorage.setItem(name, JSON.stringify(data));
-        },
-        remove: function (name) {
-            sessionStorage.removeItem(name);
-        },
-        clear: function () {
-            sessionStorage.clear();
-        }
-    }
-};
-
 //localStorage方法封装
 const storageLocal = {
   set: function (name, data) {
@@ -122,8 +45,6 @@ const storageLocal = {
   }
 };
 
-const nullFn = ()=>{};
-
 //是否为空
 const isNull = (item)=>{
     return String(item)=== "" || String(item)==="null" || String(item)==="undefined";
@@ -177,7 +98,7 @@ const getAllDataList =(baseList) =>{           //获取所有模块结构化的
     jsonData.currentIllSelecteds = baseList.currentIll.selecteds;      //主诉选中状态保存
     jsonData.otherHistorySelecteds = baseList.otherHistory.selecteds;      //主诉选中状态保存
     jsonData.checkBodySelecteds = baseList.checkBody.selecteds;      //主诉选中状态保存
-    jsonData.addItems = baseList.homePage.addItems||{};
+    //jsonData.addItems = baseList.homePage.addItems||{};
     jsonData.mainsuitIds = baseList.mainSuit.mainIds;      //主诉去重
     jsonData.mainChronicDesease = baseList.mainSuit.chronicDesease;      //主诉慢病{}
     jsonData.diagChronicMagItem = baseList.diagnosticList.chronicMagItem;      //诊断慢病{}
@@ -378,10 +299,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     data:dataJson.advice,
                     saveText:dataJsonStr.advice
                 });
-                store.dispatch({
+                /*store.dispatch({
                   type:SETREADDITEMS,
                   data:dataJson.addItems
-                });
+                });*/
                 store.dispatch({
                   type:CLEAR_FIRST_MAIN_DIAG,
                   flag:dataJson.isFirstMainDiag
@@ -451,10 +372,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     data:dataJson.advice,
                     saveText:dataJsonStr[7].content ? dataJsonStr[7].content:''
                 });
-              store.dispatch({
+              /*store.dispatch({
                 type:SETREADDITEMS,
                 data:dataJson.addItems
-              });
+              });*/
               store.dispatch({
                 type:CLEAR_FIRST_MAIN_DIAG,
                 flag:dataJson.isFirstMainDiag
@@ -505,10 +426,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     data:dataJson.advice,
                     saveText:dataJsonStr.advice,
                 });
-              store.dispatch({
+              /*store.dispatch({
                 type:SETREADDITEMS,
                 data:dataJson.addItems
-              });
+              });*/
               store.dispatch({
                 type:CLEAR_FIRST_MAIN_DIAG,
                 flag:dataJson.isFirstMainDiag
@@ -566,10 +487,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     data:dataJson.advice,
                     saveText:dataJsonStr[7].content ? dataJsonStr[7].content:''
                 });
-              store.dispatch({
+              /*store.dispatch({
                 type:SETREADDITEMS,
                 data:dataJson.addItems
-              });
+              });*/
               store.dispatch({
                 type:CLEAR_FIRST_MAIN_DIAG,
                 flag:dataJson.isFirstMainDiag
@@ -715,16 +636,16 @@ function didPushParamChange(){
   const oldParams = storageLocal.get('emrParam');
   const newParams = JSON.stringify({
     age: emrData.age,
+    hosCode:emrData.hosCode,
     diag: emrData.dis,
     lis: emrData.lis,
     other: emrData.other,
     pacs: emrData.pacs,
     sex: emrData.sex,
     vital:emrData.vital,
-    symptom: emrData.current + emrData.main,
-    hosCode:emrData.hosCode
+    symptom: emrData.current + emrData.main
   });
-  if(newParams == oldParams){
+  if(newParams === oldParams){
       return false;
   }
   return true;
@@ -938,19 +859,6 @@ function parseChartData(indexData){
   //nameObj,obj;
   return {nameObj,obj};
 }
-//函数类工具,对函数进行操作 返回函数
-//延时操作
-function debounce(func, delay) {
-  let timer = null;
-  return function (...args) {
-    if (timer) {
-      clearTimeout(timer);
-    }
-    timer = setTimeout(() => {
-      func.apply(this, args);
-    }, delay);
-  }
-}
 
 // 时间戳转换日期
 function dateParser(timestamp,link = '-'){
@@ -966,40 +874,6 @@ function dateParser(timestamp,link = '-'){
   return result;
 }
 
-//时间搓转换年龄
-function getAge(time){
-  const birthday = new Date(time),
-    year = birthday.getFullYear(),
-    month = birthday.getMonth() + 1,
-    day = birthday.getDate(),
-    now = new Date(),
-    now_year = now.getFullYear(),
-    now_month = now.getMonth() + 1,
-    now_day = now.getDate();
-  let age= now_year - year;
-  if (now_month > month) {
-    age += 1;
-  } else if (now_month === month) {
-    if (now_day >= day) {
-      age += 1;
-    }
-  }
-  return age;
-};
-
-//获取URL参数-返回json对象
-function parseUrl(url){
-  const r = url.substr(1).split("&"),
-    obj = {};
-  r.forEach((v) => {
-    const index = v.indexOf('=');
-    if (index > -1) {
-      obj[v.substring(0, index)] = v.substring(index + 1);
-    }
-  });
-  return obj;
-}
-
 //获取组合组件已填文字填入saveText
 function getSaveText(data){//console.log(data)
   const arr = data.questionMapping.map((it)=>{
@@ -1437,21 +1311,13 @@ function setPosition (e,dom,setHighter){
   },10);
 }
 module.exports = {
-    checkType: Type.checkType,
     getIds,
     getWindowInnerWidth,
     getWindowInnerHeight,
     getLabelIndex,
     fullfillText,
     checkFullfillText,
-    parseUrl,
-    getAge,
     dateParser,
-    debounce,
-    regexp,
-    isUndefined,
-    Storage,
-    nullFn,
     isNotNull,
     isNull,
     deepClone,

+ 61 - 3
src/utils/utils.js

@@ -1,10 +1,12 @@
-import config from '@config/index.js';
-import {getLabelIndex} from './tools';
+import {getLabelIndex,getEMRParams,storageLocal} from './tools';
+import { json } from "./ajax";
 /**
  * 各类标签统一的处理函数
  *
  * */
-
+const api = {
+  push:'/push/pushInner'
+};
 //数字键盘选中事件
 export function setNumberValue(state,action){
   let res = Object.assign({},state);
@@ -131,4 +133,60 @@ export const setRadioInputValue = (state,action)=>{
   res.saveText[index] = str;
   res.update = Math.random();
   return res;
+}
+
+//文本输入标签inlineTag值保存
+export function setInputLabel(state,action){
+  let res = Object.assign({}, state);
+  const {i,text,prefix,suffix,subIndex} = action;
+  const item = res.data[i];
+  if(+item.tagType===3){      //multSpred标签
+    item.questionMapping[subIndex].value = text;
+    let texts = item.questionMapping.map((it)=>{
+      if(it.tagType===8){
+        return it.name;
+      }else{
+        return it.value?(it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||''):'';
+      }
+
+    });
+    res.saveText[i] = texts.join('');
+    res.update = Math.random();
+    return res;
+  }else{
+    if(item){
+      item.value=text;
+    }
+  }
+  if(text){
+    res.saveText[i] = prefix+text+suffix;
+  }else{//删除完要清空
+    res.saveText[i] = "";
+  }
+  res.update = Math.random();
+  return res;
+}
+
+//获取大数据推送结果:
+// type需推送的类型,symData症状相关的内容(symptom入参),save参数是否要保存到本地做变化对比
+export async function getBigPush(type,symData,save){
+  const emrData = getEMRParams();
+  const params = {
+    "age": emrData.age,
+    "hosCode": emrData.hosCode,
+    "featureType": type,  //类型1:症状,4:查体,5:化验,6:辅检,7:诊断
+    "diag": emrData.dis,
+    "lis": emrData.lis,
+    "other": emrData.other,
+    "pacs": emrData.pacs,
+    "sex": emrData.sex,
+    "vital":emrData.vital,
+    "symptom": symData||emrData.current + emrData.main
+  };
+  if(save){
+    let savePm = Object.assign({},params);
+    delete savePm.featureType;
+    storageLocal.set('emrParam',savePm);      //推送数据存储,用作推送前对比是否有变,有变才推送
+  }
+  return json(api.push,params);
 }