瀏覽代碼

Merge branch 'dev/new1' into dev/zhangxc1

zhangxc 6 年之前
父節點
當前提交
422c5cfdfa

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

@@ -22,12 +22,12 @@ class EMRContainer extends Component {
     componentDidMount(){
         // const {initHospital} = this.props;
         // initHospital()
-        const height = getWindowInnerHeight() - 115;
+        const height = getWindowInnerHeight() - 175;
         const width = getWindowInnerWidth() - 480;
         this.$cont.current.style.height = height+"px";
         this.$cont.current.style.width = width + "px";
         windowEventHandler('resize', ()=>{
-          const height = getWindowInnerHeight() - 115;
+          const height = getWindowInnerHeight() - 175;
           const width = getWindowInnerWidth() - 480;
           this.$cont.current.style.height = height + "px";
           this.$cont.current.style.width = width + "px";

+ 3 - 3
src/components/EMRContainer/index.less

@@ -1,7 +1,7 @@
 @import "~@less/variables.less";
 .EMR-container{
   background: #fff;
-//   margin-top: 10px;
+  margin-top: 60px;
   // margin-right:@push-width + 10px;
   padding: 0px 0 10px 0 ;
   box-sizing: border-box;
@@ -13,8 +13,8 @@
   overflow-x: hidden;
 }
 .inner{
-  padding-top:80px;
-  padding-bottom: 80px;
+  padding-top:20px;
+  padding-bottom: 20px;
 }
 .keep {
     position: absolute;

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

@@ -21,6 +21,7 @@
         border-radius: 5px;
         border: 1px solid @template-color;
         overflow: hidden;
+        margin-top: -3px;
     }
     .disabledBtn{
         float: right;

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

@@ -62,8 +62,9 @@ class MainSuit extends Component{
 
   handleFocus(e){
     e.stopPropagation();
-    const {getCommonSymptoms,datas} = this.props;
-    let innerText = e.target.innerText;
+    const {getCommonSymptoms,datas,clearDiagnose} = this.props;
+    let innerText = e.target.innerText || e.target.innerHTML;//兼容火狐43
+    clearDiagnose&&clearDiagnose();//清除复诊数据
     if(!isIE()){//IE会触发onfocus和onblur事件
       if(!innerText.trim()){//有内容就走搜索接口
         getCommonSymptoms && getCommonSymptoms();
@@ -225,6 +226,7 @@ class MainSuit extends Component{
     let data = this.state.inpText;
     if(!isIE()){
       e.target.innerText="";
+      e.target.innerHTML="";//兼容火狐43
       freeText && freeText(data.trim());
     }else{
       if(datas.length==0){

+ 16 - 16
src/components/Operation/index.jsx

@@ -158,13 +158,13 @@ class Operation extends Component {
     let jsonStr = getAllDataStringList(baseList);
     let whichSign = baseList.typeConfig.typeConfig;
     let tmpLis = baseList.tabTemplate.items;
-    // console.log(jsonStr,'文本')
-    // console.log(jsonData.chief,'结构')       //测试需要用到,不要删了
+    console.log(jsonStr,'文本')
+    console.log(jsonData.chief,'结构')       //测试需要用到,不要删了
     for(let i = 0;i <tmpLis.length;i++){
       let dataStr = tmpLis[i].preview;
       let dataJson = tmpLis[i].dataJson;
       // console.log(JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')),111)
-      console.log(JSON.stringify(jsonData.other) ,787878,JSON.stringify(JSON.parse(dataJson).other))
+      // console.log(JSON.stringify(jsonData.other) )
       if(
         jsonStr.chief == JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')) && 
         jsonStr.present == JSON.stringify(eval('('+JSON.parse(dataStr).present+')')) && 
@@ -172,17 +172,17 @@ class Operation extends Component {
         jsonStr.vital == JSON.stringify(eval('('+JSON.parse(dataStr).vital+')'))  &&
         JSON.stringify(jsonData.chief) == JSON.stringify(JSON.parse(dataJson).chief) &&    
         JSON.stringify(jsonData.present) == JSON.stringify(JSON.parse(dataJson).present)  &&     
-        // JSON.stringify(jsonData.other) == JSON.stringify(JSON.parse(dataJson).other) &&      
-        JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(dataJson).vital)  
-        // JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(dataJson).lis) &&  
-        // JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(dataJson).pacs) &&     
-        // JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
-        // JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&    
-        // JSON.stringify(jsonData.mainSuitSelecteds) == JSON.stringify(JSON.parse(dataJson).mainSuitSelecteds) &&      
-        // JSON.stringify(jsonData.currentIllSelecteds) == JSON.stringify(JSON.parse(dataJson).currentIllSelecteds) &&     
-        // JSON.stringify(jsonData.otherHistorySelecteds) == JSON.stringify(JSON.parse(dataJson).otherHistorySelecteds) && 
-        // JSON.stringify(jsonData.checkBodySelecteds) == JSON.stringify(JSON.parse(dataJson).checkBodySelecteds) &&     
-        // JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
+        JSON.stringify(jsonData.other) == JSON.stringify(JSON.parse(dataJson).other) &&      
+        JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(dataJson).vital) && 
+        JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(dataJson).lis) &&  
+        JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(dataJson).pacs) &&     
+        JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
+        JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&    
+        JSON.stringify(jsonData.mainSuitSelecteds) == JSON.stringify(JSON.parse(dataJson).mainSuitSelecteds) &&      
+        JSON.stringify(jsonData.currentIllSelecteds) == JSON.stringify(JSON.parse(dataJson).currentIllSelecteds) &&     
+        JSON.stringify(jsonData.otherHistorySelecteds) == JSON.stringify(JSON.parse(dataJson).otherHistorySelecteds) && 
+        JSON.stringify(jsonData.checkBodySelecteds) == JSON.stringify(JSON.parse(dataJson).checkBodySelecteds) &&     
+        JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
       ){
         Notify.info('该模板已保存');
         return false;
@@ -304,8 +304,8 @@ class Operation extends Component {
       <span className={style['button']} onClick={showPrint}><img src={printImg} /> 打印病历</span>
       <span className={style['preButton']} onClick={showPreview}><img src={preview} /> 预览</span>
       <span className={style['preButton']} onClick={() => { this.saveHis(3) }}><img src={saveHistory} /> 保存病历模板</span>
-      <span className={winWidth<=1082?`${style['saveButton']} ${style['b1024']}`: style['saveButton']} onClick={() => { this.saveAll(1) }}>保存</span>
-      <span className={winWidth<=1082?`${style['clearButton']} ${style['saveButton']} ${style['b1024']}`:`${style['clearButton']} ${style['saveButton']}`} onClick={() => { this.clearAll(2) }}>清除</span>
+      <span className={winWidth<=1082?`${style['saveButton']} ${style['minstyle']}`: style['saveButton']} onClick={() => { this.saveAll(1) }}>保存</span>
+      <span className={winWidth<=1082?`${style['clearButton']} ${style['saveButton']} ${style['minstyle']}`:`${style['clearButton']} ${style['saveButton']}`} onClick={() => { this.clearAll(2) }}>清除</span>
       <PrintPreviewContainer visible={visible} onClose={closePrint} />
       <PreviewContainer visible={preVisible} onClose={closePreview} />
       <ConfirmModal

+ 1 - 1
src/components/Operation/index.less

@@ -67,7 +67,7 @@
         background-color: #fff;
         color: #000;
     }
-    .b1024{
+    .minstyle{
         width: 60px;
         margin-left: 15px;
         margin-right: 10px;

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

@@ -193,8 +193,8 @@ class SpreadDrop extends Component{
   }
   handleConfirm(e){
     e.stopPropagation();
-    const {handleConfirm,ikey,type,tagType,order,mainSaveText,copyType,value} = this.props;
-    const params = Object.assign({},this.state,{ikey,type,tagType,order,mainSaveText,copyType,value});
+    const {handleConfirm,ikey,type,tagType,order,mainSaveText,copyType,value,mainData} = this.props;
+    const params = Object.assign({},this.state,{ikey,type,tagType,order,mainSaveText,copyType,value,mainData});
     handleConfirm&&handleConfirm(params);
 	this.btnClickFlag = true;
     //点确定后隐藏弹窗

+ 2 - 2
src/config/index.js

@@ -30,8 +30,8 @@ export default {
     delayTime:500,      //延迟搜索的时间
     delayPushTime:1000,    //延迟推送时间
     pushDelay:1000,
-    punctuationReg:/[^,,.。;;、]/g,       //正则表达式,全局查找不是括号内标点的字符
-    punReg:/[,,.。;;、]+/g,
+    punctuationReg:/[^,,.。::"“?”;;、!!]/g,       //正则表达式,全局查找不是括号内标点的字符
+    punReg:/[,,.。::"“?”;;、!!]+/g,
     currentText:"患者XX因XX诊断为(**),经XX治疗后,目前XX症状已缓解,仍有XX,各项指标情况:XX,辅助检查:XX。今来复诊,进一步治疗",
     timeUnit:{
       minute:"分",

+ 6 - 0
src/containers/MainSuit.js

@@ -5,6 +5,7 @@ import {CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,CLEAR_SEARCH,SET_SEARCH,SAVE_FRE
 import {RESET,CLICKCOUNT,ISREAD} from '@store/types/homePage.js';
 import {getCommSymptoms,getCommSymptomPush} from '@store/async-actions/mainSuit.js'
 import {SET_MAIN_SUIT} from '@store/types/fillInfo';
+import {CLEAR_DIAGNOSE} from '@store/types/diagnosticList';
 import {getSearch} from '@store/async-actions/fetchModules';
 import {billing} from '@store/async-actions/pushMessage';
 import {filterArr,didPushParamChange,filterDataArr} from '@utils/tools.js';
@@ -151,6 +152,11 @@ function mapDispatchToProps(dispatch) {
             text:obj.text
           })
       },
+      clearDiagnose(){//清除复诊
+        dispatch({
+            type:CLEAR_DIAGNOSE,
+          })
+      }
     }
 }
 

+ 59 - 9
src/containers/SpreadDrop.js

@@ -15,9 +15,10 @@ import {Notify} from '@commonComp';
 import {filterArr,didPushParamChange,filterDataArr} from '@utils/tools.js';
 import config from '@config/index.js';
 
-function mapStateToProps(state) {
+function mapStateToProps(state) {//console.log(state);
   return {
     mainSaveText:state.mainSuit.saveText,
+    mainData:state.mainSuit.data,
   }
 }
 
@@ -35,33 +36,82 @@ function getNames(data,order){//从exist withs 中获取name字段
   return nameData;
 }
 
+function addPoint(data,num){//给伴随添加顿号
+  for(let i=num; i<data.length; i++){
+    data[i].name = '、'+ data[i].name;
+  }
+  return data;
+}
 
 /***********************标签展开确定事件***************************/
 
 // 主诉--不用展开标签
 function mainSuitModule(dispatch,store,params){
-  const {nones,exists,withs,exclusion,excluName,ban,mainSaveText} = params;
-  let existsName = getNames(exists);
-  let withsName = getNames(withs);
-  let banName = ban.name;
+  const {nones,exists,withs,exclusion,excluName,ban,mainSaveText,mainData} = params;
   let text = filterDataArr(mainSaveText);
   if(text.length >= config.limited){
     Notify.info(config.limitText);
     return
   }
+  // let existsName = getNames(exists);
+  // let withsName = getNames(withs);
+  const copExists = JSON.parse(JSON.stringify(exists));
+  const copWiths = JSON.parse(JSON.stringify(withs)); 
+  let banName = ban.name;
+  const index = params.ikey;
+  let ikey = getLabelIndex(index);
+  let num = 0;
+  let existNum = 0;
+  let forwardId;
+  let mainText;
+  for(let n=ikey-1; n>0; n--){
+    if(mainData[n].flag && mainData[n].flag==1){
+      forwardId = n;
+      continue;
+    }
+  }
+  
+  if(forwardId){
+    mainText = mainSaveText.slice(forwardId,ikey);
+    const mainSlice = mainData.slice(forwardId,ikey);
+    let banIndex = mainText.indexOf('伴'); 
+    if(banIndex==-1){
+      num = 1;
+    }
+    console.log(11,exists,mainSlice);
+    // ikey前的data里没有exist=1的数据,则existNum=1
+    if(exists.length>0){
+      for(let i=0; i<mainSlice.length; i++){
+        if(!mainSlice[i].exist && mainSlice[i].exist!==1){
+          existNum = 1;
+          continue;
+        }
+      }
+    }
+    
+  }else{
+    let banIndex = mainSaveText.indexOf("伴");
+    if(banIndex==-1){
+      num = 1;
+    }
+  }
+  let withsName = getNames(addPoint(copWiths,num));
+  let existsName = getNames(addPoint(copExists,existNum));
   let names;
   if(banName){
     names = existsName + banName + withsName;
   }else{
     names = existsName + withsName;
-  }  
-  let lengths = text.length + names.length;
+  } 
+  // num==0 说明有“伴”,减1;
+  let lengths = num==0?text.length + names.length - 1:text.length + names.length;
+  // console.log(5656,num,existNum,text,text.length,names,lengths);
   if(lengths > config.limited){
     Notify.info(config.limitText);
     return
   }
-  const index = params.ikey;
-  let ikey = getLabelIndex(index);
+  // const index = params.ikey;
+  // let ikey = getLabelIndex(index);
   dispatch({
     type: MIX_CONFIRM,
     data: {exists:exists,withs:withs,withsName:withsName,existsName:existsName,ikey,ban}

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

@@ -203,12 +203,12 @@ export function insertLabelData(state,action){
       res.data.splice(index,1,pText,...spreadLabels,text);
       res.saveText = fullfillText(res.data).saveText;
       //res.saveText.splice(index,1,newText,'','');
-      res.selecteds.splice(index,1,null,new Array(spreadLabels.length).fill(null),null);
+      res.selecteds.splice(index,1,null,...new Array(spreadLabels.length).fill(null),null);
     }else{
       res.data.splice(index,1,text,...spreadLabels,pText);
       res.saveText = fullfillText(res.data).saveText;
       //res.saveText.splice(index,1,'','',newText);
-      res.selecteds.splice(index,1,null,new Array(spreadLabels.length).fill(null),null);
+      res.selecteds.splice(index,1,null,...new Array(spreadLabels.length).fill(null),null);
     }
 
   }else{
@@ -251,6 +251,7 @@ export const changeLabelVal = (state,action)=>{//双击标签输入改变值
   }else{//删除完标签内容则删除该标签
     const num = nextIsDot?2:1;
     res.data.splice(index,num);
+    res.selecteds.splice(index,num);//杂音类样式选中状态对应
     res.saveText = fullfillText(res.data).saveText;
   }
   res.update = Math.random();
@@ -278,6 +279,7 @@ export const changeNumLabelVal = (state,action)=>{
   }else{//删除完标签内容则删除该标签
     const num = nextIsDot?2:1;
     res.data.splice(index,num);
+    res.selecteds.splice(index,num);      //杂音类样式选中状态对应
     res.saveText = fullfillText(res.data).saveText;
   }
 

+ 2 - 1
src/store/actions/mainSuit.js

@@ -148,7 +148,8 @@ export const confirm = (state,action) =>{
   let forwardId;
   let text;
   for(let n=labelIndx-1; n>0; n--){
-    if(arr[n].id==8){
+    // if(arr[n].id==8){
+    if(arr[n].flag && arr[n].flag==1){//添加症状打标flag=1
       forwardId = n;
       continue;
     }

+ 6 - 0
src/store/actions/otherHistory.js

@@ -192,19 +192,23 @@ export function insertLabelData(state,action){
     if(searchInEnd){
       res.data.splice(index,1,pText,...spreadLabels,text);
       res.saveText = fullfillText(res.data).saveText;
+      res.selecteds.splice(index,1,null,...new Array(spreadLabels.length).fill(null),null);
       //res.saveText.splice(index,1,newText,'','');
     }else{
       res.data.splice(index,1,...spreadLabels,pText,text);
       res.saveText = fullfillText(res.data).saveText;//.splice(index,1,'',newText,'');
+      res.selecteds.splice(index,1,...new Array(spreadLabels.length).fill(null),null,null);
     }
   }else{
     span.current.innerText = ' ';
     if(searchInEnd){
       res.data.splice(index+1,0,spreadLabels,text);
       res.saveText.splice(index+1,0,'','');
+      res.selecteds.splice(index+1,0,...new Array(spreadLabels.length).fill(null),null);
     }else{
       res.data.splice(index,0,text,spreadLabels);
       res.saveText.splice(index,0,'','');
+      res.selecteds.splice(index,0,null,...new Array(spreadLabels.length).fill(null));
     }
 
   }
@@ -234,6 +238,7 @@ export function changeTextLabel(state,action) {
   }else{//删除完标签内容则删除该标签
     const num = nextIsDot?2:1;
     res.data.splice(index,num);
+    res.selecteds.splice(index,num);//杂音类样式选中状态对应
     res.saveText = fullfillText(res.data).saveText;
   }
   res.update = Math.random();
@@ -262,6 +267,7 @@ export const changeNumLabelVal = (state,action)=>{
   }else{//删除完标签内容则删除该标签
     const num = nextIsDot?2:1;
     res.data.splice(index,num);
+    res.selecteds.splice(index,num);//杂音类样式选中状态对应
     res.saveText = fullfillText(res.data).saveText;
   };
   res.update = Math.random();

+ 2 - 2
src/store/async-actions/fetchModules.js

@@ -45,8 +45,8 @@ export const getSearch = (param)=>{
     const params = {
       "age": patInfo.message.patientAge,
       "inputIds":mainIds&&mainIds.length>0?mainIds:[],//主诉去重
-      // "inputStr": inpStr.trim(),
-      "inputStr": inpStr,
+      "inputStr": inpStr.trim(),
+      // "inputStr": inpStr,
       "sexType": patInfo.message.sex,
       "type": boxMark //1为搜症状
     };

+ 5 - 1
src/store/reducers/diagnosticList.js

@@ -1,4 +1,4 @@
-import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, SET_TREAT, GET_DIAGNOSTIC_STR, SET_DIAG_TO_MAINSUIT, GET_IS_FIRST,CLEAR_ALL_DIAG, SET_CLICK_DIAG } from '../types/diagnosticList';
+import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, SET_TREAT, GET_DIAGNOSTIC_STR, SET_DIAG_TO_MAINSUIT, GET_IS_FIRST,CLEAR_ALL_DIAG, SET_CLICK_DIAG ,CLEAR_DIAGNOSE} from '../types/diagnosticList';
 import { addDiagnostic,  delDiagnostic, upDiagnostic, downDiagnostic, setTreat, getDiagnosticStr, setDiagToMainSuit, getIsFirst,clearAllDiag, setClickDiag} from '../actions/diagnosticList';
 
 const initState = {
@@ -35,6 +35,7 @@ const initState = {
 }
 
 export default function (state=initState, action) {
+    const res = Object.assign({},state);
     switch(action.type) {
         case ADD_DIAGNOSTIC:
             return addDiagnostic(state, action);
@@ -56,6 +57,9 @@ export default function (state=initState, action) {
             return clearAllDiag(state, action);
         case SET_CLICK_DIAG: 
             return setClickDiag(state, action);
+        case CLEAR_DIAGNOSE: 
+            res.mainSuitStr = "";
+            return res;
         default:
             return state;
     }

+ 2 - 1
src/store/types/diagnosticList.js

@@ -8,4 +8,5 @@ export const GET_DIAGNOSTIC_STR = 'GET_DIAGNOSTIC_STR';
 export const SET_DIAG_TO_MAINSUIT = 'SET_DIAG_TO_MAINSUIT'; //判断第一次添加诊断是否添加到主诉
 export const GET_IS_FIRST = 'GET_IS_FIRST'; //判断是否第一次添加诊断
 export const CLEAR_ALL_DIAG = 'CLEAR_ALL_DIAG'; //清除所有诊断
-export const SET_CLICK_DIAG = 'SET_CLICK_DIAG' //设置点击的诊断,获取提示详情时需要
+export const SET_CLICK_DIAG = 'SET_CLICK_DIAG' //设置点击的诊断,获取提示详情时需要
+export const CLEAR_DIAGNOSE = 'CLEAR_DIAGNOSE' //

+ 1 - 1
src/utils/tools.js

@@ -501,7 +501,7 @@ function filterDataArr(arrTmp){   //数据处理
 
     return tmpArr.join('').replace(config.punReg,function(word){
       return word.substr(0,1);
-    }).replace(/^[,,.。;;、]+/,'');      //去掉开头的标点符号,最后的标点保留第一个,中间连续的保留第一个
+    }).replace(/^[,,.。::"“?”;;、!!]+/,'');      //去掉开头的标点符号,最后的标点保留第一个,中间连续的保留第一个
 }
 // 取消默认行为
 function preventDefault(event) {