diff --git a/src/components/SyncForm.tsx b/src/components/SyncForm.tsx index dadb23a..334e90e 100644 --- a/src/components/SyncForm.tsx +++ b/src/components/SyncForm.tsx @@ -5,8 +5,10 @@ import { DrawerForm, ProForm, ProFormSelect, + ProFormDateRangePicker, } from '@ant-design/pro-components'; import { Button } from 'antd'; +import dayjs from 'dayjs'; import React from 'react'; // 定义SyncForm组件的props类型 @@ -14,6 +16,7 @@ interface SyncFormProps { tableRef: React.MutableRefObject; onFinish: (values: any) => Promise; siteId?: string; + dateRange?: [dayjs.Dayjs, dayjs.Dayjs]; } /** @@ -21,7 +24,7 @@ interface SyncFormProps { * @param {SyncFormProps} props 组件属性 * @returns {React.ReactElement} 抽屉表单 */ -const SyncForm: React.FC = ({ tableRef, onFinish, siteId }) => { +const SyncForm: React.FC = ({ tableRef, onFinish, siteId, dateRange }) => { // 使用 antd 的 App 组件提供的 message API const [loading, setLoading] = React.useState(false); @@ -49,7 +52,11 @@ const SyncForm: React.FC = ({ tableRef, onFinish, siteId }) => { // 返回一个抽屉表单 return ( - title="同步订单" + initialValues={{ + dateRange: [dayjs().subtract(1, 'week'), dayjs()], + }} + + title="同步订单" // 表单的触发器,一个带图标的按钮 trigger={