DiagnosticList.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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 ,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 { showHistory,sortHistory,activeHistory,visibleHistory } from '@store/actions/historyTemplates'
  10. import {CURRENT_CHRONIC} from '@store/types/currentIll';
  11. import {autoFillModules} from '@store/async-actions/fetchModules';
  12. import { initItemList } from '@store/async-actions/historyTemplates';
  13. import {MODI_LOADING} from '@store/types/homePage.js';
  14. import {SET_ASSESS_DATA} from '@types/assessResult';
  15. function mapStateToProps(state) {
  16. const {diagnosticList,assessResult,pushMessage } = state;
  17. let diagnC = diagnosticList.chronicMagItem;
  18. return {
  19. list: diagnosticList.diagnosticList,
  20. treatment: state.treat.show,
  21. isFirst: diagnosticList.isFirst,
  22. diagnosticStr: diagnosticList.diagnosticStr,
  23. showReferRecord: diagnosticList.showReferRecord,
  24. showHistoryCase: diagnosticList.showHistoryCase,
  25. items:state.historyTemplates.items,
  26. chronicMagItem: diagnC?diagnC:state.mainSuit.chronicDesease,
  27. typeConfig: state.typeConfig.typeConfig,
  28. //wholeResults:assessResult.wholeResults,
  29. scaleInfo: pushMessage.scaleInfo,//量表内容
  30. showHide: pushMessage.showHide,
  31. loading: diagnosticList.loading,
  32. }
  33. }
  34. function mapDispatchToProps(dispatch) {
  35. return {
  36. setAssess(data,disName){ //获取评估内容数据
  37. dispatch({
  38. type:SET_ASSESS_DATA,
  39. data:data,
  40. name:disName
  41. });
  42. },
  43. delDiagnostic: (item) => {
  44. dispatch({
  45. type: DEL_DIAGNOSTIC,
  46. item: item
  47. });
  48. dispatch({
  49. type: GET_DIAGNOSTIC_STR
  50. });
  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. getSearchResult:() => {
  83. dispatch(getSearchResult)
  84. },
  85. showTreat: () => {
  86. dispatch({
  87. type: SHOW_TREAT,
  88. })
  89. },
  90. getTreatResult: (item) => {
  91. // dispatch({type:MODI_LOADING,flag:true});
  92. // dispatch({type:SHOW_LOADING,flag:true});
  93. dispatch(getTreatResult(item));
  94. },
  95. getTips: (item) => {
  96. dispatch(getConceptDetail(item))
  97. },
  98. getBilling: () => {
  99. dispatch(billing())
  100. },
  101. hideReferRecord: ()=>{
  102. dispatch({
  103. type: HIDE_REFER_RECORD
  104. })
  105. },
  106. showHistoryCaseModal: ()=> {
  107. dispatch({
  108. type: SHOW_HISTORY_CASE
  109. })
  110. },
  111. hideHistoryCaseModal: ()=> {
  112. dispatch({
  113. type: HIDE_HISTORY_CASE
  114. })
  115. },
  116. handleQuoteClick(data){
  117. dispatch(keepPushData(data,'his')) //历史病历引用
  118. // dispatch(activeHistory(idx))
  119. dispatch(visibleHistory(true))
  120. },
  121. autoFillModules(){
  122. dispatch(autoFillModules())//自动分发模板
  123. },
  124. }
  125. }
  126. const diagnosticListContainer = connect(
  127. mapStateToProps,
  128. mapDispatchToProps
  129. )(DiagnosticList)
  130. export default diagnosticListContainer;