import React, { useState, useEffect } from 'react'; import { connect } from 'umi'; import { Card, Button } from 'antd'; import FormModal from '@/components/FormModal'; import CardList from '@/components/CardList'; const HCZJ = (props) => { const { id, sysToken, fetchHCZJtable, fetchAddHCZJ, fetchEditHCZJ, fetchDeleteHCZJ, onlyRead, } = props; const [visible, setVisible] = useState(false); const [dataList, setDataList] = useState([]); const getTable = () => { fetchHCZJtable({ pfId: id, sysToken }).then((res) => { if (res) { setDataList(res); } }); }; useEffect(() => { getTable(); }, []); const handleOpenModal = () => { setVisible(true); }; const handleCloseModal = () => { setVisible(false); }; return ( { !onlyRead &&
}
{visible && ( )}
); }; const mapStateToProps = ({ doing }) => ({ ...doing, }); const mapDispatchToProps = (dispatch) => ({ fetchHCZJtable(params) { return dispatch({ type: 'doing/fetchHCZJtable', payload: { ...params } }); }, fetchAddHCZJ(params) { return dispatch({ type: 'doing/fetchAddHCZJ', payload: { ...params } }); }, fetchEditHCZJ(params) { return dispatch({ type: 'doing/fetchEditHCZJ', payload: { ...params } }); }, fetchDeleteHCZJ(params) { return dispatch({ type: 'doing/fetchDeleteHCZJ', payload: { ...params } }); }, }); export default connect(mapStateToProps, mapDispatchToProps)(HCZJ);