From 6588e3accb81a0d19336237297659524f17e0eba Mon Sep 17 00:00:00 2001 From: goodmice Date: Tue, 13 Sep 2022 16:46:02 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=BE=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B1=D0=BB=D0=BE=D0=BA=D0=B0=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=BA=D0=B0=D0=B7=D1=87=D0=B8=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/WellCase/HistoryTable.jsx | 4 ++- src/pages/WellCase/index.jsx | 46 +++++++++++++---------------- src/styles/well_case.less | 25 +++++++++++++++- 3 files changed, 47 insertions(+), 28 deletions(-) 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;