Browse Source

Merge remote-tracking branch 'origin/dev5.3.3' into codeOptimize

# Conflicts:
#	src/store/actions/checkBody.js
#	src/store/actions/mainSuit.js
#	src/store/actions/otherHistory.js
#	src/store/reducers/checkBody.js
#	src/store/reducers/currentIll.js
#	src/store/reducers/mainSuit.js
#	src/store/reducers/otherHistory.js
#	src/utils/utils.js
zhouna 5 years ago
parent
commit
eec2f7cb23
47 changed files with 356 additions and 570 deletions
  1. 1 1
      src/common/components/ConfirmModal/index.jsx
  2. 18 23
      src/common/components/EditableSpan/index.jsx
  3. 5 1
      src/common/less/variables.less
  4. 37 0
      src/components/AddAssistCheck/AssistName/index.jsx
  5. 0 4
      src/components/AddAssistCheck/Textarea/index.jsx
  6. 30 24
      src/components/AddAssistCheck/index.jsx
  7. 2 2
      src/components/AssessResult/ScaleItem/index.jsx
  8. 1 8
      src/components/ChronicInfo/index.jsx
  9. 3 3
      src/components/DiagnosticItem/index.less
  10. 4 3
      src/components/DiagnosticList/index.jsx
  11. 7 0
      src/components/DiagnosticList/index.less
  12. 4 4
      src/components/MedicalInfo/index.jsx
  13. 0 1
      src/components/MultSpread/index.jsx
  14. 8 8
      src/components/NumberDrop/index.jsx
  15. 11 4
      src/components/PushItems/RecommendInspect/index.jsx
  16. 2 0
      src/components/PushItems/RecommendInspect/index.less
  17. 2 5
      src/components/PushItems/index.jsx
  18. 10 80
      src/components/RadioInpDrop/index.jsx
  19. 5 5
      src/components/ScaleSearch/index.jsx
  20. 2 2
      src/components/TemplateItems/index.jsx
  21. 1 5
      src/containers/CurrentIll.js
  22. 4 3
      src/containers/DiagnosticList.js
  23. 0 3
      src/containers/InlineTag.js
  24. 7 1
      src/containers/PushItemsContainer.js
  25. 8 62
      src/containers/RadioInpDrop.js
  26. 1 0
      src/containers/eleType.js
  27. 0 32
      src/store/actions/checkBody.js
  28. 7 3
      src/store/actions/copyRight.js
  29. 0 26
      src/store/actions/currentIll.js
  30. 23 22
      src/store/actions/mainSuit.js
  31. 44 22
      src/store/actions/otherHistory.js
  32. 1 1
      src/store/async-actions/copyRight.js
  33. 3 14
      src/store/async-actions/fetchModules.js
  34. 4 17
      src/store/async-actions/historyTemplates.js
  35. 3 1
      src/store/async-actions/mainSuit.js
  36. 8 26
      src/store/async-actions/pushMessage.js
  37. 3 1
      src/store/async-actions/tabTemplate.js
  38. 1 1
      src/store/async-actions/treat.js
  39. 2 2
      src/store/reducers/checkBody.js
  40. 2 2
      src/store/reducers/currentIll.js
  41. 2 2
      src/store/reducers/mainSuit.js
  42. 3 3
      src/store/reducers/otherHistory.js
  43. 3 1
      src/store/reducers/pushMessage.js
  44. 1 0
      src/store/types/pushMessage.js
  45. 1 1
      src/utils/config.js
  46. 11 139
      src/utils/tools.js
  47. 61 2
      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 : ''} 

+ 18 - 23
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';
 
@@ -41,6 +41,15 @@ class EditableSpan extends Component{
   }
   handleFocus(e){
     e.stopPropagation();
+    const that = this;
+    let txt = '';
+    //黏贴时去掉html格式
+    $(this.$span.current).on("paste",function(e){
+      setTimeout(function(){
+        txt = that.$span.current.innerText;
+        that.$span.current.innerHTML = txt;
+      });
+    })
     const {mainSaveText,full,setFocusIndex,i,boxMark,value}= this.props;
     let mainText = filterDataArr(mainSaveText);//主诉字数
     if(+boxMark==3||+boxMark==4){         //主诉为空,且第一次聚焦其他史查体时提示且不可输入
@@ -100,13 +109,10 @@ class EditableSpan extends Component{
       clearTimeout(that.state.timer);
       temp = newText.replace(searchPre,'');
       isEnd = !(newText.indexOf(searchPre)>0);
-      // search = temp.replace(/[(^\s*)|(\s*$)|(^\,*)|(\,*$)]/g,'');
       search = temp.replace(config.regPreAndAft,'');
-      // if(!search&&searchPre){
       if(!temp&&searchPre&&newText){
         search = searchPre;
       }
-      //console.log(labelVal,'旧:',searchPre,'新:',newText,'搜索:',search);
       if(config.punctuationReg.test(search)){    //只有标点符号时不搜索
         handleSearch&&handleSearch({text:search,isEnd,boxMark,mainIds});
       }else{//只有标点符号时要清空搜索结果
@@ -123,16 +129,9 @@ class EditableSpan extends Component{
   }
 
   handleBlur(e){//为了阻止冒泡事件
-    const {boxMark,handleClear,handleChange,i} = this.props;
     e.stopPropagation();
-    // 延时清空搜索结果,不延时会影响选中
-    /*clearTimeout(this.state.clearTimer);
-    const clearTimer = setTimeout(function(){
-      handleClear && handleClear({boxMark})
-    },config.delayTime);
-    this.setState({
-      clearTimer
-    });*/
+    //解除绑定事件
+    $(this.$span.current).off("paste");
   }
 
   moveEnd(obj) {
@@ -171,11 +170,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){
           this.moveEnd(obj[0]);
         }
@@ -185,11 +180,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.focus();
         }
@@ -306,6 +297,10 @@ class EditableSpan extends Component{
     const ext = preIsExt?style['ext']:style['unselect'];
     const unselect = value.match(config.punctuationReg)||preSelected?'':ext;
     const hasBr = br?style['editable-br']:'';       //最后一个体征标签换行
+    const $span = this.$span.current;
+    if(br&&$span&&!$span.innerText){
+      this.$span.current.innerHTML='&nbsp;';
+    }
     return classNames(style['editable-span'],isFull,unselect,hasBr);
   }
 

+ 5 - 1
src/common/less/variables.less

@@ -173,7 +173,11 @@
 .hide{
   display: none!important;
 }
-
+.ellipsis {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
 .llStyle{
   box-shadow: 0 10px 20px 0 #989DA3;
   // filter:progid:DXImageTransform.Microsoft.Shadow(color='#989DA3',Direction=125,Strength=6);

+ 37 - 0
src/components/AddAssistCheck/AssistName/index.jsx

@@ -0,0 +1,37 @@
+import React, { Component } from "react";
+import styles from "../index.less";
+import $ from 'jquery';
+import { windowEventHandler } from '@utils/tools';
+
+class AssistName extends Component {
+	constructor(props) {
+		super(props);
+		this.state = {
+
+		};
+		this.$assistName = React.createRef();
+		this.splitName = this.splitName.bind(this);
+	}
+	splitName(name){
+		let wid = this.props.winWidth;
+		if(name.length>15 && wid>1150){
+			let tmpStr = name.substr(0,15)
+			return tmpStr+'...'
+		}else{
+			return name
+		}
+	}
+	render() {
+		const { winWidth, name, getInfomation } = this.props;
+		return (
+				<span className={styles.assistName} style={{ width: winWidth < 1150 ? '120px' : 'auto' }} ref={this.$assistName}>
+					<span className={styles.tagSpan} title={name}>
+						{name&&this.splitName(name)}:
+            <span className={styles.imgInfo} title='点击i图标可查看详细说明' onClick={() => getInfomation({ name: name, position: 1, type: 6 })}></span>
+					</span>
+				</span>
+		);
+	}
+}
+
+export default AssistName;

+ 0 - 4
src/components/AddAssistCheck/Textarea/index.jsx

@@ -2,7 +2,6 @@ import React, { Component } from "react";
 import style from "./index.less";
 import config from '@config/index';
 import $ from 'jquery';
-import {windowEventHandler} from '@utils/tools';
 
 class Textarea extends Component {
   constructor(props) {
@@ -65,9 +64,6 @@ class Textarea extends Component {
     }else{
       this.$dom.current.nextSibling.innerText?(this.$dom.current.nextSibling.innerText = '报告描述或意见'):(this.$dom.current.nextSibling.innerHTML = '报告描述或意见')
     }
-    windowEventHandler('resize', ()=>{
-      $(".TextareaRsize").css({marginTop:0})
-    });
   }
   handleFocus(){     //ie8下提示语挡住输入框,导致输入框无法聚焦
     this.textInput.current.previousSibling.focus();

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

@@ -3,6 +3,7 @@ import { SearchOption, Calendar, ConfirmModal, Notify, Add ,DelToast} from '@com
 import styles from './index.less';
 import $ from 'jquery';
 import Textarea from './Textarea';
+import AssistName from './AssistName';
 import { getPageCoordinate,getCurrentDate,setPosition } from '@utils/tools';
 import ScrollArea from 'react-scrollbar';
 
@@ -37,28 +38,29 @@ class AddAssistCheck extends React.Component {
       let _close = document.getElementById("assiClose");   // 删除icon
       let _closeTil = $('#delTit')[0];   // 弹窗标题
       if(!this.isBar) {//onMousedown的目标为滚动条时,子项弹窗不关闭)
-        if (_con && searchWrapAssist != event.target && !_con.is(event.target) && _con.has(event.target).length === 0) { // Mark 1
-          if (this.state.show) {
-            this.props.setHighter(48)
+          if (_con && searchWrapAssist != event.target && !_con.is(event.target) && _con.has(event.target).length === 0) { // Mark 1
+            if (this.state.show) {
+              this.props.setHighter(48)
+            }
+            this.setState({show: false});
+          }
+          if (!_cons.is(event.target) && _cons.has(event.target).length === 0 || event.target.isEqualNode(_close)) { // Mark 1
+            this.setState({date: false});
+          }
+          if($(event.target).attr("contenteditable")||event.target.textContent == '报告描述或意见'){
+            this.setState({date: false});
+          }
+        if(_del){
+          if($(event.target).attr('id') != 'assiClose' &&!event.target.isEqualNode(_close) && !event.target.isEqualNode(_del)  && event.target.parentNode != _del && !event.target.isEqualNode(_closeTil)){
+            this.setState({
+              visible: false,
+              id: null,
+              activeName:''
+            })
           }
-          this.setState({show: false});
-        }
-        if (!_cons.is(event.target) && _cons.has(event.target).length === 0 || event.target.isEqualNode(_close)) { // Mark 1
-          this.setState({date: false});
-        }
-        if($(event.target).attr("contenteditable")||event.target.textContent == '报告描述或意见'){
-          this.setState({date: false});
-        }
-      if(_del){
-        if($(event.target).attr('id') != 'assiClose' &&!event.target.isEqualNode(_close) && !event.target.isEqualNode(_del)  && event.target.parentNode != _del && !event.target.isEqualNode(_closeTil)){
-          this.setState({
-            visible: false,
-            id: null,
-            activeName:''
-          })
         }
+        
       }
-    }
     });
     const that = this;
     document.addEventListener('mousedown',function(e){
@@ -193,6 +195,7 @@ class AddAssistCheck extends React.Component {
       width:'8px',
       background:'#f1f1f1'};
     const barStyle={background:'#777',width:'100%'};
+    $(".TextareaRsize").css({marginTop:0})
     return <React.Fragment>
       {
         checkedListImport.map((part,index)=>{
@@ -200,12 +203,13 @@ class AddAssistCheck extends React.Component {
             {
               part.map((item, idx) => {
                 return (<li className={`${styles.assistLists} ${styles.clearfix}`}>
-                  <span className={styles.assistName} style={{ width: winWidth < 1200 ? '120px' : 'auto' }}>
+                  {/* <span className={styles.assistName} style={{ width: winWidth<1200?'120px':'auto' }}>
                     <span className={styles.tagSpan}>
                       {item.name}:
                       <span className={styles.imgInfo} title='点击i图标可查看详细说明' onClick={()=>getInfomation({name: item.name, position: 1, type: 6})}></span>
                     </span>
-                  </span>
+                  </span> */}
+                  <AssistName name={item.name} winWidth={winWidth} getInfomation={getInfomation}></AssistName>
                   <div className={styles.textareaWrap}>
                     <ScrollArea speed={0.8}
                                 horizontal={false}
@@ -252,12 +256,14 @@ class AddAssistCheck extends React.Component {
               }
             }
             return (item.disabled?null:<li className={`${styles.assistLists} ${styles.clearfix}`}>
-              <span className={styles.assistName} style={{ width: winWidth < 1200 ? '120px' : 'auto' }}>
+              {/* <span className={styles.assistName} style={{ width: winWidth<1200?'120px':(winWidth-987)+'px' }}> */}
+              {/* <span className={styles.assistName} style={{ width: winWidth<1200?'120px':'auto' }}>
                 <span className={styles.tagSpan}>
                   {item.name}:
                   <span className={styles.imgInfo} title='点击i图标可查看详细说明' onClick={()=>getInfomation({name: item.name, position: 1, type: 6})}></span>
                 </span>
-              </span>
+              </span> */}
+              <AssistName name={item.name} winWidth={winWidth} getInfomation={getInfomation}></AssistName>
               <div className={styles.textareaWrap}>
                 <ScrollArea speed={0.8}
                             horizontal={false}
@@ -295,7 +301,7 @@ class AddAssistCheck extends React.Component {
           })
         }
       </ul>
-    </React.Fragment> 
+    </React.Fragment>
   }
   render() {
     const { handleChangeValue, list,assistVal,windowHeight,assistList, refreshScroller } = this.props;

+ 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>}

+ 3 - 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;

+ 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;

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

@@ -25,7 +25,7 @@ class MedicalInfo extends Component {
         const that = this;
         if(searchResult&&searchResult.length>0){
           setTimeout(function(){
-            that.$ul.current.style.height = getWindowInnerHeight()-270+'px';
+            that.$ul.current.style.height = getWindowInnerHeight()-248+'px';
           },100);
         }
         return searchResult && searchResult.map((item) => {
@@ -83,15 +83,15 @@ class MedicalInfo extends Component {
       clearResult&&clearResult();
   }
   componentDidMount(){
-    const height = getWindowInnerHeight()-170;
+    const height = getWindowInnerHeight()-148;
     this.$cont.current.style.height = height+"px";
     windowEventHandler('resize', ()=>{
       if(this.$cont.current){
-        const height = getWindowInnerHeight()-170;
+        const height = getWindowInnerHeight()-148;
         this.$cont.current.style.height = height+"px";
       }
       if(this.$ul.current){
-        const height = getWindowInnerHeight()-270;
+        const height = getWindowInnerHeight()-248;
         this.$ul.current.style.height = height+"px";
       }
     });

+ 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)){

+ 11 - 4
src/components/PushItems/RecommendInspect/index.jsx

@@ -20,14 +20,14 @@ class RecommendInspect extends Component {
     
     renderItem(item) {
       const { changeFlag } = this.props
-      return <span>
+      return <span className={style['itemLabelBox']} title={item.name}>
           <input
             id={item.id + item.name}
             onChange={() =>changeFlag(item)}
             type="checkbox"
             checked={item.checked}
           />
-          <label for={item.id + item.name}>{item.name}</label>
+          <label  for={item.id + item.name}>{item.name}</label>
       </span>
     }
 
@@ -40,9 +40,16 @@ class RecommendInspect extends Component {
       let firstLineNum = 0;   //第一行字数
       let secondLineNum = 0;      //第二行字数
       const listHide = list.map((item, index) => {
-        firstLineNum = firstLineNum + item.name.length + 2;
+        let itemNameLen =  item.name.length
+        if(itemNameLen > 24) {
+          itemNameLen = 24
+        }
+        firstLineNum = firstLineNum + itemNameLen + 2;
         if (firstLineNum > 26) {
-          secondLineNum = secondLineNum + item.name.length + 2; 
+          if(itemNameLen > 18) {
+            itemNameLen = 18
+          }
+          secondLineNum = secondLineNum + itemNameLen + 2; 
           if(secondLineNum > 20) {
             return;
           } else {

+ 2 - 0
src/components/PushItems/RecommendInspect/index.less

@@ -17,10 +17,12 @@
             line-height: 26px;
             padding: 0px 0px 0px 0px;
             span{
+              .ellipsis;
               font-size: 14px;
               line-height: 14px;
               display: inline-block;
               margin: 6px;
+              max-width: 280px;
               cursor: pointer;
               input[type='checkbox']{
                 float: left;

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

@@ -29,7 +29,6 @@ class PushItems extends Component {
       moreCheck: false,
       show:true,
       showAssess:false,      //评估弹窗
-      idx:''
     };
 
     this.showMore = this.showMore.bind(this);
@@ -148,9 +147,7 @@ class PushItems extends Component {
     });
   }
   setDataIdx(index){
-    this.setState({
-      idx:index+''
-    })
+    this.props.setDataIdx&&this.props.setDataIdx(index)
   }
   render() {
     const {
@@ -284,7 +281,7 @@ class PushItems extends Component {
             tipsDetails = {tipsDetails}/>}
             
             {
-              (setPushEmergencyIdx+'')&&(sysConfig.emergency_show==1)&&<EmergencyProcedure hideAllDrop={hideAllDrop} windowHeight={windowHeight} data={dataLis[this.state.idx]||dataLis[setPushEmergencyIdx]} idx={this.state.idx||setPushEmergencyIdx} setDataIdx={this.setDataIdx}></EmergencyProcedure>
+              (setPushEmergencyIdx+'')&&(sysConfig.emergency_show==1)&&<EmergencyProcedure hideAllDrop={hideAllDrop} windowHeight={windowHeight} data={dataLis[setPushEmergencyIdx]} idx={setPushEmergencyIdx} setDataIdx={this.setDataIdx}></EmergencyProcedure>
             }
       </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>
   }
 }
 

+ 5 - 5
src/components/ScaleSearch/index.jsx

@@ -38,10 +38,10 @@ class ScaleSearch extends Component {
   }
   getSearchList() {
     const { searchResult } = this.props;
-    const that = this;console.log(getWindowInnerHeight()-270);
+    const that = this;
     if(searchResult&&searchResult.length>0){
       setTimeout(function(){
-        that.$ul.current.style.height = getWindowInnerHeight()-270+'px';
+        that.$ul.current.style.height = getWindowInnerHeight()-248+'px';
       },100);
     }
     return searchResult && searchResult.map((item) => {
@@ -97,15 +97,15 @@ class ScaleSearch extends Component {
     clearResult&&clearResult();
   }
   componentDidMount(){
-    const height = getWindowInnerHeight()-170;
+    const height = getWindowInnerHeight()-148;
     this.$cont.current.style.height = height+"px";
     windowEventHandler('resize', ()=>{
       if(this.$cont.current){
-        const height = getWindowInnerHeight()-170;
+        const height = getWindowInnerHeight()-148;
         this.$cont.current.style.height = height+"px";
       }
       if(this.$ul.current){
-        const height = getWindowInnerHeight()-270;
+        const height = getWindowInnerHeight()-248;
         this.$ul.current.style.height = height+"px";
       }
     });

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

@@ -25,11 +25,11 @@ class TemplateItems extends React.Component {
         this.clear = this.clear.bind(this);
     }  
     componentDidMount(){
-        const height = getWindowInnerHeight()-216;
+        const height = getWindowInnerHeight()-195;
         this.$cont.current.style.height = height+"px";
         windowEventHandler('resize', ()=>{
             if(this.$cont.current){
-                const height = getWindowInnerHeight()-216;
+                const height = getWindowInnerHeight()-195;
                 this.$cont.current.style.height = height+"px";
             }
         });

+ 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 {}

+ 7 - 1
src/containers/PushItemsContainer.js

@@ -1,7 +1,7 @@
 import React from 'react';
 import {connect} from 'react-redux';
 import PushItems from '../components/PushItems'
-import {CHANGE_ASSAY, CHANGE_CHECK, ADD_BILLING, SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS,SHOW_TABLE_LIST} from '@store/types/pushMessage';
+import {CHANGE_ASSAY, CHANGE_CHECK, ADD_BILLING, SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS,SHOW_TABLE_LIST,SET_PUSH_EMERGENCY_IDX} from '@store/types/pushMessage';
 import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR } from '@store/types/diagnosticList';
 import {billing, getAllConceptDetail} from '../store/async-actions/pushMessage';
 import { isAddMainSuit } from '@store/async-actions/diagnosticList';
@@ -68,6 +68,12 @@ function mapDispatchToProps(dispatch) {
             dispatch({
                 type: HIDE_TIPS_DETAILS
             })
+        },
+        setDataIdx:(idx)=>{
+            dispatch({
+                type: SET_PUSH_EMERGENCY_IDX,
+                idx:idx
+            })
         }
     }
 }

+ 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 - 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

@@ -229,38 +229,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);

+ 7 - 3
src/store/actions/copyRight.js

@@ -24,9 +24,13 @@ export const closeDisclatmerModal=(state,action)=>{
   
 export const getMessage=(state,action)=>{
   const res=Object.assign({},state);
-  res.number = action.data.data.data.name;
-  res.date = action.data.data.data.refreshTime;
-  res.content = action.data.data.data.detail;
+  const data = action.data.data;
+  if(!data) {
+    return res;
+  }
+  res.number = data.data.name;
+  res.date = data.data.refreshTime;
+  res.content = data.data.detail;
   return res;
 };
 

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

@@ -642,32 +642,6 @@ export const clearCurrentEdit = (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);

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

@@ -652,29 +652,30 @@ export const setTextModeValue = (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] = "";
+
+//自由文本
+export function setCheckText(state,action) {
+  let res = Object.assign({},state);
+  const {i,text} = action;
+  res.data[i].value=text;
+  res.saveText[i] = text;
+  /*if(res.data[i]){
+    res.data[i].value=text;
   }
+  res.saveText[i] = text;*/
+  res.update = Math.random();
+  return res;
+}
+//复制标签(如血压)事件
+export function addLabelItem(state,action){
+  let res = Object.assign({},state);
+  const {data,i} = action;
+  const textLabel = Object.assign({},JSON.parse(config._textLabel),{showInCheck:JSON.parse(data).showInCheck});
+  //使用Object.assign({},data)拷贝操作时复制项和原项会同步修改
+  if(!data) return res;
+  res.data.splice(+i+2,0,JSON.parse(data),textLabel);
+  res.saveText.splice(+i+2,0,'','');
+  res.selecteds.splice(+i+2,0,null,null);
   res.update = Math.random();
   return res;
 }

+ 44 - 22
src/store/actions/otherHistory.js

@@ -51,29 +51,15 @@ export const confirm = (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] = "";
+//自由文本
+export function setCheckText(state,action) {
+  let res = Object.assign({},state);
+  const {i,text} = action;
+  if(res.data[i]){
+    res.data[i].value=text;
+    //res.data[i].name='';      //默认显示的文字
   }
+  res.saveText[i] = text;
   res.update = Math.random();
   return res;
 }
@@ -234,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 const otherEditClear = (state,action)=>{
   const res = Object.assign({},state);
   res.editClear = action.bool;

File diff suppressed because it is too large
+ 1 - 1
src/store/async-actions/copyRight.js


+ 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;
 }

+ 8 - 26
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||[];
@@ -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,
@@ -136,10 +120,9 @@ export const billing = (mdata,boxMark) => {
  }
 };
 
-//获取提示信息(静态信息)
+//获取提示信息(静态信息) 
 export const getConceptDetail = (item,noTips,noDetails,noNotify) => {
     return(dispatch, getState) => {
-
         const params ={
             name: item.name,
             position: item.position,
@@ -237,7 +220,7 @@ export const getAllConceptDetail = (item) => {
             } else {
                 Notify.info('提示信息未维护');
             }
-                
+               
         }).catch((e) => {
             console.log(e)
         })
@@ -286,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);
       }

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

@@ -322,7 +322,7 @@ export const setAllFollowUp = (item) => {
 }
 
 export const getInstroduce = (item, type, position)=>{
-
+    console.log(item,type)
     return (dispatch, getState) =>{
         const params = {
             name: item.name,

+ 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 {set,setCheckBoxValue,
-  setSearchData,insertLabelData,changeLabelVal,clearCheckBody,setInputLabel,backspaceText
+  setSearchData,insertLabelData,changeLabelVal,clearCheckBody,backspaceText
   ,confirm,multipleComfirn,delSingleLable,setImportCheckbodyLabel,preSetCheckbody} from '../actions/checkBody.js';
-import {recoveTag,setRadioInputValue,setRadioValue,setNumberValue,setCheckText,addLabelItem} from '@utils/utils';
+import {recoveTag,setRadioInputValue,setRadioValue,setNumberValue,setCheckText,addLabelItem,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 {confirm,insertProcess,setData,setCheckBox,changeLabelVal,clearCurrentIll,
-  setTextModeValue,setModule,bigDataSymptom,insertLabelData,clearCurrentEdit,setInputLabel,
+  setTextModeValue,setModule,bigDataSymptom,insertLabelData,clearCurrentEdit,
   backspaceText,removeId,multipleComfirn,delSingleLable,fillChronicModule} from '../actions/currentIll';
-import {recoveTag,setRadioInputValue,setRadioValue,setNumberValue,setCheckText,addLabelItem} from '@utils/utils';
+import {recoveTag,setRadioInputValue,setRadioValue,setNumberValue,setCheckText,addLabelItem,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 {getCommSymptoms,handleTailClick,insertMain,setSearch,getBigSymptom,setMainMoudle,confirm,
   commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,
-  setInputLabel,backspaceText,removeId,multipleComfirn,delSingleLable,
+  backspaceText,removeId,multipleComfirn,delSingleLable,
   getSymptomFeature} from '../actions/mainSuit'
-import {recoveTag,setRadioInputValue,setNumberValue,setRadioValue,setCheckText,addLabelItem} from '@utils/utils';
+import {recoveTag,setRadioInputValue,setNumberValue,setRadioValue,setCheckText,addLabelItem,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 {confirm,setCheckBoxValue,setSearchData,insertLabelData,clearOtherHistory,
-  changeTextLabel,setOtherInput,setTextModeValue,otherEditClear,backspaceText,multipleComfirn,
+  changeTextLabel,setNumberValue,setTextModeValue,otherEditClear,backspaceText,multipleComfirn,
   removeId,delSingleLable} from '../actions/otherHistory';
-import {recoveTag,setRadioInputValue,setRadioValue,setNumberValue,addLabelItem,setCheckText} from '@utils/utils';
+import {recoveTag,setRadioInputValue,setRadioValue,addLabelItem,setCheckText,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:

+ 3 - 1
src/store/reducers/pushMessage.js

@@ -2,7 +2,7 @@ import {CHANGE_ASSAY, CHANGE_CHECK, BILLING_ADVICE, ADD_SCHEME, SET_TIPS,  SET_T
         SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK, ADD_BILLING,
         CLEAR_ALL_PUSH_MESSAGE,SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS, SET_COMMONTREATMENT,
         SET_ADVICE_INPUT ,SET_CHRONIC_TABLELIST,SHOW_TABLE_LIST,SET_SCALE_INFO,SET_CHRONIC_PUSHS,
-        SAVE_TABLE_RESULT, SAVE_FOLLOW_UP, DEL_FOLLOW_UP,TOGGLE_CHRONIC_INFO} from '../types/pushMessage';
+        SAVE_TABLE_RESULT, SAVE_FOLLOW_UP, DEL_FOLLOW_UP,TOGGLE_CHRONIC_INFO,SET_PUSH_EMERGENCY_IDX} from '../types/pushMessage';
 import {changeAssay, changeCheck, setAdvice, addScheme, setTips, setTipsDetails, setChangeAdviceTreatment, 
         setChangeAdviceAssay, setChangeAdviceCheck, addBilling, clearAllPushMessage, showTipsDetails, hideTipsDetails, 
         setCommontreatment, setAdviceInput, saveFollowUp, delFollowUp } from '../actions/pushMessage';
@@ -80,6 +80,8 @@ export default function(state = initState, action) {
       return res;
     case TOGGLE_CHRONIC_INFO:
       res.slideUp = action.flag;
+    case SET_PUSH_EMERGENCY_IDX:
+      res.setPushEmergencyIdx = action.idx;
       return res;
     default:
       return state;

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

@@ -23,5 +23,6 @@ export const SAVE_TABLE_RESULT = 'SAVE_TABLE_RESULT' ; //量表计算结果
 export const SAVE_FOLLOW_UP = 'SAVE_FOLLOW_UP';  //保存回访时间
 export const DEL_FOLLOW_UP = 'DEL_FOLLOW_UP';  //删除回访时间
 export const TOGGLE_CHRONIC_INFO = 'TOGGLE_CHRONIC_INFO';   //收起展开指标推送模块
+export const SET_PUSH_EMERGENCY_IDX = 'SET_PUSH_EMERGENCY_IDX';   //急诊设置idx
 
 

+ 1 - 1
src/utils/config.js

@@ -1,6 +1,6 @@
 // const host='http://192.168.3.1:5050';//赵
 // const host='http://192.168.3.100:5050';//王峰
-const host='http://192.168.2.241:5050';//后端接口访问地址
+const host='http://192.168.2.121:5050';//后端接口访问地址
 // const host='http://192.168.2.121:5050';//后端接口访问地址
 // const host='http://192.168.2.241:5050';//后端接口访问地址
 // const host='http://192.168.3.11:5050';//王宇

+ 11 - 139
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";
@@ -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;
@@ -791,14 +712,20 @@ function ifOtherClear(jsonData,jsonStr,baseList){
     return true;
   }
 }
-function normalVal(min,max){
+function normalVal(min,max){//添加正常值0处理
   if(!min&&!max){
     return null;
   }else if(min&&max){
       return `正常值: (${min}~${max})`
   }else if(!min && max){
-      return `正常值: (<${max})`
+    if(min == 0){
+      return `正常值: (${min}~${max})`
+    }
+    return `正常值: (<${max})`
   }else if(min && !max){
+    if(max == 0){
+      return `正常值: (${min}~${max})`
+    }
       return `正常值: (>${min})`
   }
 }
@@ -932,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 = '-'){
@@ -960,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)=>{
@@ -1431,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 - 2
src/utils/utils.js

@@ -1,10 +1,13 @@
 import config from '@config/index.js';
-import {getLabelIndex,checkFullfillText,fullfillText,shiftLocalDelTag} from './tools';
+import {getLabelIndex,checkFullfillText,fullfillText,shiftLocalDelTag,getEMRParams,storageLocal} from './tools';
+import { json } from "./ajax";
 /**
  * 各类标签统一的处理函数
  *
  * */
-
+const api = {
+  push:'/push/pushInner'
+};
 //数字键盘选中事件
 export function setNumberValue(state,action){
   let res = Object.assign({},state);
@@ -174,4 +177,60 @@ export function addLabelItem(state,action,boxMark){
   res.selecteds.splice(+i+2,0,null,null);
   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);
 }