DiagnosticList.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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,ADDDIAGMSG,EDITDIAGMSG} from '@store/types/diagnosticList';
  5. import {SHOW_TIPS_DETAILS,HIDE_TIPS_DETAILS} from '@store/types/pushMessage';
  6. import { getTreatResult } from '@store/async-actions/treat';
  7. import { SHOW_TREAT, DEL_REACT, DEL_FOLLOW_UP } from '@store/types/treat.js';
  8. import {embedPush, getAllConceptDetail, getConceptDetail, getMRAnalyse} from '../store/async-actions/pushMessage';
  9. import {keepPushData} from '@store/actions/tabTemplate';
  10. import { visibleHistory } from '@store/actions/historyTemplates'
  11. import {autoFillModules} from '@store/async-actions/fetchModules';
  12. import {SET_ASSESS_DATA} from '@types/assessResult';
  13. import {didPushParamChange} from '@utils/tools';
  14. function mapStateToProps(state) {//console.log(state)
  15. const {diagnosticList,assessResult,pushMessage } = state;
  16. let diagnC = diagnosticList.chronicMagItem;
  17. return {
  18. pushMessage: pushMessage,
  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.mode,
  28. //wholeResults:assessResult.wholeResults,
  29. scaleInfo: pushMessage.scaleInfo,//量表内容
  30. showHide: pushMessage.showHide,
  31. loading: diagnosticList.loading&&!state.copyRight.loading,
  32. windowWidth: state.homePage.windowWidth
  33. }
  34. }
  35. function mapDispatchToProps(dispatch) {
  36. return {
  37. editDiagName(idx,name){ //获取评估内容数据
  38. dispatch({
  39. type:EDITDIAGMSG,
  40. idx:idx,
  41. name:name
  42. });
  43. },
  44. setAssess(data,disName){ //获取评估内容数据
  45. dispatch({
  46. type:SET_ASSESS_DATA,
  47. data:data,
  48. name:disName
  49. });
  50. },
  51. delDiagnostic: (item,idx) => {
  52. dispatch({
  53. type: DEL_DIAGNOSTIC,
  54. item: item,
  55. idx:idx
  56. });
  57. dispatch({
  58. type: GET_DIAGNOSTIC_STR
  59. });
  60. dispatch(getMRAnalyse())
  61. },
  62. delReact: (item) => {
  63. dispatch({
  64. type: DEL_REACT,
  65. item: item
  66. })
  67. },
  68. delFollowUp:(delItem) => {
  69. dispatch({
  70. type: DEL_FOLLOW_UP,
  71. delItem: delItem
  72. })
  73. },
  74. upDiagnostic: (index, id) => {
  75. dispatch({
  76. type: UP_DIAGNOSTIC,
  77. index: index
  78. });
  79. dispatch({
  80. type: GET_DIAGNOSTIC_STR
  81. });
  82. },
  83. downDiagnostic: (index, id) => {
  84. dispatch({
  85. type: DOWN_DIAGNOSTIC,
  86. index: index
  87. });
  88. dispatch({
  89. type: GET_DIAGNOSTIC_STR
  90. });
  91. },
  92. showTreat: () => {
  93. dispatch({
  94. type: SHOW_TREAT,
  95. })
  96. },
  97. getTreatResult: (item,idx) => {
  98. dispatch({
  99. type:ADDDIAGMSG,
  100. item:item,
  101. idx:idx
  102. });
  103. },
  104. getTips: (item) => {
  105. dispatch(getAllConceptDetail(item))
  106. },
  107. showTipsDetailsModal: () => {
  108. dispatch({
  109. type: SHOW_TIPS_DETAILS
  110. })
  111. },
  112. hideTipsDetailsModal: () => {
  113. dispatch({
  114. type: HIDE_TIPS_DETAILS
  115. })
  116. },
  117. getBilling: (obj) => {
  118. if (didPushParamChange()) {
  119. obj.action ='diag'
  120. dispatch(embedPush(obj))
  121. }
  122. },
  123. hideReferRecord: ()=>{
  124. dispatch({
  125. type: HIDE_REFER_RECORD
  126. })
  127. },
  128. showHistoryCaseModal: ()=> {
  129. dispatch({
  130. type: SHOW_HISTORY_CASE
  131. })
  132. },
  133. hideHistoryCaseModal: ()=> {
  134. dispatch({
  135. type: HIDE_HISTORY_CASE
  136. })
  137. },
  138. handleQuoteClick(data){
  139. dispatch(keepPushData(data,'his')) //历史病历引用
  140. // dispatch(activeHistory(idx))
  141. dispatch(visibleHistory(true))
  142. },
  143. autoFillModules(){
  144. dispatch(autoFillModules())//自动分发模板
  145. },
  146. }
  147. }
  148. const diagnosticListContainer = connect(
  149. mapStateToProps,
  150. mapDispatchToProps
  151. )(DiagnosticList)
  152. export default diagnosticListContainer;