12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- import React from "react";
- import {connect} from "react-redux";
- import Operation from "../components/Operation";
- import {
- SHOW_PRINT_PREVIEW,
- CLOSE_PRINT_PREVIEW,
- SHOW_PREVIEW,
- CLOSE_PREVIEW,
- DIAG_SHOW
- } from "../store/types/print";
- import {saveMessage,clearMessages} from "../store/async-actions/print";
- import {saveTemplateDetail} from '@store/async-actions/tabTemplate';
- import {saveClickNum,getInitModules} from '@store/async-actions/homePage';
- // function mapStateToProps({print}) {
- function mapStateToProps(state) {
- const {print,homePage} = state;
- return ({
- print,
- winWidth:homePage.windowWidth,
- chronicMagItem: state.diagnosticList.chronicMagItem,//慢病疾病
- chronicDesease:state.mainSuit.chronicDesease,//主诉存的慢病
- });
- }
- function mapDispatchToProps(dispatch) {
- return {
- showPrintPreview: () => {
- dispatch({
- type: SHOW_PRINT_PREVIEW
- });
- },
- closePrintPreview: () => {
- dispatch({
- type: CLOSE_PRINT_PREVIEW
- });
- },
- showPreview: () => {
- dispatch({
- type: SHOW_PREVIEW
- });
- },
- closePreview: () => {
- dispatch({
- type: CLOSE_PREVIEW
- });
- },
- save: () => {
- dispatch(saveClickNum);
- dispatch(() => saveMessage())
- },
- clear: (flag) => {
- clearMessages();
- // 清除时如果是慢病模板则重新获取模板
- if(flag){
- dispatch(getInitModules);
- }
- },
- saveDataAll(val,sex){
- dispatch(saveTemplateDetail(val,sex))
- },
- diagShowTmp(bool){
- dispatch({
- type: DIAG_SHOW,
- data:bool
- });
- }
- };
- }
- const OperationComtainer = connect(
- mapStateToProps,
- mapDispatchToProps
- )(Operation);
- export default OperationComtainer;
|