Forráskód Böngészése

Merge remote-tracking branch 'origin/IE_test' into dev/new1

zhouna 6 éve
szülő
commit
e3965b6f49

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

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

@@ -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;
     //点确定后隐藏弹窗

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

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

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