Explorar el Código

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

luolei hace 5 años
padre
commit
47bed4fa23

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

@@ -77,7 +77,7 @@ class NumberUnitPan extends Component{
   render(){
     const domNode = document.getElementById('root');
     return ReactDom.createPortal( 
-      <div className={style['panBox']} onBlur={(e)=>e.stopPropagation()} style={this.getStyle()}>
+      <div className={style['panBox']} onBlur={(e)=>e.stopPropagation()} onDoubleClick={(e)=>e.stopPropagation()} style={this.getStyle()}>
         <table className={style['pan']} >
         <tr>
           <td><span onClick={this.handleSelect}>1</span></td>

+ 14 - 10
src/components/AssessResult/ChartItem/index.jsx

@@ -24,10 +24,12 @@ class ChartItem extends Component {
     //近一周
     switch(type){
       case 'week':
-        for(let i=0;i<7;i++){
+        arr.push(...this.getDayHours(now,true,1));
+        for(let i=1;i<6;i++){
           temp=i*1000*60*60*24;
           arr.unshift(...this.getDayHours(now-temp,true));
-        }
+        };
+        arr.unshift(...this.getDayHours(now-6*1000*60*60*24,true,2));
         break;
       case 'month':
         for(let i=0;i<30;i++){
@@ -52,7 +54,7 @@ class ChartItem extends Component {
 
     return arr;
   }
-  getDayHours(time,isHour){
+  getDayHours(time,isHour,isLimit){
     const year = new Date(time).getFullYear();
     const month = new Date(time).getMonth()+1;
     const date = new Date(time).getDate();
@@ -60,9 +62,10 @@ class ChartItem extends Component {
     let arr=[],temp='';
     const str= year+'-'+(month<10?'0'+month:month)+'-'+(date<10?'0'+date:date);
     if(isHour){
-      for(let i=0;i<24;i++){
-        temp = hour-i>-1?hour-i:hour-i+24;
-        arr.unshift(str+" "+(temp<10?'0'+temp:temp)+":00:00");
+      const num = isLimit===1?hour+1:24;
+      for(let i=(isLimit===2?hour:0);i<num;i++){
+        //temp = hour-i>-1?hour-i:hour-i+24;
+        arr.push(str+" "+(i<10?'0'+i:i)+":00:00");
       }
       return arr;
     }else{
@@ -70,14 +73,14 @@ class ChartItem extends Component {
     }
   }
   rangChange(type,i){
-    const {initFn,handleChange,data,pindex} = this.props;
+    const {initFn,disName,handleChange,data,pindex} = this.props;
     const times = this.getXAxisArr(type);
     const startTime=times[0];
     const endTime=times[times.length-1];
     const range = [startTime,endTime];
     const temp=this.props.timeTypes;
     if(!data[startTime+endTime]){
-      initFn&&initFn({range,rangeType:type,index:i,pindex,getNew:false});
+      initFn&&initFn({range,disName,rangeType:type,index:i,pindex,getNew:false});
     }
     handleChange&&handleChange(Object.assign(temp,{[i]:type}));
   }
@@ -150,6 +153,7 @@ class Chart extends Component{
     let series = [],names=[],inx=-1;
     let myChart = echarts.init(document.getElementById(id) ,null, {renderer: 'svg'});
     let xAxisArr = [...xAxis];
+    const strNum = type=='week'?13:10;
     const interval = {
       week:23,
       month:4,
@@ -161,8 +165,8 @@ class Chart extends Component{
       let name='';
       it&&it.creatTime.map((x,i)=>{
         inx=xAxis.findIndex((a)=>{
-          name=x.substr(0,13);
-          return a.substr(0,13)==name;
+          name=x.substr(0,strNum);
+          return a.substr(0,strNum)==name;
         });     //日期对应横坐标的位置
         if(inx!=-1){
           if(type=='week'){

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

@@ -7,6 +7,7 @@
   /*float: right;*/
   position: absolute;
   right: 0;
+  bottom: 0;
   background: #fff;
   img{
     vertical-align: text-top;

+ 7 - 0
src/components/ChronicInfo/index.jsx

@@ -488,6 +488,13 @@ class ChronicInfo extends React.Component{
     return list;
   }
   componentWillReceiveProps(next){
+    //计算公式可能结果弹窗关闭1916
+    if(!next.data||next.data.length==0){
+      this.setState({
+        formulaId:null,
+        optionId:null
+      });
+    }
     if(JSON.stringify(next.calcuValues)!=JSON.stringify(this.props.calcuValues)){
       this.setState({
         calcuValues:next.calcuValues

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

@@ -173,16 +173,16 @@ class Multiple extends react.Component{
     }
   }
   render(){
-    const {placeholder,value,show,data,handleConfirm,ikey,order,mainSaveText,handleHide,type} = this.props;
+    const {placeholder,value,show,data,hideTag} = this.props;
     const {editable,boxTop,boxLeft,seleData,seleId} = this.state;
     return <div className={style["container"]}>
       <div className={this.getClass()}
       ref={this.$div}
       onClick={this.handleShow}
-      onDoubleClick={this.changeToEdit}
+      onDoubleClick={hideTag?null:this.changeToEdit}
       onBlur={this.handleBlur}
       onInput={this.onChange}
-      onkeydown={handleEnter}
+      onKeyDown={handleEnter}
       contentEditable={editable}>{value||placeholder}</div>
       <div className={this.getListClass()} contentEditable="false">
         <SlideItem 

+ 5 - 97
src/components/NumberUnitDrop/index.jsx

@@ -13,7 +13,7 @@ import $ from 'jquery';
  * placeholder:灰显文字
  * handleSelect: 选中事件
  * show: 是否显示下拉
- *
+ * 双击编辑效果去掉2019-8-13
  * ***/
 class NumberUnitDrop extends Component{
   constructor(props){
@@ -37,10 +37,7 @@ class NumberUnitDrop extends Component{
     this.$suf = React.createRef();
     this.$cont = React.createRef();
     this.select = this.select.bind(this);
-    this.numInpBlur = this.numInpBlur.bind(this);
-    this.handleSpanInp = this.handleSpanInp.bind(this);
     this.handleNumClick = this.handleNumClick.bind(this);
-    this.changeToEdit = this.changeToEdit.bind(this);
   }
   select(obj){         //选中键盘上数字事件
     const {handleSelect,ikey,suffix,prefix,mainSaveText,formulaCode,mainData} = this.props;
@@ -84,59 +81,7 @@ class NumberUnitDrop extends Component{
     })
     handleHide&&handleHide();
   }
-  //数字框失焦,保存值到store中
-  numInpBlur(e){
-    e.stopPropagation();
-    // const {handleSelect,ikey,suffix,prefix,mainSaveText,handleLabelChange,boxMark,formulaCode} = this.props;
-    const {handleSelect,ikey,mainSaveText,handleLabelChange,boxMark,formulaCode} = this.props;
-    const {editable} = this.state;
-    if(editable){
-      // const text = e.target.innerText || e.target.innerHTML;
-      // this.$span.current.innerText='';      //修改生成文字变成输入的2倍bug 
-      let totalVal = e.target.innerText|| e.target.innerHTML;
-      let changeVal = this.$span.current.innerText.replace(/^\s*/,'');//数字框值-修改后;去掉前空格避免多空格叠加
-      let prefix = this.$pre.current.innerText.replace(/^\s*/,''); //前缀值-修改后
-      let suffix = this.$suf.current.innerText.replace(/^\s*/,''); //后缀值-修改后
-      // console.log('数字框:'+changeVal,";全部:"+totalVal,";前缀:"+prefix+";后缀:"+suffix);
-      handleLabelChange && handleLabelChange({ikey,changeVal,type:boxMark,totalVal,prefix,suffix,formulaCode});
-      // handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
-      // handleLabelChange&&handleLabelChange({ikey,changeVal:text,suffix,prefix,mainSaveText,type:boxMark,formulaCode});
-      
-    }
-    this.setState({
-      isClosed:false,
-      numEditable:true,
-      hasSelect:false,
-      editable:false
-    });
-    
-  }
 
-  handleSpanInp(e){ //数字框输入事件
-    e.stopPropagation();
-    // 主诉字数达到上限时不允许输入
-    const {mainSaveText,ikey,type,handleSelect,suffix,prefix,boxMark} = this.props;
-    const {labelVal,editable} = this.state;
-    let mainText = filterDataArr(mainSaveText);//主诉字数
-    if(editable){//避免IE中点击标签也会触发
-      let val = e.target.innerText || e.target.innerHTML;
-      if(+boxMark==1){
-        if(mainText.length >= config.limited){
-          if(val.length > labelVal.length){
-            e.target.innerText?(e.target.innerText = labelVal):(e.target.innerHTML = labelVal);
-            Notify.info(config.limitText);
-            return
-          }else if(val.length == labelVal.length){
-            this.setState({
-              labelVal:val
-            });
-          }else{
-            handleSelect&&handleSelect({ikey,text:val,suffix,prefix,mainSaveText});
-          }
-        }
-      }
-    }
-  }
   getClasses(){         //整个标签是否有值的状态
     const {value,hideTag,show,isImports} = this.props;
     const inpValue = this.state.value;
@@ -151,53 +96,16 @@ class NumberUnitDrop extends Component{
     }
     return className(isSelected,noTag,blueBorder,orgBorder);
   }
-  changeToEdit(e){        //整个标签双击编辑状态
-    e.stopPropagation();
-    window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
-    const {value,id,handleDbclick,patId,handleHide,show} = this.props;
-    const text = e.target.innerText || e.target.innerHTML;
-    clearTimeout(this.state.timer);//取消延时的单击事件
-    e.preventDefault();
-    if(show){
-      handleHide&&handleHide();
-    }
-    if(value&&value.trim()) {//有选中值的标签才能双击编辑
-      this.setState({
-        editable: true,
-        labelVal:text
-      });
-      //失焦关闭编辑状态
-      setTimeout(()=>{
-        // e.target.focus();
-        this.$cont.current.focus();
-      })
-      //双击埋点记录
-      handleDbclick && handleDbclick({id:patId||id});
-    }
-  }
-  componentDidMount(){
-    if(isIE()){
-      // $(this.$span.current).onIe8Input(function(e){
-      $(this.$cont.current).onIe8Input(function(e){
-        this.handleSpanInp(e)
-      },this);
-    }
-  }
 
   render(){
-    const {placeholder,prefix,suffix,show,value,handleHide} = this.props;
-    const {numEditable,editable,hasSelect,boxLeft,boxTop} = this.state;
+    const {placeholder,prefix,suffix,show,value,handleHide,hideTag} = this.props;
+    const {editable,hasSelect,boxLeft,boxTop} = this.state;
     return <div className={this.getClasses()}
                 ref={this.$cont}
-                onClick={this.handleNumClick}
-                contentEditable={editable}
-                onBlur={this.numInpBlur}
-                onDoubleClick={this.changeToEdit}
-                onkeydown={handleEnter}
-                onInput={this.handleSpanInp}>
+                onClick={this.handleNumClick}>
       <span ref = {this.$pre}>{prefix?prefix+' ':prefix}</span>
       <span ref = {this.$span}
-            onkeydown={handleEnter}
+            onKeyDown={handleEnter}
             style={{cursor:editable?'text':'pointer'}}>{value||placeholder}</span>
       <span ref = {this.$suf}>{suffix?' '+suffix:suffix}</span>
       <NumberUnitPan handleSelect={(obj)=>this.select(obj)}

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

@@ -152,7 +152,7 @@ class RadioDrop extends Component{
       <div className={this.getClass()}
            onBlur={this.handleEditLabel}
            contentEditable={this.state.editable}
-           onDoubleClick={this.handledbClick}
+           onDoubleClick={hideTag?null:this.handledbClick}
            onFocus={(e)=>{e.stopPropagation()}}
            onClick={(e)=>this.handleShow(e,true)}
            onkeydown={handleEnter}>

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

@@ -205,15 +205,15 @@ class RadioInpDrop extends Component{
     return list;
   }
   render(){
-    const {data,show,vals,placeholder} = this.props;
+    const {data,show,vals,placeholder,hideTag} = this.props;
     const {boxLeft,boxTop} = this.state;
     return <div className={style['container']} ref = {this.$cont}>
       <div className={this.getClass()}
            onBlur={this.handleEditLabel}
            contentEditable={this.state.editable}
-           onDoubleClick={this.handledbClick}
+           onDoubleClick={hideTag?null:this.handledbClick}
            onClick={(e)=>this.handleShow(e,true)}
-           onkeydown={handleEnter}>
+           onKeyDown={handleEnter}>
         {vals?this.parseInputDom():<span>{placeholder}</span>}
       </div>
       <DropList onSelect={this.handleSelect} data={data} left={boxLeft} top={boxTop} show={show}/>

+ 8 - 3
src/containers/CheckBody.js

@@ -3,7 +3,8 @@ import CheckBody from '@components/CheckBody';
 import {getModule,getInitData} from '@store/async-actions/fetchModules.js';
 import {HIDE,RESET,SETDROPSHOW,ISREAD,SEARCH_DROP_LOCATION,MODI_LOADING} from '@store/types/homePage.js';
 import {SELECTSEARCHDATA} from "@store/types/checkBody";
-import {filterDataArr} from '@utils/tools.js';
+import {billing} from '@store/async-actions/pushMessage';
+import {didPushParamChange,filterDataArr} from '@utils/tools.js';
 
 function mapStateToProps(state){ 
   const {homePage,mainSuit,checkBody} = state;
@@ -46,10 +47,14 @@ function mapDispatchToProps(dispatch){
             span,
             isReplace:false,
             searchInEnd
-          })
+          });
           dispatch({
             type:ISREAD
-          })
+          });
+          //调右侧推送
+          if(didPushParamChange()) {
+            dispatch(billing());
+          }
         }
       });
     },

+ 11 - 2
src/containers/CurrentIll.js

@@ -113,10 +113,19 @@ function mapDispatchToProps(dispatch) {
                       span,
                       isReplace:false,
                       conceptId
-                  })
+                  });
                   dispatch({
                     type:ISREAD
-                  })
+                  });
+                  /*
+                  * 选中后推送的入参可能变了,如输入心率搜索出心率不齐,
+                  * 500ms内心率不齐标签未选中,系统会推送入参心率,
+                  * 此时推送结果可能影响查体高亮结果且并不准确,
+                  * 所以选中后要重新推送
+                  * */
+                  if(didPushParamChange()){     //操作后内容有变化才推送
+                    dispatch(billing());
+                  }
                 }
             });
           //右侧推送

+ 4 - 0
src/containers/OtherHistory.js

@@ -60,6 +60,10 @@ function mapDispatchToProps(dispatch,store){
           dispatch({
             type:ISREAD
           });
+          //调右侧推送
+          if(didPushParamChange()) {
+            dispatch(billing());
+          }
         }
       });
     },

+ 18 - 27
src/store/actions/currentIll.js

@@ -1,5 +1,5 @@
 import config from '@config/index.js';
-import {formatContinueDots,getLabelIndex,fullfillText,getIds} from '@utils/tools';
+import {formatContinueDots,getLabelIndex,fullfillText,getIds,resetTagtype} from '@utils/tools';
 import {Notify} from '@commonComp';
 //插入病程变化模板
 function insertPro(data,processModule){
@@ -19,35 +19,19 @@ function insertPro(data,processModule){
 //设置模板
 export const setModule = (state,action)=>{
   const res = Object.assign({},state);
-  // 处理tagType=4的类型
   const originalData = action.data||[];
   const originalSonData = action.processModule||[];
-  let spreadLabels=[];
-  let sonSpreadLabels=[];//子模板
-  if(originalData&&originalData.length>0){
-    for(let i=0; i<originalData.length;i++){
-      if(originalData[i].tagType==4){
-        spreadLabels.push(...originalData[i].questionMapping);
-      }else{
-        spreadLabels.push(originalData[i]);
-      }
-    }
-  }
-  if(originalSonData&&originalSonData.length>0){
-    for(let j=0; j<originalSonData.length;j++){
-      if(originalSonData[j].tagType==4){
-        sonSpreadLabels.push(...originalSonData[j].questionMapping);
-      }else{
-        sonSpreadLabels.push(originalSonData[j]);
-      }
-    }
-  }
-  
-  // res.moduleData = action.data;
-  // res.processModule = action.processModule;//病程变化模板
+  const originalEmpty = action.emptyData||[];
+  const originalEmptySon = action.currentEmptySon||[];
+  // 处理tagType=4的类型
+  let spreadLabels=resetTagtype(originalData);
+  let sonSpreadLabels=resetTagtype(originalSonData);//子模板
+  let emptySpreadLabels=resetTagtype(originalEmpty);//空模板
+  let emptySonSpreadLabels=resetTagtype(originalEmptySon);//空模板-子模板
   res.moduleData = spreadLabels;
   res.processModule = sonSpreadLabels;//病程变化模板
-  res.emptyData = action.emptyData;//空模板
+  res.emptyData = emptySpreadLabels;//空模板
+  res.currentEmptySon = emptySonSpreadLabels;//空模板-子模板
   let data = action.data;
   let sliceIdx;
   data&&data.map((v,i)=>{
@@ -63,11 +47,17 @@ export const setModule = (state,action)=>{
 //插入病程变化
 export const insertProcess = (state,action)=>{
   const res = Object.assign({},state);
+  const useEmpty = res.useEmpty;
   let addSmoduleData = [];
   if(res.currReadSonM.length>0){
     addSmoduleData = JSON.parse(JSON.stringify(res.currReadSonM))
   }else{
-    addSmoduleData = res.processModule.length>0?JSON.parse(JSON.stringify(res.processModule)):[];
+    if(!useEmpty){
+      addSmoduleData = res.processModule.length>0?JSON.parse(JSON.stringify(res.processModule)):[];
+    }else{//使用空模板则取空模板的子模板
+      addSmoduleData = res.currentEmptySon.length>0?JSON.parse(JSON.stringify(res.currentEmptySon)):[];
+    }
+    
   }
   if(addSmoduleData.length==0){//未匹配到子模板
     Notify.info("未找到相关内容");
@@ -147,6 +137,7 @@ export const setData = (state,action) =>{
   if (useEmpty) {
     const data = res.emptyData?JSON.parse(JSON.stringify(res.emptyData)):[];
     res.data = fullfillText(data).newArr;
+    res.useEmpty = true; //取子模板标识
   } else {
     if(mainData&&mainData.length>0){//主诉使用模板
       // 目前只需要将第一个主诉病程移植到现病史

+ 4 - 24
src/store/actions/mainSuit.js

@@ -1,4 +1,4 @@
-import {getLabelIndex,fullfillText,getIds} from '@utils/tools.js';
+import {getLabelIndex,fullfillText,getIds,resetTagtype} from '@utils/tools.js';
 import config from '@config/index.js';
 import {Notify} from '@commonComp';
 
@@ -22,32 +22,12 @@ export const setMainMoudle = (state,action) => {
   const res = Object.assign({},state);
   // const emptySpan = JSON.parse(config.textLabel);
   // let data = action.data.push(emptySpan);
-  // 处理tagType=4的类型
   // const originalData = JSON.parse(JSON.stringify(action.data));
   const originalData = action.data||[];
   const originalSonData = action.addSymptom||[];
-  let spreadLabels=[];
-  let sonSpreadLabels=[];//子模板
-  if(originalData){
-    for(let i=0; i<originalData.length;i++){
-      if(originalData[i].tagType==4){
-        spreadLabels.push(...originalData[i].questionMapping);
-      }else{
-        spreadLabels.push(originalData[i]);
-      }
-    }
-  }
-  if(originalSonData){
-    for(let j=0; j<originalSonData.length;j++){
-      if(originalSonData[j].tagType==4){
-        sonSpreadLabels.push(...originalSonData[j].questionMapping);
-      }else{
-        sonSpreadLabels.push(originalSonData[j]);
-      }
-    }
-  } 
-  // res.moduleData = action.data;
-  // res.addSmoduleData = action.addSymptom;
+  // 处理tagType=4的类型
+  let spreadLabels=resetTagtype(originalData);
+  let sonSpreadLabels=resetTagtype(originalSonData);//子模板
   res.moduleData = spreadLabels;
   // res.saveText = res.save||[];
   res.saveText = res.save||res.saveText;//慢病

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

@@ -76,6 +76,7 @@ export const getInitModules= (dispatch,getStore)=>{
             processModule:formatContinueDots(initData.process),//病程变化
             saveProcess:initSaveText.process,
             emptyData:formatContinueDots(initData.currentEmpty),//现病史空模板
+            currentEmptySon:formatContinueDots(initData.currentEmptySon),//现病史空模板-子模板
             saveEmpty:initSaveText.currentEmpty,
           });
         }else{//慢病--没有主诉模板

+ 20 - 3
src/utils/tools.js

@@ -151,7 +151,7 @@ const getUrlArgObject = (parm) => {
     return args[parm];//返回对象  
 } 
 const getAllDataList =(baseList) =>{           //获取所有模块结构化的数据
-    let jsonData = {};
+    let jsonData = {};console.log(111,baseList)
     //月经史公式
     const other = baseList.otherHistory;
     jsonData.lis = {};
@@ -182,7 +182,7 @@ const getAllDataList =(baseList) =>{           //获取所有模块结构化的
     jsonData.currentIds = baseList.currentIll.symptomIds;      //现病史去重
     jsonData.isFirstMainDiag = baseList.treat.isFirstMainDiag;      //治疗方案
     jsonData.mainReadSonM = baseList.mainSuit.addSmoduleData;      //主诉-子模板
-    jsonData.currReadSonM = baseList.currentIll.currReadSonM;      //现病史-子模板
+    jsonData.currReadSonM = baseList.currentIll.useEmpty?baseList.currentIll.currentEmptySon:baseList.currentIll.processModule;      //现病史-子模板
     // console.log(jsonData,'结构化数据获取')
     return jsonData;
 }
@@ -1330,6 +1330,22 @@ function getAllString(checkedListImport,assistLabel){
   }
   return tmpString;
 }
+
+// 模板中处理tagType==4的数据
+function resetTagtype(data){
+  let newDataArr = [];
+  if(data&&data.length>0){
+    for(let i=0; i<data.length;i++){
+      if(data[i].tagType==4){
+        newDataArr.push(...data[i].questionMapping);
+      }else{
+        newDataArr.push(data[i]);
+      }
+    }
+  }
+  return newDataArr;
+}
+
 module.exports = {
     checkType: Type.checkType,
     getIds,
@@ -1381,5 +1397,6 @@ module.exports = {
     getStringPlus,
     getPushLists,
     getPushList,
-    getAllString
+    getAllString,
+    resetTagtype
 };