Inspect.js 1.8 KB

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