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.
46 lines
1.3 KiB
46 lines
1.3 KiB
import React, { useEffect, useState } from 'react';
|
|
import { connect } from 'react-redux';
|
|
import '../style.less';
|
|
import { getDepMessage, getReportStatistic } from "../actions/infor"
|
|
import InForTable from '../components/inforTable';
|
|
const superagent = require('superagent');
|
|
const infor = (props) => {
|
|
const { dispatch, user} = props
|
|
const [data, setData] = useState()
|
|
const [modalVisible, setModalVisible] = useState(false);
|
|
const [modalRecord, setModalRecord] = useState();
|
|
useEffect(() => {
|
|
// dispatch(getDepMessage())
|
|
|
|
setData(props)
|
|
}, []);
|
|
// //打开弹窗
|
|
// const openModal = (type, record) => {
|
|
// setModalVisible(true);
|
|
// // setModalType(type);
|
|
// if (type == 'edit') {
|
|
// setModalRecord(record);
|
|
// } else {
|
|
// setModalRecord(null);
|
|
// }
|
|
// }
|
|
//批量导出
|
|
const exports = (ids,counts) => {
|
|
console.log(counts);
|
|
let idas=ids.toString()
|
|
window.open(
|
|
'/_api/'+`data/export/?ids=${idas||''}&exp=${'overspeed'}&token=${user.token}`)
|
|
|
|
}
|
|
return (
|
|
<> <InForTable data={data} exports={exports} />
|
|
</>
|
|
)
|
|
}
|
|
function mapStateToProps(state) {
|
|
const {auth}=state
|
|
return {
|
|
user: auth.user,
|
|
}
|
|
}
|
|
export default connect(mapStateToProps)(infor);
|