You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.tsx 1.1KB

123456789101112131415161718192021222324252627282930313233343536
  1. import TopNItem from '@/components/top-n-item';
  2. import { useTranslate } from '@/hooks/common-hooks';
  3. import { Form, Select } from 'antd';
  4. import { useMemo } from 'react';
  5. import { WenCaiQueryTypeOptions } from '../../constant';
  6. import { IOperatorForm } from '../../interface';
  7. import DynamicInputVariable from '../components/dynamic-input-variable';
  8. const WenCaiForm = ({ onValuesChange, form, node }: IOperatorForm) => {
  9. const { t } = useTranslate('flow');
  10. const wenCaiQueryTypeOptions = useMemo(() => {
  11. return WenCaiQueryTypeOptions.map((x) => ({
  12. value: x,
  13. label: t(`wenCaiQueryTypeOptions.${x}`),
  14. }));
  15. }, [t]);
  16. return (
  17. <Form
  18. name="basic"
  19. autoComplete="off"
  20. form={form}
  21. onValuesChange={onValuesChange}
  22. layout={'vertical'}
  23. >
  24. <DynamicInputVariable node={node}></DynamicInputVariable>
  25. <TopNItem initialValue={20} max={99}></TopNItem>
  26. <Form.Item label={t('queryType')} name={'query_type'}>
  27. <Select options={wenCaiQueryTypeOptions}></Select>
  28. </Form.Item>
  29. </Form>
  30. );
  31. };
  32. export default WenCaiForm;