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.
43 lines
1.3 KiB
43 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 EnforceTable from '../components/enforceTable';
|
|
import PromoTionalTable from '../components/promotionalTable';
|
|
const superagent = require('superagent');
|
|
const promotional = (props) => {
|
|
const { dispatch, user } = props
|
|
const [data, setData] = useState()
|
|
useEffect(() => {
|
|
// dispatch(getDepMessage())
|
|
|
|
setData(props)
|
|
}, []);
|
|
// //批量导出
|
|
// const exports = (ids, counts) => {
|
|
// // console.log(user);
|
|
// let reportIds = [];
|
|
// if (ids.length)
|
|
// reportIds = ids
|
|
// else
|
|
// reportIds = (counts || {}).ids || [];
|
|
// superagent.post('/_report/http')
|
|
// .send({ id: reportIds.map(i => Number(i)) }).end((err, res) => {
|
|
// const resTextIs = res.text.split('/').pop()
|
|
// window.open(
|
|
// '/_api/' +
|
|
// `attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`)
|
|
// })
|
|
// }
|
|
return (
|
|
<> <PromoTionalTable data={data} />
|
|
</>
|
|
)
|
|
}
|
|
function mapStateToProps(state) {
|
|
const { auth } = state
|
|
return {
|
|
user: auth.user,
|
|
}
|
|
}
|
|
export default connect(mapStateToProps)(promotional);
|