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 { downloadFile } from "../../components/factory"
|
||||
import { Progress, Button } from 'antd'
|
||||
import { downloadFile } from '../../components/factory'
|
||||
|
||||
export const ReportCreationNotify = ({progressData}) => {
|
||||
progressData = progressData ?? {progress: 0.0, operation: 'Создание отчета'}
|
||||
|
||||
let downloadButton = null
|
||||
if (progressData.file)
|
||||
downloadButton = <Button
|
||||
type="link"
|
||||
onClick={_ => {downloadFile(progressData.file)}}
|
||||
download={progressData.file.name}>
|
||||
export const ReportCreationNotify = ({ progressData }) => (
|
||||
<>
|
||||
<Progress percent={ Number(progressData.progress?.toFixed(2)) } />
|
||||
<br/>
|
||||
<span>{progressData.operation} стр {progressData.currentPage} из {progressData.totalPages}</span>
|
||||
{progressData.file && (
|
||||
<Button
|
||||
type={'link'}
|
||||
onClick={() => {downloadFile(progressData.file)}}
|
||||
download={progressData.file.name}
|
||||
>
|
||||
{progressData.file.name}
|
||||
</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