From 421143a77c744d392b0b42a7b536f2ebaebb4bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Thu, 11 Nov 2021 12:22:21 +0500 Subject: [PATCH] =?UTF-8?q?CF2-90=20=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D1=82=D1=8C=20=D0=B2=D0=BE=20=D0=B2=D0=BA?= =?UTF-8?q?=D0=BB=D0=B0=D0=B4=D0=BA=D0=B5=20=D0=BF=D1=80=D0=BE=D0=B3=D1=80?= =?UTF-8?q?=D0=B0=D0=BC=D0=BC=D0=B0=20=D0=B1=D1=83=D1=80=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=B8=D0=BD=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=BE=D0=BD=D0=BD=D0=BE=D0=B5=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=20=D0=B4=D0=B0=D1=82=D0=B5,?= =?UTF-8?q?=20=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=B8=20=D0=B8=20=D0=A4?= =?UTF-8?q?=D0=98=D0=9E=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=D0=B4=D0=BD=D0=B5?= =?UTF-8?q?=D0=B3=D0=BE=20=D0=B4=D0=B0=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Documents/DocumentsTemplate.jsx | 4 ++-- src/pages/Documents/DrillingProgram.jsx | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/pages/Documents/DocumentsTemplate.jsx b/src/pages/Documents/DocumentsTemplate.jsx index 497dd05..fb8eff9 100644 --- a/src/pages/Documents/DocumentsTemplate.jsx +++ b/src/pages/Documents/DocumentsTemplate.jsx @@ -17,7 +17,7 @@ const pageSize = 12 const { RangePicker } = DatePicker const { Search } = Input -export default function DocumentsTemplate({ idCategory, idWell, accept, headerChild, customColumns, onChange}) { +export default function DocumentsTemplate({ idCategory, idWell, accept, headerChild, customColumns, beforeTable, onChange}) { const [page, setPage] = useState(1) const [filterDataRange, setFilterDataRange] = useState([]) const [filterCompanyName, setFilterCompanyName] = useState([]) @@ -175,7 +175,7 @@ export default function DocumentsTemplate({ idCategory, idWell, accept, headerCh    {headerChild} - + {beforeTable} invokeWebApiWrapperAsync( async () => { @@ -61,6 +64,8 @@ export default function DrillingProgram({idWell}) { else{ setTooltip('Список файлов содержит недопустимые типы файлов') } + const last = files.reduce((pre, cur) => pre.uploadDate > cur.uploadDate ? pre : cur) + setLastUpdatedFile(last); } const customColumns = [ @@ -125,8 +130,18 @@ export default function DrillingProgram({idWell}) { + const lastUpdatedFileView = lastUpdatedFile && + + Последнее изменние: +  "{lastUpdatedFile.name}" +  [{formatBytes(lastUpdatedFile.size)}] +  загружен: {new Date(lastUpdatedFile.uploadDate).toLocaleString()} +  автор: + + return(