|
@@ -2,15 +2,30 @@ import React from "react";
|
|
|
import { connect } from "react-redux";
|
|
|
import Banner from "../components/Banner";
|
|
|
import { SHOW_CONFIG_MODAL, CLOSE_CONFIG_MODAL, CHANGE_TYPE, CONFIRM_TYPE } from "../store/types/typeConfig";
|
|
|
-
|
|
|
-import {saveMode} from '@store/async-actions/fetchModules';
|
|
|
+import {pushAllDataList} from '@utils/tools';
|
|
|
+import {saveMode,getOtherHisRecord} from '@store/async-actions/fetchModules';
|
|
|
import config from "@config/index";
|
|
|
+import { allCheckedShow } from '@store/actions/tabTemplate';
|
|
|
import {Notify} from '@commonComp';
|
|
|
|
|
|
+//判断模块是否有数据
|
|
|
+function ifHasData(data,saveText){
|
|
|
+ if(saveText[0]||data.length>1||(data.length===1&&(data[0].value||(data[0].value!==''&&data[0].name)))){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
function mapStateToProps(state) {
|
|
|
+ const main = state.mainSuit;
|
|
|
+ const current = state.currentIll;
|
|
|
+ const other = state.otherHistory;
|
|
|
return {
|
|
|
typeConfig:state.typeConfig.typeConfig||config.defaultValue.mode,
|
|
|
- visible:state.typeConfig.visible
|
|
|
+ visible:state.typeConfig.visible,
|
|
|
+ hasMain:ifHasData(main.data,main.saveText),
|
|
|
+ hasCurrent:ifHasData(current.data,current.saveText),
|
|
|
+ hasOther:ifHasData(other.data,other.saveText),
|
|
|
};
|
|
|
}
|
|
|
|
|
@@ -29,9 +44,11 @@ function mapDispatchToProps(dispatch) {
|
|
|
//保存模式切换结果
|
|
|
dispatch(saveMode(confirmType)).then((res)=>{
|
|
|
if(res.data.code=='0'&&res.data.data){
|
|
|
- //切换后只会影响下一个点的模块(主诉、现病史、其他史)是否有模板
|
|
|
+ //清空所有数据
|
|
|
+ pushAllDataList('','clear');
|
|
|
dispatch({type: CONFIRM_TYPE, confirmType});
|
|
|
- Notify.success("模式切换成功");
|
|
|
+ Notify.success("修改成功");
|
|
|
+ dispatch(allCheckedShow(false)) //全选反选显示重置
|
|
|
}else{
|
|
|
Notify.error(res.data.msg+",请稍后再试");
|
|
|
}
|