diff --git a/src/pages/WellCase/HistoryTable.jsx b/src/pages/WellCase/HistoryTable.jsx index e1fd685..dd9ce30 100644 --- a/src/pages/WellCase/HistoryTable.jsx +++ b/src/pages/WellCase/HistoryTable.jsx @@ -10,6 +10,8 @@ import { invokeWebApiWrapperAsync } from '@components/factory' import { WellFinalDocumentsService } from '@api' import { formatDate } from '@utils' +import '@styles/well_case.less' + export const HistoryTable = memo(({ category }) => { const [isLoading, setIsLoading] = useState(false) const [files, setFiles] = useState([]) @@ -39,7 +41,7 @@ export const HistoryTable = memo(({ category }) => { return ( {files.length > 0 ? ( - + {files.map(({ date, user, file }) => ( {formatDate(date)} diff --git a/src/pages/WellCase/index.jsx b/src/pages/WellCase/index.jsx index e55653e..96dc099 100644 --- a/src/pages/WellCase/index.jsx +++ b/src/pages/WellCase/index.jsx @@ -1,23 +1,23 @@ import { memo, useCallback, useEffect, useMemo, useState } from 'react' -import { Button } from 'antd' +import { Alert, Button, Typography } from 'antd' import { useWell } from '@asb/context' import { UserView } from '@components/views' +import UploadForm from '@components/UploadForm' import DownloadLink from '@components/DownloadLink' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' import { makeColumn, makeDateColumn, makeTextColumn, Table } from '@components/Table' import { WellFinalDocumentsService } from '@api' -import { MimeTypes, wrapPrivateComponent } from '@utils' +import { wrapPrivateComponent } from '@utils' import WellCaseEditor from './WellCaseEditor' import { HistoryTable } from './HistoryTable' -import UploadForm from '@asb/components/UploadForm' + +import '@styles/well_case.less' const expandable = { - expandedRowRender: (category) => ( - - ) + expandedRowRender: (category) => , } const WellCase = memo(() => { @@ -46,13 +46,9 @@ const WellCase = memo(() => { makeTextColumn('Категория', 'nameCategory'), makeColumn('Файл', 'file', { render: (file, category) => ( -
- {file ? ( - - ) : ( - Файл не загружен - )} - +
+ {file ? : Файл не загружен} + {category.permissionToUpload && ( { }), makeDateColumn('Дата загрузки', 'uploadDate'), makeColumn('Ответственные', 'publishers', { - render: (publishers) => publishers?.map((user) => ( - - )), + render: (publishers) => publishers?.map((user) => ), }), ], [well, updateTable]) @@ -80,21 +74,21 @@ const WellCase = memo(() => { useEffect(updateTable, [updateTable]) return ( - <> +
{canEdit && ( - + setShowEdit(true)}>Редактировать} + /> )} - +
- + ) }) diff --git a/src/styles/well_case.less b/src/styles/well_case.less index 6f4975f..de65163 100644 --- a/src/styles/well_case.less +++ b/src/styles/well_case.less @@ -1,4 +1,27 @@ -.well-case-editor { +.well-case-page { + padding-top: 10px; + + & .file-cell { + display: flex; + align-items: center; + justify-content: space-between; + } + + & .history-timeline { + margin-left: 50px; + margin-top: 20px; + + & .ant-timeline-item-last { + padding-bottom: 0; + } + } + + & .customer-block { + margin-bottom: 10px; + } +} + +& .well-case-editor { gap: 10px; width: 100%; max-height: 70vh;