feat: Configurable for excel, html table or row based text #2516 (#2538)

### What problem does this PR solve?

feat: Configurable for excel, html table or row based text #2516

### Type of change

- [ ] Bug Fix (non-breaking change which fixes an issue)
- [x] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):
This commit is contained in:
balibabu
2024-09-23 14:58:51 +08:00
committed by GitHub
parent db1be22a2f
commit dd019e7ba1
6 changed files with 32 additions and 0 deletions

View File

@ -24,6 +24,7 @@ import { useFetchParserListOnMount } from './hooks';
import { useTranslate } from '@/hooks/common-hooks';
import Delimiter from '../delimiter';
import EntityTypesItem from '../entity-types-item';
import ExcelToHtml from '../excel-to-html';
import LayoutRecognize from '../layout-recognize';
import ParseConfiguration, {
showRaptorParseConfiguration,
@ -104,6 +105,9 @@ const ChunkMethodModal: React.FC<IProps> = ({
const showEntityTypes = selectedTag === 'knowledge_graph';
const showExcelToHtml =
selectedTag === 'naive' && documentExtension === 'xlsx';
const afterClose = () => {
form.resetFields();
};
@ -279,6 +283,7 @@ const ChunkMethodModal: React.FC<IProps> = ({
<Delimiter></Delimiter>
</>
)}
{showExcelToHtml && <ExcelToHtml></ExcelToHtml>}
{showRaptorParseConfiguration(selectedTag) && (
<ParseConfiguration></ParseConfiguration>
)}

View File

@ -0,0 +1,19 @@
import { useTranslate } from '@/hooks/common-hooks';
import { Form, Switch } from 'antd';
const ExcelToHtml = () => {
const { t } = useTranslate('knowledgeDetails');
return (
<Form.Item
name={['parser_config', 'html4excel']}
label={t('html4excel')}
initialValue={false}
valuePropName="checked"
tooltip={t('html4excelTip')}
>
<Switch />
</Form.Item>
);
};
export default ExcelToHtml;