PreInIcss.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import {connect} from 'react-redux';
  2. import PreInIcss from '@components/PreInIcss';
  3. import {getPreMsg} from '@store/async-actions/preIcss';
  4. import { GET_PREC_LIST,SET_PREC_SHOW,SET_MOVE } from "@store/types/preIcss";
  5. import {SETPRE,SETPREDATA} from "@store/types/homePage";
  6. const mapStateToProps = function(state){//console.log(state)
  7. return {
  8. data:state.preIcss.preData,
  9. show:state.preIcss.preShow,
  10. windowHeight:state.homePage.windowHeight,
  11. isMove:state.preIcss.isMove
  12. }
  13. }
  14. const mapDispatchToProps = function(dispatch){
  15. return {
  16. setMove(flg){
  17. dispatch({type:SET_MOVE,isMove:flg})
  18. },
  19. showPreModal(){
  20. dispatch({type:SET_PREC_SHOW})
  21. },
  22. showPre(item){
  23. let preIcss = {},detail = item.detail
  24. if(detail){
  25. preIcss = {
  26. chief:detail.chiefComplaint?new Array(detail.chiefComplaint):[],
  27. current:detail.xbs?new Array(detail.xbs):[],
  28. other:detail.qts?new Array(detail.qts):[],
  29. checkBody:detail.supplement?detail.supplement:''
  30. }
  31. }
  32. dispatch({type:SETPREDATA,preData:preIcss,item:item});
  33. dispatch({type:SETPRE,show:true});
  34. },
  35. setPreData(){
  36. getPreMsg()
  37. }
  38. }
  39. }
  40. export default connect(mapStateToProps,mapDispatchToProps)(PreInIcss);