HistoryCases.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import React from 'react';
  2. import { connect } from 'react-redux';
  3. import HistoryCaseContainer from '@components/HistoryCaseContainer';
  4. import { showHistory,sortHistory,activeHistory,visibleHistory } 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
  14. }
  15. }
  16. function mapDispatchToProps(dispatch) {
  17. return {
  18. showHistoryBox(){
  19. dragBox('hisWrapMove','closeHis','del')
  20. dispatch(showHistory(false))
  21. },
  22. handleCaseClick(e,val){
  23. e.stopPropagation();
  24. dispatch(activeHistory(val))
  25. },
  26. handleQuoteClick(e,data,idx){
  27. // e.stopPropagation();
  28. dispatch(keepPushData(data,'his')) //历史病历引用
  29. dispatch(activeHistory(idx))
  30. dispatch(visibleHistory(true))
  31. },
  32. handleSortClick(){
  33. dispatch(sortHistory())
  34. }
  35. }
  36. }
  37. const HistoryCases = connect(
  38. mapStateToProps,
  39. mapDispatchToProps
  40. )(HistoryCaseContainer);
  41. export default HistoryCases;