feat: Add top_n to DeepLForm #1739 (#2629)

### What problem does this PR solve?

feat: Add top_n to DeepLForm #1739

### 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-27 19:22:33 +08:00 committed by GitHub
parent 96f56a3c43
commit a246e5644b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View File

@ -410,7 +410,7 @@ export const initialGoogleScholarValues = {
};
export const initialDeepLValues = {
text: 5,
top_n: 5,
auth_key: 'relevance',
};

View File

@ -1,5 +1,6 @@
import TopNItem from '@/components/top-n-item';
import { useTranslate } from '@/hooks/common-hooks';
import { Form, InputNumber, Select } from 'antd';
import { Form, Select } from 'antd';
import { DeepLSourceLangOptions, DeepLTargetLangOptions } from '../constant';
import { useBuildSortOptions } from '../form-hooks';
import { IOperatorForm } from '../interface';
@ -17,9 +18,7 @@ const DeepLForm = ({ onValuesChange, form }: IOperatorForm) => {
form={form}
onValuesChange={onValuesChange}
>
<Form.Item label={t('text')} name={'text'}>
<InputNumber></InputNumber>
</Form.Item>
<TopNItem initialValue={5}></TopNItem>
<Form.Item label={t('authKey')} name={'auth_key'}>
<Select options={options}></Select>
</Form.Item>