Исправлено отображение размера в таблицах документов

This commit is contained in:
goodmice 2022-10-06 11:47:05 +05:00
parent 443f14c0a8
commit 799fff7c0e
No known key found for this signature in database
GPG Key ID: 63EA771203189CF1

View File

@ -40,7 +40,7 @@ export const DocumentsTemplate = ({ idCategory, well: givenWell, mimeTypes, head
), ),
}, },
makeDateColumn('Дата загрузки', 'uploadDate'), makeDateColumn('Дата загрузки', 'uploadDate'),
makeNumericColumn('Размер', 'size', null, null, formatBytes), makeNumericColumn('Размер', 'size', null, null, (value) => formatBytes(value)),
makeColumn('Автор', 'author', { render: item => <UserView user={item}/> }), makeColumn('Автор', 'author', { render: item => <UserView user={item}/> }),
makeColumn('Компания', 'company', { render: (_, record) => <CompanyView company={record?.author?.company}/> }), makeColumn('Компания', 'company', { render: (_, record) => <CompanyView company={record?.author?.company}/> }),
...(customColumns ?? []) ...(customColumns ?? [])
@ -49,12 +49,8 @@ export const DocumentsTemplate = ({ idCategory, well: givenWell, mimeTypes, head
const filenames = useMemo(() => files.map(file => file.name).filter(Boolean).filter(unique), [files]) const filenames = useMemo(() => files.map(file => file.name).filter(Boolean).filter(unique), [files])
const update = useCallback(() => { const update = useCallback(() => {
let begin = null const begin = filterDataRange?.length > 1 ? filterDataRange[0].toISOString() : null
let end = null const end = filterDataRange?.length > 1 ? filterDataRange[1].toISOString() : null
if (filterDataRange?.length > 1) {
begin = filterDataRange[0].toISOString()
end = filterDataRange[1].toISOString()
}
invokeWebApiWrapperAsync( invokeWebApiWrapperAsync(
async () => { async () => {