forked from ddrilling/asb_cloud_front
Сообщение о формировании отчёта исправлено
This commit is contained in:
parent
a6f52e6aab
commit
1a832694b4
@ -1,25 +1,29 @@
|
|||||||
import { Progress, Button } from "antd"
|
import { Progress, Button } from 'antd'
|
||||||
import { downloadFile } from "../../components/factory"
|
import { downloadFile } from '../../components/factory'
|
||||||
|
|
||||||
export const ReportCreationNotify = ({progressData}) => {
|
export const ReportCreationNotify = ({ progressData }) => (
|
||||||
progressData = progressData ?? {progress: 0.0, operation: 'Создание отчета'}
|
<>
|
||||||
|
<Progress percent={ Number(progressData.progress?.toFixed(2)) } />
|
||||||
let downloadButton = null
|
<br/>
|
||||||
if (progressData.file)
|
<span>{progressData.operation} стр {progressData.currentPage} из {progressData.totalPages}</span>
|
||||||
downloadButton = <Button
|
{progressData.file && (
|
||||||
type="link"
|
<Button
|
||||||
onClick={_ => {downloadFile(progressData.file)}}
|
type={'link'}
|
||||||
download={progressData.file.name}>
|
onClick={() => {downloadFile(progressData.file)}}
|
||||||
|
download={progressData.file.name}
|
||||||
|
>
|
||||||
{progressData.file.name}
|
{progressData.file.name}
|
||||||
</Button>
|
</Button>
|
||||||
|
)}
|
||||||
const progressText = `${progressData.operation} стр ${progressData.currentPage} из ${progressData.totalPages}`
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Progress percent={ progressData.progress } />
|
|
||||||
<br/>
|
|
||||||
<span>{progressText}</span>
|
|
||||||
{downloadButton}
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ReportCreationNotify.defaultProps = {
|
||||||
|
progressData: {
|
||||||
|
progress: 0.0,
|
||||||
|
operation: 'Создание отчета',
|
||||||
|
currentPage: 0,
|
||||||
|
totalPages: 0,
|
||||||
|
file: null
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user