HistoryCases.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import React from 'react';
  2. import { connect } from 'react-redux';
  3. import HistoryCaseContainer from '@components/HistoryCaseContainer';
  4. import { showHistory,sortHistory,activeHistory,visibleHistory,saveHistoryId } from '@store/actions/historyTemplates'
  5. import {keepPushData} from '@store/actions/tabTemplate';
  6. import { dragBox } from '@utils/drag';
  7. function mapStateToProps(state) {
  8. return {
  9. showHistoryCases:state.historyTemplates.showHistoryCases,
  10. activeHistory:state.historyTemplates.activeHistory,
  11. items:state.historyTemplates.items,
  12. visible:state.historyTemplates.visible,
  13. // preInfo: { ...state.patInfo.message, hispitalName: state.historyTemplates.HospitalInfo.name},
  14. preInfo: { hispitalName: state.historyTemplates.HospitalInfo.name}
  15. }
  16. }
  17. function mapDispatchToProps(dispatch) {
  18. return {
  19. showHistoryBox(){
  20. dragBox('hisWrapMove','closeHis','del')
  21. dispatch(showHistory(false))
  22. // 取消历史模态框后,页面设置为可滚动
  23. document.body.style.overflow = 'auto';
  24. },
  25. handleCaseClick(e,val){
  26. e.stopPropagation();
  27. dispatch(activeHistory(val))
  28. },
  29. handleQuoteClick(data,idx){
  30. // e.stopPropagation();
  31. dispatch(keepPushData(data,'his')) //历史病历引用
  32. dispatch(activeHistory(idx))
  33. dispatch(visibleHistory(true))
  34. dispatch(saveHistoryId(data.id));
  35. },
  36. handleSortClick(){
  37. dispatch(sortHistory())
  38. }
  39. }
  40. }
  41. const HistoryCases = connect(
  42. mapStateToProps,
  43. mapDispatchToProps
  44. )(HistoryCaseContainer);
  45. export default HistoryCases;