DiagnosticList.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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,getMRAnalyse} 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&&!state.copyRight.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. dispatch(getMRAnalyse())
  51. },
  52. delReact: (item) => {
  53. dispatch({
  54. type: DEL_REACT,
  55. item: item
  56. })
  57. },
  58. delFollowUp:(delItem) => {
  59. dispatch({
  60. type: DEL_FOLLOW_UP,
  61. delItem: delItem
  62. })
  63. },
  64. upDiagnostic: (index, id) => {
  65. dispatch({
  66. type: UP_DIAGNOSTIC,
  67. index: index
  68. });
  69. dispatch({
  70. type: GET_DIAGNOSTIC_STR
  71. });
  72. },
  73. downDiagnostic: (index, id) => {
  74. dispatch({
  75. type: DOWN_DIAGNOSTIC,
  76. index: index
  77. });
  78. dispatch({
  79. type: GET_DIAGNOSTIC_STR
  80. });
  81. },
  82. showTreat: () => {
  83. dispatch({
  84. type: SHOW_TREAT,
  85. })
  86. },
  87. getTreatResult: (item) => {
  88. // dispatch({type:MODI_LOADING,flag:true});
  89. // dispatch({type:SHOW_LOADING,flag:true});
  90. dispatch(getTreatResult(item));
  91. },
  92. getTips: (item,noTips,noDetails,noNotify) => {
  93. dispatch(getConceptDetail(item,noTips,noDetails,noNotify))
  94. },
  95. getBilling: () => {
  96. if (didPushParamChange()) {
  97. dispatch(billing())
  98. }
  99. },
  100. hideReferRecord: ()=>{
  101. dispatch({
  102. type: HIDE_REFER_RECORD
  103. })
  104. },
  105. showHistoryCaseModal: ()=> {
  106. dispatch({
  107. type: SHOW_HISTORY_CASE
  108. })
  109. },
  110. hideHistoryCaseModal: ()=> {
  111. dispatch({
  112. type: HIDE_HISTORY_CASE
  113. })
  114. },
  115. handleQuoteClick(data){
  116. dispatch(keepPushData(data,'his')) //历史病历引用
  117. // dispatch(activeHistory(idx))
  118. dispatch(visibleHistory(true))
  119. },
  120. autoFillModules(){
  121. dispatch(autoFillModules())//自动分发模板
  122. },
  123. }
  124. }
  125. const diagnosticListContainer = connect(
  126. mapStateToProps,
  127. mapDispatchToProps
  128. )(DiagnosticList)
  129. export default diagnosticListContainer;