InlineTag.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import React from 'react';
  2. import {connect} from 'react-redux';
  3. import {SETRADIO,CLEARSELECTED,CONFIRMSELECTED,SETOTHERINPUT} from '@types/otherHistory';
  4. import {SETMAININPUT} from '@types/mainSuit';
  5. import {SETCURRENTINPUT} from '@types/currentIll';
  6. import {SETCHECKINPUT} from "@types/checkBody";
  7. import InlineTag from "../common/components/InlineTag";
  8. import {getLabelIndex} from "@common/js/func";
  9. import {CLICKCOUNT} from '@types/homePage.js';
  10. function mapStateToProps(state){
  11. return {}
  12. }
  13. const tagInpActions = {
  14. 1:SETMAININPUT,
  15. 2:SETCURRENTINPUT,
  16. 3:SETOTHERINPUT,
  17. 4:SETCHECKINPUT
  18. };
  19. function mapDispatchToProps(dispatch,store){
  20. return {
  21. handleInput(params) {
  22. const type = params.ikey.substr(0,1); //当前所在的项目
  23. const {ikey,text,prefix,suffix} = params;
  24. const i = getLabelIndex(ikey);
  25. const inner = params.ikey.substr(-1);
  26. dispatch({
  27. type:tagInpActions[+type],
  28. i,
  29. text,
  30. prefix,
  31. suffix,
  32. subIndex:inner
  33. })
  34. },
  35. handledbClick(obj){
  36. dispatch({
  37. type:CLICKCOUNT,
  38. data:obj,
  39. clickType:'双击',
  40. num:1
  41. });
  42. }
  43. }
  44. }
  45. const InlineTagCont = connect(mapStateToProps,mapDispatchToProps)(InlineTag);
  46. export default InlineTagCont;