import React from 'react'; import {connect} from 'react-redux'; import {SETRADIO,CLEARSELECTED,CONFIRMSELECTED,SETOTHERINPUT} from '@types/otherHistory'; import {SETMAININPUT} from '@types/mainSuit'; import {SETCURRENTINPUT,CURRENT_TEXT_LABEL} from '@types/currentIll'; import {SETCHECKINPUT} from "@types/checkBody"; import InlineTag from "../common/components/InlineTag"; import {getLabelIndex} from '@utils/tools.js'; import {SET_SELECTED_AREA} from '@types/homePage'; function mapStateToProps(state){ return { mainSaveText:state.mainSuit.saveText, select_start:state.homePage.select_start, } } const tagInpActions = { 1:SETMAININPUT, 2:SETCURRENTINPUT, 3:SETOTHERINPUT, 4:SETCHECKINPUT }; function mapDispatchToProps(dispatch,store){ return { handleInput(params) { const type = params.ikey.substr(0,1); //当前所在的项目 const {ikey,text,prefix,suffix} = params; const i = getLabelIndex(ikey); const inner = params.ikey.split("-")[2]; dispatch({ type:tagInpActions[+type], i, text, prefix, suffix, subIndex:inner }) }, setSelectArea(data){ dispatch({ type:SET_SELECTED_AREA, data }) } } } const InlineTagCont = connect(mapStateToProps,mapDispatchToProps)(InlineTag); export default InlineTagCont;