feat: Add component WenCai #1739 (#2388)

### What problem does this PR solve?

feat: Add component WenCai #1739

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-09-12 17:51:43 +08:00
committed by GitHub
parent 4730145696
commit 5f9cb16a3c
8 changed files with 267 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
import TopNItem from '@/components/top-n-item';
import { useTranslate } from '@/hooks/common-hooks';
import { Form, Select } from 'antd';
import { useMemo } from 'react';
import { WenCaiQueryTypeOptions } from '../constant';
import { IOperatorForm } from '../interface';
const WenCaiForm = ({ onValuesChange, form }: IOperatorForm) => {
const { t } = useTranslate('flow');
const wenCaiQueryTypeOptions = useMemo(() => {
return WenCaiQueryTypeOptions.map((x) => ({
value: x,
label: t(`wenCaiQueryTypeOptions.${x}`),
}));
}, [t]);
return (
<Form
name="basic"
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
autoComplete="off"
form={form}
onValuesChange={onValuesChange}
>
<TopNItem initialValue={10} max={99}></TopNItem>
<Form.Item label={t('queryType')} name={'query_type'}>
<Select options={wenCaiQueryTypeOptions}></Select>
</Form.Item>
</Form>
);
};
export default WenCaiForm;