DiagnosticList.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE } 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. showReferRecord: state.diagnosticList.showReferRecord,
  15. showHistoryCase: state.diagnosticList.showHistoryCase,
  16. }
  17. }
  18. function mapDispatchToProps(dispatch) {
  19. return {
  20. delDiagnostic: (item) => {
  21. dispatch({
  22. type: DEL_DIAGNOSTIC,
  23. item: item
  24. });
  25. dispatch({
  26. type: GET_DIAGNOSTIC_STR
  27. });
  28. },
  29. upDiagnostic: (index, id) => {
  30. dispatch({
  31. type: UP_DIAGNOSTIC,
  32. index: index
  33. });
  34. dispatch({
  35. type: GET_DIAGNOSTIC_STR
  36. });
  37. },
  38. downDiagnostic: (index, id) => {
  39. dispatch({
  40. type: DOWN_DIAGNOSTIC,
  41. index: index
  42. });
  43. dispatch({
  44. type: GET_DIAGNOSTIC_STR
  45. });
  46. },
  47. getSearchResult:() => {
  48. dispatch(getSearchResult)
  49. },
  50. showTreat: () => {
  51. dispatch({
  52. type: SHOW_TREAT,
  53. })
  54. },
  55. getTreatResult: (item) => {
  56. dispatch(getTreatResult(item))
  57. },
  58. getTips: (diagItem) => {
  59. dispatch(getTips(diagItem))
  60. },
  61. getBilling: () => {
  62. dispatch(billing())
  63. },
  64. hideReferRecord: ()=>{
  65. dispatch({
  66. type: HIDE_REFER_RECORD
  67. })
  68. },
  69. showHistoryCaseModal: ()=> {
  70. dispatch({
  71. type: SHOW_HISTORY_CASE
  72. })
  73. },
  74. hideHistoryCaseModal: ()=> {
  75. dispatch({
  76. type: HIDE_HISTORY_CASE
  77. })
  78. }
  79. }
  80. }
  81. const diagnosticListContainer = connect(
  82. mapStateToProps,
  83. mapDispatchToProps
  84. )(DiagnosticList)
  85. export default diagnosticListContainer;