Inspect.js 1.9 KB

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