fix: fix uploaded file time error #680 (#690)

### What problem does this PR solve?

fix: fix uploaded file time error #680
feat: support preview of word and excel #684 

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2024-05-09 11:30:15 +08:00
committed by GitHub
parent 99be226c7c
commit 793e29f23a
18 changed files with 137 additions and 44 deletions

View File

@ -106,8 +106,8 @@ const KnowledgeFile = () => {
},
{
title: t('uploadDate'),
dataIndex: 'create_date',
key: 'create_date',
dataIndex: 'create_time',
key: 'create_time',
render(value) {
return formatDate(value);
},

View File

@ -1,5 +1,6 @@
import { ReactComponent as NavigationPointerIcon } from '@/assets/svg/navigation-pointer.svg';
import NewDocumentLink from '@/components/new-document-link';
import { useGetDocumentUrl } from '@/hooks/documentHooks';
import { ITestingDocument } from '@/interfaces/database/knowledge';
import { isPdf } from '@/utils/documentUtils';
import { Table, TableProps } from 'antd';
@ -15,6 +16,7 @@ const SelectFiles = ({ handleTesting }: IProps) => {
);
const dispatch = useDispatch();
const getDocumentUrl = useGetDocumentUrl();
const columns: TableProps<ITestingDocument>['columns'] = [
{
@ -35,7 +37,10 @@ const SelectFiles = ({ handleTesting }: IProps) => {
key: 'view',
width: 50,
render: (_, { doc_id, doc_name }) => (
<NewDocumentLink documentId={doc_id} preventDefault={!isPdf(doc_name)}>
<NewDocumentLink
link={getDocumentUrl(doc_id)}
preventDefault={!isPdf(doc_name)}
>
<NavigationPointerIcon />
</NewDocumentLink>
),