Преглед изворни кода

切换模块触发病历分析

zhangxc пре 5 година
родитељ
комит
c0a46d6000

+ 17 - 1
src/common/components/ItemBox/index.jsx

@@ -2,6 +2,12 @@ import React,{Component} from 'react';
 import style from './index.less';
 import store from '@store';
 import {isIE,handleEnter,setFontColorSize} from '@utils/tools.js';
+import {HIDEDROP,
+  SET_CURRENT_MODULE
+} from '@types/homePage';
+import {
+  getMRAnalyse
+} from '@store/async-actions/pushMessage';
 import $ from 'jquery';
 /***
  * author:zn@2018-11-13
@@ -30,8 +36,18 @@ class ItemBox extends Component {
   }
   handleClick(e){
     e.stopPropagation();
-    const {handleClick,hideAllDrop} = this.props;
+    const {handleClick,hideAllDrop,title} = this.props;
+    const state = store.getState()
+    const moduleName = state.homePage.moduleName
     handleClick && handleClick(e);//为了获取鼠标位置,显示搜索结果框;
+    if(moduleName != title) {
+      console.log('aaaaaaaaaaaaaaaaaaaaaaaa', moduleName, title)
+      store.dispatch({
+        type: SET_CURRENT_MODULE,
+        moduleName:title
+      })
+      store.dispatch(getMRAnalyse())
+    }
     hideAllDrop&&hideAllDrop();
   }
   handleInput(e){

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

@@ -138,4 +138,5 @@ export const resetSelectArea = (state,action)=>{
   delete res.select_start;
   delete res.select_end;
   return res;
-}
+}
+

+ 9 - 3
src/store/reducers/homePage.js

@@ -1,6 +1,8 @@
 import {HIDE,RESET,SETINITDATA,SETDROPSHOW,SETADDITEMINIT,SETT0EDIT,SETREADDITEMS,SETPREDATA,
-  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING,GET_INSPECT_LIST,GET_ASSIST_LIST,SETALLMODULES,SETSYSTEMCONFIG,SETPRE,RESET_SELECT_TAG,SET_SELECTED_AREA,SETADMIN} from '../types/homePage.js';
-import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum,getInspectList,getAssistList,setSelectArea,resetSelectArea} from '../actions/homePage.js';
+  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING,GET_INSPECT_LIST,GET_ASSIST_LIST,
+  SETALLMODULES,SETSYSTEMCONFIG,SETPRE,RESET_SELECT_TAG,SET_SELECTED_AREA,SETADMIN,SET_CURRENT_MODULE} from '../types/homePage.js';
+import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum,getInspectList,getAssistList,setSelectArea,resetSelectArea, setCurrentModule} from '../actions/homePage.js';
+import {getMRAnalyse} from '@store/async-actions/pushMessage';
 
 const initState = {
   totalHide:false,
@@ -21,7 +23,8 @@ const initState = {
   showPre:false,
   preData:{},
   item:{},
-  admin:false
+  admin:false,
+  moduleName:''
 };
 
 export default function (state=initState,action) {
@@ -91,6 +94,9 @@ export default function (state=initState,action) {
       return setSelectArea(state,action);
     case RESET_SELECT_TAG:
       return resetSelectArea(state,action);
+    case SET_CURRENT_MODULE: 
+      res.moduleName = action.moduleName
+    return res;
     default:
       return res;
   }

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

@@ -20,4 +20,5 @@ export const SETPRE = 'SETPRE';   //设置预问诊引用弹窗
 export const SETPREDATA = 'SETPREDATA';   //设置预问诊数据暂存
 export const SETADMIN = 'SETADMIN';   //设置管理员身份
 export const RESET_SELECT_TAG='RESET_SELECT_TAG';   //重置选中标签的各标记
-export const SET_SELECTED_AREA='SET_SELECTED_AREA';
+export const SET_SELECTED_AREA='SET_SELECTED_AREA'; 
+export const SET_CURRENT_MODULE = 'SET_CURRENT_MODULE'

+ 10 - 2
src/utils/tools.js

@@ -6,8 +6,8 @@ import {CLEARCHECKBODY,SET,CHECKBODY_CLEAR} from '@store/types/checkBody';
 import {clearAssistData,addAssistLabel} from '@store/actions/assistCheck';
 import {clearAllLabel,addLabel} from '@store/actions/inspect';
 import {CLEAR_ALL_DIAG} from '@store/types/diagnosticList';
-import {CLEAR_ALL_PUSH_MESSAGE, SET_TIPS,BILLING_ADVICE,PUSHCHANGE} from '@store/types/pushMessage';
-import {ISREAD, SETREADDITEMS,SET_SELECTED_AREA} from "../store/types/homePage";
+import {CLEAR_ALL_PUSH_MESSAGE, SET_TIPS,BILLING_ADVICE,PUSHCHANGE,SET_MR_ANALYSE} from '@store/types/pushMessage';
+import {ISREAD, SETREADDITEMS,SET_SELECTED_AREA,SET_CURRENT_MODULE} from "../store/types/homePage";
 import {CLEAR_FIRST_MAIN_DIAG, CLEAR_ALL_TREAT} from "../store/types/treat";
 import {tabChange} from '@store/actions/tabTemplate';
 import {CLEAR_ASSESS_RESULT_VALUE} from '@types/assessResult';
@@ -211,6 +211,14 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
           setPushEmergency:{},
           setPushEmergencyIdx:''
         });
+        store.dispatch({
+          type: SET_CURRENT_MODULE,
+          moduleName: ''
+        })
+        store.dispatch({
+          type: SET_MR_ANALYSE,
+          MRAnalyseResult: []
+        })
         storageLocal.remove('emrParam');
        // Notify.success('页面已清空')
     }else if(type == 'preIcss'){