/*
 * @Note:
 * @Author: 2058827620@qq.com
 * @Date: 2022-04-03 17:02:15
 */

import { ProForm, ModalForm, ProFormRadio, ProFormText, ProFormDigit } from '@ant-design/pro-components';
import { Tree, InputNumber } from 'antd';
import { useEffect, useRef } from 'react';
import FilesManager from '@/components/FilesManage/index';

export default ({ values, modalOpenState, onModalOpenState, onSubmit }) => {
  const restFormRef = useRef();

  useEffect(() => {
    restFormRef.current?.setFieldsValue(values);
  }, [values]);

  return (
    <>
      <ModalForm
        title="管理员-添加"
        formRef={restFormRef}
        submitter={{
          searchConfig: {
            resetText: '重置',
          },
          resetButtonProps: {
            onClick: () => {
              restFormRef.current?.resetFields();
            },
          },
        }}
        initialValues={values}
        onFinish={onSubmit}
        open={modalOpenState}
        onOpenChange={onModalOpenState}
      >
        <ProFormText hidden={true} width="md" name="id" />
        <ProForm.Group>

          <ProForm.Item
            rules={[{ required: true, message: '请输入!' }]}
            label="申请时间-最小时间"
            name="apply_min"
          >
            <InputNumber
              addonAfter="号"
            />
          </ProForm.Item>
          <ProForm.Item
            rules={[{ required: true, message: '请输入!' }]}
            label="申请时间-最大时间"
            name="apply_max"
          >
            <InputNumber
              addonAfter="号"
            />
          </ProForm.Item>

        </ProForm.Group>
        <ProForm.Group>
          <ProForm.Item
            rules={[{ required: true, message: '请输入!' }]}
            label="计划到账时间"
            name="arrive_day"
          >
            <InputNumber
              addonAfter="号"
            />
          </ProForm.Item>

          <ProForm.Item
            rules={[{ required: true, message: '请输入!' }]}
            label="最晚提现时间"
            name="end_hour"
          >
            <InputNumber
              addonAfter="时"
            />
          </ProForm.Item>
        </ProForm.Group>
        <ProForm.Group>
          <ProForm.Item
            rules={[{ required: true, message: '请输入!' }]}
            label="提现-手续费"
            name="fee"
          >
            <InputNumber
              addonAfter="百分比"
            />
          </ProForm.Item>
        </ProForm.Group>
      </ModalForm>
    </>
  );
};

