Просмотр исходного кода

Merge remote-tracking branch 'origin/TCM0513' into testNew

zhouna 4 лет назад
Родитель
Сommit
5a5239b5a2

+ 1 - 4
src/components/Operation/index.jsx

@@ -198,6 +198,7 @@ class Operation extends Component {
     this.setState({
       saveVisible: true
     })
+    this.props.hideAllSearch();
   }
 
   handleMedicalChange(e){
@@ -427,10 +428,6 @@ class Operation extends Component {
       // type === 2 清除数据
       diagShowTmp(false);
       this.setState({ title: '' })
-      // 慢病标识
-      const chronicFlag = chronicMagItem || chronicDesease?true:false;
-      // console.log(chronicFlag,'chronicFlag');
-      clear(chronicFlag);
       //更新滚动条
       const that = this;
       setTimeout(function(){

+ 12 - 9
src/containers/OperationContainer.js

@@ -11,8 +11,8 @@ import {
 import { saveMessage, clearMessages } from "../store/async-actions/print";
 import { saveTemplateDetail, getDepartments, saveAdminTemplateDetail, getFloderList,newFloder,orderFloder } from '@store/async-actions/tabTemplate';
 import { getDptLis,folderModal,folderOrder } from '@store/actions/tabTemplate';
-import { saveClickNum, getInitModules } from '@store/async-actions/homePage';
-import { getOtherHisRecord } from '@store/async-actions/fetchModules';
+import { saveClickNum } from '@store/async-actions/homePage';
+/*import { getOtherHisRecord } from '@store/async-actions/fetchModules';*/
 import { RECOVER_TAG_MAIN } from '@store/types/mainSuit';
 import { RECOVER_TAG_CURRENT } from '@store/types/currentIll';
 import { RECOVER_TAG_OTHER } from '@store/types/otherHistory';
@@ -101,14 +101,9 @@ function mapDispatchToProps(dispatch) {
 
       dispatch(() => saveMessage())
     },
-    clear: (flag) => {
+    clear: () => {
       clearMessages();
-      // console.log('清除数据');
-      // dispatch(getOtherHisRecord());      //清除后重新获取其他史记录
-      // 清除时如果是慢病模板则重新获取模板
-      if (flag) {
-        dispatch(getInitModules);
-      }
+
     },
     saveDataAlls(val, sex, id,fstName,folderId,folderName) {
       dispatch(saveAdminTemplateDetail(val, sex, id,fstName,folderId,folderName))
@@ -116,7 +111,15 @@ function mapDispatchToProps(dispatch) {
     saveDataAll(val, sex, spell) {
       dispatch(saveTemplateDetail(val, sex, spell))
     },
+    hideAllSearch(){
+        dispatch({
+            type:'HIDE_ALL_SEARCH'
+        });
+    },
     diagShowTmp(bool) {
+      dispatch({
+          type:'HIDE_ALL_SEARCH'
+      });
       dispatch({
         type: DIAG_SHOW,
         data: bool

+ 8 - 2
src/store/actions/diagnosticSearch.js

@@ -1,11 +1,17 @@
-export const showSearch = (state,action) => {console.log(action)
+export const showSearch = (state,action) => {
     const res = Object.assign({}, state);
     res.show = true;
     res.showTcm = false;
     res.showSym = false;
     return res;
 }
-
+export const hideAllSearch = (state) => {
+    const res = Object.assign({}, state);
+    res.show = false;
+    res.showTcm = false;
+    res.showSym = false;
+    return res;
+}
 export const hideSearch = (state,action) => {
     const res = Object.assign({}, state);
     res.show = false;

+ 3 - 1
src/store/reducers/diagnosticSearch.js

@@ -1,5 +1,5 @@
 import { SHOW_SEARCH,  HIDE_SEARCH, SHOW_TCM_SEARCH,  HIDE_TCM_SEARCH, SET_SEARCH_VALUE, GET_SEARCH_RESULT,SHOWNODATATEXT } from '../types/diagnosticSearch';
-import { showSearch,  hideSearch,showTcmSearch,hideTcmSearch, setSearchValue, getSearchResult,showText,showSymSearch } from '../actions/diagnosticSearch';
+import { showSearch,hideAllSearch,  hideSearch,showTcmSearch,hideTcmSearch, setSearchValue, getSearchResult,showText,showSymSearch } from '../actions/diagnosticSearch';
 
 const initState = {
   show: false,
@@ -18,6 +18,8 @@ export default function (state=initState, action) {
             return hideSearch(state, action);
         case 'SHOW_SYM_SEARCH':
             return showSymSearch(state, action);
+        case 'HIDE_ALL_SEARCH':
+            return hideAllSearch(state);
         case SHOW_TCM_SEARCH:
             return showTcmSearch(state, action);
         case HIDE_TCM_SEARCH: