You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
import React, { useEffect, useState } from 'react';
|
|
import { connect } from 'react-redux';
|
|
import '../style.less';
|
|
import { getDepMessage, getReportStatistic } from "../actions/infor"
|
|
import OperaTionalTable from '../components/operationalTable';
|
|
const superagent = require('superagent');
|
|
const operational = (props) => {
|
|
const { dispatch, user } = props
|
|
const [data, setData] = useState()
|
|
useEffect(() => {
|
|
// dispatch(getDepMessage())
|
|
|
|
setData(props)
|
|
}, []);
|
|
const exports = (ids,differentiate,genre) => {
|
|
let idas=ids.toString()
|
|
if(differentiate=='vehicle'){
|
|
window.open(
|
|
'/_api/'+`data/export/?ids=${idas||''}&exp=${differentiate}&municipalType=${genre}&token=${user.token}`)
|
|
}if(differentiate=='business'){
|
|
window.open(
|
|
'/_api/'+`data/export/?ids=${idas||''}&exp=${differentiate}&token=${user.token}`)
|
|
}
|
|
|
|
|
|
}
|
|
return (
|
|
<> <OperaTionalTable data={data} exports={exports} />
|
|
</>
|
|
)
|
|
}
|
|
function mapStateToProps(state) {
|
|
const { auth } = state
|
|
return {
|
|
user: auth.user,
|
|
}
|
|
}
|
|
export default connect(mapStateToProps)(operational);
|