PushItemsContainer.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import React from 'react';
  2. import {connect} from 'react-redux';
  3. import PushItems from '../components/PushItems'
  4. import {CHANGE_ASSAY, CHANGE_CHECK, ADD_BILLING, SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS} from '@store/types/pushMessage';
  5. import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR } from '@store/types/diagnosticList';
  6. import {billing, getTips, getTipsDetails} from '../store/async-actions/pushMessage';
  7. import { isAddMainSuit } from '@store/async-actions/diagnosticList';
  8. function mapStateToProps(state) {
  9. return {
  10. pushMessage: state.pushMessage,
  11. tipsDiscalimer: state.copyRight.disContent
  12. }
  13. }
  14. function mapDispatchToProps(dispatch) {
  15. return {
  16. changeAssay: (item) => {
  17. dispatch({type: CHANGE_ASSAY, item})
  18. },
  19. changeCheck: (item) => {
  20. dispatch({type: CHANGE_CHECK, item})
  21. },
  22. addDiagnostic: (item) => {
  23. dispatch({
  24. type: ADD_DIAGNOSTIC,
  25. item: item
  26. });
  27. dispatch({
  28. type: GET_DIAGNOSTIC_STR
  29. });
  30. dispatch(isAddMainSuit())
  31. dispatch(billing());
  32. },
  33. billing: (checkedAssay, checkedCheck) => {
  34. // dispatch(billing)
  35. dispatch({
  36. type: ADD_BILLING, //添加开单项
  37. assay: checkedAssay,
  38. check: checkedCheck,
  39. })
  40. },
  41. getTips: (diagItem) => {
  42. dispatch(getTips(diagItem))
  43. },
  44. getTipsDetails: () => {
  45. dispatch(getTipsDetails())
  46. },
  47. showTipsDetailsModal: () => {
  48. dispatch({
  49. type: SHOW_TIPS_DETAILS
  50. })
  51. },
  52. hideTipsDetailsModal: () => {
  53. dispatch({
  54. type: HIDE_TIPS_DETAILS
  55. })
  56. }
  57. }
  58. }
  59. const PushItemsComtainer = connect(
  60. mapStateToProps,
  61. mapDispatchToProps
  62. )(PushItems);
  63. export default PushItemsComtainer;