import React, { useEffect, useState } from 'react'; import { connect } from 'react-redux'; import '../style.less'; import { getDepMessage, getReportStatistic } from "../actions/infor" import TransporTationTable from '../components/transportationTable'; const superagent = require('superagent'); const transportation = (props) => { const { dispatch, user } = props const [data, setData] = useState() useEffect(() => { // dispatch(getDepMessage()) setData(props) }, []); //批量导出 const exports = (ids, grade, differentiate) => { //console.log(differentiate); let idas = ids.toString() if (differentiate == 'road') { window.open( '/_api/' + `data/export/?ids=${idas || ''}&exp=${differentiate}&roadLevel=${grade || ''}&token=${user.token}`) } if (differentiate == 'project') { window.open( '/_api/' + `data/export/?ids=${idas || ''}&exp=${differentiate}&token=${user.token}`) } } return ( <> ) } function mapStateToProps(state) { const { auth } = state return { user: auth.user, } } export default connect(mapStateToProps)(transportation);