Inspect.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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) {
  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. }
  16. }
  17. function mapDispatchToProps(dispatch, store) {
  18. return {
  19. handleChangeValue(val){
  20. dispatch(getSearchList(val))
  21. },
  22. getInfomation(id,name,type){
  23. dispatch(getInstroduce(id,name,type))
  24. },
  25. handleSign(id,idx,type){
  26. dispatch(setLabel(idx,type))
  27. dispatch(getSublableList(id))
  28. },
  29. handleLabelSub(e,id,idx){
  30. dispatch(fillActived(id,idx))
  31. // e.stopPropagation()
  32. },
  33. handleClear(e,idx){
  34. e.stopPropagation();
  35. dispatch(clearLabel(idx))
  36. },
  37. handleConfirm(e,idx,time,arr){
  38. e.stopPropagation();
  39. dispatch(checkValueIsChange(idx,time,arr))
  40. },
  41. changeActivePart(idx,value){
  42. dispatch(fillActiveDetail(idx,value))
  43. },
  44. handleCloseExcel(idx){
  45. dispatch(delExcelLis(idx));
  46. },
  47. delPartItem(idx){
  48. dispatch(delPartItem(idx))
  49. },
  50. //右侧推送
  51. fetchPushInfos(){
  52. //调右侧推送
  53. dispatch(billing());
  54. }
  55. }
  56. }
  57. const InspectAction = connect(mapStateToProps, mapDispatchToProps)(Inspect);
  58. export default InspectAction;