瀏覽代碼

推送mode场景传参

zhouna 5 年之前
父節點
當前提交
5004667cae

+ 3 - 4
src/common/components/BlockInp/index.jsx

@@ -25,7 +25,7 @@ class BlockInp extends Component {
     this.handleBlur = this.handleBlur.bind(this);
   }
   handleFocus(e){            //初始显示props中的值,focus已经显示输入的值,避免值更新闪烁
-    const {handleFocus,boxMark,title} = this.props;
+    const {boxMark,title,handlePush} = this.props;
     const state = store.getState()
     const moduleName = state.homePage.moduleName
     //黏贴时去掉html格式
@@ -38,8 +38,7 @@ class BlockInp extends Component {
         moveEnd($(that.$dom.current)[0]);     //光标落到最后去
       });
     });
-    handleFocus&&handleFocus();         //其他史获取上一次记录
-
+    handlePush&&handlePush({boxMark,isFocus:true,state});    //主诉、现病史空白聚焦推送
     if(moduleName != title) {
       store.dispatch({
         type: SET_CURRENT_MODULE,
@@ -63,7 +62,7 @@ class BlockInp extends Component {
     //右侧推送--延时推送
     clearTimeout(stimer);
     let timer = setTimeout(function(){
-      handlePush&&handlePush();
+      handlePush&&handlePush({boxMark});
       clearTimeout(stimer);
     },config.delayPushTime);
     this.setState({

+ 1 - 1
src/components/AddAssistCheck/Textarea/index.jsx

@@ -28,7 +28,7 @@ class Textarea extends Component {
     //右侧推送--延时推送
     clearTimeout(stimer);
     let timer = setTimeout(function(){
-      handlePush&&handlePush();
+      handlePush&&handlePush({mode:9});
       clearTimeout(stimer);
     },config.delayPushTime);
     if(text.trim() != '' && text != '<br>'){

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

@@ -86,7 +86,7 @@ class AddAssistCheck extends React.Component {
     const { id,activeName } = this.state;
     $(".TextareaRsize").css({marginTop:0});
     handleDelAssist && handleDelAssist(id,activeName,type);
-    handlePush && handlePush();           //右侧推送
+    handlePush && handlePush({mode:9});           //右侧推送
     this.setState({
       visible: false,
       id: null,

+ 1 - 1
src/components/AddInspect/SlideSelect/index.jsx

@@ -226,7 +226,7 @@ class SlideSelect extends Component {
                                 handleConfirm(e,idx,dateTime,currentData);
                             }
                             changeShowFill()
-                            handlePush&&handlePush();     //右侧推送
+                            handlePush&&handlePush({mode:8});     //右侧推送
                         }}
                     >
                     

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

@@ -54,7 +54,7 @@ class Inspect extends React.Component {
       impId: null
     })
     Notify.success("删除成功");
-    handlePush && handlePush();       //右侧推送
+    handlePush && handlePush({mode:8});       //右侧推送
   }
   handleDelClick(type, idx) {
     if (type == 2) {

+ 2 - 1
src/components/Advice/Textarea/index.jsx

@@ -15,10 +15,11 @@ class Textarea extends Component {
     this.$dom = React.createRef();
     this.$domW = React.createRef();
     this.handleInput = this.handleInput.bind(this);
+    this.handleFocus = this.handleFocus.bind(this);
   }
   handleInput(e){
     e.stopPropagation();
-    const {handleChangeAssistValue,idx,handlePush} = this.props;
+    const {handleChangeAssistValue} = this.props;
     const text =  e.target.textContent.trim() ? e.target.innerHTML : ''
     handleChangeAssistValue&&handleChangeAssistValue(text);
    

+ 5 - 5
src/components/BlockEmrCont/OtherHistory.jsx

@@ -6,18 +6,18 @@ import {setOtherHisModule} from '@store/async-actions/fetchModules';
 class OtherHistory extends Component{
   constructor(props){
     super(props);
-    this.getRecord = this.getRecord.bind(this);
+    //this.getRecord = this.getRecord.bind(this);
   }
-  getRecord(){
+  /*getRecord(){
     //空白聚焦其他史时,获取上次记录
     const {setInitData,value} = this.props;
     if(!value){
       setInitData();
-    }    
-  }
+    }
+  }*/
   render(){
     const {value,isRead}=this.props;
-   return  <BlockInp title='其他史' boxMark='3' value={value} isRead={isRead} handleFocus={this.getRecord}></BlockInp>;
+   return  <BlockInp title='其他史' boxMark='3' value={value} isRead={isRead}></BlockInp>;
   }
 }
 

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

@@ -159,7 +159,7 @@ class DiagnosticList extends Component {
         // let baseObj = items[this.state.activeHistory];
         // pushAllDataList(baseObj.sign,'push',baseObj,'history')       //引用
         store.dispatch(getHistempDetail(activeItem));
-        this.props.getBilling();
+        this.props.getBilling({mode:10});
         this.setState({
             activeHistory: -1,
             sign:-1,
@@ -241,7 +241,7 @@ class DiagnosticList extends Component {
     }
     componentWillReceiveProps(nextprops) {
       if (this.props.diagnosticStr != nextprops.diagnosticStr) {
-        this.props.getBilling();
+        this.props.getBilling({mode:10});
       }
     }
    

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

@@ -83,7 +83,7 @@ class Inspect extends React.Component {
       })
     }
     $('iframe').bind('load', function () { })
-    const { fetchPushInfos,typeConfig } = this.props;
+    const { fetchPushInfos } = this.props;
     // FileAPI.debug = true
     $.support.cors = true;
     const that = this;
@@ -135,7 +135,7 @@ class Inspect extends React.Component {
                     }
                     store.dispatch(getExcelList(res.data));
                     store.dispatch(getMRAnalyse());
-                    fetchPushInfos && fetchPushInfos({mode:typeConfig.typeConfig[0]});
+                    fetchPushInfos && fetchPushInfos({mode:8});
                     if (message && message.length != 0) {
                       that.setState({
                         visible: true,

+ 3 - 3
src/containers/AssistCheck.js

@@ -6,7 +6,7 @@ import AssistCheck from '@components/AssistCheck';
 import { assistLable,delAssistLabel,changeAssistVal,changeDate,allCheckImports,selectOneChecks,showInIcsss } from '@store/actions/assistCheck';
 import { getSearchList,getInstroduce ,getImportLists,getSonDetailList} from '@store/async-actions/assistCheck';
 import {ISREAD,HIDEDROP} from '@store/types/homePage.js';
-import {billing, getConceptDetail,getMRAnalyse} from '@store/async-actions/pushMessage';
+import {embedPush, getConceptDetail,getMRAnalyse} from '@store/async-actions/pushMessage';
 import { getCalendarDate} from '@utils/tools';
 
 function mapStateToProps(state) {//console.log(state.typeConfig)
@@ -75,9 +75,9 @@ function mapDispatchToProps(dispatch, store) {
             dispatch(changeDate(date,idx))
         },
         //右侧推送
-        fetchPushInfos(){
+        fetchPushInfos(obj){
           //调右侧推送
-          dispatch(billing());
+          dispatch(embedPush(obj));
         },
         hideAllDrop(){
           dispatch({

+ 11 - 5
src/containers/BlockInpContainer.js

@@ -5,7 +5,7 @@ import {SETCURRENTTEXTMODEVALUE} from '@store/types/currentIll';
 import {SETOTHERTEXTMODEVALUE} from '@store/types/otherHistory';
 import {SETCHECKTEXTMODEVALUE} from '@store/types/checkBody';
 import BlockInp from '@common/components/BlockInp';
-import {didPushParamChange,isAllPartClear} from '@utils/tools';
+import {didPushParamChange,isAllPartClear,getAllDataList,getAllDataStringList,isAllClear} from '@utils/tools';
 import {embedPush} from '@store/async-actions/pushMessage';
 
 function mapStateToProps(state){
@@ -21,7 +21,7 @@ const actionsType={
   '3':SETOTHERTEXTMODEVALUE,
   '4':SETCHECKTEXTMODEVALUE,
 };
-function mapDispatchToProps(dispatch,store){
+function mapDispatchToProps(dispatch){
   return {
     handleInput(obj){   //自由模式值保存
       dispatch({
@@ -29,9 +29,15 @@ function mapDispatchToProps(dispatch,store){
         text:obj.text
       })
     },
-    handlePush(){
-      if(didPushParamChange()) {
-        dispatch(embedPush());
+    handlePush(obj={}){
+      const {boxMark,isFocus,state} = obj;
+      const notClear=state?isAllClear(getAllDataStringList(state)):false;
+      if(isFocus&&(boxMark==='1'||boxMark==='2')&&!notClear){
+        dispatch(embedPush({mode:+boxMark+1}));
+        return;
+      }
+      if(!isFocus&&didPushParamChange()) {    //输入的情况
+        dispatch(embedPush({mode:+boxMark+3}));
       }
     }
   }

+ 3 - 3
src/containers/DiagnosticList.js

@@ -4,7 +4,7 @@ import DiagnosticList from '@components/DiagnosticList';
 import { DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE ,SHOW_LOADING} from '@store/types/diagnosticList'; 
 import { getTreatResult } from '@store/async-actions/treat';
 import { SHOW_TREAT, DEL_REACT, DEL_FOLLOW_UP } from '@store/types/treat.js';
-import {billing, getConceptDetail,getMRAnalyse} from '../store/async-actions/pushMessage';
+import {embedPush, getConceptDetail,getMRAnalyse} from '../store/async-actions/pushMessage';
 import {keepPushData} from '@store/actions/tabTemplate';
 import { visibleHistory } from '@store/actions/historyTemplates'
 import {autoFillModules} from '@store/async-actions/fetchModules';
@@ -94,9 +94,9 @@ function mapDispatchToProps(dispatch) {
         getTips: (item,noTips,noDetails,noNotify) => {
             dispatch(getConceptDetail(item,noTips,noDetails,noNotify))
         },
-        getBilling: () => {
+        getBilling: (obj) => {
           if (didPushParamChange()) {
-            dispatch(billing())
+            dispatch(embedPush(obj))
           }
         },
         hideReferRecord: ()=>{

+ 1 - 6
src/containers/Inspect.js

@@ -87,13 +87,8 @@ function mapDispatchToProps(dispatch) {
     },
     //右侧推送
     fetchPushInfos(obj) {
-      const mode = obj.mode;
       //调右侧推送
-      if(mode===2){
-        dispatch(embedPush());
-      }else{
-        dispatch(billing());
-      }
+      dispatch(embedPush(obj));
     },
     hideAllDrop(){
       dispatch({

+ 0 - 2
src/store/async-actions/patInfo.js

@@ -11,7 +11,6 @@ import config from '@config/index';
 import {Notify} from '@commonComp';
 import {SHOW_LOADING} from '@store/types/copyRight.js';
 import {getMRAnalyse,embedPush} from '@store/async-actions/pushMessage';
-import {getOtherHisRecord} from '@store/async-actions/fetchModules';
 
 
 
@@ -243,7 +242,6 @@ export async function getPatientMessage(dispatch, getState){
     dispatch(initHistoryDetails());      //历史病历回读
   }else{
     dispatch(embedPush({mode:1}));      //默认空白情况,刷新右侧
-    dispatch(getOtherHisRecord());          //获取其他史最近记录
   }
   //dispatch(getInitModules);     //确保病人信息获取以后再获取模板等数据,否则参数为空
   dispatch(getCommonList(5));     //获取常用化验标签列表

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

@@ -172,7 +172,7 @@ export const getConceptDetail = (item,noTips,noDetails,noNotify) => {
                           flag:true
                         });
                     }
-                    document.getElementById("tipsMsg").scrollIntoView(true)
+                    //document.getElementById("tipsMsg").scrollIntoView(true)
                     //点击i同时打开详情弹窗 点击诊断名称不打开弹窗
                     if(!noDetails) {
                       dispatch({