import { App, Badge, Button, DatePicker, Divider, Flex, Form, Input, Radio, Row, Col, Select, Space, Switch, Table, Tag, Collapse } from 'antd' import { memo, useCallback, useEffect, useState } from 'react' import { Link } from 'react-router-dom' import dayjs from 'dayjs' import { Conditional } from '@/components/Conditional' import { useAuthContext } from '@/stores/AuthContext' import { prepareUrl, isNotEmpty } from '@/utils/commons' const { RangePicker } = DatePicker const AdvanceSearchForm = memo(function ({ onSubmit }) { const DATE_RANGE_PRESETS = [ { label: '本周', value: [dayjs().startOf('w'), dayjs().endOf('w')], }, { label: '上周', value: [dayjs().startOf('w').subtract(7, 'days'), dayjs().endOf('w').subtract(7, 'days')], }, { label: '本月', value: [dayjs().startOf('M'), dayjs().endOf('M')], }, { label: '上月', value: [dayjs().subtract(1, 'M').startOf('M'), dayjs().subtract(1, 'M').endOf('M')], }, { label: '前三月', value: [dayjs().subtract(2, 'M').startOf('M'), dayjs().endOf('M')], }, { label: '本年', value: [dayjs().startOf('y'), dayjs().endOf('y')], }, ]; const [form] = Form.useForm() function handleSubmit(values) { onSubmit?.(values) } return (