Inspect.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import React from 'react';
  2. import {connect} from 'react-redux';
  3. import Inspect from '@components/Inspect';
  4. import {getSearchList,getSublableList,getInstroduce } from '@store/async-actions/inspect';
  5. import {setLabel,fillActived,fillActiveDetail,checkValueIsChange,delExcelLis,clearLabel,delPartItem} from '@store/actions/inspect';
  6. import {billing} from '@store/async-actions/pushMessage';
  7. function mapStateToProps(state) {//console.log(state)
  8. return {
  9. list:state.inspect.list,
  10. labelList:state.inspect.labelList,
  11. fillActive:state.inspect.fillActive,
  12. getExcelDataList:state.inspect.getExcelDataList,
  13. labelListActive:state.inspect.labelListActive,
  14. inspectList:state.homePage.inspectList,
  15. inspectVal:state.inspect.inspectVal
  16. }
  17. }
  18. function mapDispatchToProps(dispatch, store) {
  19. return {
  20. handleChangeValue(val){
  21. dispatch(getSearchList(val))
  22. },
  23. getInfomation(id,name,type){
  24. dispatch(getInstroduce(id,name,type))
  25. },
  26. handleSign(id,idx,type){
  27. dispatch(setLabel(idx,type))
  28. dispatch(getSublableList(id))
  29. },
  30. handleLabelSub(e,id,idx){
  31. dispatch(fillActived(id,idx))
  32. // e.stopPropagation()
  33. },
  34. handleClear(e,idx){
  35. e.stopPropagation();
  36. dispatch(clearLabel(idx))
  37. },
  38. handleConfirm(e,idx,time,arr){
  39. e.stopPropagation();
  40. dispatch(checkValueIsChange(idx,time,arr))
  41. },
  42. changeActivePart(idx,value){
  43. dispatch(fillActiveDetail(idx,value))
  44. },
  45. handleCloseExcel(idx){
  46. dispatch(delExcelLis(idx));
  47. },
  48. delPartItem(idx){
  49. dispatch(delPartItem(idx))
  50. },
  51. //右侧推送
  52. fetchPushInfos(){
  53. //调右侧推送
  54. dispatch(billing());
  55. }
  56. }
  57. }
  58. const InspectAction = connect(mapStateToProps, mapDispatchToProps)(Inspect);
  59. export default InspectAction;