DiagnosticList.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. import React from 'react';
  2. import { connect } from 'react-redux';
  3. import DiagnosticList from '@components/DiagnosticList';
  4. import { DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE ,SHOW_LOADING} from '@store/types/diagnosticList';
  5. import { getTreatResult } from '@store/async-actions/treat';
  6. import { SHOW_TREAT, DEL_REACT, DEL_FOLLOW_UP } from '@store/types/treat.js';
  7. import {billing, getConceptDetail} from '../store/async-actions/pushMessage';
  8. import {keepPushData} from '@store/actions/tabTemplate';
  9. import { visibleHistory } from '@store/actions/historyTemplates'
  10. import {autoFillModules} from '@store/async-actions/fetchModules';
  11. import {SET_ASSESS_DATA} from '@types/assessResult';
  12. import {didPushParamChange} from '@utils/tools';
  13. function mapStateToProps(state) {
  14. const {diagnosticList,assessResult,pushMessage } = state;
  15. let diagnC = diagnosticList.chronicMagItem;
  16. return {
  17. list: diagnosticList.diagnosticList,
  18. treatment: state.treat.show,
  19. isFirst: diagnosticList.isFirst,
  20. diagnosticStr: diagnosticList.diagnosticStr,
  21. showReferRecord: diagnosticList.showReferRecord,
  22. showHistoryCase: diagnosticList.showHistoryCase,
  23. items:state.historyTemplates.items,
  24. chronicMagItem: diagnC?diagnC:state.mainSuit.chronicDesease,
  25. typeConfig: state.typeConfig.mode,
  26. //wholeResults:assessResult.wholeResults,
  27. scaleInfo: pushMessage.scaleInfo,//量表内容
  28. showHide: pushMessage.showHide,
  29. loading: diagnosticList.loading,
  30. windowWidth: state.homePage.windowWidth
  31. }
  32. }
  33. function mapDispatchToProps(dispatch) {
  34. return {
  35. setAssess(data,disName){ //获取评估内容数据
  36. dispatch({
  37. type:SET_ASSESS_DATA,
  38. data:data,
  39. name:disName
  40. });
  41. },
  42. delDiagnostic: (item) => {
  43. dispatch({
  44. type: DEL_DIAGNOSTIC,
  45. item: item
  46. });
  47. dispatch({
  48. type: GET_DIAGNOSTIC_STR
  49. });
  50. },
  51. delReact: (item) => {
  52. dispatch({
  53. type: DEL_REACT,
  54. item: item
  55. })
  56. },
  57. delFollowUp:(delItem) => {
  58. dispatch({
  59. type: DEL_FOLLOW_UP,
  60. delItem: delItem
  61. })
  62. },
  63. upDiagnostic: (index, id) => {
  64. dispatch({
  65. type: UP_DIAGNOSTIC,
  66. index: index
  67. });
  68. dispatch({
  69. type: GET_DIAGNOSTIC_STR
  70. });
  71. },
  72. downDiagnostic: (index, id) => {
  73. dispatch({
  74. type: DOWN_DIAGNOSTIC,
  75. index: index
  76. });
  77. dispatch({
  78. type: GET_DIAGNOSTIC_STR
  79. });
  80. },
  81. showTreat: () => {
  82. dispatch({
  83. type: SHOW_TREAT,
  84. })
  85. },
  86. getTreatResult: (item) => {
  87. // dispatch({type:MODI_LOADING,flag:true});
  88. // dispatch({type:SHOW_LOADING,flag:true});
  89. dispatch(getTreatResult(item));
  90. },
  91. getTips: (item,noTips,noDetails,noNotify) => {
  92. dispatch(getConceptDetail(item,noTips,noDetails,noNotify))
  93. },
  94. getBilling: () => {
  95. if (didPushParamChange()) {
  96. dispatch(billing())
  97. }
  98. },
  99. hideReferRecord: ()=>{
  100. dispatch({
  101. type: HIDE_REFER_RECORD
  102. })
  103. },
  104. showHistoryCaseModal: ()=> {
  105. dispatch({
  106. type: SHOW_HISTORY_CASE
  107. })
  108. },
  109. hideHistoryCaseModal: ()=> {
  110. dispatch({
  111. type: HIDE_HISTORY_CASE
  112. })
  113. },
  114. handleQuoteClick(data){
  115. dispatch(keepPushData(data,'his')) //历史病历引用
  116. // dispatch(activeHistory(idx))
  117. dispatch(visibleHistory(true))
  118. },
  119. autoFillModules(){
  120. dispatch(autoFillModules())//自动分发模板
  121. },
  122. }
  123. }
  124. const diagnosticListContainer = connect(
  125. mapStateToProps,
  126. mapDispatchToProps
  127. )(DiagnosticList)
  128. export default diagnosticListContainer;