import React from 'react';
import {
    connect
} from 'react-redux';
import WrapModalBodyPac from '@components/WrapModalBodyPac';
import { allCheckImports,selectOneChecks,showInIcsss } from '@store/actions/wrapModalBodyPac';
import {getImportLists,getSonDetailList} from '@store/async-actions/wrapModalBodyPac';

function mapStateToProps(state) {
    return {
        message: state.patInfo.message,
        hospitalPac: state.wrapModalBodyPac.hospitalPac,
        hospitalSonInspect: state.wrapModalBodyPac.hospitalPacObj,
        selectGroupList: state.wrapModalBodyPac.selectGroupList,
        allCheck: state.wrapModalBodyPac.allCheck,
        msgObj: state.wrapModalBodyPac.msgObj,
        checkedList: state.wrapModalBodyPac.checkedList,
    }
}

function mapDispatchToProps(dispatch, store) {
    return {
        showInIcss(){
          dispatch(showInIcsss())
        },
        selectOneCheck(name,checkItem,item,idx){
          dispatch(selectOneChecks(name,checkItem,item,idx))
        },
        allCheckImport() {
          dispatch(allCheckImports())
        },
        handleSearchs(data) {
          dispatch(getImportLists(data))
        },
        handleGetSonList(name,time) {
          dispatch(getSonDetailList(name,time))
        }
    }
}

const WrapModalBodyPacAction = connect(mapStateToProps, mapDispatchToProps)(WrapModalBodyPac);

export default WrapModalBodyPacAction;