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.
41 lines
1.0 KiB
41 lines
1.0 KiB
import React, { useEffect, useState } from 'react';
|
|
import { connect } from 'react-redux';
|
|
import '../style.less';
|
|
import { getDepMessage, getReportStatistic } from "../actions/infor"
|
|
import MaintenanceTable from '../components/maintenanceTable';
|
|
import { getUserList } from '../actions/patrol';
|
|
const superagent = require('superagent');
|
|
|
|
const Maintenance = (props) => {
|
|
const { dispatch, user } = props
|
|
const [data, setData] = useState()
|
|
useEffect(() => {
|
|
// dispatch(getDepMessage())
|
|
|
|
setData(props)
|
|
}, []);
|
|
|
|
useEffect(() => {
|
|
dispatch(getUserList())
|
|
}, [true])
|
|
|
|
//批量导出
|
|
const exports = (ids, counts) => {
|
|
// console.log(user);
|
|
let reportIds = ids.toString();
|
|
window.open(
|
|
'/_api/' +
|
|
`data/export?exp=maintenance&ids=${reportIds}&token=${user.token}`)
|
|
}
|
|
return (
|
|
<> <MaintenanceTable data={data} exports={exports} />
|
|
</>
|
|
)
|
|
}
|
|
function mapStateToProps(state) {
|
|
const { auth } = state
|
|
return {
|
|
user: auth.user,
|
|
}
|
|
}
|
|
export default connect(mapStateToProps)(Maintenance);
|