Przeglądaj źródła

Merge branch 'dev5.3.3' of http://192.168.2.236:10080/zhouna/newICSS into dev5.3.3

zhangxc 5 lat temu
rodzic
commit
fee442777c

+ 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';
 
@@ -170,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]);
         }
@@ -184,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();
         }

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

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

+ 3 - 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;
@@ -79,9 +80,6 @@ function mapDispatchToProps(dispatch) {
                 type: GET_DIAGNOSTIC_STR
             });
         },
-        getSearchResult:() => {
-            dispatch(getSearchResult)
-        },
         showTreat: () => {
             dispatch({
                 type: SHOW_TREAT,
@@ -96,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
       })

+ 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

@@ -670,32 +670,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);

+ 28 - 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,34 @@ 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;
+      }
+      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;
 }

+ 6 - 23
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,
@@ -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:

+ 3 - 137
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;
@@ -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);
 }