forked from ddrilling/asb_cloud_front
Убрана информация об id скважины
This commit is contained in:
parent
53a1d33a55
commit
5dd1fc8258
@ -5,17 +5,16 @@ import { Button, Result, Typography } from 'antd'
|
|||||||
|
|
||||||
import { downloadFile, invokeWebApiWrapperAsync } from '@components/factory'
|
import { downloadFile, invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
import { wrapPrivateComponent } from '@utils'
|
import { wrapPrivateComponent } from '@utils'
|
||||||
import { FileService, WellService } from '@api'
|
import { FileService } from '@api'
|
||||||
|
|
||||||
import AccessDenied from './AccessDenied'
|
import AccessDenied from './AccessDenied'
|
||||||
|
|
||||||
const { Paragraph, Text } = Typography
|
const { Paragraph, Text } = Typography
|
||||||
|
|
||||||
export const getLinkToFile = (fileInfo) => `/file_download/${fileInfo.idWell}/${fileInfo.id}`
|
export const getLinkToFile = (fileInfo) => `/file_download/${fileInfo.id}`
|
||||||
|
|
||||||
const FileDownload = memo(function FileDownload() {
|
const FileDownload = memo(function FileDownload() {
|
||||||
const { idWell, idFile } = useParams()
|
const { idFile } = useParams()
|
||||||
const [well, setWell] = useState({})
|
|
||||||
const [file, setFile] = useState({})
|
const [file, setFile] = useState({})
|
||||||
const [isError, setIsError] = useState(false)
|
const [isError, setIsError] = useState(false)
|
||||||
|
|
||||||
@ -23,15 +22,6 @@ const FileDownload = memo(function FileDownload() {
|
|||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
const isFirstOpenApp = useMemo(() => location.key === 'default', [location])
|
const isFirstOpenApp = useMemo(() => location.key === 'default', [location])
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
invokeWebApiWrapperAsync(
|
|
||||||
async () => setWell(await WellService.get(idWell)),
|
|
||||||
null,
|
|
||||||
'Не удалось получить информацию о скважине',
|
|
||||||
{ actionName: 'Получение данных о скважине' }
|
|
||||||
)
|
|
||||||
}, [idWell])
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
invokeWebApiWrapperAsync(
|
invokeWebApiWrapperAsync(
|
||||||
async () => {
|
async () => {
|
||||||
@ -60,7 +50,7 @@ const FileDownload = memo(function FileDownload() {
|
|||||||
<>
|
<>
|
||||||
Вы перешли к странице загрузки файла!
|
Вы перешли к странице загрузки файла!
|
||||||
<br />
|
<br />
|
||||||
Файл "{file?.name ?? ('№' + idFile)}", скважина "{well.caption ?? ('№' + idWell)}".
|
Файл "{file?.name ?? ('№' + idFile)}".
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
// subTitle={}
|
// subTitle={}
|
||||||
@ -106,5 +96,5 @@ FileDownload.displayName = 'FileDownloadMemo'
|
|||||||
|
|
||||||
export default wrapPrivateComponent(FileDownload, {
|
export default wrapPrivateComponent(FileDownload, {
|
||||||
requirements: ['File.get'],
|
requirements: ['File.get'],
|
||||||
route: 'file_download/:idWell/:idFile/*',
|
route: 'file_download/:idFile/*',
|
||||||
}, <AccessDenied />)
|
}, <AccessDenied />)
|
||||||
|
Loading…
Reference in New Issue
Block a user