DiagnosticList.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import React from 'react';
  2. import { connect } from 'react-redux';
  3. import DiagnosticList from '@components/DiagnosticList';
  4. import { ADD_DIAGNOSTIC, DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, GET_IS_FIRST } from '@store/types/diagnosticList';
  5. import { getTreatResult } from '@store/async-actions/treat';
  6. import { SHOW_TREAT } from '../store/types/treat';
  7. import {billing, getTips} from '../store/async-actions/pushMessage';
  8. function mapStateToProps(state) {
  9. return {
  10. list: state.diagnosticList.diagnosticList,
  11. treatment: state.treat.show,
  12. isFirst: state.diagnosticList.isFirst,
  13. diagnosticStr: state.diagnosticList.diagnosticStr
  14. }
  15. }
  16. function mapDispatchToProps(dispatch) {
  17. return {
  18. delDiagnostic: (item) => {
  19. dispatch({
  20. type: DEL_DIAGNOSTIC,
  21. item: item
  22. });
  23. dispatch({
  24. type: GET_DIAGNOSTIC_STR
  25. });
  26. },
  27. upDiagnostic: (index, id) => {
  28. dispatch({
  29. type: UP_DIAGNOSTIC,
  30. index: index
  31. });
  32. dispatch({
  33. type: GET_DIAGNOSTIC_STR
  34. });
  35. },
  36. downDiagnostic: (index, id) => {
  37. dispatch({
  38. type: DOWN_DIAGNOSTIC,
  39. index: index
  40. });
  41. dispatch({
  42. type: GET_DIAGNOSTIC_STR
  43. });
  44. },
  45. getSearchResult:() => {
  46. dispatch(getSearchResult)
  47. },
  48. showTreat: () => {
  49. dispatch({
  50. type: SHOW_TREAT,
  51. })
  52. },
  53. getTreatResult: (item) => {
  54. dispatch(getTreatResult(item))
  55. },
  56. getTips: (diagItem) => {
  57. dispatch(getTips(diagItem))
  58. },
  59. getBilling: () => {
  60. dispatch(billing())
  61. }
  62. }
  63. }
  64. const diagnosticListContainer = connect(
  65. mapStateToProps,
  66. mapDispatchToProps
  67. )(DiagnosticList)
  68. export default diagnosticListContainer;