|
|
@ -8,17 +8,15 @@ import '../style.less' |
|
|
|
|
|
|
|
const ReserveItemsPeriodicStatistics = (props) => { |
|
|
|
const { dispatch, actions, isRequesting, reserveItemReport } = props; |
|
|
|
const [downloadUrl, setDownloadUrl] = useState(null); |
|
|
|
const [downloadKey, setDownloadKey] = useState(null); |
|
|
|
useEffect(() => { |
|
|
|
dispatch(actions.businessManagement.getReserveItemReport(RESERVEITEM_TYPE.periodicStatistics)); |
|
|
|
}, []); |
|
|
|
|
|
|
|
const exportReport = () => { |
|
|
|
RouteRequest.get(RouteTable.qnDownload).then(res => { |
|
|
|
debugger; |
|
|
|
console.log(res); |
|
|
|
// setDownloadUrl(`members/export?token=${user.token}&state=${typeChoose}&keywordTarget=${keywordTarget}&keyword=${keyword}&keys=overtimeStatistic,vacateStatistic`) |
|
|
|
}) |
|
|
|
|
|
|
|
const exportReport = (url) => { |
|
|
|
setDownloadUrl(`/_file-server${url}`); |
|
|
|
setDownloadKey(Math.random()); |
|
|
|
} |
|
|
|
|
|
|
|
const columns = [ |
|
|
@ -38,7 +36,7 @@ const ReserveItemsPeriodicStatistics = (props) => { |
|
|
|
{ |
|
|
|
title: '操作', |
|
|
|
dataIndex: 'action', |
|
|
|
render: (text, record, indexe) => (<Button theme='solid' type='secondary' onClick={() => exportReport()} > 导出</Button >) |
|
|
|
render: (text, record, indexe) => (<Button theme='solid' type='secondary' onClick={() => exportReport(record.path)} > 导出</Button >) |
|
|
|
}, |
|
|
|
]; |
|
|
|
|
|
|
@ -61,9 +59,9 @@ const ReserveItemsPeriodicStatistics = (props) => { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style={{ borderBottom: '1px solid #F2F3F5', marginLeft: '-20px', marginBottom: 16 }}></div> |
|
|
|
{/* { |
|
|
|
downloadUrl ? <iframe src={`/_api/${downloadUrl}`} style={{ display: 'none' }} /> : '' |
|
|
|
} */} |
|
|
|
{ |
|
|
|
downloadUrl ? <iframe key={downloadKey} src={downloadUrl} style={{ display: 'none' }} /> : '' |
|
|
|
} |
|
|
|
<div style={{ marginBottom: 22 }}> |
|
|
|
<Spin spinning={isRequesting}> |
|
|
|
<Table |
|
|
|